Changeset 100 in 3DVCSoftware
- Timestamp:
- 9 Aug 2012, 12:53:16 (12 years ago)
- Location:
- trunk
- Files:
-
- 70 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CommonTestConditionsCfgs/baseCfg_2view+depth.cfg
r78 r100 204 204 205 205 #========== view synthesis optimization (VSO) ========== 206 VSOConfig : [cx0 B(cc1) I(s0.5)][cx1 B(oo0) I(s0.5)] # VSO configuration string 207 206 VSOConfig : [cx0 B(cc1) I(s0.25 s0.5 s0.75)][cx1 B(oo0) I(s0.25 s0.5 s0.75)] # VSO configuration string 208 207 209 208 #============ Misc. ================ -
trunk/CommonTestConditionsCfgs/baseCfg_3view+depth.cfg
r78 r100 208 208 209 209 #========== view synthesis optimization (VSO) ========== 210 VSOConfig : [cx0 B(cc1) I(s0.5)][cx1 B(oo0) B(oo2) I(s0.5 s1.5)][cx2 B(cc1) I(s1.5)] # VSO configuration string 211 #VSOConfig : [cx0 B(cc1) I(s0.5)][cx1 B(oo0) I(s0.5)] #VSO Configuration (2-View) coding order 1 0 212 210 VSOConfig : [cx0 B(cc1) I(s0.25 s0.5 s0.75)][cx1 B(oo0) B(oo2) I(s0.25 s0.5 s0.75 s1.125 s1.5 s1.75)][cx2 B(cc1) I(s1.25 s1.5 s1.75)] # VSO configuration string 213 211 #============ Misc. ================ 214 212 SEIpictureDigest : 0 # Control generation of picture_digest SEI messages -
trunk/cfg/encoder_mvd.cfg
r78 r100 207 207 208 208 #========== view synthesis optimization (VSO) ========== 209 VSOConfig : [cx0 B(cc1) I(s0.5)][cx1 B(oo0) B(oo2) I(s0.5 s1.5)][cx2 B(cc1) I(s1.5)] # VSO configuration string 209 VSOConfig : [cx0 B(cc1) I(s0.25 s0.5 s0.75)][cx1 B(oo0) B(oo2) I(s0.25 s0.5 s0.75 s1.125 s1.5 s1.75)][cx2 B(cc1) I(s1.25 s1.5 s1.75)] # VSO configuration string (3 view) 210 VSOConfig : [cx0 B(cc1) I(s0.25 s0.5 s0.75)][cx1 B(oo0) I(s0.25 s0.5 s0.75)] # VSO configuration string (2 view) 210 211 211 212 -
trunk/source/App/TAppDecoder/TAppDecCfg.cpp
r56 r100 115 115 size_t iAppendLength = strlen(pchStringToAppend); 116 116 117 rpchOutputFileName = (Char*) malloc(iInLength+iAppendLength+1); 118 Char* pCDot = strrchr(pchInputFileName,'.'); 119 pCDot = pCDot ? pCDot : pchInputFileName + iInLength; 117 rpchOutputFileName = (Char*) malloc(iInLength+iAppendLength+1); 118 Char* pCDot = strrchr(pchInputFileName,'.'); 119 pCDot = pCDot ? pCDot : pchInputFileName + iInLength; 120 120 size_t iCharsToDot = pCDot - pchInputFileName ; 121 size_t iCharsToEnd = iInLength - iCharsToDot; 121 size_t iCharsToEnd = iInLength - iCharsToDot; 122 122 strncpy(rpchOutputFileName , pchInputFileName , iCharsToDot ); 123 123 strncpy(rpchOutputFileName+ iCharsToDot , pchStringToAppend , iAppendLength); 124 strncpy(rpchOutputFileName+ iCharsToDot+iAppendLength , pchInputFileName+iCharsToDot, iCharsToEnd ); 125 rpchOutputFileName[iInLength+iAppendLength] = '\0'; 124 strncpy(rpchOutputFileName+ iCharsToDot+iAppendLength , pchInputFileName+iCharsToDot, iCharsToEnd ); 125 rpchOutputFileName[iInLength+iAppendLength] = '\0'; 126 126 } 127 127 -
trunk/source/App/TAppDecoder/TAppDecTop.h
r77 r100 89 89 Void decode (); ///< main decoding function 90 90 #if VIDYO_VPS_INTEGRATION 91 Void increaseNumberOfViews 91 Void increaseNumberOfViews (UInt layerId, UInt viewId, UInt isDepth); 92 92 #else 93 Void increaseNumberOfViews 93 Void increaseNumberOfViews (Int newNumberOfViewDepth); 94 94 #endif 95 95 TDecTop* getTDecTop ( Int viewId, Bool isDepth ); -
trunk/source/App/TAppEncoder/TAppEncCfg.cpp
r58 r100 74 74 { 75 75 m_aidQP = NULL; 76 #if FIXES 77 m_aidQPdepth = NULL; 78 #endif 76 79 } 77 80 … … 82 85 delete[] m_aidQP; m_aidQP = NULL; 83 86 } 87 88 #if FIXES 89 if ( m_aidQPdepth ) 90 { 91 delete[] m_aidQPdepth; m_aidQPdepth = NULL; 92 } 93 #endif 94 84 95 for(Int i = 0; i< m_pchInputFileList.size(); i++ ) 85 96 { … … 306 317 #if HHI_VSO 307 318 ("VSOConfig", m_pchVSOConfig , (Char *) 0 , "VSO configuration") 308 ("VSO", m_bUseVSO , false , "Use VSO" ) 309 // GT: For development, will be removed later 319 ("VSO", m_bUseVSO , false , "Use VSO" ) 310 320 ("VSOMode", m_uiVSOMode , (UInt) 4 , "VSO Mode") 321 ("LambdaScaleVSO", m_dLambdaScaleVSO , (Double) 1 , "Lambda Scaling for VSO") 322 311 323 #if HHI_VSO_LS_TABLE 312 ("LambdaScaleVSO", m_dLambdaScaleVSO , (Double) 1 , "Lambda Scaling for VSO") 313 #else 314 ("LambdaScaleVSO", m_dLambdaScaleVSO , (Double) 0.5 , "Lambda Scaling for VSO") 315 #endif 316 ("ForceLambdaScaleVSO", m_bForceLambdaScaleVSO , false , "Force using Lambda Scale VSO also in non-VSO-Mode") 324 ("VSOLSTable", m_bVSOLSTable , true , "Depth QP dependent video/depth rate allocation by Lagrange multiplier" ) 325 #endif 326 327 #if SAIT_VSO_EST_A0033 328 ("UseEstimatedVSD", m_bUseEstimatedVSD , true , "Model based VSD estimation instead of rendering based for some encoder decisions" ) 329 #endif 330 #if LGE_VSO_EARLY_SKIP_A0093 331 ("VSOEarlySkip", m_bVSOEarlySkip , true , "Early skip of VSO computation if synthesis error assumed to be zero" ) 332 #endif 333 ("ForceLambdaScaleVSO", m_bForceLambdaScaleVSO , false , "Force using Lambda Scale VSO also in non-VSO-Mode") 317 334 #if HHI_VSO_DIST_INT 318 ("AllowNegDist", m_bAllowNegDist , true , "Allow negative Distortion in VSO")335 ("AllowNegDist", m_bAllowNegDist , true , "Allow negative Distortion in VSO") 319 336 #endif 320 337 … … 667 684 0.753550, 0.800000 668 685 }; 669 AOT( (m_aiQP[1] < 0) || (m_aiQP[1] > 51)); 670 m_dLambdaScaleVSO *= adLambdaScaleTable[m_aiQP[1]]; 686 if ( m_bVSOLSTable ) 687 { 688 AOT( (m_aiQP[1] < 0) || (m_aiQP[1] > 51)); 689 m_dLambdaScaleVSO *= adLambdaScaleTable[m_aiQP[1]]; 690 } 671 691 #endif 672 692 #endif … … 1562 1582 printf("VSO Negative Distortion : %d\n", m_bAllowNegDist ? 1 : 0); 1563 1583 #endif 1584 #if HHI_VSO_LS_TABLE 1585 printf("VSO LS Table : %d\n", m_bVSOLSTable ? 1 : 0); 1586 #endif 1587 #if SAIT_VSO_EST_A0033 1588 printf("VSO Estimated VSD : %d\n", m_bUseEstimatedVSD ? 1 : 0); 1589 #endif 1590 #if LGE_VSO_EARLY_SKIP_A0093 1591 printf("VSO Early Skip : %d\n", m_bVSOEarlySkip ? 1 : 0); 1592 #endif 1593 1564 1594 } 1565 1595 #endif … … 1658 1688 #if HHI_VSO 1659 1689 printf("VSO:%d ", m_bUseVSO ); 1660 #endif 1690 #endif 1661 1691 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 1662 1692 printf("DMM:%d ", m_bUseDMM ); -
trunk/source/App/TAppEncoder/TAppEncCfg.h
r56 r100 216 216 #endif 217 217 #if HHI_INTER_VIEW_RESIDUAL_PRED 218 UInt m_uiMultiviewResPredMode; 218 UInt m_uiMultiviewResPredMode; ///< using multiview residual prediction 219 219 #endif 220 220 221 221 #if FAST_DECISION_FOR_MRG_RD_COST 222 Bool m_useFastDecisionForMerge; 223 #endif 224 Bool m_bUseCbfFastMode; 225 Int m_iSliceMode; ///< 0: Disable all Recon slice limits, 1 : Maximum number of largest coding units per slice, 2: Maximum number of bytes in a slice226 Int m_iSliceArgument; ///< If m_iSliceMode==1, m_iSliceArgument=max. # of largest coding units. If m_iSliceMode==2, m_iSliceArgument=max. # of bytes.227 Int m_iEntropySliceMode; ///< 0: Disable all entropy slice limits, 1 : Maximum number of largest coding units per slice, 2: Constraint based entropy slice228 Int m_iEntropySliceArgument; ///< If m_iEntropySliceMode==1, m_iEntropySliceArgument=max. # of largest coding units. If m_iEntropySliceMode==2, m_iEntropySliceArgument=max. # of bins.229 230 Int m_iSliceGranularity; ///< 0: Slices always end at LCU borders. 1-3: slices may end at a depth of 1-3 below LCU level.231 Bool m_bLFCrossSliceBoundaryFlag;///< 0: Cross-slice-boundary in-loop filtering 1: non-cross-slice-boundary in-loop filtering232 Int m_iTileBehaviorControlPresentFlag; //!< 1: tile behavior control parameters are in PPS 0: tile behavior control parameters are not in PPS233 Bool m_bLFCrossTileBoundaryFlag;//!< 1: Cross-tile-boundary in-loop filtering 0: non-cross-tile-boundary in-loop filtering222 Bool m_useFastDecisionForMerge; ///< flag for using Fast Decision Merge RD-Cost 223 #endif 224 Bool m_bUseCbfFastMode; ///< flag for using Cbf Fast PU Mode Decision 225 Int m_iSliceMode; ///< 0: Disable all Recon slice limits, 1 : Maximum number of largest coding units per slice, 2: Maximum number of bytes in a slice 226 Int m_iSliceArgument; ///< If m_iSliceMode==1, m_iSliceArgument=max. # of largest coding units. If m_iSliceMode==2, m_iSliceArgument=max. # of bytes. 227 Int m_iEntropySliceMode; ///< 0: Disable all entropy slice limits, 1 : Maximum number of largest coding units per slice, 2: Constraint based entropy slice 228 Int m_iEntropySliceArgument; ///< If m_iEntropySliceMode==1, m_iEntropySliceArgument=max. # of largest coding units. If m_iEntropySliceMode==2, m_iEntropySliceArgument=max. # of bins. 229 230 Int m_iSliceGranularity; ///< 0: Slices always end at LCU borders. 1-3: slices may end at a depth of 1-3 below LCU level. 231 Bool m_bLFCrossSliceBoundaryFlag; ///< 0: Cross-slice-boundary in-loop filtering 1: non-cross-slice-boundary in-loop filtering 232 Int m_iTileBehaviorControlPresentFlag; //!< 1: tile behavior control parameters are in PPS 0: tile behavior control parameters are not in PPS 233 Bool m_bLFCrossTileBoundaryFlag; //!< 1: Cross-tile-boundary in-loop filtering 0: non-cross-tile-boundary in-loop filtering 234 234 Int m_iColumnRowInfoPresent; 235 235 Int m_iUniformSpacingIdr; … … 280 280 Char* m_pchVSOConfig; 281 281 Bool m_bUseVSO; ///< flag for using View Synthesis Optimization 282 282 #if HHI_VSO_LS_TABLE 283 Bool m_bVSOLSTable; ///< Depth QP dependent Lagrange parameter optimization (m23714) 284 #endif 285 #if LGE_VSO_EARLY_SKIP_A0093 286 Bool m_bVSOEarlySkip; ///< Early skip of VSO computation (JCT3V-A0093 modification 4) 287 #endif 283 288 //// Used for development by GT, might be removed later 284 289 Double m_dLambdaScaleVSO; ///< Scaling factor for Lambda in VSO mode … … 289 294 UInt m_uiVSOMode; ///< Number of VSO Mode, 1 = , 2 = simple, org vs. ren, 3 = simple, ren vs. ren, 4 = full 290 295 #endif 296 #if SAIT_VSO_EST_A0033 297 Bool m_bUseEstimatedVSD; ///< Flag for using model based VSD estimation instead of VSO for some encoder decisions (JCT3V-A0033 modification 3) 298 Double m_dDispCoeff; 299 #endif 291 300 292 301 // coding tools (depth intra modes) -
trunk/source/App/TAppEncoder/TAppEncTop.cpp
r77 r100 203 203 m_acTEncTopList[iViewIdx]->setLambdaScaleVSO ( 1 ); 204 204 m_acTEncTopList[iViewIdx]->setVSOMode ( 0 ); 205 m_acTEncTopList[iViewIdx]->setUseVSO ( false ); //GT: might be enabled later for VSO Mode 4 205 m_acTEncTopList[iViewIdx]->setUseVSO ( false ); 206 #if SAIT_VSO_EST_A0033 207 m_acTEncTopList[iViewIdx]->setUseEstimatedVSD ( false ); 208 #endif 206 209 #endif 207 210 … … 517 520 #endif 518 521 m_acTEncDepthTopList[iViewIdx]->setVSOMode ( m_uiVSOMode ); 522 523 #if SAIT_VSO_EST_A0033 524 m_acTEncDepthTopList[iViewIdx]->setUseEstimatedVSD ( m_bUseEstimatedVSD ); 525 #endif 519 526 #endif 520 527 … … 648 655 if ( m_uiVSOMode == 4 ) 649 656 { 657 #if HHI_VSO_SPEEDUP_A033 658 #if LGE_VSO_EARLY_SKIP_A0093 659 m_cRendererModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, g_uiMaxCUHeight , LOG2_DISP_PREC_LUT, 0, m_bVSOEarlySkip ); 660 #else 661 m_cRendererModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, g_uiMaxCUHeight , LOG2_DISP_PREC_LUT, 0 ); 662 #endif 663 #else 650 664 m_cRendererModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, m_iSourceHeight, LOG2_DISP_PREC_LUT, 0 ); 665 #endif 651 666 652 667 for ( Int iViewNum = 0; iViewNum < m_iNumberOfViews; iViewNum++ ) … … 1141 1156 }; 1142 1157 1158 #if SAIT_VSO_EST_A0033 1159 TComPicYuv* TAppEncTop::xGetPicYuvFromViewTemp( Int iViewIdx, Int iPoc, Bool bDepth, Bool bRecon ) 1160 { 1161 TComPic* pcPic = xGetPicFromView( iViewIdx, iPoc, bDepth); 1162 TComPicYuv* pcPicYuv = NULL; 1163 1164 if (pcPic != NULL) 1165 { 1166 if( bRecon ) 1167 { 1168 if ( pcPic->getReconMark() ) 1169 { 1170 pcPicYuv = pcPic->getPicYuvRec(); 1171 } 1172 } 1173 else 1174 { 1175 pcPicYuv = pcPic->getPicYuvOrg(); 1176 } 1177 }; 1178 1179 return pcPicYuv; 1180 }; 1181 #endif 1182 1143 1183 /** 1144 1184 * … … 1209 1249 #endif 1210 1250 #if HHI_VSO 1251 #if HHI_VSO_SPEEDUP_A033 1252 Void TAppEncTop::setupRenModel( Int iPoc, Int iEncViewIdx, Int iEncContent, Int iHorOffset ) 1253 { 1254 m_cRendererModel.setHorOffset( iHorOffset ); 1255 #else 1211 1256 Void TAppEncTop::setupRenModel( Int iPoc, Int iEncViewIdx, Int iEncContent ) 1212 1257 { 1258 #endif 1213 1259 Int iEncViewSIdx = m_cCameraData.getBaseId2SortedId()[ iEncViewIdx ]; 1214 1260 -
trunk/source/App/TAppEncoder/TAppEncTop.h
r77 r100 63 63 private: 64 64 // class interface 65 std::vector<TEncTop*> 66 std::vector<TEncTop*> 67 std::vector<TVideoIOYuv*> 65 std::vector<TEncTop*> m_acTEncTopList ; 66 std::vector<TEncTop*> m_acTEncDepthTopList ; 67 std::vector<TVideoIOYuv*> m_acTVideoIOYuvInputFileList; ///< input YUV file 68 68 std::vector<TVideoIOYuv*> m_acTVideoIOYuvDepthInputFileList; 69 std::vector<TVideoIOYuv*> 69 std::vector<TVideoIOYuv*> m_acTVideoIOYuvReconFileList; ///< output reconstruction file 70 70 std::vector<TVideoIOYuv*> m_acTVideoIOYuvDepthReconFileList; 71 71 … … 73 73 std::vector< TComList<TComPicYuv*>* > m_picYuvDepthRec; 74 74 75 std::vector<Int> 76 std::vector<Int> 75 std::vector<Int> m_frameRcvd; ///< number of received frames 76 std::vector<Int> m_depthFrameRcvd; 77 77 78 78 unsigned m_essentialBytes; … … 124 124 virtual ~TAppEncTop(); 125 125 126 #if SAIT_VSO_EST_A0033 127 TComPicYuv* xGetPicYuvFromViewTemp( Int iViewIdx, Int iPoc, Bool bDepth, Bool bRecon ); 128 #endif 129 126 130 Void encode (); ///< main encoding function 127 131 TEncTop* getTEncTop( Int viewId, Bool isDepth ); … … 135 139 #endif 136 140 #if HHI_VSO 141 #if HHI_VSO_SPEEDUP_A033 142 Void setupRenModel ( Int iPoc, Int iEncViewIdx, Int iEncContent, Int iHorOffset ); 143 #else 137 144 Void setupRenModel ( Int iPoc, Int iEncViewIdx, Int iEncContent ); 145 #endif 138 146 #endif 139 147 -
trunk/source/App/TAppRenderer/RendererMain.cpp
r56 r100 42 42 43 43 int main(int argc, char* argv[]) 44 44 { 45 45 TAppRendererTop cTAppRendererTop; 46 46 -
trunk/source/App/TAppRenderer/TAppRendererCfg.cpp
r56 r100 53 53 // ==================================================================================================================== 54 54 55 #define MAX_INPUT_VIEW_NUM 55 #define MAX_INPUT_VIEW_NUM 10 56 56 #define MAX_OUTPUT_VIEW_NUM 64 57 57 -
trunk/source/App/TAppRenderer/TAppRendererCfg.h
r56 r100 80 80 ////camera specification //// 81 81 Char* m_pchCameraParameterFile; ///< camera parameter file 82 Char* m_pchSynthViewCameraNumbers; 82 Char* m_pchSynthViewCameraNumbers; ///< numbers of views to synthesize 83 83 Char* m_pchViewConfig; ///< String to setup renderer 84 Char* m_pchBaseViewCameraNumbers; 84 Char* m_pchBaseViewCameraNumbers; ///< numbers of base views 85 85 86 86 // derived … … 89 89 Bool m_bUseSetupString; ///< true if setup string is used 90 90 91 Int m_iNumberOfInputViews; 92 Int m_iNumberOfOutputViews; 91 Int m_iNumberOfInputViews; ///< number of input Views 92 Int m_iNumberOfOutputViews; ///< number views to synthesize 93 93 94 94 //// renderer Modes //// 95 Int m_iRenderDirection; 95 Int m_iRenderDirection; ///< 0: interpolate, 1: extrapolate from left, 2: extrapolate from right 96 96 97 97 Int m_iLog2SamplingFactor; ///< factor for horizontal upsampling before processing -
trunk/source/App/TAppRenderer/TAppRendererTop.cpp
r81 r100 70 70 pcVideoInput->open( m_pchVideoInputFileList[iViewIdx], false, iFileBitDepth, iInteralBitDepth ); // read mode 71 71 pcDepthInput->open( m_pchDepthInputFileList[iViewIdx], false, iFileBitDepth, iInteralBitDepth ); // read mode 72 #if HHI_FIX73 72 pcVideoInput->skipFrames(m_iFrameSkip, m_iSourceWidth, m_iSourceHeight ); 74 73 pcDepthInput->skipFrames(m_iFrameSkip, m_iSourceWidth, m_iSourceHeight ); 75 #endif 74 76 75 m_apcTVideoIOYuvVideoInput.push_back( pcVideoInput ); 77 76 m_apcTVideoIOYuvDepthInput.push_back( pcDepthInput ); … … 186 185 while ( ( ( iNumOfRenderedFrames < m_iFramesToBeRendered ) || ( m_iFramesToBeRendered == 0 ) ) && !bAnyEOS ) 187 186 { 188 189 #if HHI_FIX190 187 if ( iFrame >= m_iFrameSkip ) 191 188 { 192 #endif 193 // read in depth and video 194 for(Int iBaseViewIdx=0; iBaseViewIdx < m_iNumberOfInputViews; iBaseViewIdx++ ) 195 { 196 m_apcTVideoIOYuvVideoInput[iBaseViewIdx]->read( apcPicYuvBaseVideo[iBaseViewIdx], aiPad ) ; 197 198 apcPicYuvBaseVideo[iBaseViewIdx]->extendPicBorder(); 199 200 bAnyEOS |= m_apcTVideoIOYuvVideoInput[iBaseViewIdx]->isEof(); 201 202 m_apcTVideoIOYuvDepthInput[iBaseViewIdx]->read( apcPicYuvBaseDepth[iBaseViewIdx], aiPad ) ; 203 apcPicYuvBaseDepth[iBaseViewIdx]->extendPicBorder(); 204 bAnyEOS |= m_apcTVideoIOYuvDepthInput[iBaseViewIdx]->isEof(); 205 206 if ( m_bTempDepthFilter && (iFrame >= m_iFrameSkip) ) 189 // read in depth and video 190 for(Int iBaseViewIdx=0; iBaseViewIdx < m_iNumberOfInputViews; iBaseViewIdx++ ) 207 191 { 208 m_pcRenTop->temporalFilterVSRS( apcPicYuvBaseVideo[iBaseViewIdx], apcPicYuvBaseDepth[iBaseViewIdx], apcPicYuvLastBaseVideo[iBaseViewIdx], apcPicYuvLastBaseDepth[iBaseViewIdx], ( iFrame == m_iFrameSkip) ); 192 m_apcTVideoIOYuvVideoInput[iBaseViewIdx]->read( apcPicYuvBaseVideo[iBaseViewIdx], aiPad ) ; 193 194 apcPicYuvBaseVideo[iBaseViewIdx]->extendPicBorder(); 195 196 bAnyEOS |= m_apcTVideoIOYuvVideoInput[iBaseViewIdx]->isEof(); 197 198 m_apcTVideoIOYuvDepthInput[iBaseViewIdx]->read( apcPicYuvBaseDepth[iBaseViewIdx], aiPad ) ; 199 apcPicYuvBaseDepth[iBaseViewIdx]->extendPicBorder(); 200 bAnyEOS |= m_apcTVideoIOYuvDepthInput[iBaseViewIdx]->isEof(); 201 202 if ( m_bTempDepthFilter && (iFrame >= m_iFrameSkip) ) 203 { 204 m_pcRenTop->temporalFilterVSRS( apcPicYuvBaseVideo[iBaseViewIdx], apcPicYuvBaseDepth[iBaseViewIdx], apcPicYuvLastBaseVideo[iBaseViewIdx], apcPicYuvLastBaseDepth[iBaseViewIdx], ( iFrame == m_iFrameSkip) ); 205 } 209 206 } 210 207 } 211 212 #if HHI_FIX 213 } 214 else 215 #else 216 if ( iFrame < m_iFrameSkip ) // Skip Frames 217 #endif 218 208 else 219 209 { 220 210 std::cout << "Skipping Frame " << iFrame << std::endl; … … 536 526 537 527 AOT( m_iLog2SamplingFactor != 0 ); 528 #if LGE_VSO_EARLY_SKIP_A0093 529 cCurModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, m_iSourceHeight, m_iShiftPrecision, m_iBlendHoleMargin, false ); 530 #else 538 531 cCurModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, m_iSourceHeight, m_iShiftPrecision, m_iBlendHoleMargin ); 532 #endif 533 534 #if HHI_VSO_SPEEDUP_A033 535 cCurModel.setHorOffset( 0 ); 536 #endif 539 537 540 538 for ( Int iViewIdx = 0; iViewIdx < m_iNumberOfInputViews; iViewIdx++ ) … … 563 561 { 564 562 565 #if HHI_FIX566 563 if ( iFrame >= m_iFrameSkip ) 567 564 { 568 #endif 569 // read in depth and video 570 for(Int iBaseViewIdx=0; iBaseViewIdx < m_iNumberOfInputViews; iBaseViewIdx++ ) 571 { 572 m_apcTVideoIOYuvVideoInput[iBaseViewIdx]->read( apcPicYuvBaseVideo[iBaseViewIdx], aiPad ) ; 573 bAnyEOS |= m_apcTVideoIOYuvVideoInput[iBaseViewIdx]->isEof(); 574 575 m_apcTVideoIOYuvDepthInput[iBaseViewIdx]->read( apcPicYuvBaseDepth[iBaseViewIdx], aiPad ) ; 576 bAnyEOS |= m_apcTVideoIOYuvDepthInput[iBaseViewIdx]->isEof(); 577 } 578 #if HHI_FIX 565 // read in depth and video 566 for(Int iBaseViewIdx=0; iBaseViewIdx < m_iNumberOfInputViews; iBaseViewIdx++ ) 567 { 568 m_apcTVideoIOYuvVideoInput[iBaseViewIdx]->read( apcPicYuvBaseVideo[iBaseViewIdx], aiPad ) ; 569 bAnyEOS |= m_apcTVideoIOYuvVideoInput[iBaseViewIdx]->isEof(); 570 571 m_apcTVideoIOYuvDepthInput[iBaseViewIdx]->read( apcPicYuvBaseDepth[iBaseViewIdx], aiPad ) ; 572 bAnyEOS |= m_apcTVideoIOYuvDepthInput[iBaseViewIdx]->isEof(); 573 } 579 574 } 580 575 else 581 #else582 if ( iFrame < m_iFrameSkip )583 #endif584 576 { 585 #if HHI_FIX586 577 iFrame++; 587 #endif588 578 continue; 589 579 } … … 598 588 } 599 589 600 #if HHI_FIX601 590 m_cCameraData.update( (UInt) ( iFrame - m_iFrameSkip )); 602 #endif603 591 604 592 for(Int iBaseViewIdx=0; iBaseViewIdx < m_iNumberOfInputViews; iBaseViewIdx++ ) 605 593 { 606 #if HHI_FIX607 #else608 m_cCameraData.update( (UInt)iFrame );609 #endif610 611 594 // setup virtual views 612 595 Int iBaseViewSIdx = m_cCameraData.getBaseId2SortedId()[iBaseViewIdx]; … … 726 709 727 710 AOT( m_iLog2SamplingFactor != 0 ); 711 #if HHI_VSO_SPEEDUP_A033 712 cCurModel.setHorOffset( 0 ); 713 #endif 714 #if LGE_VSO_EARLY_SKIP_A0093 715 cCurModel.create( m_iNumberOfInputViews, m_iNumberOfOutputViews, m_iSourceWidth, m_iSourceHeight, m_iShiftPrecision, m_iBlendHoleMargin, false ); 716 #else 728 717 cCurModel.create( m_iNumberOfInputViews, m_iNumberOfOutputViews, m_iSourceWidth, m_iSourceHeight, m_iShiftPrecision, m_iBlendHoleMargin ); 718 #endif 729 719 730 720 for ( UInt uiBaseView = 0; uiBaseView < m_iNumberOfInputViews; uiBaseView++ ) … … 788 778 { 789 779 790 #if HHI_FIX791 780 if ( iFrame >= m_iFrameSkip ) 792 781 { 793 #endif 794 // read in depth and video 795 for(Int iBaseViewIdx=0; iBaseViewIdx < m_iNumberOfInputViews; iBaseViewIdx++ ) 796 { 797 m_apcTVideoIOYuvVideoInput[iBaseViewIdx]->read( apcPicYuvBaseVideo[iBaseViewIdx], aiPad ) ; 798 bAnyEOS |= m_apcTVideoIOYuvVideoInput[iBaseViewIdx]->isEof(); 799 800 m_apcTVideoIOYuvDepthInput[iBaseViewIdx]->read( apcPicYuvBaseDepth[iBaseViewIdx], aiPad ) ; 801 bAnyEOS |= m_apcTVideoIOYuvDepthInput[iBaseViewIdx]->isEof(); 802 803 if ( iFrame >= m_iFrameSkip ) 782 // read in depth and video 783 for(Int iBaseViewIdx=0; iBaseViewIdx < m_iNumberOfInputViews; iBaseViewIdx++ ) 804 784 { 805 Int iBaseViewSIdx = m_cCameraData.getBaseId2SortedId()[iBaseViewIdx]; 806 cCurModel.setBaseView( iBaseViewSIdx, apcPicYuvBaseVideo[iBaseViewIdx], apcPicYuvBaseDepth[iBaseViewIdx], NULL, NULL ); 785 m_apcTVideoIOYuvVideoInput[iBaseViewIdx]->read( apcPicYuvBaseVideo[iBaseViewIdx], aiPad ) ; 786 bAnyEOS |= m_apcTVideoIOYuvVideoInput[iBaseViewIdx]->isEof(); 787 788 m_apcTVideoIOYuvDepthInput[iBaseViewIdx]->read( apcPicYuvBaseDepth[iBaseViewIdx], aiPad ) ; 789 bAnyEOS |= m_apcTVideoIOYuvDepthInput[iBaseViewIdx]->isEof(); 790 791 if ( iFrame >= m_iFrameSkip ) 792 { 793 Int iBaseViewSIdx = m_cCameraData.getBaseId2SortedId()[iBaseViewIdx]; 794 cCurModel.setBaseView( iBaseViewSIdx, apcPicYuvBaseVideo[iBaseViewIdx], apcPicYuvBaseDepth[iBaseViewIdx], NULL, NULL ); 795 } 807 796 } 808 797 } 809 810 #if HHI_FIX811 }812 798 else 813 #else814 if ( iFrame < m_iFrameSkip ) // Skip Frames815 #endif816 799 { 817 800 iFrame++; 818 801 continue; 819 802 } 820 821 #if HHI_FIX822 803 m_cCameraData.update( (UInt) (iFrame - m_iFrameSkip )); 823 #else824 m_cCameraData.update( (UInt)iFrame );825 #endif826 827 804 for(Int iSynthViewIdx=0; iSynthViewIdx < m_iNumberOfOutputViews; iSynthViewIdx++ ) 828 805 { … … 972 949 { 973 950 974 #if HHI_FIX 951 975 952 if ( iFrame >= m_iFrameSkip ) 976 953 { 977 #endif 978 // read in depth and video 979 for(Int iBaseViewIdx=0; iBaseViewIdx < m_iNumberOfInputViews; iBaseViewIdx++ ) 980 { 981 m_apcTVideoIOYuvVideoInput[iBaseViewIdx]->read( apcPicYuvBaseVideo[iBaseViewIdx], aiPad ) ; 982 apcPicYuvBaseVideo[iBaseViewIdx]->extendPicBorder(); 983 bAnyEOS |= m_apcTVideoIOYuvVideoInput[iBaseViewIdx]->isEof(); 984 985 m_apcTVideoIOYuvDepthInput[iBaseViewIdx]->read( apcPicYuvBaseDepth[iBaseViewIdx], aiPad ) ; 986 apcPicYuvBaseDepth[iBaseViewIdx]->extendPicBorder(); 987 bAnyEOS |= m_apcTVideoIOYuvDepthInput[iBaseViewIdx]->isEof(); 988 989 if ( m_bTempDepthFilter && (iFrame >= m_iFrameSkip) ) 954 // read in depth and video 955 for(Int iBaseViewIdx=0; iBaseViewIdx < m_iNumberOfInputViews; iBaseViewIdx++ ) 990 956 { 991 m_pcRenTop->temporalFilterVSRS( apcPicYuvBaseVideo[iBaseViewIdx], apcPicYuvBaseDepth[iBaseViewIdx], apcPicYuvLastBaseVideo[iBaseViewIdx], apcPicYuvLastBaseDepth[iBaseViewIdx], ( iFrame == m_iFrameSkip) ); 957 m_apcTVideoIOYuvVideoInput[iBaseViewIdx]->read( apcPicYuvBaseVideo[iBaseViewIdx], aiPad ) ; 958 apcPicYuvBaseVideo[iBaseViewIdx]->extendPicBorder(); 959 bAnyEOS |= m_apcTVideoIOYuvVideoInput[iBaseViewIdx]->isEof(); 960 961 m_apcTVideoIOYuvDepthInput[iBaseViewIdx]->read( apcPicYuvBaseDepth[iBaseViewIdx], aiPad ) ; 962 apcPicYuvBaseDepth[iBaseViewIdx]->extendPicBorder(); 963 bAnyEOS |= m_apcTVideoIOYuvDepthInput[iBaseViewIdx]->isEof(); 964 965 if ( m_bTempDepthFilter && (iFrame >= m_iFrameSkip) ) 966 { 967 m_pcRenTop->temporalFilterVSRS( apcPicYuvBaseVideo[iBaseViewIdx], apcPicYuvBaseDepth[iBaseViewIdx], apcPicYuvLastBaseVideo[iBaseViewIdx], apcPicYuvLastBaseDepth[iBaseViewIdx], ( iFrame == m_iFrameSkip) ); 968 } 992 969 } 993 970 } 994 995 #if HHI_FIX996 }997 971 else 998 #else999 if ( iFrame < m_iFrameSkip ) // Skip Frames1000 #endif1001 972 { 1002 973 std::cout << "Skipping Frame " << iFrame << std::endl; … … 1005 976 continue; 1006 977 } 1007 1008 #if HHI_FIX1009 978 m_cCameraData.update( (UInt) ( iFrame - m_iFrameSkip ) ); 1010 #else1011 m_cCameraData.update( (UInt)iFrame );1012 #endif1013 979 1014 980 for(Int iViewIdx=1; iViewIdx < m_iNumberOfInputViews; iViewIdx++ ) -
trunk/source/App/TAppRenderer/TAppRendererTop.h
r56 r100 60 60 private: 61 61 // class interface 62 std::vector<TVideoIOYuv*> 62 std::vector<TVideoIOYuv*> m_apcTVideoIOYuvVideoInput; 63 63 std::vector<TVideoIOYuv*> m_apcTVideoIOYuvDepthInput; 64 std::vector<TVideoIOYuv*> 64 std::vector<TVideoIOYuv*> m_apcTVideoIOYuvSynthOutput; 65 65 66 66 // RendererInterface -
trunk/source/Lib/TAppCommon/TAppComCamPara.cpp
r56 r100 654 654 } 655 655 656 #if SAIT_VSO_EST_A0033 657 Double g_dDispCoeff; 658 #endif 656 659 657 660 Bool … … 685 688 iTargetViewNum = (Int) uiTargetView; 686 689 } 690 691 #if SAIT_VSO_EST_A0033 692 // This part should be modified later. 693 { 694 Double dFL1, dCS1, dCP1, dZN1, dZF1; 695 Bool bInterpolated; 696 Double dPos[3]; 697 xGetGeometryData( m_aiBaseViews[0], uiFrame, dFL1, dPos[0], dCS1, bInterpolated ); 698 xGetGeometryData( m_aiBaseViews[1], uiFrame, dFL1, dPos[1], dCS1, bInterpolated ); 699 700 xGetGeometryData( iSourceViewNum, uiFrame, dFL1, dCP1, dCS1, bInterpolated ); 701 xGetZNearZFar ( iSourceViewNum, uiFrame, dZN1, dZF1 ); 702 703 Double dBaseLine = dPos[0] - dPos[1]; //Max(Max(dPos[0],dPos[1]),dPos[2]) - Min(Min(dPos[0],dPos[1]),dPos[2]); 704 g_dDispCoeff = fabs( dFL1 * ( dBaseLine / 2.0 ) / 255.0 * ( 1.0/dZN1 - 1.0/dZF1 ) ); 705 } 706 #endif 687 707 688 708 xGetGeometryData( iSourceViewNum, uiFrame, dFocalLengthSource, dPositionSource, dIntersectionSource, bInterpolatedSource ); -
trunk/source/Lib/TAppCommon/TAppComCamPara.h
r56 r100 69 69 // view lists 70 70 std::vector<Int> m_aiViewsInCfgFile; ///< views for which parameters are specified in cfg file (from left to right) 71 std::vector<Int> m_aiSynthViews; 72 std::vector<Int> m_aiRelSynthViewsNum; 71 std::vector<Int> m_aiSynthViews; ///< View numbers of External ViewReferences 72 std::vector<Int> m_aiRelSynthViewsNum; ///< Relative view numbers of External ViewReferences 73 73 std::vector<Int> m_aiBaseViews; ///< View numbers of Base View References (in coding order) 74 74 std::vector<Int> m_aiSortedBaseViews; ///< View numbers of Base View References (from left to right) … … 92 92 93 93 // scale and offset parameters 94 Double*** m_adBaseViewShiftParameter; 95 Int64 *** m_aiBaseViewShiftParameter; ///< ShiftParameters between BaseViews e.g. [2][1][0] shift scale from view 2 to view 1; [2][1][1] shift offset from view 2 to view 1/* do we need 64 bit? */96 Double*** m_adSynthViewShiftParameter; 97 Int64 *** m_aiSynthViewShiftParameter; ///< ShiftParameters between BaseViews and ERViews e.g. [2][1][0] shift scale from base view 2 to er view 1;/* do we need 64 bit? */94 Double*** m_adBaseViewShiftParameter; ///< ShiftParameters between BaseViews e.g. [2][1][0] shift scale from view 2 to view 1; [2][1][1] shift offset from view 2 to view 1 95 Int64 *** m_aiBaseViewShiftParameter; ///< ShiftParameters between BaseViews e.g. [2][1][0] shift scale from view 2 to view 1; [2][1][1] shift offset from view 2 to view 1 /* do we need 64 bit? */ 96 Double*** m_adSynthViewShiftParameter; ///< ShiftParameters between BaseViews and ERViews e.g. [2][1][0] shift scale from base view 2 to er view 1; 97 Int64 *** m_aiSynthViewShiftParameter; ///< ShiftParameters between BaseViews and ERViews e.g. [2][1][0] shift scale from base view 2 to er view 1; /* do we need 64 bit? */ 98 98 99 99 // look-up tables 100 Double**** m_adBaseViewShiftLUT; 101 Int**** m_aiBaseViewShiftLUT; 102 Double**** m_adSynthViewShiftLUT; 103 Int**** m_aiSynthViewShiftLUT; 100 Double**** m_adBaseViewShiftLUT; ///< Disparity LUT 101 Int**** m_aiBaseViewShiftLUT; ///< Disparity LUT 102 Double**** m_adSynthViewShiftLUT; ///< Disparity LUT 103 Int**** m_aiSynthViewShiftLUT; ///< Disparity LUT 104 104 105 105 -
trunk/source/Lib/TLibCommon/CommonDef.h
r77 r100 58 58 59 59 #define HM_VERSION "6.1" 60 #define NV_VERSION " 3.1rc1" ///< Current software version60 #define NV_VERSION "4.0rc1" ///< Current software version 61 61 62 62 // ==================================================================================================================== … … 130 130 #if ( HHI_INTER_VIEW_MOTION_PRED || HHI_INTER_VIEW_RESIDUAL_PRED ) 131 131 #define DEPTH_MAP_GENERATION 1 132 #define PDM_REMOVE_DEPENDENCE 1 //bug-fix for DMDV JCT2-A0095 132 133 #else 133 134 #define DEPTH_MAP_GENERATION 0 … … 138 139 #define PDM_NO_INTER_UPDATE 1 // no update for inter (but not inter-view) predicted blocks 139 140 #define PDM_MERGE_POS 0 // position of pdm in merge list (0..4) 140 #if SAIT_IMPROV_MOTION_PRED_M24829 141 #if SAIT_IMPROV_MOTION_PRED_M24829&!QC_MULTI_DIS_CAN 141 142 #define PDM_AMVP_POS 0 // position of pdm in amvp list (0..3) 142 143 #else … … 170 171 #define STD_CAM_PARAMETERS_PRECISION 5 ///< quarter luma sample accuarcy for derived disparities (as default) 171 172 172 #define LOG2_DISP_PREC_LUT 2///< log2 of disparity precision used in integer disparity LUTs173 #define LOG2_DISP_PREC_LUT 2 ///< log2 of disparity precision used in integer disparity LUTs 173 174 174 175 // ==================================================================================================================== … … 400 401 #define Clip3( MinVal, MaxVal, a) ( ((a)<(MinVal)) ? (MinVal) : (((a)>(MaxVal)) ? (MaxVal) :(a)) ) ///< general min/max clip 401 402 #define RemoveBitIncrement(x) ( (x + ( (1 << g_uiBitIncrement) >> 1 )) >> g_uiBitIncrement ) ///< Remove Bit increment 403 404 #if SAIT_VSO_EST_A0033 405 #define ROUND(a) (((a) < 0)? (int)((a) - 0.5) : (int)((a) + 0.5)) 406 #endif 402 407 403 408 // ==================================================================================================================== … … 495 500 NAL_UNIT_UNSPECIFIED_24, 496 501 #if VIDYO_VPS_INTEGRATION 497 502 NAL_UNIT_VPS, 498 503 #else 499 504 NAL_UNIT_UNSPECIFIED_25, -
trunk/source/Lib/TLibCommon/ContextTables.h
r56 r100 152 152 #endif 153 153 154 #if LGE_EDGE_INTRA 155 #define NUM_EDGE_INTRA_CTX 1 156 #if LGE_EDGE_INTRA_DELTA_DC 157 #define NUM_EDGE_INTRA_DELTA_DC_CTX 2 // one for Delta_DC flag, another for Delta_DC value 158 #endif 159 #endif 160 154 161 // ==================================================================================================================== 155 162 // Tables … … 1272 1279 } 1273 1280 }; 1281 1282 #if LGE_EDGE_INTRA 1283 static const Short 1284 INIT_EDGE_INTRA[3][NUM_EDGE_INTRA_CTX] = 1285 { 1286 { 1287 CNU 1288 }, 1289 { 1290 CNU 1291 }, 1292 { 1293 CNU 1294 } 1295 }; 1296 1297 #if LGE_EDGE_INTRA_DELTA_DC 1298 static const Short 1299 INIT_EDGE_INTRA_DELTA_DC[3][NUM_EDGE_INTRA_DELTA_DC_CTX] = 1300 { 1301 { 1302 CNU, CNU 1303 }, 1304 { 1305 CNU, CNU 1306 }, 1307 { 1308 CNU, CNU 1309 } 1310 }; 1311 #endif 1312 #endif 1313 1274 1314 #endif 1275 1315 1276 1316 //! \} 1277 1317 1278 1279 #endif 1280 1318 #endif 1319 -
trunk/source/Lib/TLibCommon/NAL.h
r77 r100 52 52 #endif 53 53 #if VIDYO_VPS_INTEGRATION 54 54 unsigned m_layerId; 55 55 unsigned m_temporalId; ///< temporal_id 56 56 #else … … 100 100 m_isDepth = isDepth; 101 101 #else 102 102 m_layerId = layerId; 103 103 #endif 104 104 m_temporalId = temporalID; … … 124 124 m_isDepth = isDepth; 125 125 #else 126 126 m_layerId = layerId; 127 127 #endif 128 128 m_temporalId = temporalID; -
trunk/source/Lib/TLibCommon/TComDataCU.cpp
r81 r100 141 141 m_pbResPredFlag = NULL; 142 142 #endif 143 #if LGE_EDGE_INTRA 144 m_pucEdgeCode = NULL; 145 m_pucEdgeNumber = NULL; 146 m_pucEdgeStartPos = NULL; 147 m_pbEdgeLeftFirst = NULL; 148 m_pbEdgePartition = NULL; 149 #if LGE_EDGE_INTRA_DELTA_DC 150 m_piEdgeDeltaDC0 = NULL; 151 m_piEdgeDeltaDC1 = NULL; 152 #endif 153 #endif 143 154 } 144 155 … … 259 270 m_piContourPredTexDeltaDC2 = (Int* )xMalloc(Int, uiNumPartition); 260 271 #endif 272 #if LGE_EDGE_INTRA 273 m_pucEdgeCode = (UChar*)xMalloc(UChar, uiNumPartition * LGE_EDGE_INTRA_MAX_EDGE_NUM_PER_4x4); 274 m_pucEdgeNumber = (UChar*)xMalloc(UChar, uiNumPartition); 275 m_pucEdgeStartPos = (UChar*)xMalloc(UChar, uiNumPartition); 276 m_pbEdgeLeftFirst = (Bool*) xMalloc(Bool, uiNumPartition); 277 m_pbEdgePartition = (Bool*) xMalloc(Bool, uiNumPartition * 16); 278 #if LGE_EDGE_INTRA_DELTA_DC 279 m_piEdgeDeltaDC0 = (Int* ) xMalloc(Int, uiNumPartition); 280 m_piEdgeDeltaDC1 = (Int* ) xMalloc(Int, uiNumPartition); 281 #endif 282 #endif 261 283 } 262 284 else … … 359 381 if ( m_piContourPredTexDeltaDC2 ) { xFree(m_piContourPredTexDeltaDC2); m_piContourPredTexDeltaDC2 = NULL; } 360 382 #endif 383 #if LGE_EDGE_INTRA 384 if ( m_pbEdgeLeftFirst ) { xFree(m_pbEdgeLeftFirst); m_pbEdgeLeftFirst = NULL; } 385 if ( m_pucEdgeStartPos ) { xFree(m_pucEdgeStartPos); m_pucEdgeStartPos = NULL; } 386 if ( m_pucEdgeNumber ) { xFree(m_pucEdgeNumber); m_pucEdgeNumber = NULL; } 387 if ( m_pucEdgeCode ) { xFree(m_pucEdgeCode); m_pucEdgeCode = NULL; } 388 if ( m_pbEdgePartition ) { xFree(m_pbEdgePartition); m_pbEdgePartition = NULL; } 389 #if LGE_EDGE_INTRA_DELTA_DC 390 if ( m_piEdgeDeltaDC0 ) { xFree(m_piEdgeDeltaDC0); m_piEdgeDeltaDC0 = NULL; } 391 if ( m_piEdgeDeltaDC1 ) { xFree(m_piEdgeDeltaDC1); m_piEdgeDeltaDC1 = NULL; } 392 #endif 393 #endif 361 394 m_acCUMvField[0].destroy(); 362 395 m_acCUMvField[1].destroy(); … … 1093 1126 m_piContourPredTexDeltaDC2 = pcCU->getContourPredTexDeltaDC2() + uiPart; 1094 1127 #endif 1128 #if LGE_EDGE_INTRA 1129 if( pcCU->getSlice()->getSPS()->isDepth() ) 1130 { 1131 m_pucEdgeCode = pcCU->getEdgeCode( uiPart ); 1132 m_pucEdgeNumber = pcCU->getEdgeNumber() + uiPart; 1133 m_pucEdgeStartPos = pcCU->getEdgeStartPos() + uiPart; 1134 m_pbEdgeLeftFirst = pcCU->getEdgeLeftFirst() + uiPart; 1135 m_pbEdgePartition = pcCU->getEdgePartition( uiPart ); 1136 #if LGE_EDGE_INTRA_DELTA_DC 1137 m_piEdgeDeltaDC0 = pcCU->getEdgeDeltaDC0() + uiPart; 1138 m_piEdgeDeltaDC1 = pcCU->getEdgeDeltaDC1() + uiPart; 1139 #endif 1140 } 1141 #endif 1095 1142 } 1096 1143 … … 1250 1297 memcpy( m_piContourPredTexDeltaDC2 + uiOffset, pcCU->getContourPredTexDeltaDC2(), sizeof( Int ) * uiNumPartition ); 1251 1298 #endif 1299 1300 #if LGE_EDGE_INTRA 1301 if( getSlice()->getSPS()->isDepth() ) 1302 { 1303 memcpy( getEdgeCode( uiOffset ), pcCU->getEdgeCode(0), iSizeInUchar * LGE_EDGE_INTRA_MAX_EDGE_NUM_PER_4x4 ); 1304 memcpy( getEdgeNumber() + uiOffset, pcCU->getEdgeNumber(), iSizeInUchar ); 1305 memcpy( getEdgeStartPos() + uiOffset, pcCU->getEdgeStartPos(), iSizeInUchar ); 1306 memcpy( getEdgeLeftFirst() + uiOffset, pcCU->getEdgeLeftFirst(), iSizeInBool ); 1307 memcpy( getEdgePartition( uiOffset ), pcCU->getEdgePartition(0), iSizeInBool * 16 ); 1308 #if LGE_EDGE_INTRA_DELTA_DC 1309 memcpy( getEdgeDeltaDC0() + uiOffset, pcCU->getEdgeDeltaDC0(), sizeof( Int ) * uiNumPartition ); 1310 memcpy( getEdgeDeltaDC1() + uiOffset, pcCU->getEdgeDeltaDC1(), sizeof( Int ) * uiNumPartition ); 1311 #endif 1312 } 1313 #endif 1314 1252 1315 #if HHI_MPI 1253 1316 memcpy( m_piTextureModeDepth + uiOffset, pcCU->getTextureModeDepth(), sizeof( Int ) * uiNumPartition ); … … 1352 1415 memcpy( rpcCU->getContourPredTexDeltaDC2() + m_uiAbsIdxInLCU, m_piContourPredTexDeltaDC2, sizeof( Int ) * m_uiNumPartition ); 1353 1416 #endif 1417 1418 #if LGE_EDGE_INTRA 1419 if( rpcCU->getSlice()->getSPS()->isDepth() ) 1420 { 1421 memcpy( rpcCU->getEdgeCode( m_uiAbsIdxInLCU ), m_pucEdgeCode, iSizeInUchar * LGE_EDGE_INTRA_MAX_EDGE_NUM_PER_4x4 ); 1422 memcpy( rpcCU->getEdgeNumber() + m_uiAbsIdxInLCU, m_pucEdgeNumber, iSizeInUchar ); 1423 memcpy( rpcCU->getEdgeStartPos() + m_uiAbsIdxInLCU, m_pucEdgeStartPos,iSizeInUchar ); 1424 memcpy( rpcCU->getEdgeLeftFirst() + m_uiAbsIdxInLCU, m_pbEdgeLeftFirst,iSizeInBool ); 1425 memcpy( rpcCU->getEdgePartition( m_uiAbsIdxInLCU ), m_pbEdgePartition,iSizeInBool * 16 ); 1426 #if LGE_EDGE_INTRA_DELTA_DC 1427 memcpy( rpcCU->getEdgeDeltaDC0() + m_uiAbsIdxInLCU, m_piEdgeDeltaDC0, sizeof( Int ) * m_uiNumPartition ); 1428 memcpy( rpcCU->getEdgeDeltaDC1() + m_uiAbsIdxInLCU, m_piEdgeDeltaDC1, sizeof( Int ) * m_uiNumPartition ); 1429 #endif 1430 } 1431 #endif 1432 1354 1433 #if HHI_MPI 1355 1434 memcpy( rpcCU->getTextureModeDepth() + m_uiAbsIdxInLCU, m_piTextureModeDepth, sizeof( Int ) * m_uiNumPartition ); … … 1455 1534 memcpy( rpcCU->getContourPredTexDeltaDC2() + uiPartOffset, m_piContourPredTexDeltaDC2, sizeof( Int ) * uiQNumPart ); 1456 1535 #endif 1536 1537 #if LGE_EDGE_INTRA 1538 if( rpcCU->getSlice()->getSPS()->isDepth() ) 1539 { 1540 memcpy( rpcCU->getEdgeCode( uiPartOffset ), m_pucEdgeCode, iSizeInUchar * LGE_EDGE_INTRA_MAX_EDGE_NUM_PER_4x4 ); 1541 memcpy( rpcCU->getEdgeNumber() + uiPartOffset, m_pucEdgeNumber, iSizeInUchar ); 1542 memcpy( rpcCU->getEdgeStartPos() + uiPartOffset, m_pucEdgeStartPos,iSizeInUchar ); 1543 memcpy( rpcCU->getEdgeLeftFirst() + uiPartOffset, m_pbEdgeLeftFirst,iSizeInBool ); 1544 memcpy( rpcCU->getEdgePartition( uiPartOffset ), m_pbEdgePartition,iSizeInBool * 16 ); 1545 #if LGE_EDGE_INTRA_DELTA_DC 1546 memcpy( rpcCU->getEdgeDeltaDC0() + uiPartOffset, m_piEdgeDeltaDC0, sizeof( Int ) * uiQNumPart ); 1547 memcpy( rpcCU->getEdgeDeltaDC1() + uiPartOffset, m_piEdgeDeltaDC1, sizeof( Int ) * uiQNumPart ); 1548 #endif 1549 } 1550 #endif 1551 1457 1552 #if HHI_MPI 1458 1553 memcpy( rpcCU->getTextureModeDepth() + uiPartOffset, m_piTextureModeDepth, sizeof( Int ) * uiQNumPart ); … … 2332 2427 mapDMMtoIntraMode( iLeftIntraDir ); 2333 2428 #endif 2429 #if LGE_EDGE_INTRA 2430 mapEdgeIntratoDC( iLeftIntraDir ); 2431 #endif 2334 2432 2335 2433 // Get intra direction of above PU … … 2343 2441 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 2344 2442 mapDMMtoIntraMode( iAboveIntraDir ); 2443 #endif 2444 #if LGE_EDGE_INTRA 2445 mapEdgeIntratoDC( iAboveIntraDir ); 2345 2446 #endif 2346 2447 … … 2426 2527 return uiPredNum; 2427 2528 } 2529 2530 #if LGE_EDGE_INTRA 2531 UInt TComDataCU::getCtxEdgeIntra( UInt uiAbsPartIdx ) 2532 { 2533 UInt uiCtx = 0; 2534 return uiCtx; 2535 } 2536 #endif 2428 2537 2429 2538 UInt TComDataCU::getCtxSplitFlag( UInt uiAbsPartIdx, UInt uiDepth ) … … 2886 2995 Void TComDataCU::getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx, Bool bLCU) 2887 2996 { 2888 UInt uiNumPartition = bLCU ? (getWidth(uiAbsPartIdx)*getHeight(uiAbsPartIdx) >> 4) : m_uiNumPartition; 2889 UInt uiTmpAbsPartIdx = bLCU ? uiAbsPartIdx : 0; 2890 2891 switch ( m_pePartSize[uiTmpAbsPartIdx] ) 2892 { 2893 case SIZE_2NxN: 2894 riWidth = getWidth(uiTmpAbsPartIdx); riHeight = getHeight(uiTmpAbsPartIdx) >> 1; ruiPartAddr = ( uiPartIdx == 0 )? 0 : uiNumPartition >> 1; 2895 break; 2896 case SIZE_Nx2N: 2897 riWidth = getWidth(uiTmpAbsPartIdx) >> 1; riHeight = getHeight(uiTmpAbsPartIdx); ruiPartAddr = ( uiPartIdx == 0 )? 0 : uiNumPartition >> 2; 2898 break; 2899 case SIZE_NxN: 2900 riWidth = getWidth(uiTmpAbsPartIdx) >> 1; riHeight = getHeight(uiTmpAbsPartIdx) >> 1; ruiPartAddr = ( uiNumPartition >> 2 ) * uiPartIdx; 2901 break; 2902 case SIZE_2NxnU: 2903 riWidth = getWidth(uiTmpAbsPartIdx); 2904 riHeight = ( uiPartIdx == 0 ) ? getHeight(uiTmpAbsPartIdx) >> 2 : ( getHeight(uiTmpAbsPartIdx) >> 2 ) + ( getHeight(uiTmpAbsPartIdx) >> 1 ); 2905 ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : uiNumPartition >> 3; 2906 break; 2907 case SIZE_2NxnD: 2908 riWidth = getWidth(uiTmpAbsPartIdx); 2909 riHeight = ( uiPartIdx == 0 ) ? ( getHeight(uiTmpAbsPartIdx) >> 2 ) + ( getHeight(uiTmpAbsPartIdx) >> 1 ) : getHeight(uiTmpAbsPartIdx) >> 2; 2910 ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : (uiNumPartition >> 1) + (uiNumPartition >> 3); 2911 break; 2912 case SIZE_nLx2N: 2913 riWidth = ( uiPartIdx == 0 ) ? getWidth(uiTmpAbsPartIdx) >> 2 : ( getWidth(uiTmpAbsPartIdx) >> 2 ) + ( getWidth(uiTmpAbsPartIdx) >> 1 ); 2914 riHeight = getHeight(uiTmpAbsPartIdx); 2915 ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : uiNumPartition >> 4; 2916 break; 2917 case SIZE_nRx2N: 2918 riWidth = ( uiPartIdx == 0 ) ? ( getWidth(uiTmpAbsPartIdx) >> 2 ) + ( getWidth(uiTmpAbsPartIdx) >> 1 ) : getWidth(uiTmpAbsPartIdx) >> 2; 2919 riHeight = getHeight(uiTmpAbsPartIdx); 2920 ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : (uiNumPartition >> 2) + (uiNumPartition >> 4); 2921 break; 2922 default: 2923 #if HHI_FIX 2997 UInt uiNumPartition = bLCU ? (getWidth(uiAbsPartIdx)*getHeight(uiAbsPartIdx) >> 4) : m_uiNumPartition; 2998 UInt uiTmpAbsPartIdx = bLCU ? uiAbsPartIdx : 0; 2999 3000 switch ( m_pePartSize[uiTmpAbsPartIdx] ) 3001 { 3002 case SIZE_2NxN: 3003 riWidth = getWidth(uiTmpAbsPartIdx); riHeight = getHeight(uiTmpAbsPartIdx) >> 1; ruiPartAddr = ( uiPartIdx == 0 )? 0 : uiNumPartition >> 1; 3004 break; 3005 case SIZE_Nx2N: 3006 riWidth = getWidth(uiTmpAbsPartIdx) >> 1; riHeight = getHeight(uiTmpAbsPartIdx); ruiPartAddr = ( uiPartIdx == 0 )? 0 : uiNumPartition >> 2; 3007 break; 3008 case SIZE_NxN: 3009 riWidth = getWidth(uiTmpAbsPartIdx) >> 1; riHeight = getHeight(uiTmpAbsPartIdx) >> 1; ruiPartAddr = ( uiNumPartition >> 2 ) * uiPartIdx; 3010 break; 3011 case SIZE_2NxnU: 3012 riWidth = getWidth(uiTmpAbsPartIdx); 3013 riHeight = ( uiPartIdx == 0 ) ? getHeight(uiTmpAbsPartIdx) >> 2 : ( getHeight(uiTmpAbsPartIdx) >> 2 ) + ( getHeight(uiTmpAbsPartIdx) >> 1 ); 3014 ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : uiNumPartition >> 3; 3015 break; 3016 case SIZE_2NxnD: 3017 riWidth = getWidth(uiTmpAbsPartIdx); 3018 riHeight = ( uiPartIdx == 0 ) ? ( getHeight(uiTmpAbsPartIdx) >> 2 ) + ( getHeight(uiTmpAbsPartIdx) >> 1 ) : getHeight(uiTmpAbsPartIdx) >> 2; 3019 ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : (uiNumPartition >> 1) + (uiNumPartition >> 3); 3020 break; 3021 case SIZE_nLx2N: 3022 riWidth = ( uiPartIdx == 0 ) ? getWidth(uiTmpAbsPartIdx) >> 2 : ( getWidth(uiTmpAbsPartIdx) >> 2 ) + ( getWidth(uiTmpAbsPartIdx) >> 1 ); 3023 riHeight = getHeight(uiTmpAbsPartIdx); 3024 ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : uiNumPartition >> 4; 3025 break; 3026 case SIZE_nRx2N: 3027 riWidth = ( uiPartIdx == 0 ) ? ( getWidth(uiTmpAbsPartIdx) >> 2 ) + ( getWidth(uiTmpAbsPartIdx) >> 1 ) : getWidth(uiTmpAbsPartIdx) >> 2; 3028 riHeight = getHeight(uiTmpAbsPartIdx); 3029 ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : (uiNumPartition >> 2) + (uiNumPartition >> 4); 3030 break; 3031 default: 2924 3032 assert ( m_pePartSize[uiTmpAbsPartIdx ] == SIZE_2Nx2N ); 2925 #else 2926 assert ( m_pePartSize[0] == SIZE_2Nx2N ); 2927 #endif 2928 riWidth = getWidth(uiTmpAbsPartIdx); riHeight = getHeight(uiTmpAbsPartIdx); ruiPartAddr = 0; 2929 break; 2930 } 3033 riWidth = getWidth(uiTmpAbsPartIdx); riHeight = getHeight(uiTmpAbsPartIdx); ruiPartAddr = 0; 3034 break; 3035 } 2931 3036 } 2932 3037 #else … … 2975 3080 Int TComDataCU::getResiPredMode(UInt uiPartAddr) 2976 3081 { 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 3082 Int iAddResiShift = -1; 3083 3084 for(UInt uiRefIdx = 0; uiRefIdx < 2; uiRefIdx++) 3085 { 3086 RefPicList eRefList = uiRefIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 3087 Int iBestRefIdx = getCUMvField(eRefList)->getRefIdx(uiPartAddr); 3088 if(iBestRefIdx >= 0 && getSlice()->getViewId() == getSlice()->getRefViewId(eRefList, iBestRefIdx)) 3089 iAddResiShift++; 3090 } 3091 3092 return iAddResiShift; 2988 3093 } 2989 3094 2990 3095 Void TComDataCU::getPUResiPredShift(Int *iPUResiPredShift, UInt uiAbsPartIndex) 2991 3096 { 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3097 UInt uiPartSize = getPartitionSize(uiAbsPartIndex); 3098 UInt uiPartAddr; 3099 Int iWidth, iHeight; 3100 Int iAddResiShift; 3101 3102 if(uiPartSize == SIZE_2Nx2N) 3103 { 3104 iAddResiShift = getResiPredMode(uiAbsPartIndex); 3105 for(UInt i = 0; i < 4; i++) 3106 iPUResiPredShift[i] = (getSlice()->getPPS()->getUseWP() || getInterDir(uiAbsPartIndex) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1); 3107 return; 3108 } 3109 3110 if(uiPartSize == SIZE_2NxN || uiPartSize == SIZE_2NxnU || uiPartSize == SIZE_2NxnD) 3111 { 3112 for(UInt i = 0; i < 2; i++) 3113 { 3114 getPartIndexAndSize(i, uiPartAddr, iWidth, iHeight, uiAbsPartIndex, true); 3115 uiPartAddr += uiAbsPartIndex; 3116 iAddResiShift = getResiPredMode(uiPartAddr); 3117 iPUResiPredShift[2*i] = iPUResiPredShift[2*i+1] = (getSlice()->getPPS()->getUseWP() || getInterDir(uiPartAddr) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1); 3118 } 3119 return; 3120 } 3121 3122 if(uiPartSize == SIZE_Nx2N || uiPartSize == SIZE_nLx2N || uiPartSize == SIZE_nRx2N) 3123 { 3124 for(UInt i = 0; i < 2; i++) 3125 { 3126 getPartIndexAndSize(i, uiPartAddr, iWidth, iHeight, uiAbsPartIndex, true); 3127 uiPartAddr += uiAbsPartIndex; 3128 iAddResiShift = getResiPredMode(uiPartAddr); 3129 iPUResiPredShift[i] = iPUResiPredShift[2+i] = (getSlice()->getPPS()->getUseWP() || getInterDir(uiPartAddr) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1); 3130 } 3131 return; 3132 } 3133 3134 if(uiPartSize == SIZE_NxN) 3135 { 3136 for(UInt i = 0; i < 4; i++) 3137 { 3138 getPartIndexAndSize(i, uiPartAddr, iWidth, iHeight, uiAbsPartIndex, true); 3139 uiPartAddr += uiAbsPartIndex; 3140 iAddResiShift = getResiPredMode(uiPartAddr); 3141 iPUResiPredShift[i] = (getSlice()->getPPS()->getUseWP() || getInterDir(uiPartAddr) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1); 3142 } 3143 } 3039 3144 3040 3145 } … … 3358 3463 TComMv acPdmMv [2]; 3359 3464 Int aiPdmRefIdx [2] = {-1, -1}; 3465 3466 #if LGE_DVMCP 3467 acPdmMv[0].m_bDvMcp = acPdmMv[1].m_bDvMcp = false; 3468 #endif 3469 3470 #if QC_MULTI_DIS_CAN 3471 DisInfo cDisInfo; 3472 cDisInfo.iN = 0; 3473 if(!bNoPdmMerge) 3474 { 3475 #if LGE_DVMCP 3476 getDisMvpCand2(uiPUIdx, uiAbsPartIdx, &cDisInfo, true ); 3477 #else 3478 getDisMvpCand (uiPUIdx, uiAbsPartIdx, &cDisInfo ); 3479 #endif 3480 } 3481 if(cDisInfo.iN==0) 3482 { 3483 cDisInfo.iN = 1; 3484 cDisInfo.m_acMvCand[0].setHor(0); 3485 cDisInfo.m_acMvCand[0].setVer(0); 3486 cDisInfo.m_aVIdxCan[0] = 0; 3487 } 3488 Int iPdmInterDir = cDisInfo.iN==0? 0:getPdmMergeCandidateDisCan ( uiPUIdx, aiPdmRefIdx, acPdmMv, &cDisInfo ); 3489 #else 3360 3490 Int iPdmInterDir = getPdmMergeCandidate( uiPUIdx, aiPdmRefIdx, acPdmMv ); 3491 #endif 3361 3492 3362 3493 if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 0 ) … … 3413 3544 pcCULeft->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3414 3545 } 3546 #if LGE_DVMCP 3547 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 3548 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 3549 #endif 3415 3550 #if SIMP_MRG_PRUN 3416 3551 if ( mrgCandIdx == iCount ) … … 3485 3620 pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3486 3621 } 3622 #if LGE_DVMCP 3623 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 3624 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 3625 #endif 3487 3626 #if SIMP_MRG_PRUN 3488 3627 if ( mrgCandIdx == iCount ) … … 3552 3691 pcCUAboveRight->getMvField( pcCUAboveRight, uiAboveRightPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3553 3692 } 3693 #if LGE_DVMCP 3694 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 3695 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 3696 #endif 3554 3697 #if SIMP_MRG_PRUN 3555 3698 if ( mrgCandIdx == iCount ) … … 3616 3759 pcCULeftBottom->getMvField( pcCULeftBottom, uiLeftBottomPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3617 3760 } 3761 #if LGE_DVMCP 3762 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 3763 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 3764 #endif 3618 3765 #if SIMP_MRG_PRUN 3619 3766 if ( mrgCandIdx == iCount ) … … 3689 3836 pcCUAboveLeft->getMvField( pcCUAboveLeft, uiAboveLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3690 3837 } 3838 #if LGE_DVMCP 3839 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 3840 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 3841 #endif 3691 3842 #if SIMP_MRG_PRUN 3692 3843 if ( mrgCandIdx == iCount ) … … 3805 3956 puhInterDirNeighbours[uiArrayAddr] = 1; 3806 3957 } 3958 #if LGE_DVMCP 3959 pcMvFieldNeighbours[uiArrayAddr<<1 ].getMv().m_bDvMcp = false; 3960 pcMvFieldNeighbours[(uiArrayAddr<<1)+1].getMv().m_bDvMcp = false; 3961 #endif 3807 3962 #if SIMP_MRG_PRUN 3808 3963 if ( mrgCandIdx == iCount ) … … 4274 4429 return m_pcSlice->getSPS()->getAMVPMode(m_puhDepth[uiIdx]); 4275 4430 } 4431 #if QC_MULTI_DIS_CAN 4432 /** construct a list of disparity motion vectors from the neighbouring PUs **/ 4433 Void TComDataCU::getDisMvpCand ( UInt uiPartIdx, UInt uiPartAddr,DisInfo* pDInfo ) 4434 { 4435 PartSize eCUMode = getPartitionSize( uiPartAddr ); 4436 TComDataCU* pcTmpCU = NULL; 4437 pDInfo->iN = 0; 4438 4439 RefPicList eRefPicList = REF_PIC_LIST_0 ; 4440 //-- Get Spatial MV 4441 UInt uiPartIdxLT, uiPartIdxRT, uiPartIdxLB; 4442 UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth(); 4443 4444 deriveLeftRightTopIdxGeneral( eCUMode, uiPartAddr, uiPartIdx, uiPartIdxLT, uiPartIdxRT ); 4445 deriveLeftBottomIdxGeneral( eCUMode, uiPartAddr, uiPartIdx, uiPartIdxLB ); 4446 4447 UInt uiIdx = 0; 4448 #if MVP_AT_ENTROPYSLICE_BOUNDARY 4449 pcTmpCU = getPULeft(uiIdx, uiPartIdxLB, true, false); 4450 #else 4451 pcTmpCU = getPULeft(uiIdx, uiPartIdxLB); 4452 #endif 4453 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) ) 4454 { 4455 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 4456 { 4457 eRefPicList = RefPicList(iList); 4458 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 4459 if( refId >= 0) 4460 { 4461 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 4462 if (refViewIdx!= m_pcSlice->getViewId()) 4463 { 4464 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4465 clipMv(cMvPred); 4466 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 4467 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 4468 return; 4469 } 4470 } 4471 } 4472 } 4473 #if MVP_AT_ENTROPYSLICE_BOUNDARY 4474 pcTmpCU = getPUAbove(uiIdx, uiPartIdxRT, true, false, true); 4475 #else 4476 pcTmpCU = getPUAbove(uiIdx, uiPartIdxRT); 4477 #endif 4478 4479 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 4480 { 4481 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 4482 { 4483 eRefPicList = RefPicList(iList); 4484 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 4485 if( refId >= 0) 4486 { 4487 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 4488 if (refViewIdx!= m_pcSlice->getViewId()) 4489 { 4490 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4491 clipMv(cMvPred); 4492 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 4493 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 4494 return; 4495 } 4496 } 4497 } 4498 } 4499 4500 #if MVP_AT_ENTROPYSLICE_BOUNDARY 4501 pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true, false, true); 4502 #else 4503 pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true, true, true); 4504 #endif 4505 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) ) 4506 { 4507 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 4508 { 4509 eRefPicList = RefPicList(iList); 4510 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 4511 if( refId >= 0) 4512 { 4513 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 4514 if (refViewIdx!= m_pcSlice->getViewId()) 4515 { 4516 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4517 clipMv(cMvPred); 4518 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 4519 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 4520 return; 4521 } 4522 } 4523 } 4524 } 4525 #if MVP_AT_ENTROPYSLICE_BOUNDARY 4526 pcTmpCU = getPUBelowLeft(uiIdx, uiPartIdxLB, true, false); 4527 #else 4528 pcTmpCU = getPUBelowLeft(uiIdx, uiPartIdxLB); 4529 #endif 4530 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 4531 { 4532 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 4533 { 4534 eRefPicList = RefPicList(iList); 4535 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 4536 if( refId >= 0) 4537 { 4538 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 4539 if (refViewIdx!= m_pcSlice->getViewId()) 4540 { 4541 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4542 clipMv(cMvPred); 4543 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 4544 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 4545 return; 4546 } 4547 } 4548 } 4549 } 4550 4551 // Above predictor search 4552 #if MVP_AT_ENTROPYSLICE_BOUNDARY 4553 pcTmpCU = getPUAboveLeft(uiIdx, (m_uiAbsIdxInLCU + uiPartAddr), true, false, true); 4554 assert(uiPartIdxLT == (m_uiAbsIdxInLCU + uiPartAddr)); 4555 #else 4556 pcTmpCU = getPUAboveLeft(uiIdx, uiPartIdxLT, true, true, true); 4557 #endif 4558 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 4559 { 4560 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 4561 { 4562 eRefPicList = RefPicList(iList); 4563 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 4564 if( refId >= 0) 4565 { 4566 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 4567 if (refViewIdx!= m_pcSlice->getViewId()) 4568 { 4569 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4570 clipMv(cMvPred); 4571 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 4572 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 4573 return; 4574 } 4575 } 4576 } 4577 } 4578 //Get temporal MV 4579 TComMv cColMv; 4580 Int iTargetViewIdx = 0; 4581 Int iTStartViewIdx = 0; 4582 UInt uiPartIdxRB, uiBRIdx; 4583 Int uiViewIdxCurr= getSlice()->getViewId(); 4584 4585 UInt uiAbsPartAddr; 4586 int uiLCUIdx = getAddr(); 4587 Int uiLCUnew = uiLCUIdx; 4588 eCUMode = getPartitionSize( 0 ); 4589 deriveRightBottomIdx( eCUMode, uiPartIdx, uiPartIdxRB ); 4590 uiBRIdx = uiPartIdxLT; 4591 UInt uiAbsPartIdxTmp = g_auiZscanToRaster[uiPartIdxRB]; 4592 if ( (( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() ) < m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) &&(( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() ) < m_pcSlice->getSPS()->getPicHeightInLumaSamples() )) // image boundary check 4593 { 4594 if ( ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) && // is not at the last column of LCU 4595 ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) ) // is not at the last row of LCU 4596 { 4597 uiBRIdx = g_auiRasterToZscan[ uiAbsPartIdxTmp + uiNumPartInCUWidth + 1 ]; 4598 } 4599 else if ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) // is not at the last column of LCU But is last row of LCU 4600 { 4601 uiBRIdx = g_auiRasterToZscan[ (uiAbsPartIdxTmp + uiNumPartInCUWidth + 1) % m_pcPic->getNumPartInCU() ]; 4602 uiLCUnew = uiLCUIdx + m_pcPic->getFrameWidthInCU(); 4603 } 4604 else if ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) // is not at the last row of LCU But is last column of LCU 4605 { 4606 uiBRIdx = g_auiRasterToZscan[ uiAbsPartIdxTmp + 1 ]; 4607 uiLCUnew = uiLCUIdx + 1; 4608 } 4609 else //is the right bottom corner of LCU 4610 { 4611 uiBRIdx = 0; 4612 uiLCUnew = uiLCUIdx + m_pcPic->getFrameWidthInCU() + 1; 4613 } 4614 } 4615 4616 Int MaxRef = getSlice()->getNumRefIdx(RefPicList(0)); 4617 UInt uiNumPartInCUHeight = m_pcPic->getNumPartInHeight(); 4618 UInt uiPUVert = (UInt)((Int)g_auiZscanToRaster[uiPartIdxLB]/(Int)(uiNumPartInCUWidth)-(Int)g_auiZscanToRaster[uiPartIdxLT]/(Int)(uiNumPartInCUWidth)); 4619 UInt uiPUHorStart = g_auiZscanToRaster[uiPartIdxLT]; 4620 UInt uiPUHorEnd = g_auiZscanToRaster[uiPartIdxRT]; 4621 for( Int i= 0; i< getSlice()->getNumRefIdx(RefPicList(0)); i ++) 4622 { 4623 getSlice()->getRefPic( RefPicList(0), i)->setCandPicCheckedFlag(0); 4624 } 4625 for( Int i= 0; i< getSlice()->getNumRefIdx(RefPicList(1)); i ++) 4626 { 4627 getSlice()->getRefPic( RefPicList(1), i)->setCandPicCheckedFlag(0); 4628 } 4629 { 4630 //check the col-located picture 4631 eRefPicList = RefPicList(getSlice()->isInterB() ? getSlice()->getColDir() : 0); 4632 #if COLLOCATED_REF_IDX 4633 Int lpRef = getSlice()->getColRefIdx(); 4634 #else 4635 Int lpRef = 0; 4636 #endif 4637 if( m_pcSlice->getViewId() == getSlice()->getRefPic( eRefPicList, lpRef)->getViewId() ) 4638 { 4639 if (uiViewIdxCurr > 1) 4640 { 4641 if( (uiLCUnew >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUnew, uiBRIdx, cColMv, iTargetViewIdx, iTStartViewIdx)) ) 4642 { 4643 clipMv(cColMv); 4644 pDInfo->m_acMvCand[pDInfo->iN] = cColMv; 4645 pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx; 4646 return ; 4647 } 4648 } 4649 for(UInt uiLoopVert = 0; uiLoopVert <= uiPUVert; uiLoopVert+=4) 4650 for( uiIdx = uiPUHorStart; uiIdx <= uiPUHorEnd; uiIdx +=4 ) 4651 { 4652 uiAbsPartAddr = g_auiRasterToZscan[uiIdx+uiNumPartInCUWidth*uiLoopVert]; 4653 if ( uiLCUIdx >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUIdx, uiAbsPartAddr, cColMv, iTargetViewIdx, iTStartViewIdx ) ) 4654 { 4655 clipMv(cColMv); 4656 pDInfo->m_acMvCand[pDInfo->iN] = cColMv; 4657 pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx; 4658 return ; 4659 } 4660 } 4661 for(UInt uiIdx_y = 0; uiIdx_y <uiNumPartInCUHeight; uiIdx_y +=4 ) 4662 for(UInt uiIdx_X = 0; uiIdx_X <uiNumPartInCUWidth; uiIdx_X +=4 ) 4663 { 4664 uiIdx = uiIdx_X + uiIdx_y * uiNumPartInCUWidth; 4665 uiAbsPartAddr = g_auiRasterToZscan[uiIdx]; 4666 if ( uiLCUIdx >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUIdx, uiAbsPartAddr, cColMv, iTargetViewIdx, iTStartViewIdx ) ) 4667 { 4668 clipMv(cColMv); 4669 pDInfo->m_acMvCand[pDInfo->iN] = cColMv; 4670 pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx; 4671 return ; 4672 } 4673 } 4674 if (uiViewIdxCurr == 1) 4675 { 4676 if( (uiLCUnew >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUnew, uiBRIdx, cColMv, iTargetViewIdx, iTStartViewIdx)) ) 4677 { 4678 clipMv(cColMv); 4679 pDInfo->m_acMvCand[pDInfo->iN] = cColMv; 4680 pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx; 4681 return ; 4682 } 4683 } 4684 } 4685 getSlice()->getRefPic( eRefPicList, lpRef)->setCandPicCheckedFlag(1); 4686 } 4687 { 4688 //check the remaining reference pictures in list0 and list1 4689 if(getSlice()->isInterB()) 4690 { 4691 if(getSlice()->getNumRefIdx(RefPicList(0))< getSlice()->getNumRefIdx(RefPicList(1))) 4692 MaxRef = getSlice()->getNumRefIdx(RefPicList(1)); 4693 } 4694 for(Int lpRef = 0; lpRef < MaxRef; lpRef++) 4695 { 4696 for(Int lpNr = 0; lpNr < (getSlice()->isInterB() ? 2: 1); lpNr ++) 4697 { 4698 eRefPicList = RefPicList(0); 4699 if(getSlice()->isInterB()) 4700 eRefPicList = RefPicList(lpNr==0 ? (getSlice()->getColDir()): (1-getSlice()->getColDir())); 4701 if(getSlice()->getRefPic( eRefPicList, lpRef)->getCandPicCheckedFlag()) 4702 continue; 4703 4704 if(lpRef >= getSlice()->getNumRefIdx(eRefPicList)||(m_pcSlice->getViewId() != getSlice()->getRefPic( eRefPicList, lpRef)->getViewId())) 4705 continue; 4706 if (uiViewIdxCurr > 1 ) 4707 { 4708 if( (uiLCUnew >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUnew, uiBRIdx, cColMv, iTargetViewIdx, iTStartViewIdx)) ) 4709 { 4710 clipMv(cColMv); 4711 pDInfo->m_acMvCand[pDInfo->iN] = cColMv; 4712 pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx; 4713 return ; 4714 } 4715 } 4716 for(UInt uiLoopVert = 0; uiLoopVert <= uiPUVert; uiLoopVert += 4) 4717 for( uiIdx = uiPUHorStart; uiIdx <= uiPUHorEnd; uiIdx += 4 ) 4718 { 4719 uiAbsPartAddr = g_auiRasterToZscan[uiIdx+uiNumPartInCUWidth*uiLoopVert]; 4720 if ( uiLCUIdx >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUIdx, uiAbsPartAddr, cColMv, iTargetViewIdx, iTStartViewIdx ) ) 4721 { 4722 clipMv(cColMv); 4723 pDInfo->m_acMvCand[pDInfo->iN] = cColMv; 4724 pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx; 4725 return ; 4726 } 4727 } 4728 for(UInt uiIdx_y = 0; uiIdx_y <uiNumPartInCUHeight; uiIdx_y += 4 ) 4729 for(UInt uiIdx_X = 0; uiIdx_X <uiNumPartInCUWidth; uiIdx_X += 4 ) 4730 { 4731 uiIdx = uiIdx_X + uiIdx_y * uiNumPartInCUWidth; 4732 uiAbsPartAddr = g_auiRasterToZscan[uiIdx]; 4733 if ( uiLCUIdx >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUIdx, uiAbsPartAddr, cColMv, iTargetViewIdx, iTStartViewIdx ) ) 4734 { 4735 clipMv(cColMv); 4736 pDInfo->m_acMvCand[pDInfo->iN] = cColMv; 4737 pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx; 4738 return ; 4739 } 4740 } 4741 if (uiViewIdxCurr == 1 ) 4742 { 4743 if( (uiLCUnew >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUnew, uiBRIdx, cColMv, iTargetViewIdx, iTStartViewIdx)) ) 4744 { 4745 clipMv(cColMv); 4746 pDInfo->m_acMvCand[pDInfo->iN] = cColMv; 4747 pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx; 4748 return ; 4749 } 4750 } 4751 getSlice()->getRefPic( eRefPicList, lpRef)->setCandPicCheckedFlag(1); 4752 }//reference lists 4753 }//reference indices 4754 }//remaining pictures 4755 } 4756 4757 #if LGE_DVMCP 4758 Void TComDataCU::getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr,DisInfo* pDInfo, Bool bMerge, RefPicList eRefPicList0, Int iRefIdx0 ) 4759 { 4760 PartSize eCUMode = getPartitionSize( uiPartAddr ); 4761 TComDataCU* pcTmpCU = NULL; 4762 TComDataCU* pcCULeft = NULL; 4763 pDInfo->iN = 0; 4764 4765 RefPicList eRefPicList = REF_PIC_LIST_0 ; 4766 //-- Get Spatial MV 4767 UInt uiPartIdxLT, uiPartIdxRT, uiPartIdxLB; 4768 UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth(); 4769 4770 Int aiDvMcpDvCand[2][7] = {{0,}, {0,}}; // dummy, 5 spatial + 1 temporal, DV-MCP ÁÖº¯ ºí·°¿¡¼ »ç¿ëµÈ DV¸¦ ÀúÀå 4771 Bool abDvMcpFlag [2][7] = {{false,},{false,}}; 4772 //Int aiRefPOC [2][7] = {{-1,},{-1}}; // debug 4773 TComMv cTmpMvPred, cMv; 4774 Bool bTmpIsSkipped = false; 4775 Bool bDvMcpIsFound = false; 4776 4777 deriveLeftRightTopIdxGeneral( eCUMode, uiPartAddr, uiPartIdx, uiPartIdxLT, uiPartIdxRT ); 4778 deriveLeftBottomIdxGeneral( eCUMode, uiPartAddr, uiPartIdx, uiPartIdxLB ); 4779 4780 UInt uiIdx = 0; 4781 #if MVP_AT_ENTROPYSLICE_BOUNDARY 4782 pcTmpCU = getPULeft(uiIdx, uiPartIdxLB, true, false); 4783 #else 4784 pcTmpCU = getPULeft(uiIdx, uiPartIdxLB); 4785 #endif 4786 4787 pcCULeft = pcTmpCU; 4788 UInt uiLeftPartIdx = uiIdx; 4789 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) ) 4790 { 4791 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); 4792 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 4793 { 4794 eRefPicList = RefPicList(iList); 4795 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 4796 if( refId >= 0) 4797 { 4798 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 4799 if (refViewIdx!= m_pcSlice->getViewId()) // DCP 4800 { 4801 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4802 clipMv(cMvPred); 4803 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 4804 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 4805 return; 4806 } 4807 else // MCP 4808 { 4809 cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4810 if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped ) 4811 { 4812 aiDvMcpDvCand[iList][DVFROM_LEFT] = cTmpMvPred.m_iDvMcpDispX; 4813 abDvMcpFlag [iList][DVFROM_LEFT] = true; 4814 bDvMcpIsFound = true; 4815 } 4816 } 4817 } 4818 } 4819 } 4820 4821 #if MVP_AT_ENTROPYSLICE_BOUNDARY 4822 pcTmpCU = getPUAbove(uiIdx, uiPartIdxRT, true, false, true); 4823 #else 4824 pcTmpCU = getPUAbove(uiIdx, uiPartIdxRT); 4825 #endif 4826 4827 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 4828 { 4829 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); 4830 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 4831 { 4832 eRefPicList = RefPicList(iList); 4833 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 4834 if( refId >= 0) 4835 { 4836 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 4837 if (refViewIdx!= m_pcSlice->getViewId()) 4838 { 4839 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4840 clipMv(cMvPred); 4841 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 4842 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 4843 return; 4844 } 4845 else // MCP 4846 { 4847 cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4848 if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped ) 4849 { 4850 aiDvMcpDvCand[iList][DVFROM_ABOVE] = cTmpMvPred.m_iDvMcpDispX; 4851 abDvMcpFlag [iList][DVFROM_ABOVE] = true; 4852 bDvMcpIsFound = true; 4853 } 4854 } 4855 } 4856 } 4857 } 4858 4859 #if MVP_AT_ENTROPYSLICE_BOUNDARY 4860 pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true, false, true); 4861 #else 4862 pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true, true, true); 4863 #endif 4864 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) ) 4865 { 4866 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); 4867 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 4868 { 4869 eRefPicList = RefPicList(iList); 4870 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 4871 if( refId >= 0) 4872 { 4873 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 4874 if (refViewIdx!= m_pcSlice->getViewId()) 4875 { 4876 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4877 clipMv(cMvPred); 4878 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 4879 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 4880 return; 4881 } 4882 else // MCP 4883 { 4884 cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4885 if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped ) 4886 { 4887 aiDvMcpDvCand[iList][DVFROM_ABOVERIGHT] = cTmpMvPred.m_iDvMcpDispX; 4888 abDvMcpFlag [iList][DVFROM_ABOVERIGHT] = true; 4889 bDvMcpIsFound = true; 4890 } 4891 } 4892 } 4893 } 4894 } 4895 4896 #if MVP_AT_ENTROPYSLICE_BOUNDARY 4897 pcTmpCU = getPUBelowLeft(uiIdx, uiPartIdxLB, true, false); 4898 #else 4899 pcTmpCU = getPUBelowLeft(uiIdx, uiPartIdxLB); 4900 #endif 4901 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 4902 { 4903 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); 4904 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 4905 { 4906 eRefPicList = RefPicList(iList); 4907 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 4908 if( refId >= 0) 4909 { 4910 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 4911 if (refViewIdx!= m_pcSlice->getViewId()) 4912 { 4913 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4914 clipMv(cMvPred); 4915 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 4916 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 4917 return; 4918 } 4919 else // MCP 4920 { 4921 cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4922 if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped ) 4923 { 4924 aiDvMcpDvCand[iList][DVFROM_LEFTBELOW] = cTmpMvPred.m_iDvMcpDispX; 4925 abDvMcpFlag [iList][DVFROM_LEFTBELOW] = true; 4926 bDvMcpIsFound = true; 4927 } 4928 } 4929 } 4930 } 4931 } 4932 4933 // Above predictor search 4934 #if MVP_AT_ENTROPYSLICE_BOUNDARY 4935 pcTmpCU = getPUAboveLeft(uiIdx, (m_uiAbsIdxInLCU + uiPartAddr), true, false, true); 4936 assert(uiPartIdxLT == (m_uiAbsIdxInLCU + uiPartAddr)); 4937 #else 4938 pcTmpCU = getPUAboveLeft(uiIdx, uiPartIdxLT, true, true, true); 4939 #endif 4940 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 4941 { 4942 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); 4943 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 4944 { 4945 eRefPicList = RefPicList(iList); 4946 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 4947 if( refId >= 0) 4948 { 4949 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 4950 if (refViewIdx!= m_pcSlice->getViewId()) 4951 { 4952 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4953 clipMv(cMvPred); 4954 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 4955 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 4956 return; 4957 } 4958 else // MCP 4959 { 4960 cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4961 if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped ) 4962 { 4963 aiDvMcpDvCand[iList][DVFROM_ABOVELEFT] = cTmpMvPred.m_iDvMcpDispX; 4964 abDvMcpFlag [iList][DVFROM_ABOVELEFT] = true; 4965 bDvMcpIsFound = true; 4966 } 4967 } 4968 } 4969 } 4970 } 4971 4972 // copied from getInterMergeCand() 4973 if ( getSlice()->getPPS()->getEnableTMVPFlag() ) 4974 { 4975 UInt uiPUIdx = uiPartIdx; 4976 UInt uiAbsPartAddr = uiPartAddr; 4977 4978 // col [2] 4979 Int iRefIdxSkip[2] = {-1, -1}; 4980 if( !bMerge ) 4981 { 4982 iRefIdxSkip[ eRefPicList0 ] = iRefIdx0; 4983 } 4984 else 4985 { 4986 for (Int i=0; i<2; i++) 4987 { 4988 RefPicList eRefPicList1 = ( i==1 ? REF_PIC_LIST_1 : REF_PIC_LIST_0 ); 4989 #if SET_MERGE_TMVP_REFIDX 4990 Int iRefIdxTmp; 4991 if ( uiPUIdx != 0 ) 4992 { 4993 iRefIdxTmp = 0; 4994 } 4995 else 4996 { 4997 iRefIdxTmp = (pcCULeft != NULL) ? pcCULeft->getCUMvField(eRefPicList1)->getRefIdx(uiLeftPartIdx) : -1; 4998 } 4999 #else 5000 Int iRefIdxTmp = (pcCULeft != NULL) ? pcCULeft->getCUMvField(eRefPicList1)->getRefIdx(uiLeftPartIdx) : -1; 5001 #endif 5002 iRefIdxSkip[i] = (iRefIdxTmp != -1) ? iRefIdxTmp : 0; 5003 } 5004 } 5005 5006 //>> MTK colocated-RightBottom 5007 UInt uiPartIdxRB; 5008 Int uiLCUIdx = getAddr(); 5009 eCUMode = getPartitionSize( 0 ); 5010 5011 deriveRightBottomIdx( eCUMode, uiPUIdx, uiPartIdxRB ); 5012 5013 UInt uiAbsPartIdxTmp = g_auiZscanToRaster[uiPartIdxRB]; 5014 //UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth(); 5015 5016 TComMv cColMv; 5017 Int iRefIdx; 5018 5019 if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) // image boundary check 5020 { 5021 uiLCUIdx = -1; 5022 } 5023 else if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() ) >= m_pcSlice->getSPS()->getPicHeightInLumaSamples() ) 5024 { 5025 uiLCUIdx = -1; 5026 } 5027 else 5028 { 5029 if ( ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) && // is not at the last column of LCU 5030 ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) ) // is not at the last row of LCU 5031 { 5032 uiAbsPartAddr = g_auiRasterToZscan[ uiAbsPartIdxTmp + uiNumPartInCUWidth + 1 ]; 5033 uiLCUIdx = getAddr(); 5034 } 5035 else if ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) // is not at the last column of LCU But is last row of LCU 5036 { 5037 uiAbsPartAddr = g_auiRasterToZscan[ (uiAbsPartIdxTmp + uiNumPartInCUWidth + 1) % m_pcPic->getNumPartInCU() ]; 5038 uiLCUIdx = -1 ; 5039 } 5040 else if ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) // is not at the last row of LCU But is last column of LCU 5041 { 5042 uiAbsPartAddr = g_auiRasterToZscan[ uiAbsPartIdxTmp + 1 ]; 5043 uiLCUIdx = getAddr() + 1; 5044 } 5045 else //is the right bottom corner of LCU 5046 { 5047 uiAbsPartAddr = 0; 5048 uiLCUIdx = -1 ; 5049 } 5050 } 5051 5052 Bool bExistMV = false; 5053 UInt uiPartIdxCenter; 5054 UInt uiCurLCUIdx = getAddr(); 5055 xDeriveCenterIdx( eCUMode, uiPUIdx, uiPartIdxCenter ); 5056 5057 Int iTargetView, iStartView; 5058 if( !bMerge ) // AMVP 5059 { 5060 bExistMV = uiLCUIdx >= 0 && xGetColDisMV( eRefPicList0, iRefIdx0, uiLCUIdx, uiAbsPartAddr, cColMv, iTargetView, iStartView ); 5061 if( bExistMV == false ) 5062 { 5063 bExistMV = xGetColDisMV( eRefPicList0, iRefIdx0, uiCurLCUIdx, uiPartIdxCenter, cColMv, iTargetView, iStartView ); 5064 } 5065 if( bExistMV ) // DV is found 5066 { 5067 if( cColMv.m_bDvMcp == false ) //=> DCP, if true => DV-MCP 5068 { 5069 clipMv(cColMv); 5070 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv; 5071 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetView; 5072 return; 5073 } 5074 else // DV-MCP 5075 { 5076 aiDvMcpDvCand[eRefPicList0][DVFROM_COL] = cColMv.getHor(); 5077 abDvMcpFlag [eRefPicList0][DVFROM_COL] = true; 5078 bDvMcpIsFound = true; 5079 } 5080 } 5081 } 5082 else // MERGE 5083 { 5084 iRefIdx = iRefIdxSkip[0]; 5085 bExistMV = uiLCUIdx >= 0 && xGetColDisMV( REF_PIC_LIST_0, iRefIdx, uiLCUIdx, uiAbsPartAddr, cColMv, iTargetView, iStartView ); 5086 if( bExistMV == false ) 5087 { 5088 bExistMV = xGetColDisMV( REF_PIC_LIST_0, iRefIdx, uiCurLCUIdx, uiPartIdxCenter, cColMv, iTargetView, iStartView ); 5089 } 5090 if( bExistMV ) 5091 { 5092 if( cColMv.m_bDvMcp == false ) // DCP 5093 { 5094 clipMv(cColMv); 5095 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv; 5096 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetView; 5097 return; 5098 } 5099 else { // // DV-MCP 5100 aiDvMcpDvCand[0][DVFROM_COL] = cColMv.getHor(); 5101 abDvMcpFlag [0][DVFROM_COL] = true; 5102 bDvMcpIsFound = true; 5103 }; 5104 5105 if ( getSlice()->isInterB() ) 5106 { 5107 iRefIdx = iRefIdxSkip[1]; 5108 bExistMV = uiLCUIdx >= 0 && xGetColDisMV( REF_PIC_LIST_1, iRefIdx, uiLCUIdx, uiAbsPartAddr, cColMv, iTargetView, iStartView ); 5109 if( bExistMV == false ) 5110 { 5111 bExistMV = xGetColDisMV( REF_PIC_LIST_1, iRefIdx, uiCurLCUIdx, uiPartIdxCenter, cColMv, iTargetView, iStartView ); 5112 } 5113 if( bExistMV ) 5114 { 5115 if( cColMv.m_bDvMcp == false ) // DCP 5116 { 5117 clipMv(cColMv); 5118 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv; 5119 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetView; 5120 return; 5121 } 5122 else // DV-MCP 5123 { 5124 aiDvMcpDvCand[1][DVFROM_COL] = cColMv.getHor(); 5125 abDvMcpFlag [1][DVFROM_COL] = true; 5126 bDvMcpIsFound = true; 5127 }; 5128 } 5129 } 5130 } 5131 } 5132 } // if TMVP Flag 5133 5134 if( bDvMcpIsFound ) // skip dvmcp 5135 { 5136 for( Int i=1 ; i<7 ; i++ ) // 5 spatial + 1 temporal 5137 { 5138 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 5139 { 5140 if( abDvMcpFlag[iList][i]==true ) 5141 { 5142 TComMv dv( aiDvMcpDvCand[iList][ i ], 0 ); 5143 clipMv( dv ); 5144 pDInfo->m_acMvCand[ pDInfo->iN ] = dv; 5145 pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; 5146 return; 5147 } 5148 5149 } 5150 } 5151 } 5152 5153 return; 5154 5155 } 5156 #endif 5157 5158 #endif 4276 5159 4277 5160 /** Constructs a list of candidates for AMVP … … 4295 5178 } 4296 5179 5180 #if QC_MULTI_DIS_CAN 5181 DisInfo cDisInfo; 5182 cDisInfo.iN = 0; 5183 if(m_pcSlice->getSPS()->getViewId() && m_pcSlice->getSPS()->getMultiviewMvPredMode()) 5184 { 5185 #if LGE_DVMCP 5186 getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo, false, eRefPicList, iRefIdx ); 5187 #else 5188 getDisMvpCand (uiPartIdx, uiPartAddr, &cDisInfo ); 5189 #endif 5190 } 5191 if(cDisInfo.iN==0) 5192 { 5193 cDisInfo.iN = 1; 5194 cDisInfo.m_acMvCand[0].setHor(0); 5195 cDisInfo.m_acMvCand[0].setVer(0); 5196 cDisInfo.m_aVIdxCan[0] = 0; 5197 } 5198 #endif 4297 5199 #if HHI_INTER_VIEW_MOTION_PRED 4298 5200 #if ( PDM_AMVP_POS == 0 ) 4299 5201 // get inter-view mv predictor (at position 0) 4300 5202 TComMv cPdmMvPred; 5203 #if QC_MULTI_DIS_CAN 5204 if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) ) 5205 #else 4301 5206 if( getPdmMvPred( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred ) ) 5207 #endif 4302 5208 { 4303 5209 clipMv( cPdmMvPred ); … … 4354 5260 // get inter-view mv predictor (at position 1) 4355 5261 TComMv cPdmMvPred; 5262 #if QC_MULTI_DIS_CAN 5263 if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) ) 5264 #else 4356 5265 if( getPdmMvPred( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred ) ) 5266 #endif 4357 5267 { 4358 5268 clipMv( cPdmMvPred ); … … 4402 5312 // get inter-view mv predictor (at position 2) 4403 5313 TComMv cPdmMvPred; 5314 #if QC_MULTI_DIS_CAN 5315 if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) ) 5316 #else 4404 5317 if( getPdmMvPred( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred ) ) 5318 #endif 4405 5319 { 4406 5320 clipMv( cPdmMvPred ); … … 4418 5332 } 4419 5333 } 5334 #if QC_MULTI_DIS_CAN 5335 if ( getSlice()->getViewId()!=0 && pInfo->iN == 3 ) 5336 { 5337 if ( pInfo->m_acMvCand[ 1 ] == pInfo->m_acMvCand[ 2 ] ) 5338 { 5339 pInfo->iN = 2; 5340 if( pInfo->m_acMvCand[ 0 ] == pInfo->m_acMvCand[ 1 ] ) 5341 pInfo->iN = 1; 5342 } 5343 else 5344 { 5345 if( pInfo->m_acMvCand[ 0 ] == pInfo->m_acMvCand[ 1 ] ) 5346 { 5347 pInfo->m_acMvCand[1 ] = pInfo->m_acMvCand[ 2 ]; 5348 pInfo->iN = 2; 5349 } 5350 else if (pInfo->m_acMvCand[ 0 ] == pInfo->m_acMvCand[ 2 ]) 5351 { 5352 pInfo->iN = 2; 5353 } 5354 } 5355 } 5356 #endif 4420 5357 #endif 4421 5358 … … 4488 5425 // get inter-view mv predictor (at position 3) 4489 5426 TComMv cPdmMvPred; 5427 #if QC_MULTI_DIS_CAN 5428 if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) ) 5429 #else 4490 5430 if( getPdmMvPred( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred ) ) 5431 #endif 4491 5432 { 4492 5433 clipMv( cPdmMvPred ); … … 4674 5615 { 4675 5616 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 4676 5617 #if LGE_DVMCP 5618 cMvPred.m_bDvMcp = false; 5619 #endif 4677 5620 pInfo->m_acMvCand[ pInfo->iN++] = cMvPred; 4678 5621 return true; … … 4709 5652 { 4710 5653 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList2nd)->getMv(uiIdx); 5654 #if LGE_DVMCP 5655 cMvPred.m_bDvMcp = false; 5656 #endif 4711 5657 pInfo->m_acMvCand[ pInfo->iN++] = cMvPred; 4712 5658 return true; … … 4840 5786 Int iNeibRefPOC; 4841 5787 4842 #if HHI_FIX4843 5788 if( pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) >= 0 ) 4844 5789 { … … 4849 5794 { 4850 5795 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList2nd)->getMv(uiIdx); 4851 5796 #if LGE_DVMCP 5797 cMvPred.m_bDvMcp = false; 5798 #endif 4852 5799 clipMv(cMvPred); 4853 5800 pInfo->m_acMvCand[ pInfo->iN++] = cMvPred; … … 4855 5802 } 4856 5803 } 4857 #endif 5804 4858 5805 //--------------- V1 (END) ------------------// 4859 5806 if( pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) >= 0) … … 4877 5824 rcMv = cMvPred.scaleMv( iScale ); 4878 5825 } 5826 #if LGE_DVMCP 5827 rcMv.m_bDvMcp = false; 5828 #endif 4879 5829 pInfo->m_acMvCand[ pInfo->iN++] = rcMv; 4880 5830 return true; … … 4901 5851 rcMv = cMvPred.scaleMv( iScale ); 4902 5852 } 5853 #if LGE_DVMCP 5854 rcMv.m_bDvMcp = false; 5855 #endif 4903 5856 pInfo->m_acMvCand[ pInfo->iN++] = rcMv; 4904 5857 return true; … … 4908 5861 } 4909 5862 5863 #if QC_MULTI_DIS_CAN 5864 Bool TComDataCU::xGetColDisMV( RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv , Int & iTargetViewIdx, Int & iStartViewIdx ) 5865 { 5866 #if LGE_DVMCP 5867 Int iDvMcpDispX[2] = {-1,}; 5868 Bool bDvMcpFlag [2] = { false, }; 5869 Int iCurrViewIdx = m_pcSlice->getViewId(); 5870 #endif 5871 5872 UInt uiAbsPartAddr = uiPartUnitIdx; 5873 5874 RefPicList eColRefPicList = REF_PIC_LIST_0; 5875 Int iColViewIdx, iColRefViewIdx; 5876 TComPic *pColPic = getSlice()->getRefPic( eRefPicList, refidx); 5877 TComDataCU *pColCU = pColPic->getCU( uiCUAddr ); 5878 iColViewIdx = pColCU->getSlice()->getViewId(); 5879 5880 5881 if (pColCU->getPic()==0||pColCU->getPartitionSize(uiPartUnitIdx)==SIZE_NONE||pColCU->isIntra(uiAbsPartAddr)) 5882 { 5883 return false; 5884 } 5885 #if LGE_DVMCP 5886 Bool bColIsSkipped = pColCU->isSkipped( uiAbsPartAddr ); 5887 #endif 5888 for (Int ilist = 0; ilist < (pColCU->getSlice()->isInterB()? 2:1); ilist++) 5889 { 5890 if(pColCU->getSlice()->isInterB()) 5891 { 5892 if(ilist == 0 ) 5893 eColRefPicList = getSlice()->getCheckLDC() ? eRefPicList : RefPicList(1-getSlice()->getColDir()); 5894 else 5895 eColRefPicList = getSlice()->getCheckLDC() ? (eRefPicList== REF_PIC_LIST_0? REF_PIC_LIST_1:REF_PIC_LIST_0 ): RefPicList(getSlice()->getColDir()); 5896 } 5897 5898 Int iColRefIdx = pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr); 5899 5900 if (iColRefIdx < 0) 5901 { 5902 continue; 5903 } 5904 5905 iColRefViewIdx = pColCU->getSlice()->getRefPic(eColRefPicList, iColRefIdx)->getViewId(); 5906 5907 if ( iColViewIdx == iColRefViewIdx ) // temporal vector 5908 { 5909 #if LGE_DVMCP 5910 if( iColViewIdx >0 ) 5911 { 5912 TComMv tmpMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiAbsPartAddr); 5913 if( tmpMv.m_bDvMcp && bColIsSkipped ) // DV-MCP SKIP 5914 { 5915 iDvMcpDispX[ilist] = tmpMv.m_iDvMcpDispX; 5916 bDvMcpFlag [ilist] = true; 5917 iTargetViewIdx = 0; //iColRefViewIdx ; 5918 iStartViewIdx = 0; //iCurrViewIdx; //iColViewIdx ; 5919 } 5920 } 5921 #endif 5922 continue; 5923 } 5924 else 5925 { 5926 rcMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiAbsPartAddr); 5927 #if LGE_DVMCP 5928 rcMv.m_bDvMcp = false; 5929 #endif 5930 iTargetViewIdx = iColRefViewIdx ; 5931 iStartViewIdx = iColViewIdx ; 5932 return true; 5933 } 5934 } 5935 5936 #if LGE_DVMCP 5937 for( Int ilist=0 ; ilist<2 ; ilist++ ) 5938 { 5939 if( bDvMcpFlag[ilist] ) 5940 { 5941 rcMv.setHor( iDvMcpDispX[ilist] ); 5942 rcMv.setVer( 0 ); 5943 rcMv.m_bDvMcp = true; 5944 iTargetViewIdx = 0; //iColRefViewIdx ; 5945 iStartViewIdx = iCurrViewIdx; //iColViewIdx ; 5946 return true; 5947 } 5948 } 5949 #endif 5950 5951 return false; 5952 } 5953 #endif 4910 5954 /** 4911 5955 * \param eRefPicList … … 4984 6028 iColRefViewOrderIdx = pColCU->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewOrderIdx(); 4985 6029 #else 4986 #if HHI_FIX4987 6030 if( pColCU->getSlice()->getRefViewId( eColRefPicList, iColRefIdx ) != pColCU->getSlice()->getViewId() ) 4988 #else4989 if( pColCU->getSlice()->getRefViewId( eColRefPicList, iColRefIdx ) != m_pcSlice->getRefPic( eRefPicList, riRefIdx )->getViewId() )4990 #endif4991 6031 { 4992 6032 return false; … … 5004 6044 else if((iColPOC == iColRefPOC)&&(iCurrPOC == iCurrRefPOC)) 5005 6045 iScale = xGetDistScaleFactor(iCurrViewOrderIdx, iCurrRefViewOrderIdx, iColViewOrderIdx, iColRefViewOrderIdx); 5006 #if HHI_FIX //GT: fix reported by Sony5007 6046 else 5008 6047 return false; 5009 #endif 6048 5010 6049 #else 5011 6050 iScale = xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iColPOC, iColRefPOC); … … 5951 6990 // ------------------------------------------------------------------------------------------------------------------- 5952 6991 #if HHI_INTER_VIEW_MOTION_PRED 6992 #if !QC_MULTI_DIS_CAN 5953 6993 Int 5954 6994 TComDataCU::getPdmMergeCandidate( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv ) … … 5967 7007 return pcDepthMapGenerator->getPdmMvPred( this, uiPartIdx, eRefPicList, iRefIdx, rcMv, bMerge ); 5968 7008 } 7009 #else 7010 Int 7011 TComDataCU::getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo ) 7012 { 7013 TComDepthMapGenerator* pcDepthMapGenerator = m_pcSlice->getSPS()->getDepthMapGenerator(); 7014 ROFRS( pcDepthMapGenerator, 0 ); 7015 return pcDepthMapGenerator->getPdmMergeCandidate( this, uiPartIdx, paiPdmRefIdx, pacPdmMv, pDInfo ); 7016 } 7017 Bool 7018 TComDataCU::getPdmMvPredDisCan( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge ) 7019 { 7020 TComDepthMapGenerator* pcDepthMapGenerator = m_pcSlice->getSPS()->getDepthMapGenerator(); 7021 ROFRS( pcDepthMapGenerator, false ); 7022 if (pDInfo->iN > 0 && pcDepthMapGenerator->getDisCanPdmMvPred(this, uiPartIdx, eRefPicList, iRefIdx, rcMv, pDInfo, bMerge )) //bug fix li 7023 return true; 7024 return false; 7025 } 7026 #endif 5969 7027 5970 7028 … … 5988 7046 TComResidualGenerator* pcResidualGenerator = m_pcSlice->getSPS()->getResidualGenerator(); 5989 7047 ROFRS( pcResidualGenerator, false ); 7048 #if QC_MULTI_DIS_CAN 7049 DisInfo cDisInfo; 7050 cDisInfo.iN = 0; 7051 PartSize m_peSaved = getPartitionSize( 0 ); 7052 m_pePartSize[0] = SIZE_2Nx2N; 7053 #if LGE_DVMCP 7054 getDisMvpCand2( 0, 0, &cDisInfo, true ); 7055 #else 7056 getDisMvpCand ( 0, 0, &cDisInfo ); 7057 #endif 7058 if( cDisInfo.iN == 0) 7059 { 7060 m_pePartSize[0] = m_peSaved; 7061 return false; 7062 } 7063 else 7064 { 7065 Bool bAvailable = pcResidualGenerator->getResidualSamples( this, uiPartIdx, pcYuv, cDisInfo.m_acMvCand[0].getHor() 7066 #if QC_SIMPLIFIEDIVRP_M24938 7067 , bRecon 7068 #endif 7069 ); 7070 m_pePartSize[0] = m_peSaved; 7071 return bAvailable; 7072 } 7073 #else 5990 7074 return pcResidualGenerator->getResidualSamples( this, uiPartIdx, pcYuv 5991 7075 #if QC_SIMPLIFIEDIVRP_M24938 … … 5993 7077 #endif 5994 7078 ); 5995 } 7079 #endif 7080 } 7081 #endif 7082 7083 #if LGE_EDGE_INTRA 7084 Void TComDataCU::reconPartition( UInt uiAbsPartIdx, UInt uiDepth, Bool bLeft, UChar ucStartPos, UChar ucNumEdge, UChar* pucEdgeCode, Bool* pbRegion ) 7085 { 7086 Int iWidth; 7087 Int iHeight; 7088 if( uiDepth == 0 ) 7089 { 7090 iWidth = 64; 7091 iHeight = 64; 7092 } 7093 else if( uiDepth == 1 ) 7094 { 7095 iWidth = 32; 7096 iHeight = 32; 7097 } 7098 else if( uiDepth == 2 ) 7099 { 7100 iWidth = 16; 7101 iHeight = 16; 7102 } 7103 else if( uiDepth == 3 ) 7104 { 7105 iWidth = 8; 7106 iHeight = 8; 7107 } 7108 else // uiDepth == 4 7109 { 7110 iWidth = 4; 7111 iHeight = 4; 7112 } 7113 7114 Int iPtr = 0; 7115 Int iX, iY; 7116 Int iDir = -1; 7117 Int iDiffX = 0, iDiffY = 0; 7118 7119 // 1. Edge Code -> Vert & Horz Edges 7120 Bool* pbEdge = (Bool*) xMalloc( Bool, 4 * iWidth * iHeight ); 7121 7122 for( UInt ui = 0; ui < 4 * iWidth * iHeight; ui++ ) 7123 pbEdge [ ui ] = false; 7124 7125 // Direction : left(0), right(1), top(2), bottom(3), left-top(4), right-top(5), left-bottom(6), right-bottom(7) 7126 // Code : 0deg(0), 45deg(1), -45deg(2), 90deg(3), -90deg(4), 135deg(5), -135deg(6) 7127 const UChar tableDir[8][7] = { { 0, 6, 4, 3, 2, 7, 5 }, 7128 { 1, 5, 7, 2, 3, 4, 6 }, 7129 { 2, 4, 5, 0, 1, 6, 7 }, 7130 { 3, 7, 6, 1, 0, 5, 4 }, 7131 { 4, 0, 2, 6, 5, 3, 1 }, 7132 { 5, 2, 1, 4, 7, 0, 3 }, 7133 { 6, 3, 0, 7, 4, 1, 2 }, 7134 { 7, 1, 3, 5, 6, 2, 0 }}; 7135 7136 UChar ucCode = pucEdgeCode[iPtr++]; 7137 7138 if( !bLeft ) 7139 { 7140 iX = ucStartPos; 7141 iY = 0; 7142 7143 switch(ucCode) 7144 { 7145 case 0: // bottom 7146 iDir = 3; 7147 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7148 break; 7149 case 2: // left-bottom 7150 iDir = 6; 7151 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7152 break; 7153 case 1: // right-bottom 7154 iDir = 7; 7155 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7156 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7157 break; 7158 case 4: // left 7159 iDir = 0; 7160 assert(false); 7161 break; 7162 case 3: // right 7163 iDir = 1; 7164 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7165 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7166 break; 7167 } 7168 } 7169 else 7170 { 7171 iX = 0; 7172 iY = ucStartPos; 7173 7174 switch(ucCode) 7175 { 7176 case 0: // right 7177 iDir = 1; 7178 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7179 break; 7180 case 1: // right-top 7181 iDir = 5; 7182 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7183 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7184 break; 7185 case 2: // right-bottom 7186 iDir = 7; 7187 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7188 break; 7189 case 3: // top 7190 iDir = 2; 7191 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7192 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7193 break; 7194 case 4: // bottom 7195 iDir = 3; 7196 assert(false); 7197 break; 7198 } 7199 } 7200 7201 switch( iDir ) 7202 { 7203 case 0: // left 7204 iDiffX = -1; 7205 iDiffY = 0; 7206 break; 7207 case 1: // right 7208 iDiffX = +1; 7209 iDiffY = 0; 7210 break; 7211 case 2: // top 7212 iDiffX = 0; 7213 iDiffY = -1; 7214 break; 7215 case 3: // bottom 7216 iDiffX = 0; 7217 iDiffY = +1; 7218 break; 7219 case 4: // left-top 7220 iDiffX = -1; 7221 iDiffY = -1; 7222 break; 7223 case 5: // right-top 7224 iDiffX = +1; 7225 iDiffY = -1; 7226 break; 7227 case 6: // left-bottom 7228 iDiffX = -1; 7229 iDiffY = +1; 7230 break; 7231 case 7: // right-bottom 7232 iDiffX = +1; 7233 iDiffY = +1; 7234 break; 7235 } 7236 7237 iX += iDiffX; 7238 iY += iDiffY; 7239 7240 while( iPtr < ucNumEdge ) 7241 { 7242 ucCode = pucEdgeCode[iPtr++]; 7243 7244 Int iNewDir = tableDir[iDir][ucCode]; 7245 7246 switch( iNewDir ) 7247 { 7248 case 0: // left 7249 iDiffX = -1; 7250 iDiffY = 0; 7251 break; 7252 case 1: // right 7253 iDiffX = +1; 7254 iDiffY = 0; 7255 break; 7256 case 2: // top 7257 iDiffX = 0; 7258 iDiffY = -1; 7259 break; 7260 case 3: // bottom 7261 iDiffX = 0; 7262 iDiffY = +1; 7263 break; 7264 case 4: // left-top 7265 iDiffX = -1; 7266 iDiffY = -1; 7267 break; 7268 case 5: // right-top 7269 iDiffX = +1; 7270 iDiffY = -1; 7271 break; 7272 case 6: // left-bottom 7273 iDiffX = -1; 7274 iDiffY = +1; 7275 break; 7276 case 7: // right-bottom 7277 iDiffX = +1; 7278 iDiffY = +1; 7279 break; 7280 } 7281 7282 switch( iDir ) 7283 { 7284 case 0: // left 7285 switch( ucCode ) 7286 { 7287 case 0: 7288 case 2: 7289 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7290 break; 7291 case 1: 7292 case 3: 7293 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7294 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7295 break; 7296 case 4: 7297 case 6: 7298 // no 7299 break; 7300 case 5: 7301 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7302 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7303 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7304 break; 7305 } 7306 break; 7307 case 1: // right 7308 switch( ucCode ) 7309 { 7310 case 0: 7311 case 2: 7312 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7313 break; 7314 case 1: 7315 case 3: 7316 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7317 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7318 break; 7319 case 4: 7320 case 6: 7321 // no 7322 break; 7323 case 5: 7324 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7325 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7326 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7327 break; 7328 } 7329 break; 7330 case 2: // top 7331 switch( ucCode ) 7332 { 7333 case 0: 7334 case 2: 7335 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7336 break; 7337 case 1: 7338 case 3: 7339 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7340 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7341 break; 7342 case 4: 7343 case 6: 7344 // no 7345 break; 7346 case 5: 7347 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7348 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7349 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7350 break; 7351 } 7352 break; 7353 case 3: // bottom 7354 switch( ucCode ) 7355 { 7356 case 0: 7357 case 2: 7358 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7359 break; 7360 case 1: 7361 case 3: 7362 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7363 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7364 break; 7365 case 4: 7366 case 6: 7367 // no 7368 break; 7369 case 5: 7370 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7371 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7372 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7373 break; 7374 } 7375 break; 7376 case 4: // left-top 7377 switch( ucCode ) 7378 { 7379 case 0: 7380 case 1: 7381 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7382 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7383 break; 7384 case 2: 7385 case 4: 7386 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7387 break; 7388 case 3: 7389 case 5: 7390 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7391 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7392 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7393 break; 7394 case 6: 7395 // no 7396 break; 7397 } 7398 break; 7399 case 5: // right-top 7400 switch( ucCode ) 7401 { 7402 case 0: 7403 case 1: 7404 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7405 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7406 break; 7407 case 2: 7408 case 4: 7409 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7410 break; 7411 case 3: 7412 case 5: 7413 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7414 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7415 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7416 break; 7417 case 6: 7418 // no 7419 break; 7420 } 7421 break; 7422 case 6: // left-bottom 7423 switch( ucCode ) 7424 { 7425 case 0: 7426 case 1: 7427 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7428 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7429 break; 7430 case 2: 7431 case 4: 7432 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7433 break; 7434 case 3: 7435 case 5: 7436 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true; 7437 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7438 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7439 break; 7440 case 6: 7441 // no 7442 break; 7443 } 7444 break; 7445 case 7: // right-bottom 7446 switch( ucCode ) 7447 { 7448 case 0: 7449 case 1: 7450 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7451 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7452 break; 7453 case 2: 7454 case 4: 7455 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7456 break; 7457 case 3: 7458 case 5: 7459 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true; 7460 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true; 7461 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true; 7462 break; 7463 case 6: 7464 // no 7465 break; 7466 } 7467 break; 7468 } 7469 7470 assert( iX >= 0 && iX <= iWidth ); 7471 assert( iY >= 0 && iY <= iHeight ); 7472 7473 iX += iDiffX; 7474 iY += iDiffY; 7475 iDir = iNewDir; 7476 } 7477 7478 // finalize edge chain 7479 if( iX == iWidth-1 ) 7480 { 7481 if( iY == 0 ) 7482 { 7483 if( iDir == 1 ) 7484 { 7485 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true; 7486 } 7487 else if( iDir == 5 ) 7488 { 7489 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true; 7490 } 7491 else 7492 { 7493 assert(false); 7494 } 7495 } 7496 else if( iY == iHeight-1 ) 7497 { 7498 if( iDir == 3 ) 7499 { 7500 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true; 7501 } 7502 else if( iDir == 7 ) 7503 { 7504 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true; 7505 } 7506 else 7507 { 7508 assert(false); 7509 } 7510 } 7511 else 7512 { 7513 if( iDir == 1 ) 7514 { 7515 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true; 7516 } 7517 else if( iDir == 3 ) 7518 { 7519 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true; 7520 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true; 7521 } 7522 else if( iDir == 5 ) 7523 { 7524 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true; 7525 } 7526 else if( iDir == 7 ) 7527 { 7528 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true; 7529 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true; 7530 } 7531 else 7532 { 7533 assert(false); 7534 } 7535 } 7536 } 7537 else if( iX == 0 ) 7538 { 7539 if( iY == 0 ) 7540 { 7541 if( iDir == 2 ) 7542 { 7543 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true; 7544 } 7545 else if( iDir == 4 ) 7546 { 7547 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true; 7548 } 7549 else 7550 { 7551 assert(false); 7552 } 7553 } 7554 else if( iY == iHeight-1 ) 7555 { 7556 if( iDir == 0 ) 7557 { 7558 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true; 7559 } 7560 else if( iDir == 6 ) 7561 { 7562 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true; 7563 } 7564 else 7565 { 7566 assert(false); 7567 } 7568 } 7569 else 7570 { 7571 if( iDir == 0 ) 7572 { 7573 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true; 7574 } 7575 else if( iDir == 2 ) 7576 { 7577 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true; 7578 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true; 7579 } 7580 else if( iDir == 4 ) 7581 { 7582 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true; 7583 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true; 7584 } 7585 else if( iDir == 6 ) 7586 { 7587 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true; 7588 } 7589 else 7590 { 7591 assert(false); 7592 } 7593 } 7594 } 7595 else if( iY == 0 ) 7596 { 7597 if( iDir == 1 ) 7598 { 7599 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true; 7600 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true; 7601 } 7602 else if( iDir == 2 ) 7603 { 7604 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true; 7605 } 7606 else if( iDir == 4 ) 7607 { 7608 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true; 7609 } 7610 else if( iDir == 5 ) 7611 { 7612 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true; 7613 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true; 7614 } 7615 else 7616 { 7617 assert(false); 7618 } 7619 } 7620 else if( iY == iHeight-1 ) 7621 { 7622 if( iDir == 0 ) 7623 { 7624 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true; 7625 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true; 7626 } 7627 else if( iDir == 3 ) 7628 { 7629 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true; 7630 } 7631 else if( iDir == 6 ) 7632 { 7633 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true; 7634 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true; 7635 } 7636 else if( iDir == 7 ) 7637 { 7638 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true; 7639 } 7640 else 7641 { 7642 assert(false); 7643 } 7644 } 7645 else 7646 { 7647 printf("xPredIntraEdge: wrong termination\n"); 7648 assert(false); 7649 } 7650 7651 // Reconstruct Region from Chain Code 7652 Bool* pbVisit = (Bool*) xMalloc( Bool, iWidth * iHeight ); 7653 Int* piStack = (Int* ) xMalloc( Int, iWidth * iHeight ); 7654 7655 for( UInt ui = 0; ui < iWidth * iHeight; ui++ ) 7656 { 7657 pbRegion[ ui ] = true; // fill it as region 1 (we'll discover region 0 next) 7658 pbVisit [ ui ] = false; 7659 } 7660 7661 iPtr = 0; 7662 piStack[iPtr++] = (0 << 8) | (0); 7663 pbRegion[ 0 ] = false; 7664 7665 while(iPtr > 0) 7666 { 7667 Int iTmp = piStack[--iPtr]; 7668 Int iX1, iY1; 7669 iX1 = iTmp & 0xff; 7670 iY1 = (iTmp >> 8) & 0xff; 7671 7672 pbVisit[ iX1 + iY1 * iWidth ] = true; 7673 7674 assert( iX1 >= 0 && iX1 < iWidth ); 7675 assert( iY1 >= 0 && iY1 < iHeight ); 7676 7677 if( iX1 > 0 && !pbEdge[ 2 * iX1 - 1 + 4 * iY1 * iWidth ] && !pbVisit[ iX1 - 1 + iY1 * iWidth ] ) 7678 { 7679 piStack[iPtr++] = (iY1 << 8) | (iX1 - 1); 7680 pbRegion[ iX1 - 1 + iY1 * iWidth ] = false; 7681 } 7682 if( iX1 < iWidth - 1 && !pbEdge[ 2 * iX1 + 1 + 4 * iY1 * iWidth ] && !pbVisit[ iX1 + 1 + iY1 * iWidth ] ) 7683 { 7684 piStack[iPtr++] = (iY1 << 8) | (iX1 + 1); 7685 pbRegion[ iX1 + 1 + iY1 * iWidth ] = false; 7686 } 7687 if( iY1 > 0 && !pbEdge[ 2 * iX1 + 2 * (2 * iY1 - 1) * iWidth ] && !pbVisit[ iX1 + (iY1 - 1) * iWidth ] ) 7688 { 7689 piStack[iPtr++] = ((iY1 - 1) << 8) | iX1; 7690 pbRegion[ iX1 + (iY1 - 1) * iWidth ] = false; 7691 } 7692 if( iY1 < iHeight - 1 && !pbEdge[ 2 * iX1 + 2 * (2 * iY1 + 1) * iWidth ] && !pbVisit[ iX1 + (iY1 + 1) * iWidth ] ) 7693 { 7694 piStack[iPtr++] = ((iY1 + 1) << 8) | iX1; 7695 pbRegion[ iX1 + (iY1 + 1) * iWidth ] = false; 7696 } 7697 } 7698 7699 xFree( pbEdge ); 7700 xFree( pbVisit ); 7701 xFree( piStack ); 7702 } 7703 5996 7704 #endif 5997 7705 -
trunk/source/Lib/TLibCommon/TComDataCU.h
r77 r100 214 214 #endif 215 215 216 #if LGE_EDGE_INTRA 217 UChar* m_pucEdgeCode; ///< array of edge code 218 UChar* m_pucEdgeNumber; ///< total number of edge 219 UChar* m_pucEdgeStartPos; ///< starting point position 220 Bool* m_pbEdgeLeftFirst; ///< true if edge should be checked in left boundary first 221 Bool* m_pbEdgePartition; ///< true if it belongs to region 1, otherwise, region 0 222 #if LGE_EDGE_INTRA_DELTA_DC 223 Int* m_piEdgeDeltaDC0; 224 Int* m_piEdgeDeltaDC1; 225 #endif 226 #endif 227 216 228 // ------------------------------------------------------------------------------------------------------------------- 217 229 // misc. variables … … 256 268 Void deriveRightBottomIdx ( PartSize eCUMode, UInt uiPartIdx, UInt& ruiPartIdxRB ); 257 269 Bool xGetColMVP( RefPicList eRefPicList, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx ); 270 #if QC_MULTI_DIS_CAN 271 Bool xGetColDisMV( RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx ); 272 #endif 258 273 259 274 #if !AMVP_PRUNING_SIMPLIFICATION … … 503 518 504 519 #if HHI_INTER_VIEW_MOTION_PRED 520 #if !QC_MULTI_DIS_CAN 505 521 Int getPdmMergeCandidate( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv ); 506 522 Bool getPdmMvPred( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, Bool bMerge = false ); 523 #else 524 Bool getPdmMvPredDisCan( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge = false ); 525 Int getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo ); 526 Void getDisMvpCand ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo ); 527 #if LGE_DVMCP 528 Void getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo, Bool bMerge=false, RefPicList eRefPicList=REF_PIC_LIST_X, Int iRefIdx=-1 ); 529 #endif 530 531 #endif 507 532 Bool getIViewOrgDepthMvPred( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv ); 508 533 #endif … … 659 684 UInt getEntropySliceStartCU ( UInt pos ) { return m_uiEntropySliceStartCU[pos-m_uiAbsIdxInLCU]; } 660 685 UInt& getTotalBins () { return m_uiTotalBins; } 686 687 #if LGE_EDGE_INTRA 688 UInt getCtxEdgeIntra ( UInt uiAbsPartIdx ); 689 #endif 690 661 691 // ------------------------------------------------------------------------------------------------------------------- 662 692 // member functions for RD cost storage … … 734 764 Void setContourPredTexDeltaDC2SubParts ( Int iDC2, UInt uiAbsPartIdx, UInt uiDepth ); 735 765 #endif 766 767 #if LGE_EDGE_INTRA 768 UChar* getEdgeCode( UInt uiIdx ) { return &m_pucEdgeCode[uiIdx * LGE_EDGE_INTRA_MAX_EDGE_NUM_PER_4x4]; } 769 UChar* getEdgeNumber( ) { return m_pucEdgeNumber; } 770 UChar getEdgeNumber( UInt uiIdx ) { return m_pucEdgeNumber[uiIdx]; } 771 Void setEdgeNumber( UInt uiIdx, UChar val ) { m_pucEdgeNumber[uiIdx] = val; } 772 UChar* getEdgeStartPos( ) { return m_pucEdgeStartPos; } 773 UChar getEdgeStartPos( UInt uiIdx ) { return m_pucEdgeStartPos[uiIdx]; } 774 Void setEdgeStartPos( UInt uiIdx, UChar val ) { m_pucEdgeStartPos[uiIdx] = val; } 775 Bool* getEdgeLeftFirst( ) { return m_pbEdgeLeftFirst; } 776 Bool getEdgeLeftFirst( UInt uiIdx ) { return m_pbEdgeLeftFirst[uiIdx]; } 777 Void setEdgeLeftFirst( UInt uiIdx, Bool val ) { m_pbEdgeLeftFirst[uiIdx] = val; } 778 Bool* getEdgePartition( UInt uiIdx ) { return &m_pbEdgePartition[uiIdx * 16]; } 779 Void reconPartition( UInt uiAbsPartIdx, UInt uiDepth, Bool bLeft, UChar ucStartPos, UChar ucNumEdge, UChar* pucEdgeCode, Bool* pbRegion ); 780 781 #if LGE_EDGE_INTRA_DELTA_DC 782 Int* getEdgeDeltaDC0( ) { return m_piEdgeDeltaDC0; } 783 Int* getEdgeDeltaDC1( ) { return m_piEdgeDeltaDC1; } 784 Int getEdgeDeltaDC0( UInt uiIdx ) { return m_piEdgeDeltaDC0[uiIdx]; } 785 Int getEdgeDeltaDC1( UInt uiIdx ) { return m_piEdgeDeltaDC1[uiIdx]; } 786 Void setEdgeDeltaDC0( UInt uiIdx, Int val ) { m_piEdgeDeltaDC0[uiIdx] = val; } 787 Void setEdgeDeltaDC1( UInt uiIdx, Int val ) { m_piEdgeDeltaDC1[uiIdx] = val; } 788 #endif 789 #endif 736 790 }; 737 791 -
trunk/source/Lib/TLibCommon/TComDepthMapGenerator.cpp
r77 r100 78 78 m_uiSubSampExpX = uiSubSampExpX; 79 79 m_uiSubSampExpY = uiSubSampExpY; 80 #if !QC_MULTI_DIS_CAN 80 81 m_ppcYuv = new TComYuv* [ m_uiMaxDepth ]; 81 82 m_ppcCU = new TComDataCU* [ m_uiMaxDepth ]; … … 91 92 m_cTmpPic.create( uiPicWidth >> m_uiSubSampExpX, uiPicHeight >> m_uiSubSampExpY, uiMaxCUWidth >> m_uiSubSampExpX, uiMaxCUHeight >> m_uiSubSampExpY, uiMaxCUDepth ); 92 93 xSetChroma( &m_cTmpPic, ( 1 << uiOrgBitDepth ) >> 1 ); 94 #endif 93 95 m_bCreated = true; 94 96 } … … 100 102 { 101 103 m_bCreated = false; 104 #if !QC_MULTI_DIS_CAN 102 105 for( UInt uiDepth = 0; uiDepth < m_uiMaxDepth; uiDepth++ ) 103 106 { … … 114 117 delete [] m_ppcCU; m_ppcCU = 0; 115 118 m_cTmpPic.destroy(); 119 #endif 116 120 m_uiMaxDepth = 0; 117 121 m_uiOrgDepthBitDepth = 0; … … 163 167 m_bPDMAvailable = false; 164 168 m_uiCurrViewId = pcPic->getSPS()->getViewId(); 165 169 #if PDM_REMOVE_DEPENDENCE 170 pcPic->setStoredPDMforV2(0); 171 #endif 166 172 // update SPS list and AU pic list and set depth map generator in SPS 167 173 #if VIDYO_VPS_INTEGRATION … … 218 224 if( m_uiCurrViewId ) 219 225 { 226 #if PDM_REMOVE_DEPENDENCE 227 UInt uiBaseVId = m_auiBaseIdList[0]; 228 #else 220 229 Bool bCheckVId1 = ( m_uiCurrViewId > 1 && m_auiBaseIdList[0] == 0 ); 221 230 UInt uiBaseVId = ( bCheckVId1 ? 1 : m_auiBaseIdList[0] ); 231 #endif 222 232 TComPic* pcBasePic = m_pcAUPicAccess->getPic( uiBaseVId ); 223 233 SliceType eSliceType = pcBasePic->getCurrSlice()->getSliceType(); … … 367 377 } 368 378 369 379 #if !QC_MULTI_DIS_CAN 370 380 Bool 371 381 TComDepthMapGenerator::predictDepthMap( TComPic* pcPic ) … … 398 408 pcBasePic->addPrdDepthMapBuffer( PDM_SUB_SAMP_EXP_X(m_pcSPSAccess->getPdm()), PDM_SUB_SAMP_EXP_Y(m_pcSPSAccess->getPdm()) ); 399 409 xClearDepthMap( pcBasePic ); 410 #if PDM_REMOVE_DEPENDENCE 411 xClearDepthMap( pcBasePic, PDM_UNDEFINED_DEPTH, 1 ); 412 #endif 400 413 } 401 414 #if PDM_OUTPUT_PRED_DEPTH_MAP … … 442 455 { 443 456 xClearDepthMap( pcPic ); 457 #if PDM_REMOVE_DEPENDENCE 458 xClearDepthMap( pcPic, PDM_UNDEFINED_DEPTH, 1 ); 459 #endif 444 460 } 445 461 return bUndefined; … … 463 479 464 480 // predict depth map using current coding symbols 481 #if PDM_REMOVE_DEPENDENCE 482 pcPic->setStoredPDMforV2(0); 483 xPredictDepthMap( pcPic ); 484 if(m_uiCurrViewId==0) 485 { 486 pcPic->setStoredPDMforV2(1); 487 xPredictDepthMap( pcPic ); 488 pcPic->setStoredPDMforV2(0); 489 } 490 #else 465 491 xPredictDepthMap( pcPic ); 466 492 #if PDM_OUTPUT_PRED_DEPTH_MAP … … 469 495 dumpDepthMap( pcPic, acFilenameBase ); 470 496 } 497 #endif 471 498 #endif 472 499 … … 481 508 #endif 482 509 } 510 #if PDM_REMOVE_DEPENDENCE 511 if( m_uiCurrViewId == 2 ) 512 { 513 TComPic* pcBasePic = m_pcAUPicAccess->getPic( 0 ); 514 AOF( pcBasePic ); 515 xConvertDepthMapCurr2Ref( pcBasePic, pcPic ); 516 #if PDM_OUTPUT_PRED_DEPTH_MAP 517 dumpDepthMap( pcBasePic, acFilenameBase ); 518 #endif 519 } 520 #endif 483 521 } 484 522 … … 501 539 Int iSrcStride = pcPicYuv->getStride (); 502 540 Int iDstStride = m_cTmpPic.getStride (); 541 #if PDM_REMOVE_DEPENDENCE 542 if(pcPic->getStoredPDMforV2()) 543 pcPicYuv = pcPic->getPredDepthMapTemp(); 544 #endif 503 545 Pel* pSrcSamples = pcPicYuv->getLumaAddr ( 0 ); 504 546 Pel* pDstSamples = m_cTmpPic.getLumaAddr ( 0 ); … … 520 562 m_cTmpPic.dump( acFilename, ( pcPic->getPOC() != 0 ) ); 521 563 } 522 564 #endif 523 565 524 566 #if HHI_INTER_VIEW_MOTION_PRED … … 563 605 564 606 #if HHI_INTER_VIEW_MOTION_PRED 607 #if QC_MULTI_DIS_CAN 608 Int 609 TComDepthMapGenerator::getPdmMergeCandidate( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo ) 610 #else 565 611 Int 566 612 TComDepthMapGenerator::getPdmMergeCandidate( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv ) 567 { 613 #endif 614 { 615 #if MTK_INTERVIEW_MERGE_A0049 616 AOF ( m_bCreated && m_bInit ); 617 618 #if !QC_MULTI_DIS_CAN 619 ROFRS( m_bPDMAvailable, 0 ); 620 #endif 621 622 TComSlice* pcSlice = pcCU->getSlice (); 623 TComSPS* pcSPS = pcSlice->getSPS(); 624 AOF ( pcSPS->getViewId() == m_uiCurrViewId ); 625 Bool bPdmMerge = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_MERGE ) == PDM_USE_FOR_MERGE ); 626 ROTRS( !bPdmMerge, 0 ); 627 628 Bool abPdmAvailable[2] = {false,false}; 629 630 Int iValid = 0; 631 Int iViewId = 0; 632 for( UInt uiBId = 0; uiBId < m_uiCurrViewId && iValid==0; uiBId++ ) 633 { 634 UInt uiBaseId = m_auiBaseIdList[ uiBId ]; 635 TComPic* pcBasePic = m_pcAUPicAccess->getPic( uiBaseId ); 636 for( Int iRefListId = 0; iRefListId < 2 && iValid==0; iRefListId++ ) 637 { 638 RefPicList eRefPicListTest = RefPicList( iRefListId ); 639 Int iNumRefPics = pcSlice->getNumRefIdx( eRefPicListTest ) ; 640 for( Int iRefIndex = 0; iRefIndex < iNumRefPics; iRefIndex++ ) 641 { 642 if(pcBasePic->getPOC() == pcSlice->getRefPic( eRefPicListTest, iRefIndex )->getPOC() 643 && pcBasePic->getViewId() == pcSlice->getRefPic( eRefPicListTest, iRefIndex )->getViewId()) 644 { 645 iValid=1; 646 iViewId = uiBaseId; 647 break; 648 } 649 } 650 } 651 } 652 if (iValid == 0) 653 return 0; 654 655 //--- get base CU/PU and check prediction mode --- 656 TComPic* pcBasePic = m_pcAUPicAccess->getPic( iViewId ); 657 TComPicYuv* pcBaseRec = pcBasePic->getPicYuvRec (); 658 659 #if QC_MULTI_DIS_CAN 660 Int iCurrPosX, iCurrPosY; 661 UInt uiPartAddr; 662 Int iWidth; 663 Int iHeight; 664 665 pcCU->getPartIndexAndSize( uiPartIdx, uiPartAddr, iWidth, iHeight ); 666 pcBaseRec->getTopLeftSamplePos( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr, iCurrPosX, iCurrPosY ); 667 iCurrPosX += ( ( iWidth - 1 ) >> 1 ); 668 iCurrPosY += ( ( iHeight - 1 ) >> 1 ); 669 670 Int iBasePosX = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (pDInfo->m_acMvCand[0].getHor() + 2 ) >> 2 ) ); 671 Int iBasePosY = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (pDInfo->m_acMvCand[0].getVer() + 2 ) >> 2 )); 672 Int iBaseCUAddr; 673 Int iBaseAbsPartIdx; 674 pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY , iBaseCUAddr, iBaseAbsPartIdx ); 675 #else 676 Int iPrdDepth, iCurrPosX, iCurrPosY; 677 Bool bAvailable = xGetPredDepth( pcCU, uiPartIdx, iPrdDepth, &iCurrPosX, &iCurrPosY ); 678 AOF( bAvailable ); 679 TComPicYuv* pcBasePdm = pcBasePic->getPredDepthMap(); 680 Int iDisparity = xGetDisparityFromVirtDepth( iViewId, iPrdDepth ); 681 Int iShiftX = m_uiSubSampExpX + 2; 682 Int iAddX = ( 1 << iShiftX ) >> 1; 683 Int iBasePosX = Clip3( 0, pcBasePdm->getWidth () - 1, iCurrPosX + ( ( iDisparity + iAddX ) >> iShiftX ) ); 684 Int iBasePosY = Clip3( 0, pcBasePdm->getHeight() - 1, iCurrPosY ); 685 Int iBaseCUAddr; 686 Int iBaseAbsPartIdx; 687 pcBaseRec->getCUAddrAndPartIdx( iBasePosX<< m_uiSubSampExpX , iBasePosY<< m_uiSubSampExpY , iBaseCUAddr, iBaseAbsPartIdx ); 688 #endif 689 690 TComDataCU* pcBaseCU = pcBasePic->getCU( iBaseCUAddr ); 691 692 if( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTER || pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_SKIP ) 693 { 694 for( UInt uiBaseRefListId = 0; uiBaseRefListId < 2; uiBaseRefListId++ ) 695 { 696 RefPicList eBaseRefPicList = RefPicList( uiBaseRefListId ); 697 TComMvField cBaseMvField; 698 pcBaseCU->getMvField( pcBaseCU, iBaseAbsPartIdx, eBaseRefPicList, cBaseMvField ); 699 Int iBaseRefIdx = cBaseMvField.getRefIdx(); 700 701 if (iBaseRefIdx >= 0) 702 { 703 Int iBaseRefPOC = pcBaseCU->getSlice()->getRefPOC(eBaseRefPicList, iBaseRefIdx); 704 if (iBaseRefPOC != pcSlice->getPOC()) 705 { 706 for (Int iPdmRefIdx = 0; iPdmRefIdx < pcSlice->getNumRefIdx( eBaseRefPicList ); iPdmRefIdx++) 707 { 708 if (iBaseRefPOC == pcSlice->getRefPOC(eBaseRefPicList, iPdmRefIdx)) 709 { 710 abPdmAvailable[ uiBaseRefListId ] = true; 711 paiPdmRefIdx [ uiBaseRefListId ] = iPdmRefIdx; 712 TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer()); 713 #if LGE_DVMCP 714 cMv.m_bDvMcp = true; 715 cMv.m_iDvMcpDispX = pDInfo->m_acMvCand[0].getHor(); 716 #endif 717 pcCU->clipMv( cMv ); 718 pacPdmMv [ uiBaseRefListId ] = cMv; 719 break; 720 } 721 } 722 } 723 } 724 } 725 } 726 Int iPdmInterDir = ( abPdmAvailable[0] ? 1 : 0 ) + ( abPdmAvailable[1] ? 2 : 0 ); 727 728 if (iPdmInterDir == 0) 729 { 730 for( Int iRefListId = 0; iRefListId < 2 ; iRefListId++ ) 731 { 732 RefPicList eRefPicList = RefPicList( iRefListId ); 733 Int iNumRefPics = pcSlice->getNumRefIdx( eRefPicList ); 734 for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ ) 735 { 736 if( pcSlice->getRefPOC( eRefPicList, iPdmRefIdx ) == pcSlice->getPOC()) 737 { 738 abPdmAvailable[ iRefListId ] = true; 739 paiPdmRefIdx [ iRefListId ] = iPdmRefIdx; 740 #if QC_MULTI_DIS_CAN 741 TComMv cMv = pDInfo->m_acMvCand[0]; 742 cMv.setVer(0); 743 #else 744 TComMv cMv(iDisparity, 0); 745 #endif 746 pcCU->clipMv( cMv ); 747 pacPdmMv [ iRefListId ] = cMv; 748 break; 749 } 750 } 751 } 752 iPdmInterDir = ( abPdmAvailable[0] ? 1 : 0 ) + ( abPdmAvailable[1] ? 2 : 0 ) ; 753 } 754 755 return iPdmInterDir; 756 757 #else 568 758 Int iMaxNumInterPics = 1; 569 759 Int iMaxNumAllPics = 2; … … 580 770 if( pcCU->getSlice()->getRefPOC( eRefPicList, iPdmRefIdx ) != pcCU->getSlice()->getPOC() ) 581 771 { 772 #if QC_MULTI_DIS_CAN 773 if( getDisCanPdmMvPred (pcCU, uiPartIdx, eRefPicList, iPdmRefIdx, cMv, pDInfo, true ) ) 774 #else 582 775 if( getPdmMvPred( pcCU, uiPartIdx, eRefPicList, iPdmRefIdx, cMv, true ) ) 776 #endif 583 777 { 584 778 pcCU->clipMv( cMv ); … … 602 796 for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ ) 603 797 { 798 #if QC_MULTI_DIS_CAN 799 if ( getDisCanPdmMvPred (pcCU, uiPartIdx, eRefPicList, iPdmRefIdx, cMv, pDInfo, true ) ) 800 #else 604 801 if( getPdmMvPred( pcCU, uiPartIdx, eRefPicList, iPdmRefIdx, cMv, true ) ) 802 #endif 605 803 { 606 804 pcCU->clipMv( cMv ); … … 615 813 } 616 814 return iPdmInterDir; 617 } 618 619 815 #endif 816 } 817 818 #if QC_MULTI_DIS_CAN 819 Bool 820 TComDepthMapGenerator::getDisCanPdmMvPred ( TComDataCU* pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge ) 821 { 822 #if LGE_DVMCP 823 rcMv.m_bDvMcp = false; 824 #endif 825 AOF ( m_bCreated && m_bInit ); 826 AOF ( iRefIdx >= 0 ); 827 AOF ( pcCU ); 828 //ROFRS( m_bPDMAvailable, false ); 829 TComSlice* pcSlice = pcCU->getSlice (); 830 TComSPS* pcSPS = pcSlice->getSPS(); 831 AOF ( pcSPS->getViewId() == m_uiCurrViewId ); 832 TComPic* pcRefPic = pcSlice->getRefPic( eRefPicList, iRefIdx ); 833 UInt uiRefViewId = pcRefPic->getSPS()->getViewId(); 834 Int iRefPoc = pcRefPic->getPOC(); 835 Bool bInterview = ( uiRefViewId < m_uiCurrViewId ); 836 AOT( bInterview && iRefPoc != pcSlice->getPOC() ); 837 AOT( !bInterview && iRefPoc == pcSlice->getPOC() ); 838 Bool bPdmIView = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_IVIEW ) == PDM_USE_FOR_IVIEW ); 839 Bool bPdmInter = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_INTER ) == PDM_USE_FOR_INTER ); 840 Bool bPdmMerge = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_MERGE ) == PDM_USE_FOR_MERGE ); 841 ROTRS( ( bInterview && !bMerge ) && !bPdmIView, false ); 842 ROTRS( (!bInterview && !bMerge ) && !bPdmInter, false ); 843 ROTRS( bMerge && !bPdmMerge, false ); 844 Int iCurrPosX, iCurrPosY; 845 TComMv cDisMv; 846 847 if( bInterview ) 848 { 849 rcMv = pDInfo->m_acMvCand[0]; 850 rcMv.setVer(0); 851 return true; 852 } 853 for( UInt uiBId = 0; uiBId < m_uiCurrViewId; uiBId++ ) 854 { 855 UInt uiBaseId = uiBId; //m_auiBaseIdList[ uiBId ]; 856 857 if (m_uiCurrViewId >1 && uiBaseId ==1 ) 858 continue; 859 860 TComPic* pcBasePic = m_pcAUPicAccess->getPic( uiBaseId ); 861 TComPicYuv* pcBaseRec = pcBasePic->getPicYuvRec (); 862 UInt uiPartAddr; 863 Int iWidth; 864 Int iHeight; 865 866 pcCU->getPartIndexAndSize( uiPartIdx, uiPartAddr, iWidth, iHeight ); 867 pcBaseRec->getTopLeftSamplePos( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr, iCurrPosX, iCurrPosY ); 868 iCurrPosX += ( ( iWidth - 1 ) >> 1 ); 869 iCurrPosY += ( ( iHeight - 1 ) >> 1 ); 870 Int iBasePosX = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (pDInfo->m_acMvCand[0].getHor() + 2 ) >> 2 ) ); 871 Int iBasePosY = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (pDInfo->m_acMvCand[0].getVer() + 2 ) >> 2 )); 872 Int iBaseCUAddr; 873 Int iBaseAbsPartIdx; 874 pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY , iBaseCUAddr, iBaseAbsPartIdx ); 875 TComDataCU* pcBaseCU = pcBasePic->getCU( iBaseCUAddr ); 876 if( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) != MODE_INTER && pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) != MODE_SKIP ) 877 { 878 continue; 879 } 880 for( UInt uiBaseRefListId = 0; uiBaseRefListId < 2; uiBaseRefListId++ ) 881 { 882 RefPicList eBaseRefPicList = RefPicList( uiBaseRefListId ); 883 TComMvField cBaseMvField; 884 pcBaseCU->getMvField( pcBaseCU, iBaseAbsPartIdx, eBaseRefPicList, cBaseMvField ); 885 Int iBaseRefIdx = cBaseMvField.getRefIdx(); 886 Int iBaseRefPoc = ( iBaseRefIdx >= 0 ? pcBaseCU->getSlice()->getRefPic( eBaseRefPicList, iBaseRefIdx )->getPOC() : -(1<<30) ); 887 if( iBaseRefIdx >= 0 && iBaseRefPoc == iRefPoc ) 888 { 889 rcMv.set( cBaseMvField.getHor(), cBaseMvField.getVer() ); 890 #if LGE_DVMCP 891 // save disparity vector when a merge candidate for IVMP is set as DV-MCP 892 if( bMerge ) 893 { 894 rcMv.m_bDvMcp = true; 895 rcMv.m_iDvMcpDispX = pDInfo->m_acMvCand[0].getHor(); 896 } 897 else { // AMVP ? 898 rcMv.m_bDvMcp = false; 899 } 900 #endif 901 return true; 902 } 903 } 904 } 905 return false; 906 } 907 #else 620 908 Bool 621 909 TComDepthMapGenerator::getPdmMvPred( TComDataCU* pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, Bool bMerge ) … … 664 952 //--- get base CU/PU and check prediction mode --- 665 953 UInt uiBaseId = m_auiBaseIdList[ uiBId ]; 954 #if PDM_REMOVE_DEPENDENCE 955 if( uiBaseId != 0) 956 continue; 957 #endif 666 958 TComPic* pcBasePic = m_pcAUPicAccess->getPic( uiBaseId ); 667 959 TComPicYuv* pcBasePdm = pcBasePic->getPredDepthMap(); … … 697 989 return false; 698 990 } 991 #endif 699 992 700 993 … … 744 1037 745 1038 746 1039 #if !QC_MULTI_DIS_CAN 747 1040 /*=======================================================* 748 1041 *===== =====* … … 760 1053 AOF( pcRef->getPredDepthMap()->getWidth () == pcCur->getPredDepthMap()->getWidth () ); 761 1054 AOF( pcRef->getPredDepthMap()->getHeight() == pcCur->getPredDepthMap()->getHeight() ); 762 1055 #if PDM_REMOVE_DEPENDENCE 1056 if( pcCur->getViewId() == 1) 1057 xClearDepthMap( pcRef ); 1058 else if (pcCur->getViewId() == 2) 1059 xClearDepthMap( pcRef, PDM_UNDEFINED_DEPTH, 1 ); 1060 #else 763 1061 xClearDepthMap( pcRef ); 1062 #endif 764 1063 TComPicYuv* pcCurDepthMap = pcCur->getPredDepthMap (); 765 1064 TComPicYuv* pcRefDepthMap = pcRef->getPredDepthMap (); … … 771 1070 Pel* pRefSamples = pcRefDepthMap->getLumaAddr( 0 ); 772 1071 Int iRefViewIdx = pcRef->getViewId(); 1072 #if PDM_REMOVE_DEPENDENCE 1073 if( pcCur->getViewId() == 2) 1074 { 1075 pcRefDepthMap = pcRef->getPredDepthMapTemp(); 1076 pRefSamples = pcRefDepthMap->getLumaAddr( 0 ); 1077 } 1078 #endif 773 1079 Int iShiftX = m_uiSubSampExpX + 2; 774 1080 Int iAddX = ( 1 << iShiftX ) >> 1; … … 799 1105 AOF( pcCur->getSPS()->getViewId() > pcRef->getSPS()->getViewId() ); 800 1106 AOF( pcCur->getPredDepthMap() ); 1107 #if PDM_REMOVE_DEPENDENCE 1108 if(pcCur->getViewId() == 1) 1109 { 1110 AOF( pcRef->getPredDepthMap() ); 1111 }else 1112 { 1113 AOF( pcRef->getPredDepthMapTemp() ); 1114 } 1115 #else 801 1116 AOF( pcRef->getPredDepthMap() ); 1117 #endif 802 1118 AOF( pcRef->getPredDepthMap()->getWidth () == pcCur->getPredDepthMap()->getWidth () ); 803 1119 AOF( pcRef->getPredDepthMap()->getHeight() == pcCur->getPredDepthMap()->getHeight() ); … … 805 1121 xClearDepthMap( pcCur ); 806 1122 TComPicYuv* pcRefDepthMap = pcRef->getPredDepthMap (); 1123 #if PDM_REMOVE_DEPENDENCE 1124 if(pcCur->getViewId() == 2) 1125 pcRefDepthMap = pcRef->getPredDepthMapTemp (); 1126 #endif 807 1127 TComPicYuv* pcCurDepthMap = pcCur->getPredDepthMap (); 808 1128 Int iWidth = pcRefDepthMap->getWidth (); … … 844 1164 } 845 1165 Bool bUndefined = xFillDepthMapHoles( pcPic ); 1166 #if PDM_REMOVE_DEPENDENCE 1167 if(pcPic->getStoredPDMforV2() == 1){ 1168 pcPic->getPredDepthMapTemp()->setBorderExtension( false ); 1169 pcPic->getPredDepthMapTemp()->extendPicBorder (); 1170 }else{ 1171 #endif 846 1172 pcPic->getPredDepthMap()->setBorderExtension( false ); 847 1173 pcPic->getPredDepthMap()->extendPicBorder (); 1174 #if PDM_REMOVE_DEPENDENCE 1175 } 1176 #endif 848 1177 return bUndefined; 849 1178 } … … 855 1184 Bool bUndefined = false; 856 1185 TComPicYuv* pcDepthMap = pcPic->getPredDepthMap (); 1186 #if PDM_REMOVE_DEPENDENCE 1187 if(pcPic->getViewId()==0 && pcPic->getStoredPDMforV2()==1) 1188 pcDepthMap = pcPic->getPredDepthMapTemp (); 1189 #endif 857 1190 Int iWidth = pcDepthMap->getWidth (); 858 1191 Int iHeight = pcDepthMap->getHeight (); … … 888 1221 { 889 1222 bUndefined = true; 890 1223 break; 891 1224 } 892 1225 iX = iE - 1; … … 913 1246 914 1247 Void 915 TComDepthMapGenerator::xClearDepthMap( TComPic* pcPic, Int iVal ) 1248 TComDepthMapGenerator::xClearDepthMap( TComPic* pcPic, Int iVal 1249 #if PDM_REMOVE_DEPENDENCE 1250 , 1251 Int forFirstNonBaseView 1252 #endif 1253 ) 916 1254 { 917 1255 TComPicYuv* pcDepthMap = pcPic->getPredDepthMap (); … … 920 1258 Int iStride = pcDepthMap->getStride (); 921 1259 Pel* pDMSamples = pcDepthMap->getLumaAddr ( 0 ); 1260 #if PDM_REMOVE_DEPENDENCE 1261 if( forFirstNonBaseView == 1) 1262 { 1263 pcDepthMap = pcPic->getPredDepthMapTemp (); 1264 pDMSamples = pcDepthMap->getLumaAddr ( 0 ); 1265 } 1266 #endif 922 1267 for( Int iY = 0; iY < iHeight; iY++, pDMSamples += iStride ) 923 1268 { … … 989 1334 TComYuv* pcSubDM = m_ppcYuv[ uiDepth ]; 990 1335 TComPicYuv* pcPicDM = pcCU->getPic()->getPredDepthMap(); 1336 #if PDM_REMOVE_DEPENDENCE 1337 if( pcCU->getPic()->getStoredPDMforV2() == 1) 1338 pcPicDM = pcCU->getPic()->getPredDepthMapTemp(); 1339 #endif 991 1340 UInt uiCUAddr = pcCU->getAddr(); 992 1341 pcSubCU->copySubCU( pcCU, uiAbsPartIdx, uiDepth ); … … 1075 1424 UInt uiZOrderIdx = pcCU->getZorderIdxInCU() + uiAbsPartIdx; 1076 1425 Pel* pPicDepthMap = pcCU->getPic()->getPredDepthMap()->getLumaAddr( pcCU->getAddr(), uiZOrderIdx ); 1426 #if PDM_REMOVE_DEPENDENCE 1427 if(pcCU->getPic()->getStoredPDMforV2()==1) 1428 pPicDepthMap = pcCU->getPic()->getPredDepthMapTemp()->getLumaAddr( pcCU->getAddr(), uiZOrderIdx ); 1429 #endif 1077 1430 Int iPicStride = pcCU->getPic()->getPredDepthMap()->getStride (); 1078 1431 for( UInt uiY = 0; uiY < uiHeight; uiY++, pDepthMap += uiStride, pPicDepthMap += iPicStride ) … … 1511 1864 return true; 1512 1865 } 1866 #endif 1513 1867 1514 1868 #endif // DEPTH_MAP_GENERATION -
trunk/source/Lib/TLibCommon/TComDepthMapGenerator.h
r77 r100 136 136 137 137 Void initViewComponent ( TComPic* pcPic ); 138 #if !QC_MULTI_DIS_CAN 138 139 Bool predictDepthMap ( TComPic* pcPic ); 139 140 Void updateDepthMap ( TComPic* pcPic ); 140 141 Void dumpDepthMap ( TComPic* pcPic, char* pFilenameBase ); 142 #endif 141 143 142 144 #if HHI_INTER_VIEW_MOTION_PRED … … 149 151 Int getDisparity ( TComPic* pcPic, Int iPosX, Int iPosY, UInt uiRefViewId ); 150 152 #if HHI_INTER_VIEW_MOTION_PRED 153 #if QC_MULTI_DIS_CAN 154 Int getPdmMergeCandidate ( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo ); 155 Bool getPdmMvPredDisCan ( TComDataCU* pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge ); 156 Bool getDisCanPdmMvPred ( TComDataCU* pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge ); 157 #else 151 158 Int getPdmMergeCandidate ( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv ); 152 159 Bool getPdmMvPred ( TComDataCU* pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, Bool bMerge ); 160 #endif 153 161 Bool getIViewOrgDepthMvPred( TComDataCU* pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv ); 154 162 #endif … … 163 171 private: 164 172 // picture operations 173 #if !QC_MULTI_DIS_CAN 165 174 Bool xConvertDepthMapCurr2Ref ( TComPic* pcRef, TComPic* pcCur ); 166 175 Bool xConvertDepthMapRef2Curr ( TComPic* pcCur, TComPic* pcRef ); 167 176 Bool xPredictDepthMap ( TComPic* pcPic ); 168 177 Bool xFillDepthMapHoles ( TComPic* pcPic ); 169 Void xClearDepthMap ( TComPic* pcPic, Int iVal = PDM_UNDEFINED_DEPTH ); 178 Void xClearDepthMap ( TComPic* pcPic, Int iVal = PDM_UNDEFINED_DEPTH 179 #if PDM_REMOVE_DEPENDENCE 180 , 181 Int forFirstNonBaseView = 0 182 #endif 183 ); 170 184 Void xSetChroma ( TComPicYuv* pcPic, Int iVal ); 171 185 … … 182 196 Void xInterPUDepthMapPrediction( TComDataCU* pcCU, TComYuv* pcCUDepthMap, UInt uiPartIdx ); // PU inter prediction 183 197 Bool xGetPredDepth ( TComDataCU* pcCU, UInt uiPartIdx, Int& riPrdDepth, Int* piPosX = 0, Int* piPosY = 0 ); 184 198 #endif 185 199 // conversion functions 186 200 Int xGetVirtDepthFromDisparity( UInt uiBaseId, Int iDisparity ) -
trunk/source/Lib/TLibCommon/TComMotionInfo.h
r56 r100 59 59 60 60 // ==================================================================================================================== 61 #if QC_MULTI_DIS_CAN 62 typedef struct _DisCand 63 { 64 TComMv m_acMvCand[ DIS_CANS ]; ///< array of motion vector predictor candidates 65 Int m_aVIdxCan[ DIS_CANS ]; ///< array of motion vector predictor candidates 66 Int iN; ///< number of motion vector predictor candidates 67 } DisInfo; 68 #endif 61 69 // Class definition 62 70 // ==================================================================================================================== -
trunk/source/Lib/TLibCommon/TComMv.h
r56 r100 57 57 public: 58 58 59 #if LGE_DVMCP 60 Bool m_bDvMcp; // is dv-mcp ? 61 Int m_iDvMcpDispX; // disparity for dv-mcp 62 #endif 63 59 64 // ------------------------------------------------------------------------------------------------------------------ 60 65 // constructors … … 64 69 m_iHor(0), 65 70 m_iVer(0) 71 #if LGE_DVMCP 72 , m_bDvMcp(false) 73 , m_iDvMcpDispX(0) 74 #endif 66 75 { 67 76 } … … 70 79 m_iHor(iHor), 71 80 m_iVer(iVer) 81 #if LGE_DVMCP 82 , m_bDvMcp(false) 83 , m_iDvMcpDispX(0) 84 #endif 72 85 { 73 86 } -
trunk/source/Lib/TLibCommon/TComPattern.cpp
r56 r100 675 675 { 676 676 Int* piSrc; 677 #if LGE_EDGE_INTRA 678 mapEdgeIntratoDC( uiDirMode ); 679 #endif 677 680 assert(log2BlkSize >= 2 && log2BlkSize < 7); 678 681 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX -
trunk/source/Lib/TLibCommon/TComPic.cpp
r56 r100 55 55 #if DEPTH_MAP_GENERATION 56 56 m_pcPredDepthMap = NULL; 57 #if PDM_REMOVE_DEPENDENCE 58 m_pcPredDepthMap_temp = NULL; 59 #endif 57 60 #endif 58 61 #if HHI_INTER_VIEW_MOTION_PRED … … 136 139 m_pcPredDepthMap = NULL; 137 140 } 141 #if PDM_REMOVE_DEPENDENCE 142 if( m_pcPredDepthMap_temp ) // estimated depth map 143 { 144 m_pcPredDepthMap_temp->destroy(); 145 delete m_pcPredDepthMap_temp; 146 m_pcPredDepthMap_temp = NULL; 147 } 148 #endif 138 149 #endif 139 150 #if HHI_INTER_VIEW_MOTION_PRED … … 179 190 m_pcPredDepthMap = new TComPicYuv; 180 191 m_pcPredDepthMap ->create( iWidth >> uiSubSampExpX, iHeight >> uiSubSampExpY, uiMaxCuWidth >> uiSubSampExpX, uiMaxCuHeight >> uiSubSampExpY, uiMaxCuDepth ); 192 #if PDM_REMOVE_DEPENDENCE 193 m_pcPredDepthMap_temp = new TComPicYuv; 194 m_pcPredDepthMap_temp ->create( iWidth >> uiSubSampExpX, iHeight >> uiSubSampExpY, uiMaxCuWidth >> uiSubSampExpX, uiMaxCuHeight >> uiSubSampExpY, uiMaxCuDepth ); 195 #endif 181 196 } 182 197 #endif … … 224 239 m_pcPredDepthMap = NULL; 225 240 } 241 #if PDM_REMOVE_DEPENDENCE 242 if(m_pcPredDepthMap_temp) 243 { 244 m_pcPredDepthMap_temp->destroy(); 245 delete m_pcPredDepthMap_temp; 246 m_pcPredDepthMap_temp = NULL; 247 } 248 #endif 226 249 } 227 250 #endif -
trunk/source/Lib/TLibCommon/TComPic.h
r77 r100 67 67 #if DEPTH_MAP_GENERATION 68 68 TComPicYuv* m_pcPredDepthMap; // estimated depth map 69 #if PDM_REMOVE_DEPENDENCE 70 TComPicYuv* m_pcPredDepthMap_temp; // estimated depth map 71 Bool m_bPDMV2; 72 #endif 73 #endif 74 75 #if LG_ZEROINTRADEPTHRESI_M26039 76 Int m_uiIntraPeriod; 69 77 #endif 70 78 71 79 #if HHI_INTER_VIEW_MOTION_PRED 72 80 TComPicYuv* m_pcOrgDepthMap; // original depth map 81 #if QC_MULTI_DIS_CAN 82 Bool m_checked; 83 #endif 73 84 #endif 74 85 #if HHI_INTER_VIEW_RESIDUAL_PRED … … 123 134 TComVPS* getVPS() { return m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getVPS(); } 124 135 #endif 136 #if LG_ZEROINTRADEPTHRESI_M26039 137 Int getIntraPeriod() { return m_uiIntraPeriod; } 138 Void setIntraPeriod(Int uiIntraPeriod) { m_uiIntraPeriod = uiIntraPeriod; } 139 #endif 125 140 TComSPS* getSPS() { return m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getSPS(); } 126 141 Int getPOC() { return m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getPOC(); } 127 142 Int getViewId() { return m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getViewId(); } 128 TComDataCU*& getCU( UInt uiCUAddr ) 143 TComDataCU*& getCU( UInt uiCUAddr ){ return m_apcPicSym->getCU( uiCUAddr ); } 129 144 130 145 TComPicYuv* getPicYuvOrg() { return m_apcPicYuv[0]; } … … 136 151 #if DEPTH_MAP_GENERATION 137 152 TComPicYuv* getPredDepthMap() { return m_pcPredDepthMap; } 138 #endif 139 153 #if PDM_REMOVE_DEPENDENCE 154 TComPicYuv* getPredDepthMapTemp() { return m_pcPredDepthMap_temp; } 155 Void setStoredPDMforV2 (Bool flag) { m_bPDMV2 = flag;} 156 Bool getStoredPDMforV2 () { return m_bPDMV2;} 157 #endif 158 159 #endif 140 160 #if HHI_INTER_VIEW_MOTION_PRED 141 161 TComPicYuv* getOrgDepthMap() { return m_pcOrgDepthMap; } 162 #if QC_MULTI_DIS_CAN 163 Void setCandPicCheckedFlag (Bool bchecked) { m_checked = bchecked; } 164 Bool getCandPicCheckedFlag () { return m_checked;} 165 #endif 142 166 #endif 143 167 -
trunk/source/Lib/TLibCommon/TComPrediction.cpp
r56 r100 46 46 // ==================================================================================================================== 47 47 48 #if LGE_EDGE_INTRA 49 #define MAX_DISTANCE_EDGEINTRA 255 50 #endif 51 48 52 TComPrediction::TComPrediction() 49 53 : m_pLumaRecBuffer(0) … … 419 423 } 420 424 425 #if LGE_EDGE_INTRA 426 Void TComPrediction::predIntraLumaEdge ( TComDataCU* pcCU, TComPattern* pcTComPattern, UInt uiAbsPartIdx, Int iWidth, Int iHeight, Pel* piPred, UInt uiStride, Bool bDelta ) 427 { 428 Pel *piDst = piPred; 429 Int *piSrc; 430 Int iSrcStride = ( iWidth<<1 ) + 1; 431 Int iDstStride = uiStride; 432 433 piSrc = pcTComPattern->getPredictorPtr( 0, g_aucConvertToBit[ iWidth ] + 2, m_piYuvExt ); 434 435 xPredIntraEdge ( pcCU, uiAbsPartIdx, iWidth, iHeight, piSrc, iSrcStride, piDst, iDstStride 436 #if LGE_EDGE_INTRA_DELTA_DC 437 , bDelta 438 #endif 439 ); 440 } 441 442 Pel TComPrediction::xGetNearestNeighbor( Int x, Int y, Int* pSrc, Int srcStride, Int iWidth, Int iHeight, Bool* bpRegion ) 443 { 444 Bool bLeft = (x < y) ? true : false; 445 Bool bFound = false; 446 Int iFoundX = -1, iFoundY = -1; 447 Int cResult = 0; 448 449 UChar* piTopDistance = new UChar[iWidth]; 450 UChar* piLeftDistance = new UChar[iHeight]; 451 452 for( Int i = 0; i < iWidth; i++ ) 453 { 454 int Abs = x > i ? x - i : i - x; 455 piTopDistance[ i ] = y + Abs; 456 457 Abs = y > i ? y - i : i - y; 458 piLeftDistance[ i ] = x + Abs; 459 } 460 461 for( Int dist = 0; dist < MAX_DISTANCE_EDGEINTRA && !bFound; dist++ ) 462 { 463 if( !bLeft ) 464 { 465 for( Int i = 0; i < iWidth; i++ ) 466 { 467 if( piTopDistance[ i ] == dist ) 468 { 469 if( bpRegion[ i ] == bpRegion[ x + y * iWidth ] ) 470 { 471 iFoundX = i; 472 iFoundY = 0; 473 bFound = true; 474 } 475 } 476 } 477 for( Int i = 0; i < iHeight; i++ ) 478 { 479 if( piLeftDistance[ i ] == dist ) 480 { 481 if( bpRegion[ i * iWidth ] == bpRegion[ x + y * iWidth ] ) 482 { 483 iFoundX = 0; 484 iFoundY = i; 485 bFound = true; 486 } 487 } 488 } 489 } 490 else 491 { 492 for( Int i = 0; i < iHeight; i++ ) 493 { 494 if( piLeftDistance[ i ] == dist ) 495 { 496 if( bpRegion[ i * iWidth ] == bpRegion[ x + y * iWidth ] ) 497 { 498 iFoundX = 0; 499 iFoundY = i; 500 bFound = true; 501 } 502 } 503 } 504 for( Int i = 0; i < iWidth; i++ ) 505 { 506 if( piTopDistance[ i ] == dist ) 507 { 508 if( bpRegion[ i ] == bpRegion[ x + y * iWidth ] ) 509 { 510 iFoundX = i; 511 iFoundY = 0; 512 bFound = true; 513 } 514 } 515 } 516 } 517 } 518 519 if( iFoundY == 0 ) 520 { 521 cResult = pSrc[ iFoundX + 1 ]; 522 } 523 else // iFoundX == 0 524 { 525 cResult = pSrc[ (iFoundY + 1) * srcStride ]; 526 } 527 528 delete[] piTopDistance; piTopDistance = NULL; 529 delete[] piLeftDistance; piLeftDistance = NULL; 530 531 assert( bFound ); 532 533 return cResult; 534 } 535 536 Void TComPrediction::xPredIntraEdge( TComDataCU* pcCU, UInt uiAbsPartIdx, Int iWidth, Int iHeight, Int* pSrc, Int srcStride, Pel*& rpDst, Int dstStride, Bool bDelta ) 537 { 538 Pel* pDst = rpDst; 539 Bool* pbRegion = pcCU->getEdgePartition( uiAbsPartIdx ); 540 541 // Do prediction 542 { 543 //UInt uiSum0 = 0, uiSum1 = 0; 544 Int iSum0 = 0, iSum1 = 0; 545 //UInt uiMean0, uiMean1; 546 Int iMean0, iMean1; 547 //UInt uiCount0 = 0, uiCount1 = 0; 548 Int iCount0 = 0, iCount1 = 0; 549 for( UInt ui = 0; ui < iWidth; ui++ ) 550 { 551 if( pbRegion[ ui ] == false ) 552 { 553 iSum0 += (pSrc[ ui + 1 ]); 554 iCount0++; 555 } 556 else 557 { 558 iSum1 += (pSrc[ ui + 1 ]); 559 iCount1++; 560 } 561 } 562 for( UInt ui = 0; ui < iHeight; ui++ ) // (0,0) recount (to avoid division) 563 { 564 if( pbRegion[ ui * iWidth ] == false ) 565 { 566 iSum0 += (pSrc[ (ui + 1) * srcStride ]); 567 iCount0++; 568 } 569 else 570 { 571 iSum1 += (pSrc[ (ui + 1) * srcStride ]); 572 iCount1++; 573 } 574 } 575 if( iCount0 == 0 ) 576 assert(false); 577 if( iCount1 == 0 ) 578 assert(false); 579 iMean0 = iSum0 / iCount0; // TODO : integer op. 580 iMean1 = iSum1 / iCount1; 581 #if LGE_EDGE_INTRA_DELTA_DC 582 if( bDelta ) 583 { 584 Int iDeltaDC0 = pcCU->getEdgeDeltaDC0( uiAbsPartIdx ); 585 Int iDeltaDC1 = pcCU->getEdgeDeltaDC1( uiAbsPartIdx ); 586 xDeltaDCQuantScaleUp( pcCU, iDeltaDC0 ); 587 xDeltaDCQuantScaleUp( pcCU, iDeltaDC1 ); 588 iMean0 = Clip( iMean0 + iDeltaDC0 ); 589 iMean1 = Clip( iMean1 + iDeltaDC1 ); 590 } 591 #endif 592 for( UInt ui = 0; ui < iHeight; ui++ ) 593 { 594 for( UInt uii = 0; uii < iWidth; uii++ ) 595 { 596 if( pbRegion[ uii + ui * iWidth ] == false ) 597 pDst[ uii + ui * dstStride ] = iMean0; 598 else 599 pDst[ uii + ui * dstStride ] = iMean1; 600 } 601 } 602 } 603 } 604 #endif 605 421 606 #if DEPTH_MAP_GENERATION 422 607 Void TComPrediction::motionCompensation( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX, UInt uiSubSampExpY ) … … 569 754 { 570 755 UInt uiRShift = 0; 571 xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPredDepthMap(), uiPartAddr, &cMv, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY, rpcYuvPred, uiRShift, 0 ); 756 #if PDM_REMOVE_DEPENDENCE 757 if( pcCU->getPic()->getStoredPDMforV2() == 1 ) 758 xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPredDepthMapTemp(), uiPartAddr, &cMv, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY, rpcYuvPred, uiRShift, 0 ); 759 else 760 #endif 761 xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPredDepthMap(), uiPartAddr, &cMv, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY, rpcYuvPred, uiRShift, 0 ); 762 572 763 return; 573 764 } -
trunk/source/Lib/TLibCommon/TComPrediction.h
r56 r100 125 125 #endif 126 126 127 #if LGE_EDGE_INTRA 128 Pel xGetNearestNeighbor ( Int x, Int y, Int* pSrc, Int srcStride, Int iWidth, Int iHeight, Bool* bpRegion ); 129 Void xPredIntraEdge ( TComDataCU* pcCU, UInt uiAbsPartIdx, Int iWidth, Int iHeight, Int* pSrc, Int srcStride, Pel*& rpDst, Int dstStride, Bool bDelta = false ); 130 #endif 131 127 132 public: 128 133 TComPrediction(); … … 170 175 Bool getWedgePatternIdx ( WedgeRefList* pcWedgeRefList, UInt& ruiTabIdx, UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe ); 171 176 #endif 177 #if LGE_EDGE_INTRA 178 Void predIntraLumaEdge ( TComDataCU* pcCU, TComPattern* pcTComPattern, UInt uiAbsPartIdx, Int iWidth, Int iHeight, Pel* piPred, UInt uiStride, Bool bDelta = false ); 179 #endif 172 180 173 181 // simplified intra pred for "virtual" depth maps -
trunk/source/Lib/TLibCommon/TComRdCost.cpp
r81 r100 45 45 //! \{ 46 46 47 #if SAIT_VSO_EST_A0033 48 Double TComRdCost::m_dDisparityCoeff = 1.0; 49 #endif 50 47 51 TComRdCost::TComRdCost() 48 52 { … … 232 236 m_afpDistortFunc[28] = TComRdCost::xGetHADs; 233 237 238 #if SAIT_VSO_EST_A0033 239 m_afpDistortFunc[29] = TComRdCost::xGetVSD; 240 m_afpDistortFunc[30] = TComRdCost::xGetVSD4; 241 m_afpDistortFunc[31] = TComRdCost::xGetVSD8; 242 m_afpDistortFunc[32] = TComRdCost::xGetVSD16; 243 m_afpDistortFunc[33] = TComRdCost::xGetVSD32; 244 m_afpDistortFunc[34] = TComRdCost::xGetVSD64; 245 m_afpDistortFunc[35] = TComRdCost::xGetVSD16N; 246 #endif 247 234 248 #if !FIX203 235 249 m_puiComponentCostOriginP = NULL; … … 248 262 m_uiNumberRefPics = 0; 249 263 m_bUseVSO = false; 264 #if SAIT_VSO_EST_A0033 265 m_bUseEstimatedVSD = false; 266 #endif 250 267 m_uiVSOMode = 0; 251 268 m_fpDistortFuncVSO = NULL; … … 273 290 274 291 m_puiComponentCostOriginP = new UInt[ 4 * iSubPelSearchLimit ]; 275 #if HHI_FIX276 292 m_puiMultiviewRegCostHorOrgP = new UInt[ 4 * iSubPelSearchLimit ]; 277 293 m_puiMultiviewRegCostVerOrgP = new UInt[ 4 * iSubPelSearchLimit ]; 278 #endif 294 279 295 iSubPelSearchLimit *= 2; 280 296 281 297 m_puiComponentCost = m_puiComponentCostOriginP + iSubPelSearchLimit; 282 #if HHI_FIX 298 283 299 m_puiMultiviewRegCostHor = m_puiMultiviewRegCostHorOrgP + iSubPelSearchLimit; 284 300 m_puiMultiviewRegCostVer = m_puiMultiviewRegCostVerOrgP + iSubPelSearchLimit; 285 #endif 301 286 302 287 303 for( Int n = -iSubPelSearchLimit; n < iSubPelSearchLimit; n++) 288 304 { 289 305 m_puiComponentCost[n] = xGetComponentBits( n ); 290 #if HHI_FIX291 306 m_puiMultiviewRegCostHor[n] = xGetComponentBits( n ); // first version 292 307 m_puiMultiviewRegCostVer[n] = xGetComponentBits( n ); // first version 293 #endif294 308 } 295 309 } … … 303 317 m_puiComponentCostOriginP = NULL; 304 318 } 305 #if HHI_FIX 319 306 320 if( m_puiMultiviewRegCostHorOrgP ) 307 321 { … … 314 328 m_puiMultiviewRegCostVerOrgP = NULL; 315 329 } 316 #endif317 330 } 318 331 #endif … … 565 578 } 566 579 580 581 #if SAIT_VSO_EST_A0033 582 UInt TComRdCost::getDistPart( Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, Pel* piVirRec, Pel* piVirOrg, Int iVirStride, UInt uiBlkWidth, UInt uiBlkHeight, DFunc eDFunc ) 583 { 584 AOT( ( m_dDisparityCoeff <= 0 ) || ( m_dDisparityCoeff > 10 ) ); 585 586 DistParam cDtParam; 587 setDistParam( uiBlkWidth, uiBlkHeight, eDFunc, cDtParam ); 588 cDtParam.pOrg = piOrg; 589 cDtParam.pCur = piCur; 590 cDtParam.pVirRec = piVirRec; 591 cDtParam.pVirOrg = piVirOrg; 592 cDtParam.iStrideVir = iVirStride; 593 cDtParam.iStrideOrg = iOrgStride; 594 cDtParam.iStrideCur = iCurStride; 595 cDtParam.iStep = 1; 596 597 cDtParam.bApplyWeight = false; 598 cDtParam.uiComp = 255; // just for assert: to be sure it was set before use, since only values 0,1 or 2 are allowed. 599 600 return cDtParam.DistFunc( &cDtParam ); 601 } 602 #endif 567 603 568 604 … … 2026 2062 #endif 2027 2063 2064 2065 #if SAIT_VSO_EST_A0033 2066 UInt TComRdCost::getVSDEstimate( Int dDM, Pel* pOrg, Int iOrgStride, Pel* pVirRec, Pel* pVirOrg, Int iVirStride, Int x, Int y ) 2067 { 2068 Double dD; 2069 Int iTemp; 2070 2071 dD = ( (Double) ( dDM >> g_uiBitIncrement ) ) * m_dDisparityCoeff; 2072 2073 iTemp = (Int) ROUND( 0.5 * fabs(dD) * ( abs( (Int) pVirRec[ x+y*iVirStride ] - (Int) pVirRec[ x-1+y*iVirStride ] ) + abs( (Int) pVirRec[ x+y*iVirStride ] - (Int) pVirRec[ x+1+y*iVirStride ] ) ) ); 2074 2075 return (UInt) ( (iTemp*iTemp)>>1 ); 2076 } 2077 2078 UInt TComRdCost::xGetVSD( DistParam* pcDtParam ) 2079 { 2080 Pel* piOrg = pcDtParam->pOrg; 2081 Pel* piCur = pcDtParam->pCur; 2082 Pel* piVirRec = pcDtParam->pVirRec; 2083 Pel* piVirOrg = pcDtParam->pVirOrg; 2084 Int iRows = pcDtParam->iRows; 2085 Int iCols = pcDtParam->iCols; 2086 Int iStrideOrg = pcDtParam->iStrideOrg; 2087 Int iStrideCur = pcDtParam->iStrideCur; 2088 Int iStrideVir = pcDtParam->iStrideVir; 2089 2090 UInt uiSum = 0; 2091 UInt uiShift = g_uiBitIncrement<<1; 2092 2093 Int dDM; 2094 2095 for ( Int y = 0 ; y < iRows ; y++ ) 2096 { 2097 for (Int x = 0; x < iCols; x++ ) 2098 { 2099 dDM = (Int) ( piOrg[x ] - piCur[x ] ); 2100 uiSum += getVSDEstimate( dDM, piOrg, iStrideOrg, piVirRec, piVirOrg, iStrideVir, x, y ) >> uiShift; 2101 } 2102 piOrg += iStrideOrg; 2103 piCur += iStrideCur; 2104 } 2105 2106 return ( uiSum ); 2107 } 2108 2109 UInt TComRdCost::xGetVSD4( DistParam* pcDtParam ) 2110 { 2111 Pel* piOrg = pcDtParam->pOrg; 2112 Pel* piCur = pcDtParam->pCur; 2113 Pel* piVirRec = pcDtParam->pVirRec; 2114 Pel* piVirOrg = pcDtParam->pVirOrg; 2115 Int iRows = pcDtParam->iRows; 2116 Int iStrideOrg = pcDtParam->iStrideOrg; 2117 Int iStrideCur = pcDtParam->iStrideCur; 2118 Int iStrideVir = pcDtParam->iStrideVir; 2119 2120 UInt uiSum = 0; 2121 UInt uiShift = g_uiBitIncrement<<1; 2122 2123 Int dDM; 2124 2125 for ( Int y = 0 ; y < iRows ; y++ ) 2126 { 2127 dDM = (Int) ( piOrg[0] - piCur[0] ); uiSum += ( getVSDEstimate( dDM, piOrg, iStrideOrg, piVirRec, piVirOrg, iStrideVir, 0, y ) ) >> uiShift; 2128 dDM = (Int) ( piOrg[1] - piCur[1] ); uiSum += ( getVSDEstimate( dDM, piOrg, iStrideOrg, piVirRec, piVirOrg, iStrideVir, 1, y ) ) >> uiShift; 2129 dDM = (Int) ( piOrg[2] - piCur[2] ); uiSum += ( getVSDEstimate( dDM, piOrg, iStrideOrg, piVirRec, piVirOrg, iStrideVir, 2, y ) ) >> uiShift; 2130 dDM = (Int) ( piOrg[3] - piCur[3] ); uiSum += ( getVSDEstimate( dDM, piOrg, iStrideOrg, piVirRec, piVirOrg, iStrideVir, 3, y ) ) >> uiShift; 2131 2132 piOrg += iStrideOrg; 2133 piCur += iStrideCur; 2134 } 2135 2136 return ( uiSum ); 2137 } 2138 2139 UInt TComRdCost::xGetVSD8( DistParam* pcDtParam ) 2140 { 2141 Pel* piOrg = pcDtParam->pOrg; 2142 Pel* piCur = pcDtParam->pCur; 2143 Pel* piVirRec = pcDtParam->pVirRec; 2144 Pel* piVirOrg = pcDtParam->pVirOrg; 2145 Int iRows = pcDtParam->iRows; 2146 Int iStrideOrg = pcDtParam->iStrideOrg; 2147 Int iStrideCur = pcDtParam->iStrideCur; 2148 Int iStrideVir = pcDtParam->iStrideVir; 2149 2150 UInt uiSum = 0; 2151 UInt uiShift = g_uiBitIncrement<<1; 2152 2153 Int dDM; 2154 2155 for ( Int y = 0 ; y < iRows ; y++ ) 2156 { 2157 for (Int x = 0; x < 8; x++ ) 2158 { 2159 dDM = (Int) ( piOrg[x] - piCur[x] ); 2160 uiSum += getVSDEstimate( dDM, piOrg, iStrideOrg, piVirRec, piVirOrg, iStrideVir, x, y ) >> uiShift; 2161 } 2162 piOrg += iStrideOrg; 2163 piCur += iStrideCur; 2164 } 2165 2166 return ( uiSum ); 2167 } 2168 2169 UInt TComRdCost::xGetVSD16( DistParam* pcDtParam ) 2170 { 2171 Pel* piOrg = pcDtParam->pOrg; 2172 Pel* piCur = pcDtParam->pCur; 2173 Pel* piVirRec = pcDtParam->pVirRec; 2174 Pel* piVirOrg = pcDtParam->pVirOrg; 2175 Int iRows = pcDtParam->iRows; 2176 Int iStrideOrg = pcDtParam->iStrideOrg; 2177 Int iStrideCur = pcDtParam->iStrideCur; 2178 Int iStrideVir = pcDtParam->iStrideVir; 2179 2180 UInt uiSum = 0; 2181 UInt uiShift = g_uiBitIncrement<<1; 2182 2183 Int dDM; 2184 2185 for ( Int y = 0 ; y < iRows ; y++ ) 2186 { 2187 for (Int x = 0; x < 16; x++ ) 2188 { 2189 dDM = (Int) ( piOrg[x] - piCur[x] ); 2190 uiSum += getVSDEstimate( dDM, piOrg, iStrideOrg, piVirRec, piVirOrg, iStrideVir, x, y ) >> uiShift; 2191 } 2192 piOrg += iStrideOrg; 2193 piCur += iStrideCur; 2194 } 2195 2196 return ( uiSum ); 2197 } 2198 2199 UInt TComRdCost::xGetVSD16N( DistParam* pcDtParam ) 2200 { 2201 Pel* piOrg = pcDtParam->pOrg; 2202 Pel* piCur = pcDtParam->pCur; 2203 Pel* piVirRec = pcDtParam->pVirRec; 2204 Pel* piVirOrg = pcDtParam->pVirOrg; 2205 Int iRows = pcDtParam->iRows; 2206 Int iCols = pcDtParam->iCols; 2207 Int iStrideOrg = pcDtParam->iStrideOrg; 2208 Int iStrideCur = pcDtParam->iStrideCur; 2209 Int iStrideVir = pcDtParam->iStrideVir; 2210 2211 UInt uiSum = 0; 2212 UInt uiShift = g_uiBitIncrement<<1; 2213 2214 Int dDM; 2215 2216 for ( Int y = 0 ; y < iRows ; y++ ) 2217 { 2218 for (Int x = 0; x < iCols; x+=16 ) 2219 { 2220 for ( Int k = 0 ; k < 16 ; k++ ) 2221 { 2222 dDM = (Int) ( piOrg[x+k] - piCur[x+k] ); 2223 uiSum += getVSDEstimate( dDM, piOrg, iStrideOrg, piVirRec, piVirOrg, iStrideVir, x+k, y ) >> uiShift; 2224 } 2225 } 2226 piOrg += iStrideOrg; 2227 piCur += iStrideCur; 2228 } 2229 2230 return ( uiSum ); 2231 } 2232 2233 UInt TComRdCost::xGetVSD32( DistParam* pcDtParam ) 2234 { 2235 Pel* piOrg = pcDtParam->pOrg; 2236 Pel* piCur = pcDtParam->pCur; 2237 Pel* piVirRec = pcDtParam->pVirRec; 2238 Pel* piVirOrg = pcDtParam->pVirOrg; 2239 Int iRows = pcDtParam->iRows; 2240 Int iStrideOrg = pcDtParam->iStrideOrg; 2241 Int iStrideCur = pcDtParam->iStrideCur; 2242 Int iStrideVir = pcDtParam->iStrideVir; 2243 2244 UInt uiSum = 0; 2245 UInt uiShift = g_uiBitIncrement<<1; 2246 2247 Int dDM; 2248 2249 for ( Int y = 0 ; y < iRows ; y++ ) 2250 { 2251 for (Int x = 0; x < 32 ; x++ ) 2252 { 2253 dDM = (Int) ( piOrg[x] - piCur[x] ); 2254 uiSum += getVSDEstimate( dDM, piOrg, iStrideOrg, piVirRec, piVirOrg, iStrideVir, x, y ) >> uiShift; 2255 } 2256 piOrg += iStrideOrg; 2257 piCur += iStrideCur; 2258 } 2259 2260 return ( uiSum ); 2261 } 2262 2263 UInt TComRdCost::xGetVSD64( DistParam* pcDtParam ) 2264 { 2265 Pel* piOrg = pcDtParam->pOrg; 2266 Pel* piCur = pcDtParam->pCur; 2267 Pel* piVirRec = pcDtParam->pVirRec; 2268 Pel* piVirOrg = pcDtParam->pVirOrg; 2269 Int iRows = pcDtParam->iRows; 2270 Int iStrideOrg = pcDtParam->iStrideOrg; 2271 Int iStrideCur = pcDtParam->iStrideCur; 2272 Int iStrideVir = pcDtParam->iStrideVir; 2273 2274 UInt uiSum = 0; 2275 UInt uiShift = g_uiBitIncrement<<1; 2276 2277 Int dDM; 2278 2279 for ( Int y = 0 ; y < iRows ; y++ ) 2280 { 2281 for (Int x = 0; x < 64; x++ ) 2282 { 2283 dDM = (Int) ( piOrg[x] - piCur[x] ); 2284 uiSum += getVSDEstimate( dDM, piOrg, iStrideOrg, piVirRec, piVirOrg, iStrideVir, x, y ) >> uiShift; 2285 } 2286 piOrg += iStrideOrg; 2287 piCur += iStrideCur; 2288 } 2289 2290 return ( uiSum ); 2291 } 2292 2293 #endif 2294 2028 2295 // -------------------------------------------------------------------------------------------------------------------- 2029 2296 // HADAMARD with step (used in fractional search) … … 2668 2935 { 2669 2936 AOT(bSAD); 2937 #ifdef LGE_VSO_EARLY_SKIP_A0093 2938 RMDist iDist = m_pcRenModel->getDist( iStartPosX, iStartPosY, (Int) uiBlkWidth, (Int) uiBlkHeight, iCurStride, piCur, piOrg, iOrgStride); 2939 #else 2670 2940 RMDist iDist = m_pcRenModel->getDist( iStartPosX, iStartPosY, (Int) uiBlkWidth, (Int) uiBlkHeight, iCurStride, piCur ); 2941 #endif 2671 2942 2672 2943 RMDist iDistMin = (RMDist) RDO_DIST_MIN; -
trunk/source/Lib/TLibCommon/TComRdCost.h
r81 r100 80 80 Int iStrideOrg; 81 81 Int iStrideCur; 82 #if SAIT_VSO_EST_A0033 83 Pel* pVirRec; 84 Pel* pVirOrg; 85 Int iStrideVir; 86 #endif 82 87 Int iRows; 83 88 Int iCols; … … 105 110 pOrg = NULL; 106 111 pCur = NULL; 112 #if SAIT_VSO_EST_A0033 113 pVirRec = NULL; 114 pVirOrg = NULL;; 115 iStrideVir = 0; 116 #endif 107 117 iStrideOrg = 0; 108 118 iStrideCur = 0; … … 145 155 UInt m_uiLambdaMotionSSE; 146 156 Double m_dFrameLambda; 157 #if SAIT_VSO_EST_A0033 158 static Double m_dDisparityCoeff; 159 #endif 147 160 148 161 #if HHI_INTERVIEW_SKIP_LAMBDA_SCALE … … 192 205 Void setFrameLambda ( Double dLambda ) { m_dFrameLambda = dLambda; } 193 206 207 #if SAIT_VSO_EST_A0033 208 Void setDisparityCoeff( Double dDisparityCoeff ) { m_dDisparityCoeff = dDisparityCoeff; } 209 Double getDisparityCoeff() { return m_dDisparityCoeff; } 210 #endif 211 194 212 #if HHI_INTERVIEW_SKIP_LAMBDA_SCALE 195 213 Void setLambdaScale ( Double dLambdaScale) { m_dLambdaScale = dLambdaScale; } … … 222 240 { 223 241 m_uiCost = (bSad ? m_uiLambdaMotionSAD + iAdd : m_uiLambdaMotionSSE + iAdd); 224 #if HHI_FIX225 242 m_uiLambdaMVReg = ( bSad ? m_uiLambdaMVRegSAD : m_uiLambdaMVRegSSE ); 226 #endif 243 227 244 } 228 245 Void setPredictor( TComMv& rcMv ) … … 301 318 static UInt xGetSAD16N ( DistParam* pcDtParam ); 302 319 320 #if SAIT_VSO_EST_A0033 321 static UInt xGetVSD ( DistParam* pcDtParam ); 322 static UInt xGetVSD4 ( DistParam* pcDtParam ); 323 static UInt xGetVSD8 ( DistParam* pcDtParam ); 324 static UInt xGetVSD16 ( DistParam* pcDtParam ); 325 static UInt xGetVSD32 ( DistParam* pcDtParam ); 326 static UInt xGetVSD64 ( DistParam* pcDtParam ); 327 static UInt xGetVSD16N ( DistParam* pcDtParam ); 328 #endif 329 303 330 #if AMP_SAD 304 331 static UInt xGetSAD12 ( DistParam* pcDtParam ); … … 329 356 #endif 330 357 358 #if SAIT_VSO_EST_A0033 359 UInt getDistPart( Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, Pel* piVirRec, Pel* piVirOrg, Int iVirStride, UInt uiBlkWidth, UInt uiBlkHeight, DFunc eDFunc = DF_VSD ); 360 static UInt getVSDEstimate( Int dDM, Pel* pOrg, Int iOrgStride, Pel* pVirRec, Pel* pVirOrg, Int iVirStride, Int x, Int y ); 361 #endif 362 331 363 #if HHI_VSO 332 364 private: … … 340 372 Bool m_bAllowNegDist; 341 373 #endif 374 #if SAIT_VSO_EST_A0033 375 TComPicYuv * m_pcVideoRecPicYuv; 376 TComPicYuv * m_pcDepthPicYuv; 377 Bool m_bUseEstimatedVSD; 378 #endif 342 379 343 380 Bool m_bUseVSO; … … 357 394 Void setUseVSO ( Bool bIn ) { m_bUseVSO = bIn; }; 358 395 Bool getUseVSO ( ) { return m_bUseVSO;}; 396 #if SAIT_VSO_EST_A0033 397 Bool getUseEstimatedVSD( ) { return m_bUseEstimatedVSD; }; 398 Void setUseEstimatedVSD( Bool bIn ) { m_bUseEstimatedVSD = bIn; }; 399 400 TComPicYuv* getVideoRecPicYuv () { return m_pcVideoRecPicYuv; }; 401 Void setVideoRecPicYuv ( TComPicYuv* pcVideoRecPicYuv ) { m_pcVideoRecPicYuv = pcVideoRecPicYuv; }; 402 TComPicYuv* getDepthPicYuv () { return m_pcDepthPicYuv; }; 403 Void setDepthPicYuv ( TComPicYuv* pcDepthPicYuv ) { m_pcDepthPicYuv = pcDepthPicYuv; }; 404 #endif 359 405 360 406 Bool getUseRenModel ( ) { return (m_bUseVSO && m_uiVSOMode == 4); }; -
trunk/source/Lib/TLibCommon/TComResidualGenerator.cpp
r77 r100 219 219 } 220 220 221 221 #if QC_MULTI_DIS_CAN 222 Bool 223 TComResidualGenerator::getResidualSamples( TComDataCU* pcCU, UInt uiPUIdx, TComYuv* pcYuv, Int iDisp 224 #if QC_SIMPLIFIEDIVRP_M24938 225 , Bool bRecon 226 #endif 227 ) 228 #else 222 229 Bool 223 230 TComResidualGenerator::getResidualSamples( TComDataCU* pcCU, UInt uiPUIdx, TComYuv* pcYuv … … 226 233 #endif 227 234 ) 235 #endif 228 236 { 229 237 AOF( pcCU ); … … 235 243 iBlkHeight = pcCU->getHeight ( 0 ); 236 244 pcCU->getPic()->getPicYuvRec()->getTopLeftSamplePos( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr, iXPos, iYPos ); 245 #if QC_MULTI_DIS_CAN 246 return getResidualSamples( pcCU->getPic(), (UInt)iXPos, (UInt)iYPos, (UInt)iBlkWidth, (UInt)iBlkHeight, pcYuv, iDisp 247 #if QC_SIMPLIFIEDIVRP_M24938 248 , bRecon 249 #endif 250 ); 251 #else 237 252 return getResidualSamples( pcCU->getPic(), (UInt)iXPos, (UInt)iYPos, (UInt)iBlkWidth, (UInt)iBlkHeight, pcYuv 238 253 #if QC_SIMPLIFIEDIVRP_M24938 … … 240 255 #endif 241 256 ); 257 #endif 242 258 } 243 259 260 #if QC_MULTI_DIS_CAN 261 Bool 262 TComResidualGenerator::getResidualSamples( TComPic* pcPic, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv, Int iDisp 263 #if QC_SIMPLIFIEDIVRP_M24938 264 , Bool bRecon 265 #endif 266 ) 267 #else 244 268 Bool 245 269 TComResidualGenerator::getResidualSamples( TComPic* pcPic, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv … … 248 272 #endif 249 273 ) 274 #endif 250 275 { 251 276 UInt uiBaseViewId = m_pcDepthMapGenerator->getBaseViewId( 0 ); … … 258 283 UInt uiXPosInRefView = uiXPos , uiYPosInRefView = uiYPos; 259 284 #endif 285 #if QC_MULTI_DIS_CAN 286 xSetPredResidualBlock( pcPic, uiBaseViewId, uiXPos, uiYPos, uiBlkWidth, uiBlkHeight, pcYuv, iDisp 287 #if QC_SIMPLIFIEDIVRP_M24938 288 , &uiXPosInRefView , &uiYPosInRefView , bRecon 289 #endif 290 ); 291 #else 260 292 xSetPredResidualBlock( pcPic, uiBaseViewId, uiXPos, uiYPos, uiBlkWidth, uiBlkHeight, pcYuv 261 293 #if QC_SIMPLIFIEDIVRP_M24938 … … 263 295 #endif 264 296 ); 265 297 #endif 266 298 #if QC_SIMPLIFIEDIVRP_M24938 267 299 return xIsNonZeroByCBF( uiBaseViewId , uiXPosInRefView , uiYPosInRefView , uiBlkWidth , uiBlkHeight ); … … 423 455 AOF( bOK ); 424 456 #if LG_RESTRICTEDRESPRED_M24766 425 426 457 pcCU->getPUResiPredShift(iPUPredResiShift, 0); 458 pcCUResidual->add(iPUPredResiShift, pcCU->getPartitionSize(0), m_ppcYuvTmp[0], pcCU->getWidth( 0 ), pcCU->getHeight( 0 ) ); 427 459 #else 428 460 pcCUResidual->add( m_ppcYuvTmp[0], pcCU->getWidth( 0 ), pcCU->getHeight( 0 ) ); … … 485 517 486 518 487 519 #if QC_MULTI_DIS_CAN 520 Void 521 TComResidualGenerator::xSetPredResidualBlock( TComPic* pcPic, UInt uiBaseViewId, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv, Int iDisp 522 #if QC_SIMPLIFIEDIVRP_M24938 523 , UInt * puiXPosInRefView , UInt * puiYPosInRefView , Bool bRecon 524 #endif 525 ) 526 #else 488 527 Void 489 528 TComResidualGenerator::xSetPredResidualBlock( TComPic* pcPic, UInt uiBaseViewId, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv … … 492 531 #endif 493 532 ) 533 #endif 494 534 { 495 535 //===== set and check some basic variables ===== … … 508 548 509 549 //===== get disparity ===== 550 #if QC_MULTI_DIS_CAN 551 Int iDisparity = iDisp; 552 #else 510 553 Int iMidPosX = Int( uiXPos + ( ( uiBlkWidth - 1 ) >> 1 ) ) >> m_pcDepthMapGenerator->getSubSampExpX(); 511 554 Int iMidPosY = Int( uiYPos + ( ( uiBlkHeight - 1 ) >> 1 ) ) >> m_pcDepthMapGenerator->getSubSampExpY(); 512 555 Int iDisparity = m_pcDepthMapGenerator->getDisparity( pcPic, iMidPosX, iMidPosY, uiBaseViewId ); 513 556 #endif 514 557 //===== compensate luma ===== 515 558 Int iYWidth = Int( uiBlkWidth ); -
trunk/source/Lib/TLibCommon/TComResidualGenerator.h
r77 r100 69 69 Void setRecResidualPic ( TComPic* pcPic ); 70 70 71 #if QC_MULTI_DIS_CAN 72 Bool getResidualSamples ( TComDataCU* pcCU, UInt uiPUIdx, TComYuv* pcYuv, Int iDisp 73 #if QC_SIMPLIFIEDIVRP_M24938 74 , Bool bRecon 75 #endif 76 ); 77 Bool getResidualSamples ( TComPic* pcPic, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv , Int iDisp 78 #if QC_SIMPLIFIEDIVRP_M24938 79 , Bool bRecon 80 #endif 81 ); 82 #else 71 83 Bool getResidualSamples ( TComDataCU* pcCU, UInt uiPUIdx, TComYuv* pcYuv 72 84 #if QC_SIMPLIFIEDIVRP_M24938 … … 79 91 #endif 80 92 ); 93 #endif 81 94 82 95 private: … … 87 100 Void xClearIntViewResidual ( TComDataCU* pcCU, TComYuv* pcCUResidual, UInt uiPartIdx ); 88 101 Void xClearResidual ( TComYuv* pcCUResidual, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight ); 89 102 #if QC_MULTI_DIS_CAN 103 Void xSetPredResidualBlock ( TComPic* pcPic, UInt uiBaseViewId, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv, Int iDisp 104 #if QC_SIMPLIFIEDIVRP_M24938 105 , UInt * puiXPosInRefView , UInt * puiYPosInRefView , Bool bRecon 106 #endif 107 ); 108 #else 90 109 Void xSetPredResidualBlock ( TComPic* pcPic, UInt uiBaseViewId, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv 91 110 #if QC_SIMPLIFIEDIVRP_M24938 … … 93 112 #endif 94 113 ); 114 #endif 95 115 Bool xIsNonZero ( TComYuv* pcYuv, UInt uiBlkWidth, UInt uiBlkHeight ); 96 116 #if QC_SIMPLIFIEDIVRP_M24938 -
trunk/source/Lib/TLibCommon/TComRom.h
r56 r100 206 206 #endif 207 207 208 #if LGE_EDGE_INTRA 209 __inline Void mapEdgeIntratoDC( UChar& curDir ) { curDir = (curDir >= EDGE_INTRA_IDX) ? DC_IDX : curDir; } 210 __inline Void mapEdgeIntratoDC( UInt& curDir ) { curDir = (curDir >= EDGE_INTRA_IDX) ? DC_IDX : curDir; } 211 __inline Void mapEdgeIntratoDC( Int& curDir ) { curDir = (curDir >= EDGE_INTRA_IDX) ? DC_IDX : curDir; } 212 #endif 213 208 214 // ========================================== 209 215 // Mode-Dependent DST Matrices -
trunk/source/Lib/TLibCommon/TComSlice.cpp
r77 r100 1335 1335 TComVPS::~TComVPS() 1336 1336 { 1337 1338 1337 1338 1339 1339 } 1340 1340 -
trunk/source/Lib/TLibCommon/TComSlice.h
r77 r100 151 151 private: 152 152 Int m_VPSId; 153 UIntm_uiMaxTLayers;154 UIntm_uiMaxLayers;155 Boolm_bTemporalIdNestingFlag;156 157 153 UInt m_uiMaxTLayers; 154 UInt m_uiMaxLayers; 155 Bool m_bTemporalIdNestingFlag; 156 157 UInt m_uiExtensionType; 158 158 159 159 Bool m_bDependentFlag[MAX_LAYER_NUM]; … … 170 170 TComVPS(); 171 171 virtual ~TComVPS(); 172 172 173 173 Int getVPSId () { return m_VPSId; } 174 174 Void setVPSId (Int i) { m_VPSId = i; } 175 175 176 176 UInt getMaxTLayers () { return m_uiMaxTLayers; } 177 177 Void setMaxTLayers (UInt t) { m_uiMaxTLayers = t; } 178 178 179 179 UInt getMaxLayers () { return m_uiMaxLayers; } 180 181 180 Void setMaxLayers (UInt l) { m_uiMaxLayers = l; } 181 182 182 Bool getTemporalNestingFlag () { return m_uiMaxLayers; } 183 183 Void setTemporalNestingFlag (UInt t) { m_bTemporalIdNestingFlag = t; } 184 184 185 185 Void setExtensionType(UInt v) { m_uiExtensionType = v; } … … 219 219 private: 220 220 #if VIDYO_VPS_INTEGRATION 221 Intm_VPSId;221 Int m_VPSId; 222 222 #endif 223 223 Int m_SPSId; … … 379 379 virtual ~TComSPS(); 380 380 #if VIDYO_VPS_INTEGRATION 381 381 Int getVPSId () { return m_VPSId; } 382 382 Void setVPSId (Int i) { m_VPSId = i; } 383 383 #endif -
trunk/source/Lib/TLibCommon/TComYuv.cpp
r77 r100 396 396 TComYuv::add(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract ) 397 397 { 398 399 398 addLuma (iPUResiPredShift, uhPartitionSize, pcYuvAdd, iWidth, iHeight, bSubtract ); 399 addChroma (iPUResiPredShift, uhPartitionSize, pcYuvAdd, iWidth>>1, iHeight>>1, bSubtract ); 400 400 } 401 401 #else … … 412 412 TComYuv::getPUXYOffset(PartSize uhPartitionSize, Int iWidth, Int iHeight, Int &iXOffset, Int &iYOffset) 413 413 { 414 415 {416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 iXOffset = iWidth; iYOffset = iHeight;break;433 414 switch(uhPartitionSize) 415 { 416 case SIZE_2NxN: 417 iXOffset = iWidth; iYOffset = iHeight >> 1; break; 418 case SIZE_2NxnU: 419 iXOffset = iWidth; iYOffset = iHeight >> 2; break; 420 case SIZE_2NxnD: 421 iXOffset = iWidth; iYOffset = (iHeight >> 1) + (iHeight >> 2); break; 422 case SIZE_Nx2N: 423 iXOffset = iWidth >> 1; iYOffset = iHeight; break; 424 case SIZE_nLx2N: 425 iXOffset = iWidth >> 2; iYOffset = iHeight; break; 426 case SIZE_nRx2N: 427 iXOffset = (iWidth >> 1) + (iWidth >> 2); iYOffset = iHeight; break; 428 case SIZE_NxN: 429 iXOffset = iWidth >> 1; iYOffset = iHeight >> 1; break; 430 default: 431 assert(uhPartitionSize == SIZE_2Nx2N); 432 iXOffset = iWidth; iYOffset = iHeight; break; 433 } 434 434 } 435 435 #endif … … 456 456 for( Int iY = 0; iY < iYOffset; iY++, pDstSamples += iDstStride, pAddSamples += iAddStride ) 457 457 { 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 458 if(iPUResiPredShift[0] >= 0) 459 { 460 for( Int iX = 0; iX < iXOffset; iX++ ) 461 { 462 pDstSamples[iX] += iScale * (pAddSamples[iX] >> iPUResiPredShift[0]); 463 } 464 } 465 466 if(iPUResiPredShift[1] >= 0) 467 { 468 for( Int iX = iXOffset; iX < iWidth; iX++ ) 469 { 470 pDstSamples[iX] += iScale * (pAddSamples[iX] >> iPUResiPredShift[1]); 471 } 472 } 473 473 } 474 474 475 475 for( Int iY = iYOffset; iY < iHeight; iY++, pDstSamples += iDstStride, pAddSamples += iAddStride ) 476 476 { 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 477 if(iPUResiPredShift[2] >= 0) 478 { 479 for( Int iX = 0; iX < iXOffset; iX++ ) 480 { 481 pDstSamples[iX] += iScale * (pAddSamples[iX] >> iPUResiPredShift[2]); 482 } 483 } 484 485 if(iPUResiPredShift[3] >= 0) 486 { 487 for( Int iX = iXOffset; iX < iWidth; iX++ ) 488 { 489 pDstSamples[iX] += iScale * (pAddSamples[iX] >> iPUResiPredShift[3]); 490 } 491 } 492 492 } 493 493 #else … … 524 524 525 525 for( Int iY = 0; iY < iYOffset; iY++, pDstSamplesCb += iDstStride, pAddSamplesCb += iAddStride, 526 527 { 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 526 pDstSamplesCr += iDstStride, pAddSamplesCr += iAddStride ) 527 { 528 if(iPUResiPredShift[0] >= 0) 529 { 530 for( Int iX = 0; iX < iXOffset; iX++ ) 531 { 532 pDstSamplesCb[iX] += iScale * (pAddSamplesCb[iX] >> iPUResiPredShift[0]); 533 pDstSamplesCr[iX] += iScale * (pAddSamplesCr[iX] >> iPUResiPredShift[0]); 534 } 535 } 536 537 if(iPUResiPredShift[1] >= 0) 538 { 539 for( Int iX = iXOffset; iX < iWidth; iX++ ) 540 { 541 pDstSamplesCb[iX] += iScale * (pAddSamplesCb[iX] >> iPUResiPredShift[1]); 542 pDstSamplesCr[iX] += iScale * (pAddSamplesCr[iX] >> iPUResiPredShift[1]); 543 } 544 } 545 545 } 546 546 547 547 for( Int iY = iYOffset; iY < iHeight; iY++, pDstSamplesCb += iDstStride, pAddSamplesCb += iAddStride, 548 549 { 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 548 pDstSamplesCr += iDstStride, pAddSamplesCr += iAddStride ) 549 { 550 if(iPUResiPredShift[2] >= 0) 551 { 552 for( Int iX = 0; iX < iXOffset; iX++ ) 553 { 554 pDstSamplesCb[iX] += iScale * (pAddSamplesCb[iX] >> iPUResiPredShift[2]); 555 pDstSamplesCr[iX] += iScale * (pAddSamplesCr[iX] >> iPUResiPredShift[2]); 556 } 557 } 558 559 if(iPUResiPredShift[3] >= 0) 560 { 561 for( Int iX = iXOffset; iX < iWidth; iX++ ) 562 { 563 pDstSamplesCb[iX] += iScale * (pAddSamplesCb[iX] >> iPUResiPredShift[3]); 564 pDstSamplesCr[iX] += iScale * (pAddSamplesCr[iX] >> iPUResiPredShift[3]); 565 } 566 } 567 567 } 568 568 #else … … 679 679 Void TComYuv::subtract(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ) 680 680 { 681 682 681 subtractLuma (iPUResiPredShift, uhPartitionSize, pcYuvSrc0, pcYuvSrc1, uiTrUnitIdx, uiPartSize ); 682 subtractChroma(iPUResiPredShift, uhPartitionSize, pcYuvSrc0, pcYuvSrc1, uiTrUnitIdx, uiPartSize>>1 ); 683 683 } 684 684 #else … … 713 713 for ( y = uiPartSize-1; y >= iYOffset; y-- ) 714 714 { 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 715 if(iPUResiPredShift[3] >= 0) 716 { 717 for ( x = uiPartSize-1; x >= iXOffset; x-- ) 718 { 719 pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[3]); 720 } 721 } 722 723 if(iPUResiPredShift[2] >= 0) 724 { 725 for ( x = iXOffset-1; x >= 0; x-- ) 726 { 727 pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[2]); 728 } 729 } 730 pSrc0 += iSrc0Stride; 731 pSrc1 += iSrc1Stride; 732 pDst += iDstStride; 733 733 } 734 734 735 735 for ( y = iYOffset-1; y >= 0; y-- ) 736 736 { 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 737 if(iPUResiPredShift[1] >= 0) 738 { 739 for ( x = uiPartSize-1; x >= iXOffset; x-- ) 740 { 741 pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[3]); 742 } 743 } 744 745 if(iPUResiPredShift[0] >= 0) 746 { 747 for ( x = iXOffset-1; x >= 0; x-- ) 748 { 749 pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[2]); 750 } 751 } 752 pSrc0 += iSrc0Stride; 753 pSrc1 += iSrc1Stride; 754 pDst += iDstStride; 755 755 } 756 756 … … 794 794 for ( y = uiPartSize-1; y >= iYOffset; y-- ) 795 795 { 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 796 if(iPUResiPredShift[3] >= 0) 797 { 798 for ( x = uiPartSize-1; x >= iXOffset; x-- ) 799 { 800 pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[3]); 801 pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[3]); 802 } 803 } 804 805 if(iPUResiPredShift[2] >= 0) 806 { 807 for ( x = iXOffset-1; x >= 0; x-- ) 808 { 809 pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[2]); 810 pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[2]); 811 } 812 } 813 pSrcU0 += iSrc0Stride; 814 pSrcU1 += iSrc1Stride; 815 pSrcV0 += iSrc0Stride; 816 pSrcV1 += iSrc1Stride; 817 pDstU += iDstStride; 818 pDstV += iDstStride; 819 819 } 820 820 821 821 for ( y = iYOffset-1; y >= 0; y-- ) 822 822 { 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 823 if(iPUResiPredShift[1] >= 0) 824 { 825 for ( x = uiPartSize-1; x >= iXOffset; x-- ) 826 { 827 pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[1]); 828 pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[1]); 829 } 830 } 831 832 if(iPUResiPredShift[0] >= 0) 833 { 834 for ( x = iXOffset-1; x >= 0; x-- ) 835 { 836 pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[0]); 837 pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[0]); 838 } 839 } 840 pSrcU0 += iSrc0Stride; 841 pSrcU1 += iSrc1Stride; 842 pSrcV0 += iSrc0Stride; 843 pSrcV1 += iSrc1Stride; 844 pDstU += iDstStride; 845 pDstV += iDstStride; 846 846 } 847 847 #else -
trunk/source/Lib/TLibCommon/TComYuv.h
r77 r100 167 167 Void removeHighFreq ( TComYuv* pcYuvSrc, UInt uiPartIdx, UInt uiWidht, UInt uiHeight ); 168 168 #if LG_RESTRICTEDRESPRED_M24766 169 voidgetPUXYOffset (PartSize uhPartitionSize, Int iWidth, Int iHeight, Int &iXOffset, Int &iYOffset);169 Void getPUXYOffset (PartSize uhPartitionSize, Int iWidth, Int iHeight, Int &iXOffset, Int &iYOffset); 170 170 Void add (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract = false ); 171 171 Void addLuma (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract ); -
trunk/source/Lib/TLibCommon/TypeDef.h
r77 r100 42 42 //! \{ 43 43 44 #define FIXES 1 45 #define LGE_EDGE_INTRA 1 //JCT2-A0070 46 #if LGE_EDGE_INTRA 47 #define LGE_EDGE_INTRA_MIN_SIZE 4 48 #define LGE_EDGE_INTRA_MAX_SIZE 32 49 #define LGE_EDGE_INTRA_THRESHOLD 20 50 #define LGE_EDGE_INTRA_MAX_EDGE_NUM_PER_4x4 8 51 #define LGE_EDGE_INTRA_DELTA_DC 1 52 #define LGE_EDGE_INTRA_PIXEL_DIFFERENCE 1 53 #endif 54 55 #define LG_ZEROINTRADEPTHRESI_M26039 1 //JCT2-A0087 56 44 57 #define SONY_COLPIC_AVAILABILITY 1 45 58 46 59 #define HHI_INTER_VIEW_MOTION_PRED 1 // inter-view motion parameter prediction 47 60 #define HHI_INTER_VIEW_RESIDUAL_PRED 1 // inter-view residual prediction 48 #define HHI_FIX 1 // inter-view prediction and other fixes 61 #define QC_MULTI_DIS_CAN 1 // JCT2-A0097 62 #if QC_MULTI_DIS_CAN 63 #define DIS_CANS 1 64 #endif 65 66 #define MTK_INTERVIEW_MERGE_A0049 1 // JCT2-A0049 second part 67 68 #define LGE_DVMCP 1 // JCT2-A0126 69 #if LGE_DVMCP 70 #define DVFROM_LEFTBELOW 1 71 #define DVFROM_LEFT 2 72 #define DVFROM_ABOVERIGHT 3 73 #define DVFROM_ABOVE 4 74 #define DVFROM_ABOVELEFT 5 75 #define DVFROM_COL 6 76 #endif 77 49 78 50 79 #define HHI_VSO 1 51 #define HHI_VSO_LS_TABLE 1 80 #define HHI_VSO_LS_TABLE 1 // m23714 52 81 #define HHI_VSO_DIST_INT 1 53 82 #define HHI_VSO_SYNTH_DIST_OUT 0 54 83 #define HHI_VSO_COLOR_PLANES 1 84 #define HHI_VSO_SPEEDUP_A033 1 // JCT2-A0033 modification 1 (changes classes directly related the renderer model 85 // to are not covered by this define, since nearly the entire class has been changed) 86 #define HHI_VSO_RM_ASSERTIONS 0 // output VSO assertions 87 #define HHI_VSO_SET_OPTIM 1 // remove unnecessary updates (works only with HHI_VSO_FIX 1 properly) 88 #define SAIT_VSO_EST_A0033 1 // JCT2-A0033 modification 3 89 #define LGE_VSO_EARLY_SKIP_A0093 1 // JCT2-A0093 modification 4 90 55 91 56 92 #define HHI_INTERVIEW_SKIP 1 57 93 #define HHI_INTERVIEW_SKIP_LAMBDA_SCALE 1 58 94 59 #define HHI_DMM_WEDGE_INTRA 1 // depth model modes independent on texture (explicit and intra-predicted Wedgelet prediction)60 #define HHI_DMM_PRED_TEX 1 // depth model modes dependent on texture (inter-component Wedgelet and Contour prediction )95 #define HHI_DMM_WEDGE_INTRA 1 // depth model modes independent on texture (explicit and intra-predicted Wedgelet prediction) 96 #define HHI_DMM_PRED_TEX 1 // depth model modes dependent on texture (inter-component Wedgelet and Contour prediction ) 61 97 62 98 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX … … 224 260 #define LOG2_SCAN_SET_SIZE 4 225 261 262 #if LGE_EDGE_INTRA 263 #if LGE_EDGE_INTRA_DELTA_DC 264 #define FAST_UDI_MAX_RDMODE_NUM 37 ///< maximum number of RD comparison in fast-UDI estimation loop 265 #else 266 #define FAST_UDI_MAX_RDMODE_NUM 36 ///< maximum number of RD comparison in fast-UDI estimation loop 267 #endif 268 #else 226 269 #define FAST_UDI_MAX_RDMODE_NUM 35 ///< maximum number of RD comparison in fast-UDI estimation loop 270 #endif 227 271 228 272 #define ZERO_MVD_EST 0 ///< Zero Mvd Estimation in normal mode … … 263 307 #define NUM_DMM_MODE 4 264 308 #endif 309 310 #if LGE_EDGE_INTRA 311 #if HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX 312 #define EDGE_INTRA_IDX (NUM_INTRA_MODE+NUM_DMM_MODE) 313 #endif // HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX 314 #if LGE_EDGE_INTRA_DELTA_DC 315 #define EDGE_INTRA_DELTA_IDX (EDGE_INTRA_IDX+1) 316 #endif 317 #endif // LGE_EDGE_INTRA 265 318 266 319 #define IBDI_DISTORTION 0 ///< enable/disable SSE modification when IBDI is used (JCTVC-D152) … … 647 700 }; 648 701 702 #if HHI_VSO_SPEEDUP_A033 703 704 enum BlenMod 705 { 706 BLEND_NONE = -1, 707 BLEND_AVRG = 0, 708 BLEND_LEFT = 1, 709 BLEND_RIGHT = 2, 710 BLEND_GEN = 3 711 }; 712 #endif 713 649 714 /// supported prediction type 650 715 enum PredMode … … 712 777 DF_HADS16N = 28, ///< 16NxM HAD with step 713 778 779 #if SAIT_VSO_EST_A0033 780 DF_VSD = 29, ///< general size VSD 781 DF_VSD4 = 30, ///< 4xM VSD 782 DF_VSD8 = 31, ///< 8xM VSD 783 DF_VSD16 = 32, ///< 16xM VSD 784 DF_VSD32 = 33, ///< 32xM VSD 785 DF_VSD64 = 34, ///< 64xM VSD 786 DF_VSD16N = 35, ///< 16NxM VSD 787 #endif 788 789 714 790 #if AMP_SAD 715 791 DF_SAD12 = 43, -
trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp
r77 r100 1891 1891 rpcSlice->setPOC( iPOCmsb+iPOClsb ); 1892 1892 1893 #if HHI_FIX1894 1893 if( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDV && rpcSlice->getPOC() == 0 ) 1895 #else1896 if( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDV )1897 #endif1898 1894 { 1899 1895 TComReferencePictureSet* rps = rpcSlice->getLocalRPS(); -
trunk/source/Lib/TLibDecoder/TDecCu.cpp
r77 r100 643 643 AOF( bOK ); 644 644 #if LG_RESTRICTEDRESPRED_M24766 645 646 647 645 Int iPUResiPredShift[4]; 646 pcCU->getPUResiPredShift(iPUResiPredShift, 0); 647 m_ppcYuvReco[uiDepth]->add(iPUResiPredShift, pcCU->getPartitionSize(0), m_ppcYuvResPred[uiDepth], pcCU->getWidth( 0 ), pcCU->getHeight( 0 ) ); 648 648 #else 649 649 m_ppcYuvReco[uiDepth]->add( m_ppcYuvResPred[uiDepth], pcCU->getWidth( 0 ), pcCU->getHeight( 0 ) ); … … 705 705 m_pcPrediction->getPredicBufHeight (), 706 706 bAboveAvail, bLeftAvail ); 707 #if LGE_EDGE_INTRA 708 if( uiLumaPredMode >= EDGE_INTRA_IDX ) 709 { 710 m_pcPrediction->predIntraLumaEdge( pcCU, pcCU->getPattern(), uiAbsPartIdx, uiWidth, uiHeight, piPred, uiStride 711 #if LGE_EDGE_INTRA_DELTA_DC 712 , uiLumaPredMode == EDGE_INTRA_DELTA_IDX 713 #endif 714 ); 715 } 716 else 717 #endif 707 718 708 719 //===== get prediction signal ===== -
trunk/source/Lib/TLibDecoder/TDecEntropy.cpp
r77 r100 109 109 { 110 110 #if LG_RESTRICTEDRESPRED_M24766 111 112 113 111 Int iPUResiPredShift[4]; 112 pcCU->getPUResiPredShift(iPUResiPredShift, uiAbsPartIdx); 113 if(iPUResiPredShift[0] >= 0 || iPUResiPredShift[1] >= 0 || iPUResiPredShift[2] >= 0 || iPUResiPredShift[3] >= 0 ) 114 114 #endif 115 115 m_pcEntropyDecoderIf->parseResPredFlag( pcCU, bResPredFlag, uiAbsPartIdx, uiDepth ); -
trunk/source/Lib/TLibDecoder/TDecGop.cpp
r56 r100 303 303 { 304 304 m_pcDepthMapGenerator->initViewComponent( rpcPic ); 305 #if !QC_MULTI_DIS_CAN 305 306 m_pcDepthMapGenerator->predictDepthMap ( rpcPic ); 307 #endif 306 308 #if HHI_INTER_VIEW_RESIDUAL_PRED 307 309 m_pcResidualGenerator->initViewComponent( rpcPic ); … … 339 341 #endif 340 342 #if DEPTH_MAP_GENERATION 343 #if !QC_MULTI_DIS_CAN 341 344 // update virtual depth map 342 345 m_pcDepthMapGenerator->updateDepthMap( rpcPic ); 346 #endif 343 347 #endif 344 348 // deblocking filter -
trunk/source/Lib/TLibDecoder/TDecSbac.cpp
r56 r100 98 98 , m_cDmmDataSCModel ( 1, 1, NUM_DMM_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 99 99 #endif 100 #if LGE_EDGE_INTRA 101 , m_cEdgeIntraSCModel ( 1, 1, NUM_EDGE_INTRA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 102 #if LGE_EDGE_INTRA_DELTA_DC 103 , m_cEdgeIntraDeltaDCSCModel ( 1, 1, NUM_EDGE_INTRA_DELTA_DC_CTX , m_contextModels + m_numContextModels, m_numContextModels) 104 #endif 105 #endif 100 106 { 101 107 assert( m_numContextModels <= MAX_NUM_CTX_MOD ); … … 182 188 183 189 m_cCUTransSubdivFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_TRANS_SUBDIV_FLAG ); 190 #if LGE_EDGE_INTRA 191 m_cEdgeIntraSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_EDGE_INTRA ); 192 #if LGE_EDGE_INTRA_DELTA_DC 193 m_cEdgeIntraDeltaDCSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_EDGE_INTRA_DELTA_DC ); 194 #endif 195 #endif 184 196 m_uiLastDQpNonZero = 0; 185 197 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX … … 815 827 { 816 828 UInt uiDMMode; 817 829 818 830 #if HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX 819 831 m_pcTDecBinIf->decodeBin( uiSymbol, m_cDmmModeSCModel.get(0, 0, 0) ); uiDMMode = uiSymbol; … … 847 859 #endif 848 860 #if !LOGI_INTRA_NAME_3MPM 849 Int iIntraIdx = pcCU->getIntraSizeIdx(uiAbsPartIdx); 850 #endif 851 861 Int iIntraIdx = pcCU->getIntraSizeIdx(uiAbsPartIdx); 862 #endif 863 864 #if LGE_EDGE_INTRA 865 Bool bCodeEdgeIntra = false; 866 if( pcCU->getSlice()->getSPS()->isDepth() ) 867 { 868 UInt uiPUWidth = pcCU->getWidth( uiAbsPartIdx ) >> (pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ? 1 : 0); 869 if( uiPUWidth <= LGE_EDGE_INTRA_MAX_SIZE && uiPUWidth >= LGE_EDGE_INTRA_MIN_SIZE ) 870 bCodeEdgeIntra = true; 871 } 872 #endif 873 852 874 #if LOGI_INTRA_NAME_3MPM 853 Int uiPreds[3] = {-1, -1, -1}; 854 #else 855 Int uiPreds[2] = {-1, -1}; 856 #endif 857 Int uiPredNum = pcCU->getIntraDirLumaPredictor(uiAbsPartIdx, uiPreds); 858 859 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUIntraPredSCModel.get( 0, 0, 0) ); 860 861 if ( uiSymbol ) 862 { 863 m_pcTDecBinIf->decodeBinEP( uiSymbol ); 875 Int uiPreds[3] = {-1, -1, -1}; 876 #else 877 Int uiPreds[2] = {-1, -1}; 878 #endif 879 Int uiPredNum = pcCU->getIntraDirLumaPredictor(uiAbsPartIdx, uiPreds); 880 #if LGE_EDGE_INTRA 881 UInt uiCheckBit = 0; 882 #endif 883 884 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUIntraPredSCModel.get( 0, 0, 0) ); 885 886 if ( uiSymbol ) 887 { 888 m_pcTDecBinIf->decodeBinEP( uiSymbol ); 864 889 #if LOGI_INTRA_NAME_3MPM 865 if (uiSymbol)866 {867 m_pcTDecBinIf->decodeBinEP( uiSymbol );868 uiSymbol++;869 }870 #endif 871 intraPredMode = uiPreds[uiSymbol];872 }873 else874 {875 intraPredMode = 0;876 890 if (uiSymbol) 891 { 892 m_pcTDecBinIf->decodeBinEP( uiSymbol ); 893 uiSymbol++; 894 } 895 #endif 896 intraPredMode = uiPreds[uiSymbol]; 897 } 898 else 899 { 900 intraPredMode = 0; 901 877 902 #if LOGI_INTRA_NAME_3MPM 878 879 m_pcTDecBinIf->decodeBinsEP( uiSymbol, 5 ); 880 intraPredMode = uiSymbol; 881 882 //postponed sorting of MPMs (only in remaining branch) 883 if (uiPreds[0] > uiPreds[1]) 884 { 885 std::swap(uiPreds[0], uiPreds[1]); 886 } 887 if (uiPreds[0] > uiPreds[2]) 888 { 889 std::swap(uiPreds[0], uiPreds[2]); 890 } 891 if (uiPreds[1] > uiPreds[2]) 892 { 893 std::swap(uiPreds[1], uiPreds[2]); 894 } 895 #else 896 m_pcTDecBinIf->decodeBinsEP( uiSymbol, g_aucIntraModeBitsAng[iIntraIdx] - 1 ); 897 intraPredMode = uiSymbol; 898 899 if ( intraPredMode == 31 ) 900 { 901 m_pcTDecBinIf->decodeBinEP( uiSymbol ); 902 intraPredMode += uiSymbol; 903 } 904 #endif 905 for ( Int i = 0; i < uiPredNum; i++ ) 906 { 907 intraPredMode += ( intraPredMode >= uiPreds[i] ); 908 } 909 } 903 904 m_pcTDecBinIf->decodeBinsEP( uiSymbol, 5 ); 905 #if LGE_EDGE_INTRA 906 if (bCodeEdgeIntra) 907 { 908 if (uiSymbol==31) 909 { 910 m_pcTDecBinIf->decodeBinsEP(uiCheckBit,1); 911 if (uiCheckBit) 912 uiSymbol = EDGE_INTRA_IDX; 913 } 914 } 915 #endif 916 intraPredMode = uiSymbol; 917 918 //postponed sorting of MPMs (only in remaining branch) 919 if (uiPreds[0] > uiPreds[1]) 920 { 921 std::swap(uiPreds[0], uiPreds[1]); 922 } 923 if (uiPreds[0] > uiPreds[2]) 924 { 925 std::swap(uiPreds[0], uiPreds[2]); 926 } 927 if (uiPreds[1] > uiPreds[2]) 928 { 929 std::swap(uiPreds[1], uiPreds[2]); 930 } 931 #else 932 m_pcTDecBinIf->decodeBinsEP( uiSymbol, g_aucIntraModeBitsAng[iIntraIdx] - 1 ); 933 intraPredMode = uiSymbol; 934 935 if ( intraPredMode == 31 ) 936 { 937 m_pcTDecBinIf->decodeBinEP( uiSymbol ); 938 intraPredMode += uiSymbol; 939 } 940 #endif 941 #if LGE_EDGE_INTRA 942 if ( intraPredMode != EDGE_INTRA_IDX) 943 { 944 #endif 945 for ( Int i = 0; i < uiPredNum; i++ ) 946 { 947 intraPredMode += ( intraPredMode >= uiPreds[i] ); 948 } 949 #if LGE_EDGE_INTRA 950 } 951 #endif 952 } 953 954 #if LGE_EDGE_INTRA 955 if( intraPredMode == EDGE_INTRA_IDX ) 956 { 957 xParseEdgeIntraInfo( pcCU, uiAbsPartIdx, uiDepth ); 958 #if LGE_EDGE_INTRA_DELTA_DC 959 m_pcTDecBinIf->decodeBin( uiSymbol, m_cEdgeIntraDeltaDCSCModel.get(0, 0, 0) ); 960 if( uiSymbol ) 961 { 962 intraPredMode = EDGE_INTRA_DELTA_IDX; 963 Int iDeltaDC0; 964 Int iDeltaDC1; 965 966 xReadExGolombLevel( (UInt &) iDeltaDC0, m_cEdgeIntraDeltaDCSCModel.get(0, 0, 1) ); 967 if( iDeltaDC0 != 0 ) 968 { 969 UInt uiSign; 970 m_pcTDecBinIf->decodeBinEP( uiSign ); 971 if ( uiSign ) 972 { 973 iDeltaDC0 = -iDeltaDC0; 974 } 975 } 976 xReadExGolombLevel( (UInt &) iDeltaDC1, m_cEdgeIntraDeltaDCSCModel.get(0, 0, 1) ); 977 if( iDeltaDC1 != 0 ) 978 { 979 UInt uiSign; 980 m_pcTDecBinIf->decodeBinEP( uiSign ); 981 if ( uiSign ) 982 { 983 iDeltaDC1 = -iDeltaDC1; 984 } 985 } 986 987 pcCU->setEdgeDeltaDC0( uiAbsPartIdx, iDeltaDC0 ); 988 pcCU->setEdgeDeltaDC1( uiAbsPartIdx, iDeltaDC1 ); 989 } 990 #endif 991 } 992 #endif 993 910 994 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 911 995 } 912 996 #endif 913 997 914 998 pcCU->setLumaIntraDirSubParts( (UChar)intraPredMode, uiAbsPartIdx, uiDepth ); 915 999 } … … 2012 2096 #endif 2013 2097 2014 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 2098 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX || (LGE_EDGE_INTRA && LGE_EDGE_INTRA_DELTA_DC) 2015 2099 Void TDecSbac::xReadExGolombLevel( UInt& ruiSymbol, ContextModel& rcSCModel ) 2016 2100 { … … 2270 2354 } 2271 2355 #endif 2356 2357 #if LGE_EDGE_INTRA 2358 Void TDecSbac::xParseEdgeIntraInfo( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2359 { 2360 UInt uiSymbol = 0; 2361 2362 // 1. Top(0) or Left(1) 2363 UChar ucLeft; 2364 m_pcTDecBinIf->decodeBinEP( uiSymbol ); 2365 ucLeft = uiSymbol; 2366 2367 // 2. Start position (lowest bit first) 2368 UChar ucStart = 0; 2369 for( UInt ui = 0; ui < 6 - uiDepth; ui++ ) 2370 { 2371 m_pcTDecBinIf->decodeBinEP( uiSymbol ); 2372 ucStart |= (uiSymbol << ui); 2373 } 2374 2375 // 3. Number of edges 2376 UChar ucMax = 0; 2377 for( UInt ui = 0; ui < 7 - uiDepth; ui++ ) 2378 { 2379 m_pcTDecBinIf->decodeBinEP( uiSymbol ); 2380 ucMax |= (uiSymbol << ui); 2381 } 2382 ucMax++; // +1 2383 2384 // 4. Edges 2385 UChar* pucSymbolList = (UChar*) xMalloc( UChar, 256 * LGE_EDGE_INTRA_MAX_EDGE_NUM_PER_4x4 ); 2386 UInt uiCtxEdgeIntra = pcCU->getCtxEdgeIntra( uiAbsPartIdx ); 2387 for( Int iPtr = 0; iPtr < ucMax; iPtr++ ) 2388 { 2389 UChar ucEdge = 0; 2390 UInt uiReorderEdge = 0; 2391 // Left-friendly direction 2392 // 0 ( 0deg) => 0 2393 // 1 ( 45deg) => 10 2394 // 2 ( -45deg) => 110 2395 // 3 ( 90deg) => 1110 2396 // 4 ( -90deg) => 11110 2397 // 5 ( 135deg) => 111110 2398 // 6 (-135deg) => 111111 2399 // Right-friendly direction 2400 // 0 ( 0deg) => 0 2401 // 1 ( -45deg) => 10 2402 // 2 ( 45deg) => 110 2403 // 3 ( -90deg) => 1110 2404 // 4 ( 90deg) => 11110 2405 // 5 (-135deg) => 111110 2406 // 6 ( 135deg) => 111111 2407 // refer to a paper "An efficient chain code with Huffman coding" 2408 for( UInt ui = 0; ui < 6; ui++ ) 2409 { 2410 m_pcTDecBinIf->decodeBin( uiSymbol, m_cEdgeIntraSCModel.get( 0, 0, uiCtxEdgeIntra ) ); 2411 ucEdge <<= 1; 2412 ucEdge |= uiSymbol; 2413 if( uiSymbol == 0 ) 2414 break; 2415 } 2416 2417 switch( ucEdge ) 2418 { 2419 case 0 : // "0" 2420 uiReorderEdge = 0; 2421 break; 2422 case 2 : // "10" 2423 uiReorderEdge = 1; 2424 break; 2425 case 6 : // "110" 2426 uiReorderEdge = 2; 2427 break; 2428 case 14 : // "1110" 2429 uiReorderEdge = 3; 2430 break; 2431 case 30 : // "11110" 2432 uiReorderEdge = 4; 2433 break; 2434 case 62 : // "111110" 2435 uiReorderEdge = 5; 2436 break; 2437 case 63 : // "111111" 2438 uiReorderEdge = 6; 2439 break; 2440 default : 2441 printf("parseIntraEdgeChain: error (unknown code %d)\n",ucEdge); 2442 assert(false); 2443 break; 2444 } 2445 pucSymbolList[iPtr] = uiReorderEdge; 2446 } 2447 ///////////////////// 2448 // Edge Reconstruction 2449 Bool* pbRegion = pcCU->getEdgePartition( uiAbsPartIdx ); 2450 pcCU->reconPartition( uiAbsPartIdx, uiDepth, ucLeft == 1, ucStart, ucMax, pucSymbolList, pbRegion ); 2451 xFree( pucSymbolList ); 2452 } 2453 #endif 2454 2272 2455 //! \} -
trunk/source/Lib/TLibDecoder/TDecSbac.h
r77 r100 146 146 #endif 147 147 148 #if LGE_EDGE_INTRA 149 Void xParseEdgeIntraInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 150 #endif 151 148 152 private: 149 153 TComInputBitstream* m_pcBitstream; … … 253 257 ContextModel3DBuffer m_cDmmDataSCModel; 254 258 #endif 259 #if LGE_EDGE_INTRA 260 ContextModel3DBuffer m_cEdgeIntraSCModel; 261 #if LGE_EDGE_INTRA_DELTA_DC 262 ContextModel3DBuffer m_cEdgeIntraDeltaDCSCModel; 263 #endif 264 #endif 255 265 }; 256 266 -
trunk/source/Lib/TLibDecoder/TDecSlice.h
r77 r100 107 107 ParameterSetMap<TComAPS> m_apsBuffer; 108 108 #if VIDYO_VPS_INTEGRATION 109 109 ParameterSetMap<TComVPS> m_vpsBuffer; 110 110 #endif 111 111 }; -
trunk/source/Lib/TLibDecoder/TDecTop.h
r77 r100 176 176 Void executeDeblockAndAlf(UInt& ruiPOC, TComList<TComPic*>*& rpcListPic, Int& iSkipFrame, Int& iPOCLastDisplay); 177 177 178 Void setViewId(Int viewId) 179 Int getViewId() 178 Void setViewId(Int viewId) { m_viewId = viewId;} 179 Int getViewId() { return m_viewId ;} 180 180 Void setIsDepth( Bool isDepth ) { m_isDepth = isDepth; } 181 181 182 182 #if SONY_COLPIC_AVAILABILITY 183 Void setViewOrderIdx(Int i) 184 Int getViewOrderIdx() 183 Void setViewOrderIdx(Int i) { m_iViewOrderIdx = i ;} 184 Int getViewOrderIdx() { return m_iViewOrderIdx ; } 185 185 #endif 186 186 … … 209 209 #endif 210 210 #if VIDYO_VPS_INTEGRATION 211 211 Void xDecodeVPS(); 212 212 #endif 213 213 Void xDecodeSPS(); -
trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
r77 r100 378 378 Void TEncCavlc::codeVPS( TComVPS* pcVPS ) 379 379 { 380 380 WRITE_CODE( pcVPS->getMaxTLayers() - 1, 3, "max_temporal_layers_minus1" ); 381 381 WRITE_CODE( pcVPS->getMaxLayers() - 1, 5, "max_layers_minus1" ); 382 382 WRITE_FLAG( pcVPS->getTemporalNestingFlag() - 1, "temporal_id_nesting_flag" ); … … 775 775 { 776 776 WRITE_CODE( (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC()))%(1<<pcSlice->getSPS()->getBitsForPOC()), pcSlice->getSPS()->getBitsForPOC(), "pic_order_cnt_lsb"); 777 #if HHI_FIX778 777 if( pcSlice->getPOC() == 0 && pcSlice->getNalUnitType() != NAL_UNIT_CODED_SLICE_IDV ) 779 778 { … … 848 847 } 849 848 if( pcSlice->getPOC() != 0 ) 850 #else851 if( pcSlice->getNalUnitType() != NAL_UNIT_CODED_SLICE_IDV )852 #endif853 849 { 854 850 TComReferencePictureSet* rps = pcSlice->getRPS(); -
trunk/source/Lib/TLibEncoder/TEncCfg.h
r77 r100 205 205 UInt m_uiVSOMode; 206 206 #endif 207 #if SAIT_VSO_EST_A0033 208 Bool m_bUseEstimatedVSD; 209 Double m_dDispCoeff; 210 #endif 211 207 212 208 213 //====== Tool list ======== … … 568 573 #endif 569 574 575 #if SAIT_VSO_EST_A0033 576 Void setUseEstimatedVSD ( Bool b ) { m_bUseEstimatedVSD = b; } 577 Void setDispCoeff ( Double d ) { m_dDispCoeff = d; } 578 #endif 579 570 580 Void setUseFastEnc ( Bool b ) { m_bUseFastEnc = b; } 571 581 Void setUseEarlyCU ( Bool b ) { m_bUseEarlyCU = b; } … … 608 618 Bool getUseVSO () { return m_bUseVSO; } 609 619 #endif 620 #if SAIT_VSO_EST_A0033 621 Bool getUseEstimatedVSD () { return m_bUseEstimatedVSD; } 622 Double getDispCoeff () { return m_dDispCoeff; } 623 #endif 624 610 625 Bool getUseFastEnc () { return m_bUseFastEnc; } 611 626 Bool getUseEarlyCU () { return m_bUseEarlyCU; } -
trunk/source/Lib/TLibEncoder/TEncCu.cpp
r81 r100 1156 1156 if( m_pcRdCost->getUseRenModel() ) 1157 1157 { 1158 #if HHI_FIX1159 1158 UInt uiWidth = m_ppcOrigYuv[uiDepth]->getWidth ( ); 1160 1159 UInt uiHeight = m_ppcOrigYuv[uiDepth]->getHeight( ); … … 1162 1161 UInt uiSrcStride = m_ppcOrigYuv[uiDepth]->getStride(); 1163 1162 m_pcRdCost->setRenModelData( m_ppcBestCU[uiDepth], 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 1164 #else1165 UInt uiWidth = m_ppcBestCU[uiDepth]->getWidth ( 0 );1166 UInt uiHeight = m_ppcBestCU[uiDepth]->getHeight( 0 );1167 Pel* piSrc = m_ppcOrigYuv[uiDepth]->getLumaAddr( 0 );1168 UInt uiSrcStride = m_ppcOrigYuv[uiDepth]->getStride();1169 m_pcRdCost->setRenModelData( m_ppcBestCU[uiDepth], 0, piSrc, uiSrcStride, uiWidth, uiHeight );1170 #endif1171 1163 } 1172 1164 #endif … … 1212 1204 1213 1205 #if HHI_VSO 1206 #if HHI_VSO_SET_OPTIM 1207 #else 1214 1208 if( m_pcRdCost->getUseRenModel() ) // necessary ?? 1215 1209 { 1216 #if HHI_FIX1217 1210 UInt uiWidth = m_ppcRecoYuvBest[uhNextDepth]->getWidth ( ); 1218 1211 UInt uiHeight = m_ppcRecoYuvBest[uhNextDepth]->getHeight ( ); … … 1220 1213 UInt uiSrcStride = m_ppcRecoYuvBest[uhNextDepth]->getStride ( ); 1221 1214 m_pcRdCost->setRenModelData( pcSubBestPartCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 1222 #else 1223 UInt uiWidth = pcSubBestPartCU->getWidth ( 0 ); 1224 UInt uiHeight = pcSubBestPartCU->getHeight( 0 ); 1225 Pel* piSrc = m_ppcRecoYuvBest[pcSubBestPartCU->getDepth(0)]->getLumaAddr( 0 ); 1226 UInt uiSrcStride = m_ppcRecoYuvBest[pcSubBestPartCU->getDepth(0)]->getStride(); 1227 m_pcRdCost->setRenModelData( pcSubBestPartCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 1228 #endif 1229 } 1215 } 1216 #endif 1230 1217 #endif 1231 1218 } … … 1369 1356 if( m_pcRdCost->getUseRenModel() ) 1370 1357 { 1371 #if HHI_FIX1372 1358 UInt uiWidth = m_ppcRecoYuvBest[uiDepth]->getWidth ( ); 1373 1359 UInt uiHeight = m_ppcRecoYuvBest[uiDepth]->getHeight ( ); … … 1375 1361 UInt uiSrcStride = m_ppcRecoYuvBest[uiDepth]->getStride ( ); 1376 1362 m_pcRdCost->setRenModelData( rpcBestCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 1377 #else1378 UInt uiWidth = rpcBestCU->getWidth ( 0 );1379 UInt uiHeight = rpcBestCU->getHeight( 0 );1380 Pel* piSrc = m_ppcRecoYuvBest[uiDepth]->getLumaAddr( 0 );1381 UInt uiSrcStride = m_ppcRecoYuvBest[uiDepth]->getStride();1382 m_pcRdCost->setRenModelData( rpcBestCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );1383 #endif1384 1363 } 1385 1364 #endif … … 1747 1726 if( m_pcRdCost->getUseRenModel() ) 1748 1727 { 1749 #if HHI_FIX1750 1728 UInt uiWidth = m_ppcOrigYuv[uhDepth]->getWidth ( ); 1751 1729 UInt uiHeight = m_ppcOrigYuv[uhDepth]->getHeight( ); … … 1753 1731 UInt uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride(); 1754 1732 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 1755 #else1756 UInt uiWidth = rpcTempCU->getWidth ( 0 );1757 UInt uiHeight = rpcTempCU->getHeight( 0 );1758 Pel* piSrc = m_ppcOrigYuv[uhDepth]->getLumaAddr( );1759 UInt uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride();1760 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );1761 #endif1762 1733 } 1763 1734 #endif … … 1851 1822 if( m_pcRdCost->getUseRenModel() ) 1852 1823 { //Reset 1853 #if HHI_FIX1854 1824 UInt uiWidth = m_ppcOrigYuv[uhDepth]->getWidth (); 1855 1825 UInt uiHeight = m_ppcOrigYuv[uhDepth]->getHeight (); … … 1857 1827 UInt uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride (); 1858 1828 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 1859 #else1860 UInt uiWidth = rpcTempCU->getWidth ( 0 );1861 UInt uiHeight = rpcTempCU->getHeight( 0 );1862 Pel* piSrc = m_ppcOrigYuv[uhDepth]->getLumaAddr( );1863 UInt uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride();1864 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );1865 #endif1866 1829 } 1867 1830 #endif … … 1927 1890 if( m_pcRdCost->getUseRenModel() ) 1928 1891 { 1929 #if HHI_FIX1930 1892 UInt uiWidth = m_ppcOrigYuv[uhDepth]->getWidth ( ); 1931 1893 UInt uiHeight = m_ppcOrigYuv[uhDepth]->getHeight( ); … … 1933 1895 UInt uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride(); 1934 1896 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 1935 #else1936 UInt uiWidth = rpcTempCU->getWidth ( 0 );1937 UInt uiHeight = rpcTempCU->getHeight( 0 );1938 Pel* piSrc = m_ppcOrigYuv[uhDepth]->getLumaAddr( );1939 UInt uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride();1940 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );1941 #endif1942 1897 } 1943 1898 #endif … … 2046 2001 if( m_pcRdCost->getUseRenModel() ) 2047 2002 { 2048 #if HHI_FIX2049 2003 UInt uiWidth = m_ppcOrigYuv[uiDepth]->getWidth (); 2050 2004 UInt uiHeight = m_ppcOrigYuv[uiDepth]->getHeight (); … … 2052 2006 UInt uiSrcStride = m_ppcOrigYuv[uiDepth]->getStride (); 2053 2007 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 2054 #else2055 UInt uiWidth = rpcTempCU->getWidth ( 0 );2056 UInt uiHeight = rpcTempCU->getHeight( 0 );2057 Pel* piSrc = m_ppcOrigYuv[uiDepth]->getLumaAddr( );2058 UInt uiSrcStride = m_ppcOrigYuv[uiDepth]->getStride();2059 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );2060 #endif2061 2008 } 2062 2009 #endif … … 2557 2504 if( m_pcRdCost->getUseRenModel() && !bRecursiveCall) 2558 2505 { 2559 #if HHI_FIX2560 2506 UInt uiWidth = m_ppcOrigYuv[uhDepth]->getWidth (); 2561 2507 UInt uiHeight = m_ppcOrigYuv[uhDepth]->getHeight (); … … 2563 2509 UInt uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride (); 2564 2510 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 2565 #else2566 UInt uiWidth = m_ppcTempCU [uhDepth]->getWidth ( 0 );2567 UInt uiHeight = m_ppcTempCU [uhDepth]->getHeight( 0 );2568 Pel* piSrc = m_ppcOrigYuv[uhDepth]->getLumaAddr( 0 );2569 UInt uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride();2570 m_pcRdCost->setRenModelData( m_ppcTempCU[uhDepth], 0, piSrc, uiSrcStride, uiWidth, uiHeight );2571 #endif2572 2511 } 2573 2512 #endif … … 2717 2656 if( !bSplit && bRecursiveCall && m_pcRdCost->getUseRenModel() ) 2718 2657 { 2719 #if HHI_FIX2720 2658 UInt uiWidth = m_ppcRecoYuvBest[uhDepth]->getWidth ( ); 2721 2659 UInt uiHeight = m_ppcRecoYuvBest[uhDepth]->getHeight ( ); … … 2723 2661 Pel* piSrc = m_ppcRecoYuvBest[uhDepth]->getLumaAddr( 0 ); 2724 2662 m_pcRdCost->setRenModelData( rpcBestCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 2725 #else2726 UInt uiWidth = rpcBestCU->getWidth ( 0 );2727 UInt uiHeight = rpcBestCU->getHeight( 0 );2728 Pel* piSrc = m_ppcRecoYuvBest[uhDepth]->getLumaAddr( 0 );2729 UInt uiSrcStride = m_ppcRecoYuvBest[uhDepth]->getStride();2730 m_pcRdCost->setRenModelData( rpcBestCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );2731 #endif2732 2663 } 2733 2664 #endif -
trunk/source/Lib/TLibEncoder/TEncEntropy.h
r77 r100 77 77 78 78 #if VIDYO_VPS_INTEGRATION 79 80 #endif 81 79 virtual Void codeVPS ( TComVPS* pcVPS ) = 0; 80 #endif 81 82 82 #if HHI_MPI 83 83 virtual Void codeSPS ( TComSPS* pcSPS, Bool bIsDepth ) = 0; … … 234 234 public: 235 235 #if VIDYO_VPS_INTEGRATION 236 236 Void encodeVPS ( TComVPS* pcVPS); 237 237 #endif 238 238 // SPS -
trunk/source/Lib/TLibEncoder/TEncGOP.cpp
r77 r100 436 436 Bool bUseVSO = m_pcEncTop->getUseVSO(); 437 437 m_pcRdCost->setUseVSO( bUseVSO ); 438 #if SAIT_VSO_EST_A0033 439 m_pcRdCost->setUseEstimatedVSD( m_pcEncTop->getUseEstimatedVSD() ); 440 #endif 438 441 439 442 if ( bUseVSO ) … … 445 448 #endif 446 449 450 #if HHI_VSO_SPEEDUP_A033 451 #else 447 452 if ( iVSOMode == 4 ) 448 453 { … … 453 458 AOT(true); 454 459 } 460 #endif 461 462 #if SAIT_VSO_EST_A0033 463 m_pcRdCost->setVideoRecPicYuv( m_pcEncTop->getEncTop()->xGetPicYuvFromViewTemp( pcSlice->getViewId(), pcSlice->getPOC(), false, true ) ); 464 m_pcRdCost->setDepthPicYuv ( m_pcEncTop->getEncTop()->xGetPicYuvFromViewTemp( pcSlice->getViewId(), pcSlice->getPOC(), true, false ) ); 465 #endif 466 467 455 468 } 456 469 #endif … … 691 704 // init view component and predict virtual depth map 692 705 m_pcDepthMapGenerator->initViewComponent( pcPic ); 706 #if !QC_MULTI_DIS_CAN 693 707 m_pcDepthMapGenerator->predictDepthMap ( pcPic ); 708 #endif 694 709 #endif 695 710 #if HHI_INTER_VIEW_MOTION_PRED … … 758 773 #endif 759 774 #if DEPTH_MAP_GENERATION 775 #if !QC_MULTI_DIS_CAN 760 776 // update virtual depth map 761 777 m_pcDepthMapGenerator->updateDepthMap( pcPic ); 778 #endif 762 779 #endif 763 780 … … 2475 2492 if( hasModification ) 2476 2493 { 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2494 Int temporalRefIdx = 0; 2495 for( Int i = 0; i < pcSlice->getNumRefIdx( REF_PIC_LIST_0 ); i++ ) 2496 { 2497 if( tempListEntryL0[i] >= 0 ) 2498 { 2499 refPicListModification->setRefPicSetIdxL0( i, tempListEntryL0[i] ); 2500 } 2501 else 2502 { 2503 refPicListModification->setRefPicSetIdxL0( i, temporalRefIdx ); 2504 temporalRefIdx++; 2505 } 2506 } 2507 } 2491 2508 else 2492 2509 { … … 2520 2537 if( hasModification ) 2521 2538 { 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2539 Int temporalRefIdx = 0; 2540 for( Int i = 0; i < pcSlice->getNumRefIdx( REF_PIC_LIST_1 ); i++ ) 2541 { 2542 if( tempListEntryL1[i] >= 0 ) 2543 { 2544 refPicListModification->setRefPicSetIdxL1( i, tempListEntryL1[i] ); 2545 } 2546 else 2547 { 2548 refPicListModification->setRefPicSetIdxL1( i, temporalRefIdx ); 2549 temporalRefIdx++; 2550 } 2551 } 2535 2552 } 2536 2553 else -
trunk/source/Lib/TLibEncoder/TEncGOP.h
r56 r100 137 137 138 138 Void preLoopFilterPicAll ( TComPic* pcPic, UInt64& ruiDist, UInt64& ruiBits ); 139 #if HHI_VSO_SPEEDUP_A033 140 TEncTop* getEncTop() { return m_pcEncTop; } 141 #endif 139 142 140 143 TEncSlice* getSliceEncoder() { return m_pcSliceEncoder; } -
trunk/source/Lib/TLibEncoder/TEncSbac.cpp
r77 r100 106 106 , m_cDmmDataSCModel ( 1, 1, NUM_DMM_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 107 107 #endif 108 #if LGE_EDGE_INTRA 109 , m_cEdgeIntraSCModel ( 1, 1, NUM_EDGE_INTRA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 110 #if LGE_EDGE_INTRA_DELTA_DC 111 , m_cEdgeIntraDeltaDCSCModel ( 1, 1, NUM_EDGE_INTRA_DELTA_DC_CTX , m_contextModels + m_numContextModels, m_numContextModels) 112 #endif 113 #endif 108 114 { 109 115 assert( m_numContextModels <= MAX_NUM_CTX_MOD ); … … 181 187 m_cDmmDataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM_DATA ); 182 188 #endif 189 #if LGE_EDGE_INTRA 190 m_cEdgeIntraSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_EDGE_INTRA ); 191 #if LGE_EDGE_INTRA_DELTA_DC 192 m_cEdgeIntraDeltaDCSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_EDGE_INTRA_DELTA_DC ); 193 #endif 194 #endif 183 195 184 196 // new structure … … 345 357 Void TEncSbac::codeVPS( TComVPS* pcVPS ) 346 358 { 347 359 assert (0); 348 360 return; 349 361 } … … 828 840 DTRACE_CABAC_T( "\n" ) 829 841 } 842 843 #if LGE_EDGE_INTRA 844 Void TEncSbac::xCodeEdgeIntraInfo( TComDataCU* pcCU, UInt uiPartIdx ) 845 { 846 UInt uiDepth = pcCU->getDepth( uiPartIdx ) + (pcCU->getPartitionSize( uiPartIdx ) == SIZE_NxN ? 1 : 0); 847 UInt uiCtxEdgeIntra = pcCU->getCtxEdgeIntra( uiPartIdx ); 848 UChar* pucSymbolList = pcCU->getEdgeCode( uiPartIdx ); 849 UChar ucEdgeNumber = pcCU->getEdgeNumber( uiPartIdx ); 850 Bool bLeft = pcCU->getEdgeLeftFirst( uiPartIdx ); 851 UChar ucStart = pcCU->getEdgeStartPos( uiPartIdx ); 852 UInt uiSymbol; 853 854 // 1. Top(0) or Left(1) 855 uiSymbol = (bLeft == false) ? 0 : 1; 856 m_pcBinIf->encodeBinEP( uiSymbol ); 857 858 // 2. Start position (lowest bit first) 859 uiSymbol = ucStart; 860 for( UInt ui = 6; ui > uiDepth; ui-- ) // 64(0)->6, 32(1)->5, 16(2)->4, 8(3)->3, 4(4)->2 861 { 862 m_pcBinIf->encodeBinEP( uiSymbol & 0x1 ); 863 uiSymbol >>= 1; 864 } 865 866 // 3. Number of edges 867 uiSymbol = ucEdgeNumber > 0 ? ucEdgeNumber - 1 : 0; 868 for( UInt ui = 7; ui > uiDepth; ui-- ) // 64(0)->7, 32(1)->6, 16(2)->5, 8(3)->4, 4(4)->3 869 { 870 m_pcBinIf->encodeBinEP( uiSymbol & 0x1 ); 871 uiSymbol >>= 1; 872 } 873 874 if(uiSymbol != 0) 875 { 876 printf(" ucEdgeNumber %d at depth %d\n",ucEdgeNumber, uiDepth); 877 assert(false); 878 } 879 880 // 4. Edges 881 for( Int iPtr2 = 0; iPtr2 < ucEdgeNumber; iPtr2++ ) 882 { 883 UInt uiReorderSymbol = pucSymbolList[iPtr2]; 884 885 //printf ("Ptr = %d, Symbol = %d\n", iPtr2, uiSymbol); 886 887 // Left-friendly direction (Top start) 888 // 0 ( 0deg) => 0 889 // 1 ( 45deg) => 10 890 // 2 ( -45deg) => 110 891 // 3 ( 90deg) => 1110 892 // 4 ( -90deg) => 11110 893 // 5 ( 135deg) => 111110 894 // 6 (-135deg) => 111111 895 // Right-friendly direction (Left start) 896 // 0 ( 0deg) => 0 897 // 2 ( -45deg) => 10 898 // 1 ( 45deg) => 110 899 // 4 ( -90deg) => 1110 900 // 3 ( 90deg) => 11110 901 // 6 (-135deg) => 111110 902 // 5 ( 135deg) => 111111 903 904 // refer to a paper "An efficient chain code with Huffman coding" 905 906 for( UInt ui = 0; ui < uiReorderSymbol; ui++ ) 907 { 908 m_pcBinIf->encodeBin( 1, m_cEdgeIntraSCModel.get( 0, 0, uiCtxEdgeIntra ) ); 909 } 910 911 if( uiReorderSymbol != 6 ) 912 m_pcBinIf->encodeBin( 0, m_cEdgeIntraSCModel.get( 0, 0, uiCtxEdgeIntra ) ); 913 } 914 } 915 #endif 916 830 917 Void TEncSbac::codeIntraDirLumaAng( TComDataCU* pcCU, UInt uiAbsPartIdx ) 831 918 { … … 835 922 if( pcCU->getSlice()->getSPS()->getUseDMM() && pcCU->getWidth( uiAbsPartIdx ) <= DMM_WEDGEMODEL_MAX_SIZE ) 836 923 { 924 #if LGE_EDGE_INTRA 925 m_pcBinIf->encodeBin( uiDir >= NUM_INTRA_MODE && uiDir < EDGE_INTRA_IDX, m_cDmmFlagSCModel.get(0, 0, 0) ); 926 #else 837 927 m_pcBinIf->encodeBin( uiDir >= NUM_INTRA_MODE, m_cDmmFlagSCModel.get(0, 0, 0) ); 838 } 928 #endif 929 } 930 #if LGE_EDGE_INTRA 931 if( uiDir >= NUM_INTRA_MODE && uiDir < EDGE_INTRA_IDX ) 932 #else 839 933 if( uiDir >= NUM_INTRA_MODE ) 934 #endif 840 935 { 841 936 assert( pcCU->getWidth( uiAbsPartIdx ) <= DMM_WEDGEMODEL_MAX_SIZE ); … … 870 965 } 871 966 else 967 #if LGE_EDGE_INTRA 968 if ( uiDir >= EDGE_INTRA_IDX) 969 { 970 m_pcBinIf->encodeBin( 0, m_cCUIntraPredSCModel.get( 0, 0, 0 ) ); 971 m_pcBinIf->encodeBinsEP( 63, 6 ); 972 xCodeEdgeIntraInfo( pcCU, uiAbsPartIdx ); 973 #if LGE_EDGE_INTRA_DELTA_DC 974 m_pcBinIf->encodeBin( (uiDir == EDGE_INTRA_DELTA_IDX), m_cEdgeIntraDeltaDCSCModel.get(0, 0, 0) ); 975 if( uiDir == EDGE_INTRA_DELTA_IDX ) 976 { 977 Int iDeltaDC0 = pcCU->getEdgeDeltaDC0( uiAbsPartIdx ); 978 Int iDeltaDC1 = pcCU->getEdgeDeltaDC1( uiAbsPartIdx ); 979 980 xWriteExGolombLevel( UInt( abs( iDeltaDC0 ) ), m_cEdgeIntraDeltaDCSCModel.get(0, 0, 1) ); 981 if ( iDeltaDC0 != 0 ) 982 { 983 UInt uiSign = iDeltaDC0 > 0 ? 0 : 1; 984 m_pcBinIf->encodeBinEP( uiSign ); 985 } 986 xWriteExGolombLevel( UInt( abs( iDeltaDC1 ) ), m_cEdgeIntraDeltaDCSCModel.get(0, 0, 1) ); 987 if ( iDeltaDC1 != 0 ) 988 { 989 UInt uiSign = iDeltaDC1 > 0 ? 0 : 1; 990 m_pcBinIf->encodeBinEP( uiSign ); 991 } 992 } 993 #endif 994 } 995 else 996 #endif // LGE_EDGE_INTRA 872 997 { 873 998 #endif 874 999 #if !LOGI_INTRA_NAME_3MPM 875 1000 Int iIntraIdx = pcCU->getIntraSizeIdx(uiAbsPartIdx); 1001 #endif 1002 #if LGE_EDGE_INTRA 1003 Bool bCodeEdgeIntra = false; 1004 if( pcCU->getSlice()->getSPS()->isDepth() ) 1005 { 1006 UInt uiPUWidth = pcCU->getWidth( uiAbsPartIdx ) >> (pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ? 1 : 0); 1007 if( uiPUWidth <= LGE_EDGE_INTRA_MAX_SIZE && uiPUWidth >= LGE_EDGE_INTRA_MIN_SIZE ) 1008 bCodeEdgeIntra = true; 1009 } 876 1010 #endif 877 1011 … … 932 1066 #if LOGI_INTRA_NAME_3MPM 933 1067 m_pcBinIf->encodeBinsEP( uiDir, 5 ); 1068 #if LGE_EDGE_INTRA 1069 if (bCodeEdgeIntra) 1070 if (uiDir == 31) m_pcBinIf->encodeBinsEP(0,1); 1071 #endif 934 1072 #else 935 1073 if ( uiDir < 31 ) … … 2270 2408 } 2271 2409 2272 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 2410 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX || (LGE_EDGE_INTRA && LGE_EDGE_INTRA_DELTA_DC) 2273 2411 Void TEncSbac::xWriteExGolombLevel( UInt uiSymbol, ContextModel& rcSCModel ) 2274 2412 { -
trunk/source/Lib/TLibEncoder/TEncSbac.h
r77 r100 101 101 Void codeVPS ( TComVPS* pcVPS ); 102 102 #endif 103 103 104 104 #if HHI_MPI 105 105 Void codeSPS ( TComSPS* pcSPS, Bool bIsDepth ); … … 174 174 Void xCodeWedgePredTexDeltaInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 175 175 Void xCodeContourPredTexDeltaInfo( TComDataCU* pcCU, UInt uiAbsPartIdx ); 176 #endif 177 #if LGE_EDGE_INTRA 178 Void xCodeEdgeIntraInfo( TComDataCU* pcCU, UInt uiPartIdx ); 176 179 #endif 177 180 … … 307 310 ContextModel3DBuffer m_cDmmDataSCModel; 308 311 #endif 312 #if LGE_EDGE_INTRA 313 ContextModel3DBuffer m_cEdgeIntraSCModel; 314 #if LGE_EDGE_INTRA_DELTA_DC 315 ContextModel3DBuffer m_cEdgeIntraDeltaDCSCModel; 316 #endif 317 #endif 309 318 }; 310 319 -
trunk/source/Lib/TLibEncoder/TEncSearch.cpp
r81 r100 304 304 // motion cost 305 305 uiSad += m_pcRdCost->getCost( iSearchX, iSearchY ); 306 #if HHI_FIX 306 307 307 // regularization cost 308 308 if( m_pcRdCost->useMultiviewReg() ) … … 310 310 uiSad += m_pcRdCost->getMultiviewRegCost( iSearchX, iSearchY ); 311 311 } 312 #endif313 312 if( uiSad < rcStruct.uiBestSad ) 314 313 { … … 957 956 TComYuv* pcPredYuv, 958 957 TComYuv* pcResiYuv, 959 Dist& ruiDist ) 958 Dist& ruiDist 959 #if LG_ZEROINTRADEPTHRESI_M26039 960 ,Bool bZeroResi 961 #endif 962 ) 960 963 { 961 964 UInt uiLumaPredMode = pcCU ->getLumaIntraDir ( uiAbsPartIdx ); … … 989 992 pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, uiTrDepth, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail ); 990 993 994 #if LGE_EDGE_INTRA 995 if( uiLumaPredMode >= EDGE_INTRA_IDX ) 996 { 997 #if LGE_EDGE_INTRA_DELTA_DC 998 if( uiLumaPredMode == EDGE_INTRA_DELTA_IDX ) 999 xAssignEdgeIntraDeltaDCs( pcCU, uiAbsPartIdx, piOrg, uiStride, piPred, uiWidth, uiHeight ); 1000 #endif 1001 1002 predIntraLumaEdge( pcCU, pcCU->getPattern(), uiAbsPartIdx, uiWidth, uiHeight, piPred, uiStride 1003 #if LGE_EDGE_INTRA_DELTA_DC 1004 , uiLumaPredMode == EDGE_INTRA_DELTA_IDX 1005 #endif 1006 ); 1007 } 1008 else 1009 #endif 1010 991 1011 //===== get prediction signal ===== 992 1012 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX … … 1020 1040 } 1021 1041 } 1042 #if LG_ZEROINTRADEPTHRESI_M26039 1043 if(bZeroResi) 1044 { 1045 Pel* pResi = piResi; 1046 1047 for( UInt uiY = 0; uiY < uiHeight; uiY++ ) 1048 { 1049 memset( pResi, 0, sizeof( Pel ) * uiWidth ); 1050 pResi += uiStride; 1051 } 1052 } 1053 #endif 1022 1054 1023 1055 //===== transform and quantization ===== … … 1311 1343 Bool bCheckFirst, 1312 1344 #endif 1313 Double& dRDCost ) 1345 Double& dRDCost 1346 #if LG_ZEROINTRADEPTHRESI_M26039 1347 ,Bool bZeroResi 1348 #endif 1349 ) 1314 1350 { 1315 1351 UInt uiFullDepth = pcCU->getDepth( 0 ) + uiTrDepth; … … 1326 1362 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 1327 1363 if( pcCU->getLumaIntraDir( uiAbsPartIdx ) >= NUM_INTRA_MODE ) 1364 { 1365 bCheckSplit = false; 1366 } 1367 #endif 1368 #if LGE_EDGE_INTRA 1369 if( pcCU->getLumaIntraDir( uiAbsPartIdx ) >= EDGE_INTRA_IDX ) 1328 1370 { 1329 1371 bCheckSplit = false; … … 1346 1388 //----- code luma block with given intra prediction mode and store Cbf----- 1347 1389 dSingleCost = 0.0; 1390 #if LG_ZEROINTRADEPTHRESI_M26039 1391 xIntraCodingLumaBlk( pcCU, uiTrDepth, uiAbsPartIdx, pcOrgYuv, pcPredYuv, pcResiYuv, uiSingleDistY, bZeroResi ); 1392 #else 1348 1393 xIntraCodingLumaBlk( pcCU, uiTrDepth, uiAbsPartIdx, pcOrgYuv, pcPredYuv, pcResiYuv, uiSingleDistY ); 1394 #endif 1349 1395 if( bCheckSplit ) 1350 1396 { … … 1808 1854 Int numModesForFullRD = g_aucIntraModeNumFast[ uiWidthBit ]; 1809 1855 1856 #if LGE_EDGE_INTRA 1857 Bool bTestEdgeIntra = false; 1858 if ( m_pcEncCfg->isDepthCoder() && uiWidth >= LGE_EDGE_INTRA_MIN_SIZE && uiWidth <= LGE_EDGE_INTRA_MAX_SIZE && uiWidth == uiHeight ) 1859 { 1860 bTestEdgeIntra = true; 1861 1862 Bool bEdgeExist; 1863 1864 bEdgeExist = xEdgePartition( pcCU, uiPartOffset, pcCU->getPartitionSize(0) == SIZE_NxN ); 1865 1866 if( !bEdgeExist ) 1867 bTestEdgeIntra = false; 1868 } 1869 #endif 1870 1810 1871 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 1811 1872 Bool bTestDmm = ( m_pcEncCfg->getUseDMM() ); … … 1828 1889 1829 1890 predIntraLumaAng( pcCU->getPattern(), uiMode, piPred, uiStride, uiWidth, uiHeight, pcCU, bAboveAvail, bLeftAvail ); 1830 1891 1831 1892 // use hadamard transform here 1832 Dist uiSad;1893 Dist uiSad; 1833 1894 #if HHI_VSO 1834 if ( m_pcRdCost->getUseVSO() ) 1835 { 1836 Bool bSad = !m_pcRdCost->getUseRenModel(); 1837 uiSad = m_pcRdCost->getDistVS(pcCU, uiPartOffset, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, bSad, 0 ); 1838 } 1839 else 1840 #endif 1841 { 1842 uiSad = (Dist) m_pcRdCost->calcHAD( piOrg, uiStride, piPred, uiStride, uiWidth, uiHeight ); 1843 } 1844 1895 if ( m_pcRdCost->getUseVSO() ) 1896 { 1897 #if SAIT_VSO_EST_A0033 1898 if ( m_pcRdCost->getUseEstimatedVSD() ) 1899 { 1900 TComPicYuv* pcVirRec = m_pcRdCost->getVideoRecPicYuv(); 1901 TComPicYuv* pcVirOrg = m_pcRdCost->getDepthPicYuv(); 1902 1903 uiSad = (Dist) ( m_pcRdCost->getDistPart( piPred, uiStride, piOrg, uiStride, pcVirRec->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()+uiPartOffset), pcVirOrg->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()+uiPartOffset), pcVirRec->getStride(), uiWidth, uiHeight ) ); 1904 } 1905 else 1906 #endif 1907 { 1908 Bool bSad = !m_pcRdCost->getUseRenModel(); 1909 uiSad = m_pcRdCost->getDistVS(pcCU, uiPartOffset, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, bSad, 0 ); 1910 } 1911 1912 } 1913 else 1914 #endif 1915 { 1916 uiSad = (Dist) m_pcRdCost->calcHAD( piOrg, uiStride, piPred, uiStride, uiWidth, uiHeight ); 1917 } 1918 1845 1919 UInt iModeBits = xModeBitsIntra( pcCU, uiMode, uiPU, uiPartOffset, uiDepth, uiInitTrDepth ); 1846 1920 1847 Double dLambda;1921 Double dLambda; 1848 1922 #if HHI_VSO 1849 if ( m_pcRdCost->getUseLambdaScaleVSO() ) 1850 { 1851 dLambda = m_pcRdCost->getUseRenModel() ? m_pcRdCost->getLambdaVSO() : m_pcRdCost->getSqrtLambdaVSO(); 1852 //GT: Sad is SSE for VSO4 1853 } 1854 else 1855 { 1923 if ( m_pcRdCost->getUseLambdaScaleVSO() ) 1924 { 1925 dLambda = m_pcRdCost->getUseRenModel() ? m_pcRdCost->getLambdaVSO() : m_pcRdCost->getSqrtLambdaVSO(); 1926 //GT: Sad is SSE for VSO4 1927 } 1928 else 1929 { 1930 dLambda = m_pcRdCost->getSqrtLambda(); 1931 } 1932 #else 1856 1933 dLambda = m_pcRdCost->getSqrtLambda(); 1857 } 1858 #else 1859 dLambda = m_pcRdCost->getSqrtLambda(); 1860 #endif 1861 1862 Double cost = (Double)uiSad + (Double)iModeBits * dLambda; 1863 1934 #endif 1935 1936 Double cost = (Double)uiSad + (Double)iModeBits * dLambda; 1937 1864 1938 CandNum += xUpdateCandList( uiMode, cost, numModesForFullRD, uiRdModeList, CandCostList ); 1865 1939 1866 1940 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 1867 1941 if( bTestDmm ) bTestDmm = uiSad ? true : false; 1942 #endif 1943 #if LGE_EDGE_INTRA 1944 if ( bTestEdgeIntra ) bTestEdgeIntra = uiSad ? true : false; 1868 1945 #endif 1869 1946 } … … 1974 2051 } 1975 2052 #endif 2053 #if LGE_EDGE_INTRA 2054 if( bTestEdgeIntra ) 2055 { 2056 uiRdModeList[ numModesForFullRD++ ] = EDGE_INTRA_IDX; 2057 #if LGE_EDGE_INTRA_DELTA_DC 2058 uiRdModeList[ numModesForFullRD++ ] = EDGE_INTRA_DELTA_IDX; 2059 #endif 2060 } 2061 #endif 1976 2062 1977 2063 //===== check modes (using r-d costs) ===== … … 1987 2073 for( UInt uiMode = 0; uiMode < numModesForFullRD; uiMode++ ) 1988 2074 { 2075 #if LG_ZEROINTRADEPTHRESI_M26039 2076 Bool bAllowZeroResi = pcCU->getSlice()->getIsDepth() && (pcCU->getSlice()->getPOC()%pcCU->getPic()->getIntraPeriod());// && (uiMode < NUM_INTRA_MODE); 2077 for(UInt uiCnt = 0; uiCnt < (bAllowZeroResi ? 2 : 1); uiCnt++) 2078 { 2079 Bool bZeroResi = uiCnt ? true : false; 2080 #endif 1989 2081 // set luma prediction mode 1990 2082 UInt uiOrgMode = uiRdModeList[uiMode]; 1991 2083 1992 2084 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 1993 if( m_pcEncCfg->getIsDepth() && !predIntraLumaDMMAvailable( uiOrgMode, uiWidth, uiHeight ) ) 2085 if( m_pcEncCfg->getIsDepth() && !predIntraLumaDMMAvailable( uiOrgMode, uiWidth, uiHeight ) 2086 #if LGE_EDGE_INTRA 2087 && uiOrgMode < EDGE_INTRA_IDX 2088 #endif 2089 ) 1994 2090 { 1995 2091 continue; … … 2020 2116 2021 2117 #if HHI_RQT_INTRA_SPEEDUP 2118 #if LG_ZEROINTRADEPTHRESI_M26039 2119 xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, true, dPUCost, bZeroResi ); 2120 #else 2022 2121 xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, true, dPUCost ); 2122 #endif 2023 2123 #else 2024 2124 xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, dPUCost ); … … 2052 2152 dSecondBestPUCost = dPUCost; 2053 2153 } 2154 #endif 2155 #if LG_ZEROINTRADEPTHRESI_M26039 2156 } 2054 2157 #endif 2055 2158 } // Mode loop … … 2579 2682 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx ); 2580 2683 #if LG_RESTRICTEDRESPRED_M24766 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2684 Int iAddResiShift; 2685 UInt uiPartAddr; 2686 Int iRoiWidth, iRoiHeight; 2687 2688 pcCU->getPartIndexAndSize( iPUIdx, uiPartAddr, iRoiWidth, iRoiHeight ); 2689 iAddResiShift = pcCU->getResiPredMode(uiPartAddr); 2690 iAddResiShift = (pcCU->getSlice()->getPPS()->getUseWP() || pcCU->getInterDir(uiPartAddr) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1 - iAddResiShift : -1); 2691 2692 if( pcCU->getResPredFlag( 0 )) 2693 { // subtract residual prediction from original in motion search 2694 if(iLastAddResiShift != iAddResiShift) 2695 { 2696 //add subtracted residual last time 2697 if(iLastAddResiShift >= 0) 2698 { 2699 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iLastAddResiShift; 2700 pcYuvOrg->add(iPUResiPredShift, ePartSize, rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 )); 2701 } 2702 //subtract residual 2703 if(iAddResiShift >= 0) 2704 { 2705 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iAddResiShift; 2706 pcYuvOrg->add(iPUResiPredShift, ePartSize, rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ), true ); 2707 } 2708 iLastAddResiShift = iAddResiShift; 2709 } 2710 } 2608 2711 #endif 2609 2712 xGetInterPredictionError( pcCU, pcYuvOrg, iPUIdx, uiCostCand, m_pcEncCfg->getUseHADME() ); … … 2631 2734 if( pcCU->getResPredFlag( 0 ) && iLastAddResiShift >= 0) 2632 2735 { 2633 2634 2736 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iLastAddResiShift; 2737 pcYuvOrg->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 )); 2635 2738 } 2636 2739 #endif … … 2755 2858 UInt uiBitsTempL0[MAX_NUM_REF]; 2756 2859 #if LG_RESTRICTEDRESPRED_M24766 2757 2860 Int iPUResiPredShift[4] = {0, 0, 0, 0}; 2758 2861 #endif 2759 2862 xGetBlkBits( ePartSize, pcCU->getSlice()->isInterP(), iPartIdx, uiLastMode, uiMbBits); … … 2773 2876 #endif 2774 2877 #if LG_RESTRICTEDRESPRED_M24766 2775 2878 Bool bLastResiFlag = false; 2776 2879 #endif 2777 2880 // Uni-directional prediction … … 2783 2886 { 2784 2887 #if LG_RESTRICTEDRESPRED_M24766 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2888 if( pcCU->getResPredFlag( 0 )) 2889 { 2890 if(pcCU->getSlice()->getViewId() == pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdxTemp)) 2891 { // subtract residual prediction from original in motion search 2892 if(!bLastResiFlag) 2893 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ), true ); 2894 bLastResiFlag = true; 2895 } 2896 else 2897 { 2898 if(bLastResiFlag) 2899 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 )); 2900 bLastResiFlag = false; 2901 } 2902 } 2800 2903 #endif 2801 2904 uiBitsTemp = uiMbBits[iRefList]; … … 2963 3066 } 2964 3067 #if LG_RESTRICTEDRESPRED_M24766 2965 2966 2967 2968 3068 if( pcCU->getResPredFlag( 0 ) && bLastResiFlag) 3069 { // subtract residual prediction from original in motion search 3070 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 )); 3071 } 2969 3072 #endif 2970 3073 // Bi-directional prediction … … 2972 3075 { 2973 3076 #if LG_RESTRICTEDRESPRED_M24766 2974 3077 Int iLastAddResiShift = -1000; 2975 3078 #endif 2976 3079 cMvBi[0] = cMv[0]; cMvBi[1] = cMv[1]; … … 3077 3180 #endif 3078 3181 #if LG_RESTRICTEDRESPRED_M24766 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3182 Int iAddResiShift = -1, iPredFrom = 0; 3183 Int iBestRefIdx = pcCU->getCUMvField(eRefPicList == REF_PIC_LIST_0 ? REF_PIC_LIST_1 : REF_PIC_LIST_0)->getRefIdx(uiPartAddr); 3184 3185 iPredFrom = iBestRefIdx >= 0 ? 3 : 1; 3186 if(iBestRefIdx >= 0 && pcCU->getSlice()->getViewId() == pcCU->getSlice()->getRefViewId(eRefPicList == REF_PIC_LIST_0 ? REF_PIC_LIST_1 : REF_PIC_LIST_0, iBestRefIdx)) 3187 iAddResiShift++; 3188 if(pcCU->getSlice()->getViewId() == pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdxTemp)) 3189 iAddResiShift++; 3190 iAddResiShift = (pcCU->getSlice()->getPPS()->getUseWP() || iPredFrom != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1); 3191 3192 if( pcCU->getResPredFlag( 0 ) ) 3193 { 3194 if(iLastAddResiShift != iAddResiShift) 3195 { 3196 //add substracted residual last time 3197 if(iLastAddResiShift >= 0 ) 3198 { 3199 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iLastAddResiShift; 3200 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 )); 3201 } 3202 //substract residual 3203 if(iAddResiShift >= 0) 3204 { 3205 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iAddResiShift; 3206 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ), true ); 3207 } 3208 iLastAddResiShift = iAddResiShift; 3209 } 3210 } 3108 3211 #endif 3109 3212 // call ME … … 3162 3265 } // for loop-iter 3163 3266 #if LG_RESTRICTEDRESPRED_M24766 3164 3165 3166 3167 3168 3267 if( pcCU->getResPredFlag( 0 ) && iLastAddResiShift >= 0) 3268 { 3269 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iLastAddResiShift; 3270 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 )); 3271 } 3169 3272 #endif 3170 3273 } // if (B_SLICE) … … 3375 3478 { 3376 3479 #if LG_RESTRICTEDRESPRED_M24766 3377 3378 3379 3380 3381 3382 3383 3480 Int iAddResiShift = pcCU->getResiPredMode(uiPartAddr); 3481 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = \ 3482 (pcCU->getSlice()->getPPS()->getUseWP() || pcCU->getInterDir(uiPartAddr) != 3)? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1); 3483 if(pcCU->getResPredFlag(0) && iAddResiShift >= 0) 3484 { 3485 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ), true); 3486 } 3384 3487 #endif 3385 3488 xGetInterPredictionError( pcCU, pcOrgYuv, iPartIdx, uiMEError, m_pcEncCfg->getUseHADME() ); 3386 3489 uiMECost = uiMEError + m_pcRdCost->getCost( uiMEBits ); 3387 3490 #if LG_RESTRICTEDRESPRED_M24766 3388 3389 3390 3391 3491 if(pcCU->getResPredFlag(0) && iAddResiShift >= 0) 3492 { 3493 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 )); 3494 } 3392 3495 #endif 3393 3496 } … … 3871 3974 else 3872 3975 { 3873 #if HHI_FIX3874 3976 rcMv = ( m_pcRdCost->useMultiviewReg() ? m_pcRdCost->getMultiviewOrgMvPred() : *pcMvPred ); 3875 #else3876 rcMv = *pcMvPred;3877 #endif3878 3977 xPatternSearchFast ( pcCU, pcPatternKey, piRefY, iRefStride, &cMvSrchRngLT, &cMvSrchRngRB, rcMv, ruiCost ); 3879 3978 } … … 3977 4076 uiSad += m_pcRdCost->getCost( x, y ); 3978 4077 3979 #if HHI_FIX3980 4078 // regularization cost 3981 4079 if( m_pcRdCost->useMultiviewReg() ) … … 3983 4081 uiSad += m_pcRdCost->getMultiviewRegCost( x, y ); 3984 4082 } 3985 #endif3986 4083 3987 4084 if ( uiSad < uiSadBest ) … … 4281 4378 { 4282 4379 #if LG_RESTRICTEDRESPRED_M24766 4283 4284 4380 pcCU->getPUResiPredShift(iPUResiPredShift, 0); 4381 rpcYuvRec->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcYuvResPrd, uiWidth, uiHeight ); 4285 4382 #else 4286 4383 rpcYuvRec->add( rpcYuvResPrd, uiWidth, uiHeight ); … … 4294 4391 { 4295 4392 uiDistortion = m_pcRdCost->getDistVS( pcCU, 0, rpcYuvRec->getLumaAddr(), rpcYuvRec->getStride(), pcYuvOrg->getLumaAddr(), pcYuvOrg->getStride(), uiWidth, uiHeight , false, 0 ); 4296 4393 } 4297 4394 else 4298 4395 { … … 4349 4446 pcCU->setTrIdxSubParts( 0, 0, pcCU->getDepth(0) ); 4350 4447 4448 4351 4449 #if HHI_VSO // necessary? 4352 4450 // set Model 4451 #if SAIT_VSO_EST_A0033 4452 if( !m_pcRdCost->getUseEstimatedVSD()&& m_pcRdCost->getUseRenModel() ) 4453 #else 4353 4454 if( m_pcRdCost->getUseRenModel() ) 4455 #endif 4354 4456 { 4355 4457 Pel* piSrc = rpcYuvRec->getLumaAddr(); … … 4395 4497 { 4396 4498 #if LG_RESTRICTEDRESPRED_M24766 4397 4398 4499 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = 0; 4500 rpcYuvResi->subtract(iPUResiPredShift, pcCU->getPartitionSize(0), pcYuvOrg, pcYuvPred, 0, uiWidth ); 4399 4501 #else 4400 4502 rpcYuvResi->subtract( pcYuvOrg, pcYuvPred, 0, uiWidth ); … … 4405 4507 { 4406 4508 #if LG_RESTRICTEDRESPRED_M24766 4407 4408 4509 pcCU->getPUResiPredShift(iPUResiPredShift, 0); 4510 rpcYuvResi->subtract(iPUResiPredShift, pcCU->getPartitionSize(0), rpcYuvResi, rpcYuvResPrd, 0, uiWidth ); 4409 4511 #else 4410 4512 rpcYuvResi->subtract( rpcYuvResi, rpcYuvResPrd, 0, uiWidth ); … … 4579 4681 } 4580 4682 4683 4581 4684 #if HHI_VSO 4582 // GT: reset Model, only fordQP necessary?? 4685 #if SAIT_VSO_EST_A0033 4686 if( m_pcRdCost->getUseRenModel() && !m_pcRdCost->getUseEstimatedVSD() ) 4687 #else 4583 4688 if( m_pcRdCost->getUseRenModel() ) 4689 #endif 4584 4690 { 4585 4691 Pel* piSrc = pcYuvOrg->getLumaAddr(); … … 4624 4730 pcYuvPred->copyToPartYuv( rpcYuvRec, 0 ); 4625 4731 #if LG_RESTRICTEDRESPRED_M24766 4626 4627 4628 4732 pcCU->getPUResiPredShift(iPUResiPredShift, 0); 4733 rpcYuvRec->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcYuvResPrd, uiWidth, uiHeight ); 4734 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = 0; 4629 4735 rpcYuvRec->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcYuvResiBest, uiWidth, uiHeight ); 4630 4736 #else … … 4685 4791 4686 4792 // set Model 4793 4687 4794 #if HHI_VSO // necessary?? 4795 #if SAIT_VSO_EST_A0033 4796 if( m_pcRdCost->getUseRenModel() && !m_pcRdCost->getUseEstimatedVSD() ) 4797 #else 4688 4798 if( m_pcRdCost->getUseRenModel() ) 4799 #endif 4689 4800 { 4690 4801 Pel* piSrc = rpcYuvRec->getLumaAddr(); … … 4693 4804 } 4694 4805 #endif 4695 4696 4806 } 4697 4807 … … 4869 4979 if ( m_pcRdCost->getUseVSO() ) 4870 4980 { 4871 uiDistY = m_pcRdCost->getDistVS ( pcCU, uiAbsPartIdx, pcPred->getLumaAddr( uiAbsPartIdx ), pcPred->getStride(), pcOrg->getLumaAddr( uiAbsPartIdx), pcOrg->getStride(), 1<< uiLog2TrSize, 1<< uiLog2TrSize, false, 0 ); // initialized with zero residual distortion 4981 #if SAIT_VSO_EST_A0033 4982 if( m_pcRdCost->getUseEstimatedVSD() ) 4983 { 4984 TComPicYuv* pcVirRec = m_pcRdCost->getVideoRecPicYuv(); 4985 TComPicYuv* pcVirOrg = m_pcRdCost->getDepthPicYuv(); 4986 uiDistY = m_pcRdCost->getDistPart( m_pTempPel, 1<< uiLog2TrSize, pcResi->getLumaAddr( uiAbsPartIdx ), pcResi->getStride(), pcVirRec->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()+uiAbsPartIdx), pcVirOrg->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()+uiAbsPartIdx), pcVirRec->getStride(), 1<< uiLog2TrSize, 1<< uiLog2TrSize ); 4987 } 4988 else 4989 #endif 4990 { 4991 uiDistY = m_pcRdCost->getDistVS ( pcCU, uiAbsPartIdx, pcPred->getLumaAddr( uiAbsPartIdx ), pcPred->getStride(), pcOrg->getLumaAddr( uiAbsPartIdx), pcOrg->getStride(), 1<< uiLog2TrSize, 1<< uiLog2TrSize, false, 0 ); // initialized with zero residual distortion 4992 } 4872 4993 } 4873 4994 else … … 4880 5001 #endif 4881 5002 } 4882 4883 5003 4884 5004 if ( puiZeroDist ) … … 4909 5029 if ( m_pcRdCost->getUseVSO() ) 4910 5030 { 4911 static int iCount = 1; 4912 iCount++; 4913 m_cYuvRecTemp.addClipPartLuma( &m_pcQTTempTComYuv[uiQTTempAccessLayer], pcPred, uiAbsPartIdx, 1<< uiLog2TrSize ); 4914 uiNonzeroDistY = m_pcRdCost->getDistVS( pcCU, uiAbsPartIdx, m_cYuvRecTemp.getLumaAddr(uiAbsPartIdx), m_cYuvRecTemp.getStride(), 4915 pcOrg->getLumaAddr( uiAbsPartIdx ), pcOrg->getStride(), 1<< uiLog2TrSize, 1<< uiLog2TrSize, false, 0 ); 5031 #if SAIT_VSO_EST_A0033 5032 if ( m_pcRdCost->getUseEstimatedVSD() ) 5033 { 5034 TComPicYuv* pcVirRec = m_pcRdCost->getVideoRecPicYuv(); 5035 TComPicYuv* pcVirOrg = m_pcRdCost->getDepthPicYuv(); 5036 uiNonzeroDistY = m_pcRdCost->getDistPart( m_pcQTTempTComYuv[uiQTTempAccessLayer].getLumaAddr( uiAbsPartIdx ), m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(), pcResi->getLumaAddr( uiAbsPartIdx ), pcResi->getStride(), pcVirRec->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU()+uiAbsPartIdx ), pcVirOrg->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU()+uiAbsPartIdx ), pcVirRec->getStride(), 1<< uiLog2TrSize, 1<< uiLog2TrSize ); 5037 } 5038 else 5039 #endif 5040 { 5041 m_cYuvRecTemp.addClipPartLuma( &m_pcQTTempTComYuv[uiQTTempAccessLayer], pcPred, uiAbsPartIdx, 1<< uiLog2TrSize ); 5042 uiNonzeroDistY = m_pcRdCost->getDistVS( pcCU, uiAbsPartIdx, m_cYuvRecTemp.getLumaAddr(uiAbsPartIdx), m_cYuvRecTemp.getStride(), 5043 pcOrg->getLumaAddr( uiAbsPartIdx ), pcOrg->getStride(), 1<< uiLog2TrSize, 1<< uiLog2TrSize, false, 0 ); 5044 } 4916 5045 } 4917 5046 else … … 5307 5436 } 5308 5437 5438 5309 5439 #if HHI_VSO 5440 #if SAIT_VSO_EST_A0033 5441 if( m_pcRdCost->getUseRenModel() && !m_pcRdCost->getUseEstimatedVSD() ) 5442 #else 5310 5443 if ( m_pcRdCost->getUseRenModel() ) //Only done if not split ( see return above ) 5444 #endif 5311 5445 { 5312 5446 UInt uiWidth = 1<< uiLog2TrSize; … … 5977 6111 5978 6112 assignWedgeDCs2Pred( pcWedgelet, piPredic, uiStride, iTestDC1, iTestDC2 ); 5979 5980 Dist uiActDist = m_pcRdCost->getDistVS( pcCU, 0, piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false, 0 ); 6113 6114 Dist uiActDist = RDO_DIST_MAX; 6115 #if SAIT_VSO_EST_A0033 6116 if ( m_pcRdCost->getUseEstimatedVSD() ) 6117 { 6118 TComPicYuv* pcVirRec = m_pcRdCost->getVideoRecPicYuv(); 6119 TComPicYuv* pcVirOrg = m_pcRdCost->getDepthPicYuv(); 6120 uiActDist = m_pcRdCost->getDistPart( piPredic, uiStride, piOrig, uiStride, pcVirRec->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()), pcVirOrg->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()), pcVirRec->getStride(), uiWidth, uiHeight ); 6121 } 6122 else 6123 #else 6124 { 6125 uiActDist = m_pcRdCost->getDistVS( pcCU, 0, piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false, 0 ); 6126 } 6127 #endif 6128 5981 6129 if( uiActDist < uiBestDist || uiBestDist == RDO_DIST_MAX ) 5982 6130 { … … 6078 6226 if( m_pcRdCost->getUseVSO() ) 6079 6227 { 6080 uiActDist = m_pcRdCost->getDistVS( pcCU, 0, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, 0 ); 6228 #if SAIT_VSO_EST_A0033 6229 if ( m_pcRdCost->getUseEstimatedVSD() ) 6230 { 6231 TComPicYuv* pcVirRec = m_pcRdCost->getVideoRecPicYuv(); 6232 TComPicYuv* pcVirOrg = m_pcRdCost->getDepthPicYuv(); 6233 uiActDist = m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, pcVirRec->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()), pcVirOrg->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()), pcVirRec->getStride(), uiWidth, uiHeight ); 6234 } 6235 else 6236 #endif 6237 { 6238 uiActDist = m_pcRdCost->getDistVS( pcCU, 0, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, 0 ); 6239 } 6081 6240 } 6082 6241 else … … 6133 6292 if( m_pcRdCost->getUseVSO() ) 6134 6293 { 6135 uiActDist = m_pcRdCost->getDistVS( pcCU, 0, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, 0 ); 6294 #if SAIT_VSO_EST_A0033 6295 if ( m_pcRdCost->getUseEstimatedVSD() ) 6296 { 6297 TComPicYuv* pcVirRec = m_pcRdCost->getVideoRecPicYuv(); 6298 TComPicYuv* pcVirOrg = m_pcRdCost->getDepthPicYuv(); 6299 uiActDist = m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, pcVirRec->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()+uiAbsPtIdx), pcVirOrg->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()+uiAbsPtIdx), pcVirRec->getStride(), uiWidth, uiHeight ); 6300 } 6301 else 6302 #endif 6303 { 6304 uiActDist = m_pcRdCost->getDistVS( pcCU, 0, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, 0 ); 6305 } 6136 6306 } 6137 6307 else … … 6207 6377 } 6208 6378 #endif 6379 6380 #if LGE_EDGE_INTRA 6381 Bool TEncSearch::xCheckTerminatedEdge( Bool* pbEdge, Int iX, Int iY, Int iWidth, Int iHeight ) 6382 { 6383 if( (iY % 2) == 0 ) // vertical edge 6384 { 6385 Bool bTopConnected = false; 6386 Bool bBottomConnected = false; 6387 6388 if( iY != 0 ) 6389 { 6390 if( pbEdge[ iX + (iY - 2) * 2 * iWidth ] ) 6391 bTopConnected = true; 6392 if( pbEdge[ (iX - 1) + (iY - 1) * 2 * iWidth ] ) 6393 bTopConnected = true; 6394 if( pbEdge[ (iX + 1) + (iY - 1) * 2 * iWidth ] ) 6395 bTopConnected = true; 6396 } 6397 else 6398 { 6399 bTopConnected = true; 6400 } 6401 6402 6403 if( iY != 2 * iHeight - 2 ) 6404 { 6405 if( pbEdge[ iX + (iY + 2) * 2 * iWidth ] ) 6406 bBottomConnected = true; 6407 if( pbEdge[ (iX - 1) + (iY + 1) * 2 * iWidth ] ) 6408 bBottomConnected = true; 6409 if( pbEdge[ (iX + 1) + (iY + 1) * 2 * iWidth ] ) 6410 bBottomConnected = true; 6411 } 6412 else 6413 { 6414 bBottomConnected = true; 6415 } 6416 6417 6418 if( bTopConnected && bBottomConnected ) 6419 { 6420 return true; 6421 } 6422 else 6423 { 6424 return false; 6425 } 6426 } 6427 else 6428 { 6429 Bool bLeftConnected = false; 6430 Bool bRightConnected = false; 6431 6432 if( iX != 0 ) 6433 { 6434 if( pbEdge[ (iX - 2) + iY * 2 * iWidth ] ) 6435 bLeftConnected = true; 6436 if( pbEdge[ (iX - 1) + (iY - 1) * 2 * iWidth ] ) 6437 bLeftConnected = true; 6438 if( pbEdge[ (iX - 1) + (iY + 1) * 2 * iWidth ] ) 6439 bLeftConnected = true; 6440 } 6441 else 6442 { 6443 bLeftConnected = true; 6444 } 6445 6446 if( iX != 2 * iWidth - 2 ) 6447 { 6448 if( pbEdge[ (iX + 2) + iY * 2 * iWidth ] ) 6449 bRightConnected = true; 6450 if( pbEdge[ (iX + 1) + (iY - 1) * 2 * iWidth ] ) 6451 bRightConnected = true; 6452 if( pbEdge[ (iX + 1) + (iY + 1) * 2 * iWidth ] ) 6453 bRightConnected = true; 6454 } 6455 else 6456 { 6457 bRightConnected = true; 6458 } 6459 6460 6461 if( bLeftConnected && bRightConnected ) 6462 { 6463 return true; 6464 } 6465 else 6466 { 6467 return false; 6468 } 6469 } 6470 } 6471 6472 #if LGE_EDGE_INTRA_PIXEL_DIFFERENCE 6473 Bool TEncSearch::xEdgePartition( TComDataCU* pcCU, UInt uiPartIdx, Bool bPU4x4 ) 6474 { 6475 Pel* pcOrgY = pcCU->getPic()->getPicYuvOrg()->getLumaAddr(pcCU->getAddr()); 6476 UInt uiStride = pcCU->getPic()->getPicYuvOrg()->getStride(); 6477 Int iWidth = pcCU->getWidth(uiPartIdx) >> (bPU4x4 ? 1 : 0); 6478 Int iHeight = pcCU->getHeight(uiPartIdx) >> (bPU4x4 ? 1 : 0); 6479 Bool* pbEdge = (Bool*) xMalloc( Bool, iWidth * iHeight * 4 ); 6480 6481 { 6482 UInt uiOffsetX = 0; 6483 UInt uiOffsetY = 0; 6484 UInt uiAbsPartIdx = pcCU->getZorderIdxInCU() + uiPartIdx; 6485 6486 uiOffsetX = (uiAbsPartIdx & 0x1) | 6487 ((uiAbsPartIdx & 0x4) >> 1) | 6488 ((uiAbsPartIdx & 0x10) >> 2) | 6489 ((uiAbsPartIdx & 0x40) >> 3); 6490 uiOffsetY = ((uiAbsPartIdx & 0x2) >> 1) | 6491 ((uiAbsPartIdx & 0x8) >> 2) | 6492 ((uiAbsPartIdx & 0x20) >> 3) | 6493 ((uiAbsPartIdx & 0x80) >> 4); 6494 uiOffsetX *= 4; 6495 uiOffsetY *= 4; 6496 pcOrgY += (uiOffsetX + uiOffsetY * uiStride); 6497 6498 } 6499 6500 Short* psDiffX = new Short[ iWidth * iHeight ]; 6501 Short* psDiffY = new Short[ iWidth * iHeight ]; 6502 Bool* pbEdgeX = new Bool [ iWidth * iHeight ]; 6503 Bool* pbEdgeY = new Bool [ iWidth * iHeight ]; 6504 6505 // Find Horizontal Gradient & Edge Detection ((x+1, y) - (x,y)) 6506 for( Int y=0; y<iHeight; y++ ) 6507 { 6508 Short* psDiffXPtr = &psDiffX[ y * iHeight ]; 6509 Bool* pbEdgeXPtr = &pbEdgeX[ y * iHeight ]; 6510 for(Int x=0; x<iWidth-1; x++ ) 6511 { 6512 *psDiffXPtr = pcOrgY[ x+1 + y*uiStride ] - pcOrgY[ x + y*uiStride ]; 6513 if(*psDiffXPtr >= LGE_EDGE_INTRA_THRESHOLD || *psDiffXPtr <= (-1)*LGE_EDGE_INTRA_THRESHOLD) 6514 { 6515 *pbEdgeXPtr = true; 6516 } 6517 else 6518 { 6519 *pbEdgeXPtr = false; 6520 } 6521 6522 psDiffXPtr++; 6523 pbEdgeXPtr++; 6524 } 6525 } 6526 6527 // Find Vertical Gradient & Edge Detection((x,y+1) - (x,y)) 6528 for( Int y=0; y<iHeight-1; y++ ) 6529 { 6530 Short* psDiffYPtr = &psDiffY[ y * iHeight ]; 6531 Bool* pbEdgeYPtr = &pbEdgeY[ y * iHeight ]; 6532 for(Int x=0; x<iWidth; x++ ) 6533 { 6534 *psDiffYPtr = pcOrgY[ x + (y+1)*uiStride ] - pcOrgY [ x + y*uiStride ]; 6535 if(*psDiffYPtr >= LGE_EDGE_INTRA_THRESHOLD || *psDiffYPtr <= (-1)*LGE_EDGE_INTRA_THRESHOLD) 6536 { 6537 *pbEdgeYPtr = true; 6538 } 6539 else 6540 { 6541 *pbEdgeYPtr = false; 6542 } 6543 6544 psDiffYPtr++; 6545 pbEdgeYPtr++; 6546 } 6547 } 6548 6549 // Eliminate local maximum 6550 for( Int y=0; y<iHeight; y++ ) 6551 { 6552 Short* psDiffXPtr = &psDiffX[ y * iHeight ]; 6553 Bool* pbEdgeXPtr = &pbEdgeX[ y * iHeight ]; 6554 for( Int x=0; x<iWidth-1; x++ ) 6555 { 6556 UShort usAbs0=0, usAbs1=0, usAbs2=0; // 0 : left, 1 : current, 2 : right 6557 6558 if( x > 0 && *(pbEdgeXPtr-1) == true ) 6559 { 6560 if( *(psDiffXPtr-1) >= 0) 6561 { 6562 usAbs0 = *(psDiffXPtr-1); 6563 6564 } 6565 else 6566 { 6567 usAbs0 = (-1) * *(psDiffXPtr-1); 6568 } 6569 } 6570 if( *pbEdgeXPtr == true ) 6571 { 6572 if( *(psDiffXPtr) >= 0) 6573 { 6574 usAbs1 = *(psDiffXPtr); 6575 } 6576 else 6577 { 6578 usAbs1 = (-1) * *(psDiffXPtr); 6579 } 6580 } 6581 if( x < iWidth-2 && *(pbEdgeXPtr+1) == true ) 6582 { 6583 if( *(psDiffXPtr+1) >= 0) 6584 { 6585 usAbs2 = *(psDiffXPtr+1); 6586 //bSign2 = true; 6587 } 6588 else 6589 { 6590 usAbs2 = (-1) * *(psDiffXPtr+1); 6591 } 6592 } 6593 6594 if( x == 0 ) 6595 { 6596 if( usAbs1 < usAbs2 ) 6597 { 6598 *pbEdgeXPtr = false; 6599 } 6600 } 6601 else if( x == iWidth-2 ) 6602 { 6603 if( usAbs1 <= usAbs0 ) 6604 *pbEdgeXPtr = false; 6605 } 6606 else 6607 { 6608 if( usAbs2 > usAbs0 ) 6609 { 6610 if( usAbs1 < usAbs2 ) 6611 *pbEdgeXPtr = false; 6612 } 6613 else 6614 { 6615 if( usAbs1 <= usAbs0 ) 6616 *pbEdgeXPtr = false; 6617 } 6618 } 6619 6620 psDiffXPtr++; 6621 pbEdgeXPtr++; 6622 } 6623 } 6624 6625 for( Int y=0; y<iHeight-1; y++ ) 6626 { 6627 Short* psDiffYPtr = &psDiffY[ y * iWidth ]; 6628 Bool* pbEdgeYPtr = &pbEdgeY[ y * iWidth ]; 6629 for( Int x=0; x<iWidth; x++ ) 6630 { 6631 UShort usAbs0=0, usAbs1=0, usAbs2=0; // 0 : upper, 1 : current, 2 : bottom 6632 if( y > 0 && *(pbEdgeYPtr-iWidth) == true ) 6633 { 6634 if( *(psDiffYPtr-iWidth) >= 0) 6635 { 6636 usAbs0 = *(psDiffYPtr-iWidth); 6637 } 6638 else 6639 { 6640 usAbs0 = (-1) * *(psDiffYPtr-iWidth); 6641 } 6642 } 6643 if( *pbEdgeYPtr == true ) 6644 { 6645 if( *(psDiffYPtr) >= 0) 6646 { 6647 usAbs1 = *(psDiffYPtr); 6648 } 6649 else 6650 { 6651 usAbs1 = (-1) * *(psDiffYPtr); 6652 } 6653 } 6654 if( y < iHeight-2 && *(pbEdgeYPtr+iWidth) == true ) 6655 { 6656 if( *(psDiffYPtr+iWidth) >= 0) 6657 { 6658 usAbs2 = *(psDiffYPtr+iWidth); 6659 } 6660 else 6661 { 6662 usAbs2 = (-1) * *(psDiffYPtr+iWidth); 6663 } 6664 } 6665 6666 if( y == 0 ) 6667 { 6668 if( usAbs1 < usAbs2 ) 6669 *pbEdgeYPtr = false; 6670 } 6671 else if( y == iHeight-2 ) 6672 { 6673 if( usAbs1 <= usAbs0 ) 6674 *pbEdgeYPtr = false; 6675 } 6676 else 6677 { 6678 if( usAbs2 > usAbs0 ) 6679 { 6680 if( usAbs1 < usAbs2 ) 6681 *pbEdgeYPtr = false; 6682 } 6683 else 6684 { 6685 if( usAbs1 <= usAbs0 ) 6686 *pbEdgeYPtr = false; 6687 } 6688 } 6689 6690 psDiffYPtr++; 6691 pbEdgeYPtr++; 6692 } 6693 } 6694 6695 // Edge Merging 6696 for( Int i=0; i< 4 * iWidth * iHeight; i++ ) 6697 pbEdge[ i ] = false; 6698 /// Even Line (0,2,4,6,...) => Vertical Edge 6699 for( Int i=0; i<iHeight; i++) 6700 { 6701 for( Int j=0; j<iWidth-1; j++) 6702 { 6703 pbEdge[ (2 * j + 1) + (2 * i) * 2 * iWidth ] = pbEdgeX[ j + i * iHeight ]; 6704 } 6705 } 6706 /// Odd Line (1,3,5,7,...) => Horizontal Edge 6707 for( Int i=0; i<iHeight-1; i++) 6708 { 6709 for( Int j=0; j<iWidth; j++) 6710 { 6711 pbEdge[ (2 * j) + (2 * i + 1) * 2 * iWidth ] = pbEdgeY[ j + i * iHeight ]; 6712 } 6713 } 6714 6715 // Intersection Filling 6716 /// Vertical Edge between Horizontal Edges 6717 for( Int i = 1; i < 2 * iHeight - 3; i += 2) 6718 { 6719 for( Int j = 0; j < 2 * iWidth - 1; j += 2) 6720 { 6721 if( pbEdge[ j + i * 2 * iWidth ] ) 6722 { 6723 if( j != 0 && pbEdge[ (j - 2) + ((i + 2) * 2 * iWidth) ] ) 6724 { 6725 if( !pbEdge[ (j - 1) + ((i - 1) * 2 * iWidth) ] && !pbEdge[ (j - 1) + ((i + 3) * 2 * iWidth) ] ) 6726 pbEdge[ (j - 1) + ((i + 1) * 2 * iWidth) ] = true; 6727 } 6728 if( j != 2 * iWidth - 2 && pbEdge[ (j + 2) + ((i + 2) * 2 * iWidth) ] ) 6729 { 6730 if( !pbEdge[ (j + 1) + ((i - 1) * 2 * iWidth) ] && !pbEdge[ (j + 1) + ((i + 3) * 2 * iWidth) ] ) 6731 pbEdge[ (j + 1) + ((i + 1) * 2 * iWidth) ] = true; 6732 } 6733 } 6734 } 6735 } 6736 /// Horizontal Edge between Vertical Edges 6737 for( Int j = 1; j < 2 * iWidth - 3; j += 2) 6738 { 6739 for( Int i = 0; i < 2 * iHeight - 1; i += 2) 6740 { 6741 if( pbEdge[ j + i * 2 * iWidth ] ) 6742 { 6743 if( i != 0 && pbEdge[ (j + 2) + ((i - 2) * 2 * iWidth) ] ) 6744 { 6745 if( !pbEdge[ (j - 1) + ((i - 1) * 2 * iWidth) ] && !pbEdge[ (j + 3) + ((i - 1) * 2 * iWidth) ] ) 6746 pbEdge[ (j + 1) + ((i - 1) * 2 * iWidth) ] = true; 6747 } 6748 if( i != 2 * iHeight - 2 && pbEdge[ (j + 2) + ((i + 2) * 2 * iWidth) ] ) 6749 { 6750 if( !pbEdge[ (j - 1) + ((i + 1) * 2 * iWidth) ] && !pbEdge[ (j + 3) + ((i + 1) * 2 * iWidth) ] ) 6751 pbEdge[ (j + 1) + ((i + 1) * 2 * iWidth) ] = true; 6752 } 6753 } 6754 } 6755 } 6756 6757 // Static Pruning Unnecessary Edges 6758 /// Step1. Stack push the unconnected edges 6759 UShort* pusUnconnectedEdgeStack = new UShort[ 4 * iWidth * iHeight ]; // approximate size calculation 6760 Int iUnconnectedEdgeStackPtr = 0; 6761 //// Vertical Edges 6762 for( Int i = 0; i < 2 * iHeight - 1; i += 2 ) 6763 { 6764 for( Int j = 1; j < 2 * iWidth - 2; j += 2 ) 6765 { 6766 if( pbEdge[ j + i * 2 * iWidth ] ) 6767 { 6768 if( !xCheckTerminatedEdge( pbEdge, j, i, iWidth, iHeight ) ) 6769 { 6770 pusUnconnectedEdgeStack[iUnconnectedEdgeStackPtr] = (i << 8) | (j); 6771 iUnconnectedEdgeStackPtr++; 6772 } 6773 } 6774 } 6775 } 6776 6777 //// Horizontal Edges 6778 for( Int i = 1; i < 2 * iHeight - 2; i += 2 ) 6779 { 6780 for( Int j = 0; j < 2 * iWidth - 1; j += 2 ) 6781 { 6782 if( pbEdge[ j + i * 2 * iWidth ] ) 6783 { 6784 if( !xCheckTerminatedEdge( pbEdge, j, i, iWidth, iHeight ) ) 6785 { 6786 pusUnconnectedEdgeStack[iUnconnectedEdgeStackPtr] = (i << 8) | (j); 6787 iUnconnectedEdgeStackPtr++; 6788 } 6789 } 6790 } 6791 } 6792 6793 /// Step2. Remove the edges from the stack and push the new unconnected edges 6794 //// (This step may contain duplicated edges already in the stack) 6795 //// (But it doesn't cause any functional problems) 6796 while( iUnconnectedEdgeStackPtr != 0 ) 6797 { 6798 iUnconnectedEdgeStackPtr--; 6799 Int iX = pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] & 0xff; 6800 Int iY = pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] >> 8; 6801 6802 pbEdge[ iX + iY * 2 * iWidth ] = false; 6803 6804 if( iY % 2 == 1 && iX > 0 && pbEdge[ iX - 2 + iY * 2 * iWidth ] && 6805 !xCheckTerminatedEdge( pbEdge, iX - 2, iY, iWidth, iHeight ) ) // left 6806 { 6807 pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY + 0) << 8) | (iX - 2); 6808 iUnconnectedEdgeStackPtr++; 6809 } 6810 if( iY % 2 == 1 && iX < 2 * iWidth - 2 && pbEdge[ iX + 2 + iY * 2 * iWidth ] && 6811 !xCheckTerminatedEdge( pbEdge, iX + 2, iY, iWidth, iHeight ) ) // right 6812 { 6813 pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY + 0) << 8) | (iX + 2); 6814 iUnconnectedEdgeStackPtr++; 6815 } 6816 if( iY % 2 == 0 && iY > 0 && pbEdge[ iX + (iY - 2) * 2 * iWidth ] && 6817 !xCheckTerminatedEdge( pbEdge, iX, iY - 2, iWidth, iHeight ) ) // top 6818 { 6819 pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY - 2) << 8) | (iX + 0); 6820 iUnconnectedEdgeStackPtr++; 6821 } 6822 if( iY % 2 == 0 && iY < 2 * iHeight - 2 && pbEdge[ iX + (iY + 2) * 2 * iWidth ] && 6823 !xCheckTerminatedEdge( pbEdge, iX, iY + 2, iWidth, iHeight ) ) // bottom 6824 { 6825 pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY + 2) << 8) | (iX + 0); 6826 iUnconnectedEdgeStackPtr++; 6827 } 6828 if( iX > 0 && iY > 0 && pbEdge[ iX - 1 + (iY - 1) * 2 * iWidth ] && 6829 !xCheckTerminatedEdge( pbEdge, iX - 1, iY - 1, iWidth, iHeight ) ) // left-top 6830 { 6831 pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY - 1) << 8) | (iX - 1); 6832 iUnconnectedEdgeStackPtr++; 6833 } 6834 if( iX < 2 * iWidth - 1 && iY > 0 && pbEdge[ iX + 1 + (iY - 1) * 2 * iWidth ] && 6835 !xCheckTerminatedEdge( pbEdge, iX + 1, iY - 1, iWidth, iHeight ) ) // right-top 6836 { 6837 pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY - 1) << 8) | (iX + 1); 6838 iUnconnectedEdgeStackPtr++; 6839 } 6840 if( iX > 0 && iY < 2 * iHeight - 1 && pbEdge[ iX - 1 + (iY + 1) * 2 * iWidth ] && 6841 !xCheckTerminatedEdge( pbEdge, iX - 1, iY + 1, iWidth, iHeight ) ) // left-bottom 6842 { 6843 pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY + 1) << 8) | (iX - 1); 6844 iUnconnectedEdgeStackPtr++; 6845 } 6846 if( iX < 2 * iWidth - 1 && iY < 2 * iHeight - 1 && pbEdge[ iX + 1 + (iY + 1) * 2 * iWidth ] && 6847 !xCheckTerminatedEdge( pbEdge, iX + 1, iY + 1, iWidth, iHeight ) ) // right-bottom 6848 { 6849 pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY + 1) << 8) | (iX + 1); 6850 iUnconnectedEdgeStackPtr++; 6851 } 6852 } 6853 6854 6855 // Region Generation ( edge -> region ) 6856 Bool* pbRegion = pcCU->getEdgePartition( uiPartIdx ); 6857 Bool* pbVisit = new Bool[ iWidth * iHeight ]; 6858 6859 for( UInt ui = 0; ui < iWidth * iHeight; ui++ ) 6860 { 6861 pbRegion[ ui ] = true; // fill it as region 1 (we'll discover region 0 next) 6862 pbVisit [ ui ] = false; 6863 } 6864 6865 Int* piStack = new Int[ iWidth * iHeight ]; 6866 6867 Int iPtr = 0; 6868 6869 piStack[iPtr++] = (0 << 8) | (0); 6870 pbRegion[ 0 ] = false; 6871 6872 while(iPtr > 0) 6873 { 6874 Int iTmp = piStack[--iPtr]; 6875 Int iX1, iY1; 6876 iX1 = iTmp & 0xff; 6877 iY1 = (iTmp >> 8) & 0xff; 6878 6879 pbVisit[ iX1 + iY1 * iWidth ] = true; 6880 6881 assert( iX1 >= 0 && iX1 < iWidth ); 6882 assert( iY1 >= 0 && iY1 < iHeight ); 6883 6884 if( iX1 > 0 && !pbEdge[ 2 * iX1 - 1 + 4 * iY1 * iWidth ] && !pbVisit[ iX1 - 1 + iY1 * iWidth ] ) 6885 { 6886 piStack[iPtr++] = (iY1 << 8) | (iX1 - 1); 6887 pbRegion[ iX1 - 1 + iY1 * iWidth ] = false; 6888 } 6889 if( iX1 < iWidth - 1 && !pbEdge[ 2 * iX1 + 1 + 4 * iY1 * iWidth ] && !pbVisit[ iX1 + 1 + iY1 * iWidth ] ) 6890 { 6891 piStack[iPtr++] = (iY1 << 8) | (iX1 + 1); 6892 pbRegion[ iX1 + 1 + iY1 * iWidth ] = false; 6893 } 6894 if( iY1 > 0 && !pbEdge[ 2 * iX1 + 2 * (2 * iY1 - 1) * iWidth ] && !pbVisit[ iX1 + (iY1 - 1) * iWidth ] ) 6895 { 6896 piStack[iPtr++] = ((iY1 - 1) << 8) | iX1; 6897 pbRegion[ iX1 + (iY1 - 1) * iWidth ] = false; 6898 } 6899 if( iY1 < iHeight - 1 && !pbEdge[ 2 * iX1 + 2 * (2 * iY1 + 1) * iWidth ] && !pbVisit[ iX1 + (iY1 + 1) * iWidth ] ) 6900 { 6901 piStack[iPtr++] = ((iY1 + 1) << 8) | iX1; 6902 pbRegion[ iX1 + (iY1 + 1) * iWidth ] = false; 6903 } 6904 } 6905 6906 /////////// 6907 iPtr = 0; 6908 for( Int i = 0; i < iWidth * iHeight; i++ ) 6909 pbVisit[ i ] = false; 6910 piStack[ iPtr++ ] = (0 << 8) | (0); // initial seed 6911 while( iPtr > 0 && iPtr < iWidth * iHeight ) 6912 { 6913 Int iX; 6914 Int iY; 6915 iPtr--; 6916 iX = piStack[ iPtr ] & 0xff; 6917 iY = piStack[ iPtr ] >> 8; 6918 pbVisit[ iY * iWidth + iX ] = true; 6919 6920 if( iY > 0 && !pbVisit[ (iY - 1) * iWidth + iX ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ (iY - 1) * iWidth + iX ] ) 6921 { 6922 piStack[ iPtr++ ] = ((iY - 1) << 8) | iX; 6923 } 6924 if( iY < iHeight - 1 && !pbVisit[ (iY + 1) * iWidth + iX ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ (iY + 1) * iWidth + iX ] ) 6925 { 6926 piStack[ iPtr++ ] = ((iY + 1) << 8) | iX; 6927 } 6928 if( iX > 0 && !pbVisit[ iY * iWidth + (iX - 1) ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ iY * iWidth + (iX - 1) ] ) 6929 { 6930 piStack[ iPtr++ ] = (iY << 8) | (iX - 1); 6931 } 6932 if( iX < iWidth - 1 && !pbVisit[ iY * iWidth + (iX + 1) ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ iY * iWidth + (iX + 1) ] ) 6933 { 6934 piStack[ iPtr++ ] = (iY << 8) | (iX + 1); 6935 } 6936 } 6937 assert( iPtr == 0 || iPtr == iWidth * iHeight ); 6938 6939 Bool bBipartition; 6940 if( iPtr == iWidth * iHeight ) 6941 { 6942 bBipartition = false; // single partition 6943 } 6944 else 6945 { 6946 for( Int i = 0; i < iWidth * iHeight; i++ ) 6947 { 6948 if( !pbVisit[ i ] ) 6949 { 6950 piStack[ iPtr++ ] = (( i / iWidth ) << 8) | ( i % iWidth ); 6951 pbVisit[ i ] = true; 6952 break; 6953 } 6954 } 6955 while( iPtr > 0 ) 6956 { 6957 Int iX; 6958 Int iY; 6959 iPtr--; 6960 iX = piStack[ iPtr ] & 0xff; 6961 iY = piStack[ iPtr ] >> 8; 6962 pbVisit[ iY * iWidth + iX ] = true; 6963 6964 if( iY > 0 && !pbVisit[ (iY - 1) * iWidth + iX ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ (iY - 1) * iWidth + iX ] ) 6965 { 6966 piStack[ iPtr++ ] = ((iY - 1) << 8) | iX; 6967 } 6968 if( iY < iHeight - 1 && !pbVisit[ (iY + 1) * iWidth + iX ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ (iY + 1) * iWidth + iX ] ) 6969 { 6970 piStack[ iPtr++ ] = ((iY + 1) << 8) | iX; 6971 } 6972 if( iX > 0 && !pbVisit[ iY * iWidth + (iX - 1) ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ iY * iWidth + (iX - 1) ] ) 6973 { 6974 piStack[ iPtr++ ] = (iY << 8) | (iX - 1); 6975 } 6976 if( iX < iWidth - 1 && !pbVisit[ iY * iWidth + (iX + 1) ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ iY * iWidth + (iX + 1) ] ) 6977 { 6978 piStack[ iPtr++ ] = (iY << 8) | (iX + 1); 6979 } 6980 } 6981 bBipartition = true; 6982 for( Int i = 0; i < iWidth * iHeight; i++ ) 6983 { 6984 if( !pbVisit[ i ] ) 6985 { 6986 bBipartition = false; 6987 break; 6988 } 6989 } 6990 } 6991 6992 xFree( pbEdge ); 6993 delete[] pbEdgeX; pbEdgeX = NULL; 6994 delete[] pbEdgeY; pbEdgeY = NULL; 6995 delete[] psDiffX; psDiffX = NULL; 6996 delete[] psDiffY; psDiffY = NULL; 6997 delete[] pusUnconnectedEdgeStack; pusUnconnectedEdgeStack = NULL; 6998 delete[] pbVisit; pbVisit = NULL; 6999 delete[] piStack; piStack = NULL; 7000 7001 Bool bCheckPossibleChain; 7002 7003 if( bBipartition ) 7004 bCheckPossibleChain = xConstructChainCode( pcCU, uiPartIdx, bPU4x4 ); 7005 else 7006 bCheckPossibleChain = false; 7007 7008 return bCheckPossibleChain; 7009 } 7010 7011 #endif 7012 7013 Bool TEncSearch::xConstructChainCode( TComDataCU* pcCU, UInt uiPartIdx, Bool bPU4x4 ) 7014 { 7015 UInt uiWidth = pcCU->getWidth( uiPartIdx ) >> (bPU4x4 ? 1 : 0); 7016 UInt uiHeight = pcCU->getHeight( uiPartIdx ) >> (bPU4x4 ? 1 : 0); 7017 Bool* pbEdge = (Bool*) xMalloc( Bool, uiWidth * uiHeight * 4 ); 7018 Bool* pbVisit = (Bool*) xMalloc( Bool, uiWidth * uiHeight * 4 ); 7019 UInt uiMaxEdge = uiWidth * (LGE_EDGE_INTRA_MAX_EDGE_NUM_PER_4x4 / 4); 7020 Bool* pbRegion = pcCU->getEdgePartition( uiPartIdx ); 7021 UChar* piEdgeCode = pcCU->getEdgeCode( uiPartIdx ); 7022 Bool bStartLeft = false; 7023 Bool bPossible = false; 7024 Bool bFinish = false; 7025 Int iStartPosition = -1; 7026 Int iPtr = 0; 7027 Int iDir = -1, iNextDir = -1; 7028 Int iArrow = -1, iNextArrow = -1; 7029 Int iX = -1, iY = -1; 7030 Int iDiffX = 0, iDiffY = 0; 7031 UChar iCode = 255; 7032 UInt uiWidth2 = uiWidth * 2; 7033 7034 for( Int i = 0; i < uiWidth * uiHeight * 4; i++ ) 7035 pbEdge[ i ] = false; 7036 7037 for( Int i = 0; i < uiHeight; i++ ) 7038 { 7039 for( Int j = 0; j < uiWidth - 1; j++ ) 7040 { 7041 if( pbRegion[ i * uiWidth + j ] != pbRegion[ i * uiWidth + j + 1 ] ) 7042 pbEdge[ i * uiWidth * 4 + j * 2 + 1 ] = true; 7043 } 7044 } 7045 7046 for( Int i = 0; i < uiHeight - 1; i++ ) 7047 { 7048 for( Int j = 0; j < uiWidth; j++ ) 7049 { 7050 if( pbRegion[ (i + 0) * uiWidth + j ] != pbRegion[ (i + 1) * uiWidth + j ] ) 7051 pbEdge[ (2 * i + 1) * 2 * uiWidth + j * 2 ] = true; 7052 } 7053 } 7054 7055 for( Int i = 1; i < uiWidth2 - 2; i+=2 ) 7056 { 7057 if(pbEdge[ i ]) 7058 { 7059 bPossible = true; 7060 bStartLeft = false; 7061 iStartPosition = iX = i; 7062 iY = 0; 7063 iDir = 3; 7064 iArrow = 3; 7065 break; 7066 } 7067 } 7068 7069 if( !bPossible ) 7070 { 7071 for( Int i = 1; i < uiWidth2 - 2; i+=2 ) 7072 { 7073 if(pbEdge[ i * uiWidth2 ]) 7074 { 7075 bPossible = true; 7076 bStartLeft = true; 7077 iX = 0; 7078 iStartPosition = iY = i; 7079 iDir = 1; 7080 iArrow = 1; 7081 break; 7082 } 7083 } 7084 } 7085 7086 if( bPossible ) 7087 { 7088 for( Int i = 0; i < 4 * uiWidth * uiHeight; i++ ) 7089 pbVisit[ i ] = false; 7090 7091 while( !bFinish ) 7092 { 7093 Bool bArrowSkip = false; 7094 pbVisit[ iX + iY * uiWidth2 ] = true; 7095 7096 switch( iDir ) 7097 { 7098 case 0: // left 7099 if( iX > 0 && !pbVisit[ (iX - 2) + iY * uiWidth2 ] && pbEdge[ (iX - 2) + iY * uiWidth2 ] ) // left 7100 { 7101 iDiffX = -2; 7102 iDiffY = 0; 7103 iNextDir = 0; 7104 iNextArrow = 0; 7105 } 7106 else if( iX > 0 && !pbVisit[ (iX - 1) + (iY - 1) * uiWidth2 ] && pbEdge[ (iX - 1) + (iY - 1) * uiWidth2 ] ) // top 7107 { 7108 iDiffX = -1; 7109 iDiffY = -1; 7110 iNextDir = 2; 7111 iNextArrow = 4; 7112 } 7113 else if( iX > 0 && !pbVisit[ (iX - 1) + (iY + 1) * uiWidth2 ] && pbEdge[ (iX - 1) + (iY + 1) * uiWidth2 ] ) // bottom 7114 { 7115 iDiffX = -1; 7116 iDiffY = +1; 7117 iNextDir = 3; 7118 iNextArrow = iArrow; 7119 if( !(iPtr == 0 && iX == uiWidth2 - 2 && iY == uiHeight * 2 - 3) ) 7120 bArrowSkip = true; 7121 else 7122 iNextArrow = 3; 7123 } 7124 else if( iX == 0 ) 7125 { 7126 iDiffX = 0; 7127 iDiffY = 0; 7128 iNextDir = iDir; 7129 iNextArrow = iArrow; 7130 bFinish = true; 7131 continue; 7132 } 7133 else 7134 { 7135 iPtr = 0; // edge loop or unwanted case 7136 bFinish = true; 7137 //continue; 7138 assert(false); 7139 } 7140 break; 7141 case 1: // right 7142 if( iX < uiWidth2 - 2 && !pbVisit[ (iX + 2) + iY * uiWidth2 ] && pbEdge[ (iX + 2) + iY * uiWidth2 ] ) // right 7143 { 7144 iDiffX = +2; 7145 iDiffY = 0; 7146 iNextDir = 1; 7147 iNextArrow = 1; 7148 } 7149 else if( iX < uiWidth2 - 2 && !pbVisit[ (iX + 1) + (iY - 1) * uiWidth2 ] && pbEdge[ (iX + 1) + (iY - 1) * uiWidth2 ] ) // top 7150 { 7151 iDiffX = +1; 7152 iDiffY = -1; 7153 iNextDir = 2; 7154 iNextArrow = iArrow; 7155 if( !(iPtr == 0 && iX == 0 && iY == 1) ) 7156 bArrowSkip = true; 7157 else 7158 iNextArrow = 2; 7159 } 7160 else if( iX < uiWidth2 - 2 && !pbVisit[ (iX + 1) + (iY + 1) * uiWidth2 ] && pbEdge[ (iX + 1) + (iY + 1) * uiWidth2 ] ) // bottom 7161 { 7162 iDiffX = +1; 7163 iDiffY = +1; 7164 iNextDir = 3; 7165 iNextArrow = 7; 7166 } 7167 else if( iX == uiWidth2 - 2 ) 7168 { 7169 iDiffX = 0; 7170 iDiffY = 0; 7171 iNextDir = iDir; 7172 iNextArrow = iArrow; 7173 bFinish = true; 7174 continue; 7175 } 7176 else 7177 { 7178 iPtr = 0; // edge loop or unwanted case 7179 bFinish = true; 7180 //continue; 7181 assert(false); 7182 } 7183 break; 7184 case 2: // top 7185 if( iY > 0 && !pbVisit[ (iX - 1) + (iY - 1) * uiWidth2 ] && pbEdge[ (iX - 1) + (iY - 1) * uiWidth2 ] ) // left 7186 { 7187 iDiffX = -1; 7188 iDiffY = -1; 7189 iNextDir = 0; 7190 iNextArrow = iArrow; 7191 if( !(iPtr == 0 && iX == 1 && iY == uiHeight * 2 - 2) ) 7192 bArrowSkip = true; 7193 else 7194 iNextArrow = 0; 7195 } 7196 else if( iY > 0 && !pbVisit[ (iX + 1) + (iY - 1) * uiWidth2 ] && pbEdge[ (iX + 1) + (iY - 1) * uiWidth2 ] ) // right 7197 { 7198 iDiffX = +1; 7199 iDiffY = -1; 7200 iNextDir = 1; 7201 iNextArrow = 5; 7202 } 7203 else if( iY > 0 && !pbVisit[ iX + (iY - 2) * uiWidth2 ] && pbEdge[ iX + (iY - 2) * uiWidth2 ] ) // top 7204 { 7205 iDiffX = 0; 7206 iDiffY = -2; 7207 iNextDir = 2; 7208 iNextArrow = 2; 7209 } 7210 else if( iY == 0 ) 7211 { 7212 iDiffX = 0; 7213 iDiffY = 0; 7214 iNextDir = iDir; 7215 iNextArrow = iArrow; 7216 bFinish = true; 7217 continue; 7218 } 7219 else 7220 { 7221 iPtr = 0; // edge loop or unwanted case 7222 bFinish = true; 7223 //continue; 7224 assert(false); 7225 } 7226 break; 7227 case 3: // bottom 7228 if( iY < uiWidth2 - 2 && !pbVisit[ (iX - 1) + (iY + 1) * uiWidth2 ] && pbEdge[ (iX - 1) + (iY + 1) * uiWidth2 ] ) // left 7229 { 7230 iDiffX = -1; 7231 iDiffY = +1; 7232 iNextDir = 0; 7233 iNextArrow = 6; 7234 } 7235 else if( iY < uiWidth2 - 2 && !pbVisit[ (iX + 1) + (iY + 1) * uiWidth2 ] && pbEdge[ (iX + 1) + (iY + 1) * uiWidth2 ] ) // right 7236 { 7237 iDiffX = +1; 7238 iDiffY = +1; 7239 iNextDir = 1; 7240 iNextArrow = iArrow; 7241 if( !(iPtr == 0 && iX == uiWidth * 2 - 3 && iY == 0) ) 7242 bArrowSkip = true; 7243 else 7244 iNextArrow = 1; 7245 } 7246 else if( iY < uiWidth2 - 2 && !pbVisit[ iX + (iY + 2) * uiWidth2 ] && pbEdge[ iX + (iY + 2) * uiWidth2 ] ) // bottom 7247 { 7248 iDiffX = 0; 7249 iDiffY = +2; 7250 iNextDir = 3; 7251 iNextArrow = 3; 7252 } 7253 else if( iY == uiWidth2 - 2 ) 7254 { 7255 iDiffX = 0; 7256 iDiffY = 0; 7257 iNextDir = iDir; 7258 iNextArrow = iArrow; 7259 bFinish = true; 7260 continue; 7261 } 7262 else 7263 { 7264 iPtr = 0; // edge loop or unwanted case 7265 bFinish = true; 7266 //continue; 7267 assert(false); 7268 } 7269 break; 7270 } 7271 7272 const UChar tableCode[8][8] = { { 0, -1, 4, 3, 2, 6, 1, 5 }, // iArrow(current direction), iNextArrow(next direction) 7273 { -1, 0, 3, 4, 5, 1, 6, 2 }, 7274 { 3, 4, 0, -1, 1, 2, 5, 6 }, 7275 { 4, 3, -1, 0, 6, 5, 2, 1 }, 7276 { 1, 6, 2, 5, 0, 4, 3, -1 }, 7277 { 5, 2, 1, 6, 3, 0, -1, 4 }, 7278 { 2, 5, 6, 1, 4, -1, 0, 3 }, 7279 { 6, 1, 5, 2, -1, 3, 4, 0 } }; 7280 7281 iCode = tableCode[iArrow][iNextArrow]; 7282 7283 if(iPtr >= uiMaxEdge) 7284 { 7285 iPtr = 0; // over the maximum number of edge 7286 bPossible = false; 7287 break; 7288 } 7289 7290 if( !bArrowSkip ) 7291 { 7292 piEdgeCode[iPtr++] = iCode; // first edge coding 7293 //printf("xEdgeCoding: (%d,%d)->(%d,%d) code %d\n",iX,iY, iX+iDiffX, iY+iDiffY, iCode); 7294 } 7295 7296 iX += iDiffX; 7297 iY += iDiffY; 7298 iDir = iNextDir; 7299 iArrow = iNextArrow; 7300 } 7301 } 7302 7303 pcCU->setEdgeLeftFirst( uiPartIdx, bStartLeft ); 7304 pcCU->setEdgeStartPos ( uiPartIdx, bStartLeft ? (iStartPosition - 1) >> 1 : (iStartPosition + 1) >> 1); 7305 pcCU->setEdgeNumber ( uiPartIdx, iPtr ); 7306 7307 xFree( pbEdge ); 7308 xFree( pbVisit ); 7309 7310 return (iPtr != 0); 7311 } 7312 7313 #if LGE_EDGE_INTRA_DELTA_DC 7314 Void TEncSearch::xAssignEdgeIntraDeltaDCs( TComDataCU* pcCU, 7315 UInt uiAbsPartIdx, 7316 Pel* piOrig, 7317 UInt uiStride, 7318 Pel* piPredic, 7319 UInt uiWidth, 7320 UInt uiHeight ) 7321 { 7322 Int iDC0 = 0; 7323 Int iDC1 = 0; 7324 Int iPredDC0 = 0; 7325 Int iPredDC1 = 0; 7326 Int iDeltaDC0 = 0; 7327 Int iDeltaDC1 = 0; 7328 7329 Bool* pbRegion = pcCU->getEdgePartition( uiAbsPartIdx ); 7330 7331 Int* piMask = pcCU->getPattern()->getAdiOrgBuf( uiWidth, uiHeight, m_piYuvExt ); 7332 Int iMaskStride = ( uiWidth<<1 ) + 1; 7333 7334 // DC Calculation 7335 { 7336 UInt uiSum0 = 0; 7337 UInt uiSum1 = 0; 7338 UInt uiCount0 = 0; 7339 UInt uiCount1 = 0; 7340 7341 Pel* piTemp = piOrig; 7342 for( UInt ui = 0; ui < uiHeight; ui++ ) 7343 { 7344 for( UInt uii = 0; uii < uiWidth; uii++ ) 7345 { 7346 if( pbRegion[ ui * uiWidth + uii ] == false ) 7347 { 7348 uiSum0 += (piTemp[ uii ]); 7349 uiCount0++; 7350 } 7351 else 7352 { 7353 uiSum1 += (piTemp[ uii ]); 7354 uiCount1++; 7355 } 7356 } 7357 piTemp += uiStride; 7358 } 7359 if( uiCount0 == 0 ) 7360 assert(false); 7361 if( uiCount1 == 0 ) 7362 assert(false); 7363 iDC0 = uiSum0 / uiCount0; // TODO : integer op. 7364 iDC1 = uiSum1 / uiCount1; 7365 } 7366 7367 // PredDC Calculation 7368 { 7369 UInt uiSum0 = 0; 7370 UInt uiSum1 = 0; 7371 UInt uiCount0 = 0; 7372 UInt uiCount1 = 0; 7373 7374 for( UInt ui = 0; ui < uiWidth; ui++ ) 7375 { 7376 if( pbRegion[ ui ] == false ) 7377 { 7378 uiSum0 += (piMask[ ui + 1 ]); 7379 uiCount0++; 7380 } 7381 else 7382 { 7383 uiSum1 += (piMask[ ui + 1 ]); 7384 uiCount1++; 7385 } 7386 } 7387 for( UInt ui = 0; ui < uiHeight; ui++ ) // (0,0) recount (to avoid division) 7388 { 7389 if( pbRegion[ ui * uiWidth ] == false ) 7390 { 7391 uiSum0 += (piMask[ (ui + 1) * iMaskStride ]); 7392 uiCount0++; 7393 } 7394 else 7395 { 7396 uiSum1 += (piMask[ (ui + 1) * iMaskStride ]); 7397 uiCount1++; 7398 } 7399 } 7400 if( uiCount0 == 0 ) 7401 assert(false); 7402 if( uiCount1 == 0 ) 7403 assert(false); 7404 iPredDC0 = uiSum0 / uiCount0; // TODO : integer op. 7405 iPredDC1 = uiSum1 / uiCount1; 7406 } 7407 7408 iDeltaDC0 = iDC0 - iPredDC0; 7409 iDeltaDC1 = iDC1 - iPredDC1; 7410 7411 #if HHI_VSO 7412 if( m_pcRdCost->getUseVSO() ) 7413 { 7414 Int iFullDeltaDC0 = iDeltaDC0; 7415 Int iFullDeltaDC1 = iDeltaDC1; 7416 7417 xDeltaDCQuantScaleDown( pcCU, iFullDeltaDC0 ); 7418 xDeltaDCQuantScaleDown( pcCU, iFullDeltaDC1 ); 7419 7420 Dist uiBestDist = RDO_DIST_MAX; 7421 UInt uiBestQStepDC0 = 0; 7422 UInt uiBestQStepDC1 = 0; 7423 7424 UInt uiDeltaDC0Max = abs(iFullDeltaDC0); 7425 UInt uiDeltaDC1Max = abs(iFullDeltaDC1); 7426 7427 //VSO Level delta DC check range extension 7428 uiDeltaDC0Max += (uiDeltaDC0Max>>1); 7429 uiDeltaDC1Max += (uiDeltaDC1Max>>1); 7430 7431 for( UInt uiQStepDC0 = 1; uiQStepDC0 <= uiDeltaDC0Max; uiQStepDC0++ ) 7432 { 7433 Int iLevelDeltaDC0 = (Int)(uiQStepDC0) * (Int)(( iFullDeltaDC0 < 0 ) ? -1 : 1); 7434 xDeltaDCQuantScaleUp( pcCU, iLevelDeltaDC0 ); 7435 7436 Int iTestDC0 = Clip( iPredDC0 + iLevelDeltaDC0 ); 7437 for( UInt uiQStepDC1 = 1; uiQStepDC1 <= uiDeltaDC1Max; uiQStepDC1++ ) 7438 { 7439 Int iLevelDeltaDC1 = (Int)(uiQStepDC1) * (Int)(( iFullDeltaDC1 < 0 ) ? -1 : 1); 7440 xDeltaDCQuantScaleUp( pcCU, iLevelDeltaDC1 ); 7441 7442 Int iTestDC1 = Clip( iPredDC1 + iLevelDeltaDC1 ); 7443 7444 Pel* piTemp = piPredic; 7445 for( UInt ui = 0; ui < uiHeight; ui++ ) 7446 { 7447 for( UInt uii = 0; uii < uiWidth; uii++ ) 7448 { 7449 if( pbRegion[ ui * uiWidth + uii ] == false ) 7450 { 7451 piTemp[ uii ] = iTestDC0; 7452 } 7453 else 7454 { 7455 piTemp[ uii ] = iTestDC1; 7456 } 7457 } 7458 piTemp += uiStride; 7459 } 7460 7461 Dist uiActDist = m_pcRdCost->getDistVS( pcCU, 0, piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false, 0 ); 7462 if( uiActDist < uiBestDist || uiBestDist == RDO_DIST_MAX ) 7463 { 7464 uiBestDist = uiActDist; 7465 uiBestQStepDC0 = uiQStepDC0; 7466 uiBestQStepDC1 = uiQStepDC1; 7467 } 7468 } 7469 } 7470 7471 iFullDeltaDC0 = (Int)(uiBestQStepDC0) * (Int)(( iFullDeltaDC0 < 0 ) ? -1 : 1); 7472 iFullDeltaDC1 = (Int)(uiBestQStepDC1) * (Int)(( iFullDeltaDC1 < 0 ) ? -1 : 1); 7473 xDeltaDCQuantScaleUp( pcCU, iFullDeltaDC0 ); 7474 xDeltaDCQuantScaleUp( pcCU, iFullDeltaDC1 ); 7475 iDeltaDC0 = iFullDeltaDC0; 7476 iDeltaDC1 = iFullDeltaDC1; 7477 } 7478 #endif 7479 7480 xDeltaDCQuantScaleDown( pcCU, iDeltaDC0 ); 7481 xDeltaDCQuantScaleDown( pcCU, iDeltaDC1 ); 7482 7483 pcCU->setEdgeDeltaDC0( uiAbsPartIdx, iDeltaDC0 ); 7484 pcCU->setEdgeDeltaDC1( uiAbsPartIdx, iDeltaDC1 ); 7485 } 7486 #endif 7487 #endif 7488 6209 7489 //! \} -
trunk/source/Lib/TLibEncoder/TEncSearch.h
r77 r100 189 189 TComYuv* pcOrgYuv, 190 190 #if LG_RESTRICTEDRESPRED_M24766 191 TComYuv*rpcResiPredYuv,191 TComYuv* rpcResiPredYuv, 192 192 #endif 193 193 TComYuv*& rpcPredYuv, … … 259 259 TComYuv* pcPredYuv, 260 260 TComYuv* pcResiYuv, 261 Dist& ruiDist ); 261 Dist& ruiDist 262 #if LG_ZEROINTRADEPTHRESI_M26039 263 ,Bool bZeroResi = false 264 #endif 265 ); 262 266 Void xIntraCodingChromaBlk ( TComDataCU* pcCU, 263 267 UInt uiTrDepth, … … 278 282 Dist& ruiDistC, 279 283 #if HHI_RQT_INTRA_SPEEDUP 280 Bool bCheckFirst, 281 #endif 282 Double& dRDCost ); 284 Bool bCheckFirst, 285 #endif 286 Double& dRDCost 287 #if LG_ZEROINTRADEPTHRESI_M26039 288 ,Bool bZeroResi = false 289 #endif 290 ); 283 291 284 292 Void xSetIntraResultQT ( TComDataCU* pcCU, … … 321 329 Bool bLeftAvail ); 322 330 #endif 331 332 #if LGE_EDGE_INTRA 333 Bool xEdgePartition ( TComDataCU* pcCU, UInt uiPartIdx, Bool bPU4x4 ); 334 Bool xCheckTerminatedEdge ( Bool* pbEdge, Int iX, Int iY, Int iWidth, Int iHeight ); 335 Bool xConstructChainCode ( TComDataCU* pcCU, UInt uiPartIdx, Bool bPU4x4 ); 336 #if LGE_EDGE_INTRA_DELTA_DC 337 Void xAssignEdgeIntraDeltaDCs( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piOrig, UInt uiStride, Pel* piPredic, UInt uiWidth, UInt uiHeight ); 338 #endif 339 #endif 340 323 341 #if HHI_DMM_WEDGE_INTRA 324 342 Void findWedgeFullMinDist ( TComDataCU* pcCU, … … 444 462 TComYuv* pcYuvOrg, 445 463 #if LG_RESTRICTEDRESPRED_M24766 446 464 TComYuv* rpcResiPredYuv, 447 465 #endif 448 466 Int iPartIdx, -
trunk/source/Lib/TLibEncoder/TEncSlice.cpp
r77 r100 38 38 #include "TEncTop.h" 39 39 #include "TEncSlice.h" 40 #if HHI_VSO_SPEEDUP_A033 41 #include "../../App/TAppEncoder/TAppEncTop.h" 42 #endif 40 43 #include <math.h> 44 #if SAIT_VSO_EST_A0033 45 extern Double g_dDispCoeff; 46 #endif 41 47 42 48 //! \ingroup TLibEncoder … … 627 633 TComSlice* pcSlice = rpcPic->getSlice(getSliceIdx()); 628 634 xDetermineStartAndBoundingCUAddr ( uiStartCUAddr, uiBoundingCUAddr, rpcPic, false ); 635 #if LG_ZEROINTRADEPTHRESI_M26039 636 rpcPic->setIntraPeriod(this->m_pcCfg->getIntraPeriod()); 637 #endif 629 638 630 639 // initialize cost values … … 702 711 m_pcEntropyCoder->setMaxAlfCtrlDepth(0); //unnecessary 703 712 713 #if SAIT_VSO_EST_A0033 714 if( m_pcCfg->getUseVSO() ) 715 { 716 m_pcRdCost->setDisparityCoeff( g_dDispCoeff ); // Temp. code!!! 717 //printf( "Disp Coeff : %3.4f \n", m_pcRdCost->getDisparityCoeff() ); 718 719 Int frameWidth = m_pcCfg->getSourceWidth(); 720 Pel* pVideoRec = m_pcRdCost->getVideoRecPicYuv()->getLumaAddr(); 721 Int iVideoRecStride = m_pcRdCost->getVideoRecPicYuv()->getStride(); 722 723 Pel* pDepthOrg = m_pcRdCost->getDepthPicYuv()->getLumaAddr(); 724 Int iDepthOrgStride = m_pcRdCost->getDepthPicYuv()->getStride(); 725 726 for( Int y = 0 ; y < m_pcCfg->getSourceHeight() ; y++ ) 727 { 728 pVideoRec[-4] = pVideoRec[-3] = pVideoRec[-2] = pVideoRec[-1] = pVideoRec[0]; 729 pVideoRec[frameWidth+3] = pVideoRec[frameWidth+2] = pVideoRec[frameWidth+1] = pVideoRec[frameWidth] = pVideoRec[frameWidth-1]; 730 pDepthOrg[-4] = pDepthOrg[-3] = pDepthOrg[-2] = pDepthOrg[-1] = pDepthOrg[0]; 731 pDepthOrg[frameWidth+3] = pDepthOrg[frameWidth+2] = pDepthOrg[frameWidth+1] = pDepthOrg[frameWidth] = pDepthOrg[frameWidth-1]; 732 733 pVideoRec += iVideoRecStride; 734 pDepthOrg += iDepthOrgStride; 735 } 736 } 737 #endif 704 738 TEncTop* pcEncTop = (TEncTop*) m_pcCfg; 705 739 TEncSbac**** ppppcRDSbacCoders = pcEncTop->getRDSbacCoders(); … … 753 787 UInt uiTileLCUX = 0; 754 788 789 #if HHI_VSO_SPEEDUP_A033 790 Int iLastPosY = -1; 791 #endif 792 755 793 // for every CU in slice 756 794 UInt uiEncCUOrder; … … 763 801 TComDataCU*& pcCU = rpcPic->getCU( uiCUAddr ); 764 802 pcCU->initCU( rpcPic, uiCUAddr ); 803 804 #if HHI_VSO_SPEEDUP_A033 805 if ( m_pcRdCost->getUseRenModel() ) 806 { 807 // updated renderer model if necessary 808 Int iCurPosX; 809 Int iCurPosY; 810 pcCU->getPosInPic(0, iCurPosX, iCurPosY ); 811 if ( iCurPosY != iLastPosY ) 812 { 813 iLastPosY = iCurPosY; 814 815 m_pcGOPEncoder->getEncTop()->getEncTop()->setupRenModel( rpcPic->getCurrSlice()->getPOC() , rpcPic->getCurrSlice()->getSPS()->getViewId(), rpcPic->getCurrSlice()->getSPS()->isDepth() ? 1 : 0, iCurPosY ); 816 } 817 } 818 #endif 819 765 820 766 821 // inherit from TR if necessary, select substream to use. -
trunk/source/Lib/TLibEncoder/TEncTop.cpp
r77 r100 597 597 // mark it should be extended 598 598 rpcPic->getPicYuvRec()->setBorderExtension(false); 599 #if FIXES 600 rpcPic->getPicYuvOrg()->setBorderExtension(false); 601 #endif 599 602 } 600 603 … … 981 984 Void TEncTop::selectReferencePictureSet(TComSlice* slice, Int POCCurr, Int GOPid,TComList<TComPic*>& listPic ) 982 985 { 983 #if HHI_FIX984 986 if( slice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDV && POCCurr == 0 ) 985 #else986 if( slice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDV )987 #endif988 987 { 989 988 TComReferencePictureSet* rps = slice->getLocalRPS(); -
trunk/source/Lib/TLibExtractor/TExtrTop.cpp
r77 r100 56 56 { 57 57 #if VIDYO_VPS_INTEGRATION 58 58 //extraction now has to be done using layer_id 59 59 UInt uiLayerId = nalu.m_layerId; 60 60 #else -
trunk/source/Lib/TLibRenderer/TRenImage.cpp
r56 r100 106 106 } 107 107 108 #if HHI_VSO_SPEEDUP_A033 109 template<typename T> 110 Void TRenImage<T>::getDataAndStrides( T** pptData, Int* piStrides ) 111 { 112 for (UInt uiCurPlane = 0; uiCurPlane < m_uiNumberOfPlanes; uiCurPlane++ ) 113 { 114 piStrides[uiCurPlane] = m_apcPlanes[uiCurPlane]->getStride (); 115 pptData [uiCurPlane] = m_apcPlanes[uiCurPlane]->getPlaneData(); 116 } 117 } 118 119 120 template<typename T> 121 Void TRenImage<T>::getWidthAndHeight( Int* ppiWidths, Int* ppiHeights ) 122 { 123 for (UInt uiCurPlane = 0; uiCurPlane < m_uiNumberOfPlanes; uiCurPlane++ ) 124 { 125 ppiWidths [uiCurPlane] = m_apcPlanes[uiCurPlane]->getWidth (); 126 ppiHeights[uiCurPlane] = m_apcPlanes[uiCurPlane]->getHeight(); 127 } 128 } 129 #endif 130 108 131 template<typename T> 109 132 Void TRenImage<T>::allocatePlanes( UInt uiWidth, UInt uiHeight, UInt uiNumberOfFullPlanes, UInt uiNumberOfQuaterPlanes ) -
trunk/source/Lib/TLibRenderer/TRenImage.h
r56 r100 69 69 TRenImagePlane<T>** getPlanes() const; 70 70 71 #if HHI_VSO_SPEEDUP_A033 72 Void getDataAndStrides( T** pptData, Int* piStrides ); 73 Void getWidthAndHeight( Int* piWidths, Int* piHeights ); 74 #endif 75 71 76 UInt getNumberOfPlanes() const; 72 77 UInt getNumberOfQuaterPlanes() const; -
trunk/source/Lib/TLibRenderer/TRenModSetupStrParser.cpp
r56 r100 357 357 { 358 358 case 'E': 359 iBlendMode = -1;359 iBlendMode = BLEND_NONE; 360 360 break; 361 361 case 'I': 362 iBlendMode = 0;362 iBlendMode = BLEND_AVRG; 363 363 break; 364 364 case 'L': 365 iBlendMode = 1;365 iBlendMode = BLEND_LEFT; 366 366 break; 367 367 case 'R': 368 iBlendMode = 2;368 iBlendMode = BLEND_RIGHT; 369 369 break; 370 370 default: -
trunk/source/Lib/TLibRenderer/TRenModel.cpp
r56 r100 32 32 */ 33 33 34 35 36 34 #include "TRenImage.h" 37 35 #include "TRenFilter.h" … … 48 46 m_iShiftPrec = 0; 49 47 m_iHoleMargin = 1; 48 m_uiHorOff = -1; 49 #if LGE_VSO_EARLY_SKIP_A0093 50 m_bEarlySkip = false; 51 #endif 50 52 51 53 // Current Error Type /// … … 211 213 212 214 Void 215 #if LGE_VSO_EARLY_SKIP_A0093 216 TRenModel::create( Int iNumOfBaseViews, Int iNumOfModels, Int iWidth, Int iHeight, Int iShiftPrec, Int iHoleMargin, Bool bEarlySkip ) 217 #else 213 218 TRenModel::create( Int iNumOfBaseViews, Int iNumOfModels, Int iWidth, Int iHeight, Int iShiftPrec, Int iHoleMargin ) 219 #endif 214 220 { 215 221 m_iNumOfBaseViews = iNumOfBaseViews; … … 219 225 m_iShiftPrec = iShiftPrec; 220 226 m_iHoleMargin = iHoleMargin; 227 #if LGE_VSO_EARLY_SKIP_A0093 228 m_bEarlySkip = bEarlySkip; 229 #endif 230 221 231 222 232 // LUTs for sub pel shifting … … 231 241 232 242 TRenFilter::setSubPelShiftLUT( m_iShiftPrec, m_aaaiSubPelShiftLut[0], 0 ); 233 TRenFilter::setSubPelShiftLUT( m_iShiftPrec, m_aaaiSubPelShiftLut[1], -1);243 TRenFilter::setSubPelShiftLUT( m_iShiftPrec, m_aaaiSubPelShiftLut[1], 0 ); 234 244 235 245 m_iSampledWidth = iWidth << m_iShiftPrec; … … 268 278 for (Int iModelNum = 0; iModelNum < m_iNumOfRenModels; iModelNum++) 269 279 { 270 m_apcRenModels [iModelNum] = new TRenSingleModel();280 m_apcRenModels [iModelNum] = NULL; 271 281 } 272 282 … … 339 349 340 350 AOT( iMode == -1); 341 AOT( iModelNum < 0 || iModelNum > m_iNumOfRenModels ); 342 AOF( m_apcRenModels[iModelNum] ); 351 AOT( iModelNum < 0 || iModelNum > m_iNumOfRenModels ); 343 352 AOT( iLeftViewNum < -1 || iLeftViewNum > m_iNumOfBaseViews ); 344 353 AOT( iRightViewNum < -1 || iRightViewNum > m_iNumOfBaseViews ); … … 348 357 AOT( iBlendMode < -1 || iBlendMode > 2 ); 349 358 359 Bool bBitInc = (g_uiBitIncrement != 0); 360 361 AOT( m_apcRenModels[iModelNum] ); 362 363 if ( bBitInc ) 364 { 365 if ( iMode != 2 ) 366 { // No Blending 367 m_apcRenModels[iModelNum] = new TRenSingleModelC<BLEND_NONE, true>; 368 } 369 else 370 { 371 switch ( iBlendMode ) 372 { 373 case BLEND_AVRG: // average 374 m_apcRenModels[iModelNum] = new TRenSingleModelC<BLEND_AVRG, true>; 375 break; 376 case BLEND_LEFT: // left view is main view 377 m_apcRenModels[iModelNum] = new TRenSingleModelC<BLEND_LEFT, true>; 378 break; 379 case BLEND_RIGHT: // right view is main view 380 m_apcRenModels[iModelNum] = new TRenSingleModelC<BLEND_RIGHT, true>; 381 break; 382 default: 383 AOT(true); 384 break; 385 } 386 } 387 } 388 else 389 { 390 if ( iMode != 2 ) 391 { // No Blending 392 m_apcRenModels[iModelNum] = new TRenSingleModelC<BLEND_NONE, false>; 393 } 394 else 395 { 396 switch ( iBlendMode ) 397 { 398 case BLEND_AVRG: // average 399 m_apcRenModels[iModelNum] = new TRenSingleModelC<BLEND_AVRG, false>; 400 break; 401 case BLEND_LEFT: // left view is main view 402 m_apcRenModels[iModelNum] = new TRenSingleModelC<BLEND_LEFT, false>; 403 break; 404 case BLEND_RIGHT: // right view is main view 405 m_apcRenModels[iModelNum] = new TRenSingleModelC<BLEND_RIGHT, false>; 406 break; 407 default: 408 AOT(true); 409 break; 410 } 411 } 412 } 413 414 415 #if LGE_VSO_EARLY_SKIP_A0093 416 m_apcRenModels[iModelNum]->create( iMode ,m_iWidth, m_iHeight, m_iShiftPrec, m_aaaiSubPelShiftLut, m_iHoleMargin, bUseOrgRef, iBlendMode, m_bEarlySkip ); 417 #else 350 418 m_apcRenModels[iModelNum]->create( iMode ,m_iWidth, m_iHeight, m_iShiftPrec, m_aaaiSubPelShiftLut, m_iHoleMargin, bUseOrgRef, iBlendMode ); 419 #endif 351 420 352 421 if ( iLeftViewNum != -1 ) … … 361 430 } 362 431 363 364 432 Void 365 433 TRenModel::setBaseView( Int iViewNum, TComPicYuv* pcPicYuvVideoData, TComPicYuv* pcPicYuvDepthData, TComPicYuv* pcPicYuvOrgVideoData, TComPicYuv* pcPicYuvOrgDepthData ) 366 434 { 367 435 AOT( iViewNum < 0 || iViewNum > m_iNumOfBaseViews ); 368 AOF( pcPicYuvVideoData->getHeight() == m_iHeight|| pcPicYuvVideoData->getWidth() == m_iWidth );369 AOF( pcPicYuvDepthData->getHeight() == m_iHeight|| pcPicYuvDepthData->getWidth() == m_iWidth );436 AOF( pcPicYuvVideoData->getHeight() <= m_iHeight + m_uiHorOff || pcPicYuvVideoData->getWidth() == m_iWidth ); 437 AOF( pcPicYuvDepthData->getHeight() <= m_iHeight + m_uiHorOff || pcPicYuvDepthData->getWidth() == m_iWidth ); 370 438 371 439 pcPicYuvVideoData->extendPicBorder(); 372 TRenFilter::sampleHorUp ( m_iShiftPrec, pcPicYuvVideoData->getLumaAddr(), pcPicYuvVideoData->getStride() , m_iWidth, m_iHeight, m_aapiCurVideoPel[ iViewNum ][0], m_aaiCurVideoStrides[iViewNum][0] ); 373 TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvVideoData->getCbAddr() , pcPicYuvVideoData->getCStride(), m_iWidth >> 1, m_iHeight >> 1, m_aapiCurVideoPel[ iViewNum ][1], m_aaiCurVideoStrides[iViewNum][1] ); 374 TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvVideoData->getCrAddr() , pcPicYuvVideoData->getCStride(), m_iWidth >> 1, m_iHeight >> 1, m_aapiCurVideoPel[ iViewNum ][2], m_aaiCurVideoStrides[iViewNum][2] ); 375 TRenFilter::copy ( pcPicYuvDepthData->getLumaAddr(), pcPicYuvDepthData->getStride(), m_iWidth, m_iHeight, m_apiCurDepthPel [ iViewNum], m_aiCurDepthStrides [iViewNum] ); 440 441 442 443 444 TRenFilter::sampleHorUp ( m_iShiftPrec, pcPicYuvVideoData->getLumaAddr() + m_uiHorOff * pcPicYuvVideoData->getStride () , pcPicYuvVideoData->getStride() , m_iWidth, m_iHeight, m_aapiCurVideoPel[ iViewNum ][0], m_aaiCurVideoStrides[iViewNum][0] ); 445 TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvVideoData->getCbAddr() + (m_uiHorOff >> 1 ) * pcPicYuvVideoData->getCStride() , pcPicYuvVideoData->getCStride(), m_iWidth >> 1, m_iHeight >> 1, m_aapiCurVideoPel[ iViewNum ][1], m_aaiCurVideoStrides[iViewNum][1] ); 446 TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvVideoData->getCrAddr() + (m_uiHorOff >> 1 ) * pcPicYuvVideoData->getCStride() , pcPicYuvVideoData->getCStride(), m_iWidth >> 1, m_iHeight >> 1, m_aapiCurVideoPel[ iViewNum ][2], m_aaiCurVideoStrides[iViewNum][2] ); 447 TRenFilter::copy ( pcPicYuvDepthData->getLumaAddr() + m_uiHorOff * pcPicYuvDepthData->getStride () , pcPicYuvDepthData->getStride(), m_iWidth, m_iHeight, m_apiCurDepthPel [ iViewNum], m_aiCurDepthStrides [iViewNum] ); 376 448 377 449 // Used for rendering reference pic from original video data … … 381 453 if ( m_abSetupVideoFromOrgForView[iViewNum] ) 382 454 { 383 AOF( pcPicYuvOrgVideoData->getHeight() == m_iHeight|| pcPicYuvOrgVideoData->getWidth() == m_iWidth );455 AOF( pcPicYuvOrgVideoData->getHeight() <= m_iHeight + m_uiHorOff || pcPicYuvOrgVideoData->getWidth() == m_iWidth ); 384 456 pcPicYuvOrgVideoData->extendPicBorder(); 385 TRenFilter::sampleHorUp ( m_iShiftPrec, pcPicYuvOrgVideoData->getLumaAddr() , pcPicYuvOrgVideoData->getStride() , m_iWidth, m_iHeight, m_aapiOrgVideoPel[ iViewNum ][0], m_aaiOrgVideoStrides[iViewNum][0] );386 TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvOrgVideoData->getCbAddr() , pcPicYuvOrgVideoData->getCStride(), m_iWidth >> 1, m_iHeight >> 1, m_aapiOrgVideoPel[ iViewNum ][1], m_aaiOrgVideoStrides[iViewNum][1] );387 TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvOrgVideoData->getCrAddr() , pcPicYuvOrgVideoData->getCStride(), m_iWidth >> 1, m_iHeight >> 1, m_aapiOrgVideoPel[ iViewNum ][2], m_aaiOrgVideoStrides[iViewNum][2] );457 TRenFilter::sampleHorUp ( m_iShiftPrec, pcPicYuvOrgVideoData->getLumaAddr() + m_uiHorOff * pcPicYuvOrgVideoData->getStride() , pcPicYuvOrgVideoData->getStride() , m_iWidth, m_iHeight, m_aapiOrgVideoPel[ iViewNum ][0], m_aaiOrgVideoStrides[iViewNum][0] ); 458 TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvOrgVideoData->getCbAddr() + (m_uiHorOff >> 1 ) * pcPicYuvOrgVideoData->getCStride(), pcPicYuvOrgVideoData->getCStride(), m_iWidth >> 1, m_iHeight >> 1, m_aapiOrgVideoPel[ iViewNum ][1], m_aaiOrgVideoStrides[iViewNum][1] ); 459 TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvOrgVideoData->getCrAddr() + (m_uiHorOff >> 1 ) * pcPicYuvOrgVideoData->getCStride(), pcPicYuvOrgVideoData->getCStride(), m_iWidth >> 1, m_iHeight >> 1, m_aapiOrgVideoPel[ iViewNum ][2], m_aaiOrgVideoStrides[iViewNum][2] ); 388 460 } 389 461 390 462 if ( m_abSetupDepthFromOrgForView[iViewNum] ) 391 463 { 392 AOF( pcPicYuvOrgDepthData->getHeight() == m_iHeight|| pcPicYuvOrgDepthData->getWidth() == m_iWidth );393 TRenFilter::copy ( pcPicYuvOrgDepthData->getLumaAddr() , pcPicYuvOrgDepthData->getStride(), m_iWidth, m_iHeight, m_apiOrgDepthPel [ iViewNum], m_aiOrgDepthStrides [iViewNum] );464 AOF( pcPicYuvOrgDepthData->getHeight() <= m_iHeight + m_uiHorOff || pcPicYuvOrgDepthData->getWidth() == m_iWidth ); 465 TRenFilter::copy ( pcPicYuvOrgDepthData->getLumaAddr() + m_uiHorOff * pcPicYuvOrgDepthData->getStride() , pcPicYuvOrgDepthData->getStride(), m_iWidth, m_iHeight, m_apiOrgDepthPel [ iViewNum], m_aiOrgDepthStrides [iViewNum] ); 394 466 } 395 467 } … … 404 476 for (Int iBaseViewIdx = 0; iBaseViewIdx < m_iNumOfBaseViews; iBaseViewIdx++ ) 405 477 { 478 406 479 Bool bSetupFromOrgVideo = m_abSetupVideoFromOrgForView[iBaseViewIdx]; 407 480 Bool bSetupFromOrgDepth = m_abSetupDepthFromOrgForView[iBaseViewIdx]; 408 409 if ( ( bSetupFromOrgVideo || bSetupFromOrgDepth ) && m_aaeBaseViewPosInModel[iBaseViewIdx][iModelNum] != VIEWPOS_INVALID ) 481 bAnyRefFromOrg = bAnyRefFromOrg || bSetupFromOrgVideo || bSetupFromOrgDepth; 482 483 if ( m_aaeBaseViewPosInModel[iBaseViewIdx][iModelNum] != VIEWPOS_INVALID ) 410 484 { 411 485 bAnyRefFromOrg = true; … … 418 492 } 419 493 420 m_apcRenModels[iModelNum]->setup ( pcPicYuvRefView, ppiShiftLutLeft, ppiBaseShiftLutLeft, ppiShiftLutRight, ppiBaseShiftLutRight, iDistToLeft, false );494 m_apcRenModels[iModelNum]->setup ( pcPicYuvRefView, ppiShiftLutLeft, ppiBaseShiftLutLeft, ppiShiftLutRight, ppiBaseShiftLutRight, iDistToLeft, false, m_uiHorOff ); 421 495 422 496 // Setup to Org … … 438 512 } 439 513 440 // setup keeping reference from original data441 m_apcRenModels[iModelNum]->setup ( pcPicYuvRefView, ppiShiftLutLeft, ppiBaseShiftLutLeft, ppiShiftLutRight, ppiBaseShiftLutRight, iDistToLeft, true 514 // setup keeping reference rendered from original data 515 m_apcRenModels[iModelNum]->setup ( pcPicYuvRefView, ppiShiftLutLeft, ppiBaseShiftLutLeft, ppiShiftLutRight, ppiBaseShiftLutRight, iDistToLeft, true, m_uiHorOff); 442 516 } 443 517 } … … 468 542 } 469 543 544 545 Void 546 TRenModel::setHorOffset ( UInt uiHorOff ) 547 { 548 m_uiHorOff = uiHorOff; 549 } 550 551 #if LGE_VSO_EARLY_SKIP_A0093 552 RMDist 553 TRenModel::getDist( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel * piOrgData, Int iOrgStride) 554 #else 470 555 RMDist 471 556 TRenModel::getDist( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) 472 { 557 #endif 558 { 559 iStartPosY -= m_uiHorOff; 560 473 561 AOT( iWidth + iStartPosX > m_iWidth ); 474 562 AOT( iHeight + iStartPosY > m_iHeight ); … … 484 572 if (m_iCurrentContent == 1) 485 573 { 574 #if LGE_VSO_EARLY_SKIP_A0093 575 iDist += m_apcCurRenModels[iModelNum]->getDistDepth ( m_aiCurPosInModels[iModelNum], iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData , piOrgData, iOrgStride); 576 #else 486 577 iDist += m_apcCurRenModels[iModelNum]->getDistDepth ( m_aiCurPosInModels[iModelNum], iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData ); 578 #endif 487 579 } 488 580 else … … 498 590 TRenModel::setData( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) 499 591 { 592 iStartPosY -= m_uiHorOff; 593 500 594 iWidth = min(iWidth , m_iWidth - iStartPosX ); 501 595 iHeight = min(iHeight, m_iHeight - iStartPosY ); … … 510 604 if (m_iCurrentContent == 1) 511 605 { 606 #ifdef LGE_VSO_EARLY_SKIP_A0093 607 Int iTargetStride = m_aiCurDepthStrides[ m_iCurrentView ]; 608 m_apcCurRenModels[iModelNum]->setDepth ( m_aiCurPosInModels[iModelNum], iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData,m_apiCurDepthPel[ m_iCurrentView ] + iStartPosY * iTargetStride + iStartPosX ,iTargetStride ); 609 #else 512 610 m_apcCurRenModels[iModelNum]->setDepth ( m_aiCurPosInModels[iModelNum], iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData ); 513 611 #endif 514 612 } 515 613 else … … 519 617 } 520 618 619 #ifdef LGE_VSO_EARLY_SKIP_A0093 521 620 if (m_iCurrentContent == 1) 522 621 { … … 524 623 TRenFilter::copy( piNewData, iStride, iWidth, iHeight, m_apiCurDepthPel[ m_iCurrentView ] + iStartPosY * iTargetStride + iStartPosX, iTargetStride ); 525 624 } 526 else 527 { 528 Int iTargetStride = m_aaiCurVideoStrides[ m_iCurrentView ][m_iCurrentPlane]; 529 TRenFilter::copy( piNewData, iStride, iWidth, iHeight, m_aapiCurVideoPel[ m_iCurrentView ][m_iCurrentPlane] + iStartPosY * iTargetStride + iStartPosX, iTargetStride); 530 } 531 } 532 533 Void 534 TRenModel::getSynthVideo( Int iModelNum, Int iViewNum, TComPicYuv*& rpcPicYuvSynthVideo ) 535 { 536 Pel** ppiSynthVideoPel = NULL; 537 Pel* ppiSynthDepthPel = NULL; 538 Int iStride = -1; 539 Int aiStrides[3]; 540 541 m_apcRenModels[iModelNum]->getSynthView(iViewNum, ppiSynthVideoPel, ppiSynthDepthPel, iStride ); 542 543 aiStrides[0] = iStride; aiStrides[1] = iStride; aiStrides[2] = iStride; 544 xCopy2PicYuv( ppiSynthVideoPel, aiStrides, rpcPicYuvSynthVideo ); 545 } 546 547 Void 548 TRenModel::getSynthDepth( Int iModelNum, Int iViewNum, TComPicYuv*& rpcPicYuvSynthDepth ) 549 { 550 Pel** ppiSynthVideoPel = NULL; 551 Pel* piSynthDepthPel = NULL; 552 Int iStride = -1; 553 554 m_apcRenModels[iModelNum]->getSynthView(iViewNum, ppiSynthVideoPel, piSynthDepthPel, iStride ); 555 TRenFilter::copy( piSynthDepthPel, iStride, m_iWidth, m_iHeight, rpcPicYuvSynthDepth->getLumaAddr(), rpcPicYuvSynthDepth->getStride() ); 556 rpcPicYuvSynthDepth->setChromaTo( 128 << g_uiBitIncrement ); 557 } 558 625 #endif 626 } 627 628 Void 629 TRenModel::getSynthVideo( Int iModelNum, Int iViewNum, TComPicYuv* pcPicYuv ) 630 { 631 m_apcRenModels[iModelNum]->getSynthVideo(iViewNum, pcPicYuv, m_uiHorOff ); 632 } 633 634 Void 635 TRenModel::getSynthDepth( Int iModelNum, Int iViewNum, TComPicYuv* pcPicYuv ) 636 { 637 #if HHI_VSO_SPEEDUP_A033 638 m_apcRenModels[iModelNum]->getSynthDepth(iViewNum, pcPicYuv, m_uiHorOff ); 639 #else 640 m_apcRenModels[iModelNum]->getSynthDepth(iViewNum, pcPicYuv ); 641 #endif 642 } 559 643 560 644 Void … … 573 657 for (Int iCurModel = 0; iCurModel < m_iNumOfCurRenModels; iCurModel++) 574 658 { 575 Pel** ppiSynthVideoPel = NULL; 576 Pel* ppiSynthDepthPel = NULL; 577 Pel** ppiRefVideoPel = NULL; 578 Int iSynStride = -1; 579 Int* piRefStrides = NULL; 580 Int aiSynStrides[3]; 581 582 m_apcCurRenModels[iCurModel]->getSynthView( m_aiCurPosInModels[iCurModel], ppiSynthVideoPel, ppiSynthDepthPel, iSynStride ); 583 aiSynStrides[0] = iSynStride; aiSynStrides[1] = iSynStride; aiSynStrides[2] = iSynStride; 584 xCopy2PicYuv( ppiSynthVideoPel, aiSynStrides, &cPicYuvSynth ); 585 586 TComPicYuv* pcPicYuvOrgRef; 587 TComPicYuv* pcPicYuvRef; 588 m_apcCurRenModels[iCurModel]->getRefView ( pcPicYuvOrgRef, ppiRefVideoPel, piRefStrides ); 589 590 if (!pcPicYuvOrgRef ) 591 { 592 xCopy2PicYuv( ppiRefVideoPel, piRefStrides, &cPicYuvTempRef); 593 pcPicYuvRef = &cPicYuvTempRef; 594 } 595 else 596 { 597 pcPicYuvRef = pcPicYuvOrgRef; 598 } 659 m_apcCurRenModels[iCurModel]->getSynthVideo( m_aiCurPosInModels[iCurModel], &cPicYuvSynth, 0 ); 660 TComPicYuv* pcPicYuvRef = &cPicYuvTempRef; 661 m_apcCurRenModels[iCurModel]->getRefVideo ( m_aiCurPosInModels[iCurModel], pcPicYuvRef , 0 ); 599 662 600 663 iSSEY += TRenFilter::SSE( cPicYuvSynth.getLumaAddr(), cPicYuvSynth.getStride(), m_iWidth, m_iHeight , pcPicYuvRef->getLumaAddr(), pcPicYuvRef->getStride() ); … … 620 683 m_aaeBaseViewPosInModel[iBaseViewNum][iModelNum] = iViewPos; 621 684 622 m_apcRenModels[iModelNum]->setLRView( iViewPos, m_aapiCurVideoPel[iBaseViewNum], m_aaiCurVideoStrides[iBaseViewNum], m_apiCurDepthPel[iBaseViewNum], m_aiCurDepthStrides [iBaseViewNum] );623 624 685 if (bAdd) 625 686 { … … 639 700 } 640 701 } 641 642 Void643 TRenModel::xCopy2PicYuv( Pel** ppiSrcVideoPel, Int* piStrides, TComPicYuv* rpcPicYuvTarget )644 {645 TRenFilter::copy ( ppiSrcVideoPel[0], piStrides[0], m_iWidth, m_iHeight, rpcPicYuvTarget->getLumaAddr(), rpcPicYuvTarget->getStride() );646 TRenFilter::sampleDown2Tap13( ppiSrcVideoPel[1], piStrides[1], m_iWidth, m_iHeight, rpcPicYuvTarget->getCbAddr (), rpcPicYuvTarget->getCStride() );647 TRenFilter::sampleDown2Tap13( ppiSrcVideoPel[2], piStrides[2], m_iWidth, m_iHeight, rpcPicYuvTarget->getCrAddr (), rpcPicYuvTarget->getCStride() );648 } -
trunk/source/Lib/TLibRenderer/TRenModel.h
r56 r100 50 50 51 51 // Creation 52 #if LGE_VSO_EARLY_SKIP_A0093 53 Void create ( Int iNumOfBaseViews, Int iNumOfModels, Int iWidth, Int iHeight, Int iShiftPrec, Int iHoleMargin, Bool bEarlySkip ); 54 #else 52 55 Void create ( Int iNumOfBaseViews, Int iNumOfModels, Int iWidth, Int iHeight, Int iShiftPrec, Int iHoleMargin ); 56 #endif 53 57 Void createSingleModel( Int iBaseViewNum, Int iContent, Int iModelNum, Int iLeftViewNum, Int iRightViewNum, Bool bUseOrgRef, Int iBlendMode ); 54 58 … … 57 61 Void setSingleModel ( Int iModelNum, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, TComPicYuv* pcPicYuvRefView ); 58 62 63 // Set horizontal offset 64 Void setHorOffset ( UInt uiHorOff ); 65 59 66 // Set Mode 60 67 Void setErrorMode ( Int iView, Int iContent, int iPlane ); 61 68 62 69 // Get Distortion, set Data 70 #ifdef LGE_VSO_EARLY_SKIP_A0093 71 Int64 getDist ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel * piOrgData, Int iOrgStride); 72 #else 63 73 Int64 getDist ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ); 74 #endif 64 75 Void setData ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ); 65 76 66 77 // Get Rendered View 67 Void getSynthVideo ( Int iModelNum, Int iViewNum, TComPicYuv*& rpcPicYuvSynthVideo ); 68 Void getSynthDepth ( Int iModelNum, Int iViewNum, TComPicYuv*& rpcPicYuvSynthDepth ); 78 79 Void getSynthVideo ( Int iModelNum, Int iViewNum, TComPicYuv* pcPicYuvSynthVideo ); 80 Void getSynthDepth ( Int iModelNum, Int iViewNum, TComPicYuv* pcPicYuvSynthDepth ); 69 81 70 82 // Get Total Distortion … … 74 86 // helpers 75 87 Void xSetLRViewAndAddModel( Int iModelNum, Int iBaseViewNum, Int iContent, Int iViewPos, Bool bAdd ); 76 Void xCopy2PicYuv ( Pel** ppiSrcVideoPel, Int* piStrides, TComPicYuv* rpcPicYuvTarget );77 88 78 89 // Settings … … 80 91 Int** m_aaaiSubPelShiftLut[2]; 81 92 Int m_iHoleMargin; 93 #if LGE_VSO_EARLY_SKIP_A0093 94 Bool m_bEarlySkip; 95 #endif 82 96 83 97 /// Size of Video and Depth … … 88 102 89 103 Int m_iNumOfBaseViews; 104 105 #if HHI_VSO_SPEEDUP_A033 106 // Horizontal Offset in input data 107 UInt m_uiHorOff; 108 #endif 90 109 91 110 /// Current Error Type /// -
trunk/source/Lib/TLibRenderer/TRenSingleModel.cpp
r81 r100 32 32 */ 33 33 34 35 34 #include "TRenImage.h" 36 35 #include "TRenFilter.h" … … 38 37 39 38 ////////////// TRENSINGLE MODEL /////////////// 40 TRenSingleModel::TRenSingleModel() 39 template <BlenMod iBM, Bool bBitInc> 40 TRenSingleModelC<iBM,bBitInc>::TRenSingleModelC() 41 41 : m_iDistShift ( g_uiBitIncrement << 1 ) 42 42 { … … 50 50 51 51 m_pcPicYuvRef = NULL; 52 53 m_pcOutputSamples = NULL; 54 m_pcOutputSamplesRow = NULL; 55 m_iOutputSamplesStride = -1; 56 57 m_ppiCurLUT = NULL; 58 m_piInvZLUTLeft = NULL; 59 m_piInvZLUTRight = NULL; 60 52 61 m_aapiRefVideoPel[0] = NULL; 53 62 m_aapiRefVideoPel[1] = NULL; 54 63 m_aapiRefVideoPel[2] = NULL; 55 64 56 57 65 m_aiRefVideoStrides[0] = -1; 58 66 m_aiRefVideoStrides[1] = -1; 59 67 m_aiRefVideoStrides[2] = -1; 60 68 69 61 70 for (UInt uiViewNum = 0 ; uiViewNum < 2; uiViewNum++) 62 71 { 63 72 // LUT 64 73 m_appiShiftLut[uiViewNum] = NULL; 74 75 m_pcInputSamples[uiViewNum] = NULL; 76 m_iInputSamplesStride = -1; 77 65 78 m_ppiCurLUT = NULL; 66 79 m_piInvZLUTLeft = NULL; 67 80 m_piInvZLUTRight = NULL; 68 69 // Cur Data 70 m_apiBaseDepthPel [uiViewNum] = NULL; 71 m_aiBaseDepthStrides [uiViewNum] = -1; 72 73 // State Data 74 m_apbOccluded [uiViewNum] = NULL; 75 m_apiFilled [uiViewNum] = NULL; 76 77 // Cur Data 78 m_aapiBaseVideoPel [uiViewNum] = NULL; 79 m_aaiBaseVideoStrides [uiViewNum] = NULL; 80 }; 81 82 m_piError = NULL; 83 84 for (UInt uiViewNum = 0 ; uiViewNum < 3; uiViewNum++) 85 { 86 m_apiSynthDepthPel[uiViewNum] = NULL; 87 for (UInt uiPlaneNum = 0; uiPlaneNum < 3; uiPlaneNum++) 88 { 89 // Rendered Data 90 m_aapiSynthVideoPel[uiViewNum][uiPlaneNum] = NULL; 91 } 92 } 93 } 94 95 TRenSingleModel::~TRenSingleModel() 96 { 97 if ( m_apbOccluded[0] ) delete[] m_apbOccluded[0]; 98 if ( m_apbOccluded[1] ) delete[] m_apbOccluded[1]; 99 100 if ( m_apiFilled [0] ) delete[] m_apiFilled [0]; 101 if ( m_apiFilled [1] ) delete[] m_apiFilled [1]; 102 103 if ( m_piError ) delete[] m_piError ; 104 105 106 for (UInt uiViewNum = 0 ; uiViewNum < 3; uiViewNum++) 107 { 108 for (UInt uiPlaneNum = 0; uiPlaneNum < 3; uiPlaneNum++) 109 { 110 if ( m_aapiSynthVideoPel[uiViewNum] && m_aapiSynthVideoPel[uiViewNum][uiPlaneNum] ) delete[] m_aapiSynthVideoPel[uiViewNum][uiPlaneNum]; 111 } 112 if ( m_apiSynthDepthPel[uiViewNum] ) delete[] m_apiSynthDepthPel[uiViewNum]; 113 } 114 115 delete[] (m_aapiRefVideoPel[0] - m_iPad * m_aiRefVideoStrides[0] - m_iPad ); 116 delete[] (m_aapiRefVideoPel[1] - m_iPad * m_aiRefVideoStrides[1] - m_iPad ); 117 delete[] (m_aapiRefVideoPel[2] - m_iPad * m_aiRefVideoStrides[2] - m_iPad ); 118 119 if ( m_piInvZLUTLeft ) delete[] m_piInvZLUTLeft; 120 if ( m_piInvZLUTRight ) delete[] m_piInvZLUTRight; 121 } 122 123 Void 124 TRenSingleModel::create( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode ) 125 { 126 m_iBlendMode = iBlendMode; 81 } 82 83 #ifdef LGE_VSO_EARLY_SKIP_A0093 84 m_pbHorSkip = NULL; 85 #endif 86 } 87 88 template <BlenMod iBM, Bool bBitInc> 89 TRenSingleModelC<iBM,bBitInc>::~TRenSingleModelC() 90 { 91 #ifdef LGE_VSO_EARLY_SKIP_A0093 92 if (m_pbHorSkip) 93 { 94 delete[] m_pbHorSkip; 95 m_pbHorSkip = NULL; 96 } 97 #endif 98 99 if ( m_pcInputSamples [0] ) delete[] m_pcInputSamples [0]; 100 if ( m_pcInputSamples [1] ) delete[] m_pcInputSamples [1]; 101 if ( m_pcOutputSamples ) delete m_pcOutputSamples ; 102 } 103 104 template <BlenMod iBM, Bool bBitInc> Void 105 #if LGE_VSO_EARLY_SKIP_A0093 106 TRenSingleModelC<iBM,bBitInc>::create( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bEarlySkip ) 107 #else 108 TRenSingleModelC<iBM,bBitInc>::create( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode ) 109 #endif 110 111 { 112 #if LGE_VSO_EARLY_SKIP_A0093 113 m_pbHorSkip = new Bool [MAX_CU_SIZE]; 114 m_bEarlySkip = bEarlySkip; 115 #endif 116 117 AOF( iBlendMode == iBM ); 118 127 119 m_iMode = iMode; 120 128 121 m_iWidth = iWidth; 129 122 m_iHeight = iHeight; … … 160 153 m_aapiRefVideoPel [2] += m_aiRefVideoStrides[2] * m_iPad + m_iPad; 161 154 162 m_piError = new Int [m_iStride*m_iHeight]; 163 164 // Create Buffers 165 if ( (m_iMode == 0) || (m_iMode == 2 ) ) 166 { 167 m_apbOccluded [0] = new Bool[m_iStride*m_iHeight]; 168 m_apiFilled [0] = new Pel [m_iStride*m_iHeight]; 169 170 for (UInt uiPlaneNum = 0; uiPlaneNum < 3; uiPlaneNum++) 171 { 172 m_aapiSynthVideoPel[0][uiPlaneNum] = new Pel[m_iStride*m_iHeight]; 173 } 174 } 175 176 if ( (m_iMode == 1) || (m_iMode == 2 ) ) 177 { 178 m_apbOccluded [1] = new Bool[m_iStride*m_iHeight]; 179 m_apiFilled [1] = new Pel [m_iStride*m_iHeight]; 180 181 for (UInt uiPlaneNum = 0; uiPlaneNum < 3; uiPlaneNum++) 182 { 183 m_aapiSynthVideoPel[1][uiPlaneNum] = new Pel[m_iStride*m_iHeight]; 184 } 185 } 186 187 if ( m_iMode == 2 ) 188 { 189 m_apiSynthDepthPel[0] = new Pel[m_iStride*m_iHeight]; 190 m_apiSynthDepthPel[1] = new Pel[m_iStride*m_iHeight]; 191 m_apiSynthDepthPel[2] = new Pel[m_iStride*m_iHeight]; 192 193 for (UInt uiPlaneNum = 0; uiPlaneNum < 3; uiPlaneNum++) 194 { 195 m_aapiSynthVideoPel[2][uiPlaneNum] = new Pel[m_iStride*m_iHeight]; 196 } 197 } 198 } 199 200 Void 201 TRenSingleModel::setLRView( Int iViewPos, Pel** apiCurVideoPel, Int* aiCurVideoStride, Pel* piCurDepthPel, Int iCurDepthStride ) 155 m_iInputSamplesStride = m_iWidth+1; 156 m_iOutputSamplesStride = m_iWidth; 157 158 m_pcInputSamples[0] = new RenModelInPels[m_iInputSamplesStride*m_iHeight]; 159 m_pcInputSamples[1] = new RenModelInPels[m_iInputSamplesStride*m_iHeight]; 160 161 m_pcOutputSamples = new RenModelOutPels[m_iOutputSamplesStride*m_iHeight]; 162 } 163 164 template <BlenMod iBM, Bool bBitInc> Void 165 TRenSingleModelC<iBM,bBitInc>::setLRView( Int iViewPos, Pel** apiCurVideoPel, Int* aiCurVideoStride, Pel* piCurDepthPel, Int iCurDepthStride ) 202 166 { 203 167 AOF(( iViewPos == 0) || (iViewPos == 1) ); 168 169 RenModelInPels* pcCurInputSampleRow = m_pcInputSamples[iViewPos]; 170 171 Pel* piDRow = piCurDepthPel; 172 Pel* piYRow = apiCurVideoPel[0]; 173 #if HHI_VSO_COLOR_PLANES 174 Pel* piURow = apiCurVideoPel[1]; 175 Pel* piVRow = apiCurVideoPel[2]; 176 #endif 177 178 179 Int iOffsetX = ( iViewPos == VIEWPOS_RIGHT ) ? 1 : 0; 180 181 for ( Int iPosY = 0; iPosY < m_iHeight; iPosY++ ) 182 { 183 if ( iViewPos == VIEWPOS_RIGHT ) 184 { 185 Int iSubPosX = (1 << m_iShiftPrec); 186 pcCurInputSampleRow[0].aiY[iSubPosX] = piYRow[0]; 187 #if HHI_VSO_COLOR_PLANES 188 pcCurInputSampleRow[0].aiU[iSubPosX] = piURow[0]; 189 pcCurInputSampleRow[0].aiV[iSubPosX] = piVRow[0]; 190 #endif 191 } 192 193 for ( Int iPosX = 0; iPosX < m_iWidth; iPosX++ ) 194 { 195 pcCurInputSampleRow[iPosX].iD = piDRow[iPosX]; 196 197 for (Int iSubPosX = 0; iSubPosX < (1 << m_iShiftPrec)+1; iSubPosX++ ) 198 { 199 Int iShift = (iPosX << m_iShiftPrec) + iSubPosX; 200 pcCurInputSampleRow[iPosX+iOffsetX].aiY[iSubPosX] = piYRow[iShift]; 201 #if HHI_VSO_COLOR_PLANES 202 pcCurInputSampleRow[iPosX+iOffsetX].aiU[iSubPosX] = piURow[iShift]; 203 pcCurInputSampleRow[iPosX+iOffsetX].aiV[iSubPosX] = piVRow[iShift]; 204 #endif 205 } 206 } 207 208 pcCurInputSampleRow += m_iInputSamplesStride; 209 210 piDRow += iCurDepthStride; 211 piYRow += aiCurVideoStride[0]; 212 #if HHI_VSO_COLOR_PLANES 213 piURow += aiCurVideoStride[1]; 214 piVRow += aiCurVideoStride[2]; 215 #endif 216 } 217 218 204 219 m_aapiBaseVideoPel [iViewPos] = apiCurVideoPel; 205 220 m_aaiBaseVideoStrides [iViewPos] = aiCurVideoStride; 206 221 m_apiBaseDepthPel [iViewPos] = piCurDepthPel; 207 222 m_aiBaseDepthStrides [iViewPos] = iCurDepthStride; 208 } 209 210 Void 211 TRenSingleModel::setup( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, Bool bKeepReference ) 223 224 } 225 226 template <BlenMod iBM, Bool bBitInc> Void 227 TRenSingleModelC<iBM,bBitInc>::setup( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, Bool bKeepReference, UInt uiHorOff ) 212 228 { 213 229 AOT( !m_bUseOrgRef && pcOrgVideo ); 214 230 AOT( (ppiShiftLutLeft == NULL) && (m_iMode == 0 || m_iMode == 2) ); 215 231 AOT( (ppiShiftLutRight == NULL) && (m_iMode == 1 || m_iMode == 2) ); 216 #if HHI_FIX217 #else218 AOT( pcOrgVideo != NULL && bKeepReference );219 #endif220 232 221 233 m_appiShiftLut[0] = ppiShiftLutLeft; … … 225 237 m_pcPicYuvRef = pcOrgVideo; 226 238 227 #if HHI_FIX228 239 if ( pcOrgVideo && !bKeepReference ) 229 #else 230 if ( pcOrgVideo ) 231 #endif 232 { 233 TRenFilter::copy( pcOrgVideo->getLumaAddr(), pcOrgVideo->getStride() , m_iWidth, m_iHeight, m_aapiRefVideoPel[0], m_aiRefVideoStrides[0]); 234 TRenFilter::sampleCUpHorUp(0, pcOrgVideo->getCbAddr() , pcOrgVideo->getCStride(), m_iWidth >> 1, m_iHeight >> 1, m_aapiRefVideoPel[1], m_aiRefVideoStrides[1]); 235 TRenFilter::sampleCUpHorUp(0, pcOrgVideo->getCrAddr() , pcOrgVideo->getCStride(), m_iWidth >> 1, m_iHeight >> 1, m_aapiRefVideoPel[2], m_aiRefVideoStrides[2]); 240 { 241 TRenFilter::copy( pcOrgVideo->getLumaAddr() + uiHorOff * pcOrgVideo->getStride() , pcOrgVideo->getStride() , m_iWidth, m_iHeight, m_aapiRefVideoPel[0], m_aiRefVideoStrides[0]); 242 TRenFilter::sampleCUpHorUp(0, pcOrgVideo->getCbAddr() + (uiHorOff >> 1) * pcOrgVideo->getCStride(), pcOrgVideo->getCStride(), m_iWidth >> 1, m_iHeight >> 1, m_aapiRefVideoPel[1], m_aiRefVideoStrides[1]); 243 TRenFilter::sampleCUpHorUp(0, pcOrgVideo->getCrAddr() + (uiHorOff >> 1) * pcOrgVideo->getCStride(), pcOrgVideo->getCStride(), m_iWidth >> 1, m_iHeight >> 1, m_aapiRefVideoPel[2], m_aiRefVideoStrides[2]); 244 xSetStructRefView(); 236 245 } 237 246 238 247 // Initial Rendering 239 xSetInts( m_piError , m_iStride, m_iWidth, m_iHeight, 0 ); 248 xResetStructError(); 249 xInitSampleStructs(); 240 250 241 251 switch ( m_iMode ) 242 { 243 case 0: 244 xInitView( VIEWPOS_LEFT ); 245 xRenderL( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0], true ); 252 { 253 case 0: 254 #if LGE_VSO_EARLY_SKIP_A0093 255 xRenderL<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0],false ); 256 #else 257 xRenderL<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0] ); 258 #endif 246 259 break; 247 case 1: 248 xInitView( VIEWPOS_RIGHT ); 249 xRenderR( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1], true ); 260 case 1: 261 #ifdef LGE_VSO_EARLY_SKIP_A0093 262 xRenderR<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1],false); 263 #else 264 xRenderR<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1] ); 265 #endif 250 266 break; 251 267 case 2: 252 268 TRenFilter::setupZLUT( true, 30, iDistToLeft, ppiBaseShiftLutLeft, ppiBaseShiftLutRight, m_iBlendZThres, m_iBlendDistWeight, m_piInvZLUTLeft, m_piInvZLUTRight ); 253 xInitView( VIEWPOS_LEFT ); 254 xInitView( VIEWPOS_RIGHT ); 255 xInitView( VIEWPOS_MERGED ); 256 xRenderL( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0], true ); 257 xRenderR( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1], true ); 269 #ifdef LGE_VSO_EARLY_SKIP_A0093 270 xRenderL<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0],false); 271 xRenderR<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1],false); 272 #else 273 xRenderL<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0] ); 274 xRenderR<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1] ); 275 #endif 258 276 break; 259 277 default: … … 264 282 if ( !pcOrgVideo && !bKeepReference ) 265 283 { 266 xSetInts ( m_piError , m_iStride, m_iWidth, m_iHeight, 0 ); 267 TRenFilter::copy( m_aapiSynthVideoPel[m_iMode ][0], m_iStride, m_iWidth, m_iHeight , m_aapiRefVideoPel[0], m_aiRefVideoStrides[0]); 268 TRenFilter::copy( m_aapiSynthVideoPel[m_iMode ][1], m_iStride, m_iWidth, m_iHeight , m_aapiRefVideoPel[1], m_aiRefVideoStrides[1]); 269 TRenFilter::copy( m_aapiSynthVideoPel[m_iMode ][2], m_iStride, m_iWidth, m_iHeight , m_aapiRefVideoPel[2], m_aiRefVideoStrides[2]); 270 } 271 } 272 273 RMDist 274 TRenSingleModel::getDistDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) 275 { 276 RMDist iSSE = 0; 277 switch (iViewPos ) 284 xResetStructError(); 285 xSetStructSynthViewAsRefView(); 286 } 287 } 288 289 template <BlenMod iBM, Bool bBitInc> Void 290 #if HHI_VSO_COLOR_PLANES 291 TRenSingleModelC<iBM,bBitInc>::xGetSampleStrTextPtrs( Int iViewNum, Pel RenModelOutPels::*& rpiSrcY, Pel RenModelOutPels::*& rpiSrcU, Pel RenModelOutPels::*& rpiSrcV ) 292 #else 293 TRenSingleModelC<iBM,bBitInc>::xGetSampleStrTextPtrs( Int iViewNum, Pel RenModelOutPels::*& rpiSrcY ) 294 #endif 295 { 296 switch ( iViewNum ) 278 297 { 279 298 case 0: 280 iSSE = xRenderL( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData, false ); 299 rpiSrcY = &RenModelOutPels::iYLeft; 300 #if HHI_VSO_COLOR_PLANES 301 rpiSrcU = &RenModelOutPels::iULeft; 302 rpiSrcV = &RenModelOutPels::iVLeft; 303 #endif 281 304 break; 282 305 case 1: 283 iSSE = xRenderR( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData, false ); 306 rpiSrcY = &RenModelOutPels::iYRight; 307 #if HHI_VSO_COLOR_PLANES 308 rpiSrcU = &RenModelOutPels::iURight; 309 rpiSrcV = &RenModelOutPels::iVRight; 310 #endif 311 break; 312 case 2: 313 rpiSrcY = &RenModelOutPels::iYBlended; 314 #if HHI_VSO_COLOR_PLANES 315 rpiSrcU = &RenModelOutPels::iUBlended; 316 rpiSrcV = &RenModelOutPels::iVBlended; 317 #endif 318 break; 319 } 320 } 321 322 323 template <BlenMod iBM, Bool bBitInc> Void 324 TRenSingleModelC<iBM,bBitInc>::xGetSampleStrDepthPtrs( Int iViewNum, Pel RenModelOutPels::*& rpiSrcD ) 325 { 326 AOT(iViewNum != 0 && iViewNum != 1); 327 rpiSrcD = (iViewNum == 1) ? &RenModelOutPels::iDRight : &RenModelOutPels::iDLeft; 328 } 329 330 331 template <BlenMod iBM, Bool bBitInc> Void 332 TRenSingleModelC<iBM,bBitInc>::xSetStructRefView( ) 333 { 334 RenModelOutPels* pcCurOutSampleRow = m_pcOutputSamples; 335 336 Pel* piYRow = m_aapiRefVideoPel[0]; 337 #if HHI_VSO_COLOR_PLANES 338 Pel* piURow = m_aapiRefVideoPel[1]; 339 Pel* piVRow = m_aapiRefVideoPel[2]; 340 #endif 341 342 for ( Int iPosY = 0; iPosY < m_iHeight; iPosY++ ) 343 { 344 for ( Int iPosX = 0; iPosX < m_iWidth; iPosX++ ) 345 { 346 pcCurOutSampleRow[iPosX].iYRef = piYRow[iPosX]; 347 #if HHI_VSO_COLOR_PLANES 348 pcCurOutSampleRow[iPosX].iURef = piURow[iPosX]; 349 pcCurOutSampleRow[iPosX].iVRef = piVRow[iPosX]; 350 #endif 351 } 352 353 pcCurOutSampleRow += m_iOutputSamplesStride; 354 355 piYRow += m_aiRefVideoStrides[0]; 356 #if HHI_VSO_COLOR_PLANES 357 piURow += m_aiRefVideoStrides[1]; 358 piVRow += m_aiRefVideoStrides[2]; 359 #endif 360 } 361 } 362 363 template <BlenMod iBM, Bool bBitInc> Void 364 TRenSingleModelC<iBM,bBitInc>::xResetStructError( ) 365 { 366 RenModelOutPels* pcCurOutSampleRow = m_pcOutputSamples; 367 368 for ( Int iPosY = 0; iPosY < m_iHeight; iPosY++ ) 369 { 370 for ( Int iPosX = 0; iPosX < m_iWidth; iPosX++ ) 371 { 372 pcCurOutSampleRow[iPosX].iError = 0; 373 } 374 pcCurOutSampleRow += m_iOutputSamplesStride; 375 } 376 } 377 378 template <BlenMod iBM, Bool bBitInc> Void 379 TRenSingleModelC<iBM,bBitInc>::xSetStructSynthViewAsRefView( ) 380 { 381 AOT( m_iMode < 0 || m_iMode > 2); 382 383 RenModelOutPels* pcCurOutSampleRow = m_pcOutputSamples; 384 385 Pel RenModelOutPels::* piSrcY = NULL; 386 387 #if HHI_VSO_COLOR_PLANES 388 Pel RenModelOutPels::* piSrcU = NULL; 389 Pel RenModelOutPels::* piSrcV = NULL; 390 xGetSampleStrTextPtrs( m_iMode, piSrcY, piSrcU, piSrcV ); 391 #else 392 xGetSampleStrTextPtrs( m_iMode, piSrcY ); 393 #endif 394 395 for ( Int iPosY = 0; iPosY < m_iHeight; iPosY++ ) 396 { 397 for ( Int iPosX = 0; iPosX < m_iWidth; iPosX++ ) 398 { 399 pcCurOutSampleRow[iPosX].iYRef = pcCurOutSampleRow[iPosX].*piSrcY; 400 #if HHI_VSO_COLOR_PLANES 401 pcCurOutSampleRow[iPosX].iURef = pcCurOutSampleRow[iPosX].*piSrcU; 402 pcCurOutSampleRow[iPosX].iVRef = pcCurOutSampleRow[iPosX].*piSrcV; 403 #endif 404 } 405 pcCurOutSampleRow += m_iOutputSamplesStride; 406 } 407 } 408 409 template <BlenMod iBM, Bool bBitInc> Void 410 TRenSingleModelC<iBM,bBitInc>::xInitSampleStructs() 411 { 412 RenModelOutPels* pcOutSampleRow = m_pcOutputSamples; 413 RenModelInPels * pcLeftInSampleRow = m_pcInputSamples[0]; 414 RenModelInPels * pcRightInSampleRow = m_pcInputSamples[1]; 415 416 417 for (Int iPosY = 0; iPosY < m_iHeight; iPosY++) 418 { 419 for (Int iPosX = 0; iPosX < m_iWidth; iPosX++) 420 { 421 //// Output Samples 422 pcOutSampleRow[iPosX].iFilledLeft = REN_IS_HOLE; 423 pcOutSampleRow[iPosX].iFilledRight = REN_IS_HOLE; 424 425 pcOutSampleRow[iPosX].iDLeft = 0; 426 pcOutSampleRow[iPosX].iDRight = 0; 427 pcOutSampleRow[iPosX].iDBlended = 0; 428 429 // Y Planes 430 pcOutSampleRow[iPosX].iYLeft = 0; 431 pcOutSampleRow[iPosX].iYRight = 0; 432 pcOutSampleRow[iPosX].iYBlended = 0; 433 #if HHI_VSO_COLOR_PLANES 434 // U Planes 435 pcOutSampleRow[iPosX].iULeft = 128 << g_uiBitIncrement; 436 pcOutSampleRow[iPosX].iURight = 128 << g_uiBitIncrement; 437 pcOutSampleRow[iPosX].iUBlended = 128 << g_uiBitIncrement; 438 439 // V Planes 440 pcOutSampleRow[iPosX].iVLeft = 128 << g_uiBitIncrement; 441 pcOutSampleRow[iPosX].iVRight = 128 << g_uiBitIncrement; 442 pcOutSampleRow[iPosX].iVBlended = 128 << g_uiBitIncrement; 443 #endif 444 //// Input Samples 445 pcLeftInSampleRow [iPosX].bOccluded = false; 446 pcRightInSampleRow[iPosX].bOccluded = false; 447 } 448 449 pcOutSampleRow += m_iOutputSamplesStride; 450 pcLeftInSampleRow += m_iInputSamplesStride; 451 pcRightInSampleRow += m_iInputSamplesStride; 452 } 453 } 454 455 456 #ifdef LGE_VSO_EARLY_SKIP_A0093 457 template <BlenMod iBM, Bool bBitInc> RMDist 458 TRenSingleModelC<iBM,bBitInc>::getDistDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData , Pel * piOrgData, Int iOrgStride ) 459 #else 460 template <BlenMod iBM, Bool bBitInc> RMDist 461 TRenSingleModelC<iBM,bBitInc>::getDistDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) 462 #endif 463 { 464 RMDist iSSE = 0; 465 #ifdef LGE_VSO_EARLY_SKIP_A0093 466 Bool bEarlySkip; 467 #endif 468 switch ( iViewPos ) 469 { 470 case 0: 471 #ifdef LGE_VSO_EARLY_SKIP_A0093 472 bEarlySkip = m_bEarlySkip ? xDetectEarlySkipL(iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData, piOrgData, iOrgStride) : false; 473 if( !bEarlySkip ) 474 { 475 iSSE = xRenderL<false>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData,true ); 476 } 477 #else 478 iSSE = xRenderL<false>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData ); 479 #endif 480 break; 481 case 1: 482 #ifdef LGE_VSO_EARLY_SKIP_A0093 483 bEarlySkip = m_bEarlySkip ? xDetectEarlySkipR(iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData, piOrgData, iOrgStride) : false; 484 if( !bEarlySkip ) 485 { 486 iSSE = xRenderR<false>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData,true ); 487 } 488 #else 489 iSSE = xRenderR<false>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData ); 490 #endif 284 491 break; 285 492 default: 286 493 assert(0); 287 494 } 495 288 496 return iSSE; 289 497 } 290 291 Void 292 TRenSingleModel::setDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) 293 { 294 switch (iViewPos ) 295 { 296 case 0: 297 xRenderL( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData, true ); 298 break; 299 case 1: 300 xRenderR( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData, true ); 301 break; 302 default: 303 assert(0); 304 } 305 } 306 307 308 Void 309 TRenSingleModel::getSynthView( Int iViewPos, Pel**& rppiRenVideoPel, Pel*& rpiRenDepthPel, Int& riStride ) 310 { 311 rppiRenVideoPel = m_aapiSynthVideoPel[iViewPos]; 312 rpiRenDepthPel = m_apiSynthDepthPel [iViewPos]; 313 riStride = m_iStride; 314 } 315 316 317 Void 318 TRenSingleModel::getRefView( TComPicYuv*& rpcPicYuvRefView, Pel**& rppiRefVideoPel, Int*& raiStrides ) 319 { 320 rpcPicYuvRefView = m_pcPicYuvRef; 321 rppiRefVideoPel = m_aapiRefVideoPel; 322 raiStrides = m_aiRefVideoStrides; 323 } 324 325 326 RMDist 327 TRenSingleModel::getDistVideo( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) 498 #ifdef LGE_VSO_EARLY_SKIP_A0093 499 template <BlenMod iBM, Bool bBitInc> Void 500 TRenSingleModelC<iBM,bBitInc>::setDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel* piOrgData, Int iOrgStride ) 501 #else 502 template <BlenMod iBM, Bool bBitInc> Void 503 TRenSingleModelC<iBM,bBitInc>::setDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) 504 #endif 505 { 506 #ifdef LGE_VSO_EARLY_SKIP_A0093 507 Bool bEarlySkip; 508 #endif 509 switch ( iViewPos ) 510 { 511 case 0: 512 #ifdef LGE_VSO_EARLY_SKIP_A0093 513 bEarlySkip = m_bEarlySkip ? xDetectEarlySkipL(iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData, piOrgData,iOrgStride) : false; 514 if( !bEarlySkip ) 515 { 516 xRenderL<true>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData,true ); 517 } 518 #else 519 xRenderL<true>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData ); 520 #endif 521 break; 522 case 1: 523 #ifdef LGE_VSO_EARLY_SKIP_A0093 524 bEarlySkip = m_bEarlySkip ? xDetectEarlySkipR(iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData, piOrgData,iOrgStride) : false; 525 if( !bEarlySkip ) 526 { 527 xRenderR<true>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData,true ); 528 } 529 #else 530 xRenderR<true>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData ); 531 #endif 532 break; 533 default: 534 assert(0); 535 } 536 } 537 538 template <BlenMod iBM, Bool bBitInc> Void 539 TRenSingleModelC<iBM,bBitInc>::getSynthVideo( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset ) 540 { 541 AOT( pcPicYuv->getWidth() != m_iWidth ); 542 AOT( pcPicYuv->getHeight() > m_iHeight + uiHorOffset ); 543 544 #if HHI_VSO_COLOR_PLANES 545 Pel RenModelOutPels::* piText[3] = { NULL, NULL, NULL }; 546 xGetSampleStrTextPtrs(iViewPos, piText[0], piText[1], piText[2]); 547 548 // Temp image for chroma down sampling 549 PelImage cTempImage( m_iWidth, m_iHeight, 3, 0); 550 Int aiStrides[3]; 551 Pel* apiData [3]; 552 553 cTempImage.getDataAndStrides( apiData, aiStrides ); 554 555 for (UInt uiCurPlane = 0; uiCurPlane < 3; uiCurPlane++ ) 556 { 557 xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piText[uiCurPlane], apiData[uiCurPlane], aiStrides[uiCurPlane] , m_iWidth, m_iHeight); 558 } 559 560 xCopy2PicYuv( apiData, aiStrides, pcPicYuv, uiHorOffset ); 561 #else 562 Pel RenModelOutPels::* piY; 563 xGetSampleStrTextPtrs(iViewPos, piY); 564 xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piY, pcPicYuv->getLumaAddr() + uiHorOffset * pcPicYuv->getStride(), pcPicYuv->getStride(), m_iWidth, m_iHeight ); 565 pcPicYuv->setChromaTo( 128 << g_uiBitIncrement ); 566 #endif 567 } 568 569 570 template <BlenMod iBM, Bool bBitInc> Void 571 TRenSingleModelC<iBM,bBitInc>::getSynthDepth( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOff ) 572 { 573 AOT( iViewPos != 0 && iViewPos != 1); 574 575 AOT( pcPicYuv->getWidth() != m_iWidth ); 576 AOT( pcPicYuv->getHeight() > m_iHeight + uiHorOff ); 577 578 Pel RenModelOutPels::* piD = 0; 579 xGetSampleStrDepthPtrs(iViewPos, piD); 580 xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piD, pcPicYuv->getLumaAddr() + pcPicYuv->getStride() * uiHorOff, pcPicYuv->getStride(), m_iWidth, m_iHeight ); 581 pcPicYuv->setChromaTo( 128 << g_uiBitIncrement ); 582 } 583 584 template <BlenMod iBM, Bool bBitInc> Void 585 TRenSingleModelC<iBM,bBitInc>::getRefVideo ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset ) 586 { 587 AOT( pcPicYuv->getWidth() != m_iWidth ); 588 AOT( pcPicYuv->getHeight() > m_iHeight + uiHorOffset); 589 590 #if HHI_VSO_COLOR_PLANES 591 Pel RenModelOutPels::* piText[3]; 592 piText[0] = &RenModelOutPels::iYRef; 593 piText[1] = &RenModelOutPels::iURef; 594 piText[2] = &RenModelOutPels::iVRef; 595 596 // Temp image for chroma down sampling 597 PelImage cTempImage( m_iWidth, m_iHeight, 3, 0); 598 Int aiStrides[3]; 599 Pel* apiData [3]; 600 601 cTempImage.getDataAndStrides( apiData, aiStrides ); 602 603 for (UInt uiCurPlane = 0; uiCurPlane < 3; uiCurPlane++ ) 604 { 605 xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piText[uiCurPlane], apiData[uiCurPlane], aiStrides[uiCurPlane] , m_iWidth, m_iHeight); 606 } 607 608 xCopy2PicYuv( apiData, aiStrides, pcPicYuv, uiHorOffset ); 609 #else 610 xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, &RenModelOutPels::iYRef, pcPicYuv->getLumaAddr() * pcPicYuv->getStride() + uiHorOffset, pcPicYuv->getStride(), m_iWidth, m_iHeight ); 611 pcPicYuv->setChromaTo( 128 << g_uiBitIncrement ); 612 #endif 613 } 614 615 616 template <BlenMod iBM, Bool bBitInc> RMDist 617 TRenSingleModelC<iBM,bBitInc>::getDistVideo( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) 328 618 { 329 619 AOF(false); … … 331 621 } 332 622 333 Void334 TRenSingleModel ::setVideo( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData )623 template <BlenMod iBM, Bool bBitInc> Void 624 TRenSingleModelC<iBM,bBitInc>::setVideo( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) 335 625 { 336 626 AOF(false); … … 339 629 340 630 341 __inline Void 342 TRenSingleModel::xSetViewRow( Int iPosY ) 343 { 344 m_aapiBaseVideoPelRow [m_iCurViewPos][0] = m_aapiBaseVideoPel [m_iCurViewPos] [0] + m_aaiBaseVideoStrides [ m_iCurViewPos ][0] * iPosY; 345 m_aapiBaseVideoPelRow [m_iCurViewPos][1] = m_aapiBaseVideoPel [m_iCurViewPos] [1] + m_aaiBaseVideoStrides [ m_iCurViewPos ][1] * iPosY; 346 m_aapiBaseVideoPelRow [m_iCurViewPos][2] = m_aapiBaseVideoPel [m_iCurViewPos] [2] + m_aaiBaseVideoStrides [ m_iCurViewPos ][2] * iPosY; 347 348 m_apiBaseDepthPelRow [m_iCurViewPos] = m_apiBaseDepthPel [m_iCurViewPos] + m_aiBaseDepthStrides [ m_iCurViewPos] * iPosY; 349 m_apbOccludedRow [m_iCurViewPos] = m_apbOccluded [m_iCurViewPos] + m_iStride * iPosY; 350 m_apiFilledRow [m_iCurViewPos] = m_apiFilled [m_iCurViewPos] + m_iStride * iPosY; 351 m_apiErrorRow = m_piError + m_iStride * iPosY; 352 353 m_aapiSynthVideoPelRow [m_iCurViewPos][0] = m_aapiSynthVideoPel [m_iCurViewPos] [0] + m_iStride * iPosY; 354 m_aapiSynthVideoPelRow [m_iCurViewPos][1] = m_aapiSynthVideoPel [m_iCurViewPos] [1] + m_iStride * iPosY; 355 m_aapiSynthVideoPelRow [m_iCurViewPos][2] = m_aapiSynthVideoPel [m_iCurViewPos] [2] + m_iStride * iPosY; 356 357 m_aapiRefVideoPelRow [0] = m_aapiRefVideoPel [0] + m_aiRefVideoStrides [0] * iPosY; 358 m_aapiRefVideoPelRow [1] = m_aapiRefVideoPel [1] + m_aiRefVideoStrides [1] * iPosY; 359 m_aapiRefVideoPelRow [2] = m_aapiRefVideoPel [2] + m_aiRefVideoStrides [2] * iPosY; 360 361 if (m_iMode == 2) 362 { 363 m_apiSynthDepthPelRow [m_iCurViewPos ] = m_apiSynthDepthPel [m_iCurViewPos] + m_iStride * iPosY; 364 m_aapiSynthVideoPelRow[m_iOtherViewPos][0] = m_aapiSynthVideoPel [m_iOtherViewPos][0] + m_iStride * iPosY; 365 m_aapiSynthVideoPelRow[m_iOtherViewPos][1] = m_aapiSynthVideoPel [m_iOtherViewPos][1] + m_iStride * iPosY; 366 m_aapiSynthVideoPelRow[m_iOtherViewPos][2] = m_aapiSynthVideoPel [m_iOtherViewPos][2] + m_iStride * iPosY; 367 368 m_apiFilledRow [m_iOtherViewPos] = m_apiFilled [m_iOtherViewPos] + m_iStride * iPosY; 369 m_apiSynthDepthPelRow [m_iOtherViewPos] = m_apiSynthDepthPel [m_iOtherViewPos] + m_iStride * iPosY; 370 371 m_aapiSynthVideoPelRow[2 ][0] = m_aapiSynthVideoPel[2] [0] + m_iStride * iPosY; 372 m_aapiSynthVideoPelRow[2 ][1] = m_aapiSynthVideoPel[2] [1] + m_iStride * iPosY; 373 m_aapiSynthVideoPelRow[2 ][2] = m_aapiSynthVideoPel[2] [2] + m_iStride * iPosY; 374 } 375 } 376 377 __inline Void 378 TRenSingleModel::xIncViewRow( ) 379 { 380 m_aapiBaseVideoPelRow [m_iCurViewPos][0] += m_aaiBaseVideoStrides [ m_iCurViewPos ][0]; 381 m_aapiBaseVideoPelRow [m_iCurViewPos][1] += m_aaiBaseVideoStrides [ m_iCurViewPos ][1]; 382 m_aapiBaseVideoPelRow [m_iCurViewPos][2] += m_aaiBaseVideoStrides [ m_iCurViewPos ][2]; 383 384 m_apiBaseDepthPelRow [m_iCurViewPos] += m_aiBaseDepthStrides [ m_iCurViewPos] ; 385 m_apbOccludedRow [m_iCurViewPos] += m_iStride ; 386 m_apiFilledRow [m_iCurViewPos] += m_iStride ; 387 m_apiErrorRow += m_iStride ; 388 389 m_aapiSynthVideoPelRow [m_iCurViewPos][0] += m_iStride ; 390 m_aapiSynthVideoPelRow [m_iCurViewPos][1] += m_iStride ; 391 m_aapiSynthVideoPelRow [m_iCurViewPos][2] += m_iStride ; 392 393 m_aapiRefVideoPelRow [0] += m_aiRefVideoStrides [0]; 394 m_aapiRefVideoPelRow [1] += m_aiRefVideoStrides [1]; 395 m_aapiRefVideoPelRow [2] += m_aiRefVideoStrides [2]; 396 397 if (m_iMode == 2) 398 { 399 m_apiSynthDepthPelRow [m_iCurViewPos ] += m_iStride ; // This is correct! 400 401 m_aapiSynthVideoPelRow[m_iOtherViewPos][0] += m_iStride ; 402 m_aapiSynthVideoPelRow[m_iOtherViewPos][1] += m_iStride ; 403 m_aapiSynthVideoPelRow[m_iOtherViewPos][2] += m_iStride ; 404 405 m_apiFilledRow [m_iOtherViewPos] += m_iStride ; 406 m_apiSynthDepthPelRow [m_iOtherViewPos] += m_iStride ; 407 408 m_aapiSynthVideoPelRow[2 ][0] += m_iStride ; 409 m_aapiSynthVideoPelRow[2 ][1] += m_iStride ; 410 m_aapiSynthVideoPelRow[2 ][2] += m_iStride ; 411 } 412 } 413 414 __inline RMDist 415 TRenSingleModel::xRenderL( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Bool bAdd ) 416 { 417 m_bSet = bAdd; 418 m_iCurViewPos = 0; 419 m_iOtherViewPos = 1; 631 template <BlenMod iBM, Bool bBitInc> __inline Void 632 TRenSingleModelC<iBM,bBitInc>::xSetViewRow( Int iPosY ) 633 { 634 m_pcInputSamplesRow[0] = m_pcInputSamples[0] + m_iInputSamplesStride * iPosY; 635 m_pcInputSamplesRow[1] = m_pcInputSamples[1] + m_iInputSamplesStride * iPosY; 636 m_pcOutputSamplesRow = m_pcOutputSamples + m_iOutputSamplesStride * iPosY; 637 638 } 639 640 template <BlenMod iBM, Bool bBitInc> __inline Void 641 TRenSingleModelC<iBM,bBitInc>::xIncViewRow( ) 642 { 643 m_pcInputSamplesRow[0] += m_iInputSamplesStride ; 644 m_pcInputSamplesRow[1] += m_iInputSamplesStride ; 645 m_pcOutputSamplesRow += m_iOutputSamplesStride; 646 } 647 #if LGE_VSO_EARLY_SKIP_A0093 648 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline RMDist 649 TRenSingleModelC<iBM,bBitInc>::xRenderL( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Bool bFast) 650 #else 651 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline RMDist 652 TRenSingleModelC<iBM,bBitInc>::xRenderL( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData) 653 #endif 654 { 655 const Int iCurViewPos = 0; 656 const Int iOtherViewPos = 1; 657 658 m_iCurViewPos = iCurViewPos ; 659 m_iOtherViewPos = iOtherViewPos; 420 660 421 661 m_piNewDepthData = piNewData; … … 426 666 return 0; 427 667 428 //TODO: Specialize to left and right; setData and getDist429 430 668 // Get Data 431 m_ppiCurLUT = m_appiShiftLut [ m_iCurViewPos];669 m_ppiCurLUT = m_appiShiftLut [iCurViewPos]; 432 670 433 671 xSetViewRow ( iStartPosY); … … 441 679 for (Int iPosY = iStartPosY; iPosY < iStartPosY + iHeight; iPosY++ ) 442 680 { 681 #ifdef LGE_VSO_EARLY_SKIP_A0093 682 if( m_bEarlySkip && bFast ) 683 { 684 if ( m_pbHorSkip[iPosY-iStartPosY] ) 685 { 686 xIncViewRow(); 687 m_piNewDepthData += iStride; 688 continue; 689 } 690 } 691 #endif 443 692 m_bInOcclusion = false; 444 693 … … 454 703 m_iLastOccludedSPos = iCurSPos + 1; 455 704 m_iLastOccludedSPosFP = xRangeLeftL( m_iLastOccludedSPos ); 456 xExtrapolateMarginL ( iCurSPos, iEndChangePos, iError ); 457 iMinChangedSPos = Min( iMinChangedSPos, (iEndChangePos << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrement( max(m_apiBaseDepthPelRow[m_iCurViewPos][iEndChangePos], m_piNewDepthData[iPosXinNewData] )) ]); 705 xExtrapolateMarginL<bSet> ( iCurSPos, iEndChangePos, iError ); 706 707 iMinChangedSPos = Min( iMinChangedSPos, (iEndChangePos << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( Max(m_pcInputSamplesRow[iCurViewPos][iEndChangePos].iD, m_piNewDepthData[iPosXinNewData] )) ]); 458 708 iLastSPos = iCurSPos; 459 709 m_iLastDepth = m_iCurDepth; 710 711 if ( bSet ) 712 { 713 m_pcInputSamplesRow[iCurViewPos][iEndChangePos].iD = m_piNewDepthData[iPosXinNewData]; 714 } 715 460 716 iPosXinNewData--; 461 717 iEndChangePos--; … … 464 720 { 465 721 iLastSPos = xShift(iEndChangePos+1); 466 m_iLastDepth = m_ apiBaseDepthPelRow[m_iCurViewPos][iEndChangePos+1];722 m_iLastDepth = m_pcInputSamplesRow [iCurViewPos][iEndChangePos+1].iD; 467 723 xInitRenderPartL( iEndChangePos, iLastSPos ); 468 724 } … … 473 729 { 474 730 // Get minimal changed sample position 475 iMinChangedSPos = Min( iMinChangedSPos, (iCurPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrement( max(m_apiBaseDepthPelRow[m_iCurViewPos][iCurPosX], m_piNewDepthData[iPosXinNewData] )) ]); 731 732 iMinChangedSPos = Min( iMinChangedSPos, (iCurPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( Max(m_pcInputSamplesRow[iCurViewPos][iCurPosX].iD, m_piNewDepthData[iPosXinNewData] )) ]); 476 733 Int iCurSPos = xShiftNewData(iCurPosX,iPosXinNewData); 477 734 m_iCurDepth = m_piNewDepthData[iPosXinNewData]; 478 xRenderRangeL (iCurSPos, iLastSPos, iCurPosX, iError );735 xRenderRangeL<bSet>(iCurSPos, iLastSPos, iCurPosX, iError ); 479 736 iLastSPos = iCurSPos; 480 737 m_iLastDepth = m_iCurDepth; 738 739 if ( bSet ) 740 { 741 m_pcInputSamplesRow[iCurViewPos][iCurPosX].iD = m_piNewDepthData[iPosXinNewData]; 742 } 743 481 744 iPosXinNewData--; 482 745 } … … 486 749 { 487 750 Int iCurSPos = xShift(iCurPosX); 488 m_iCurDepth = m_apiBaseDepthPelRow[m_iCurViewPos][iCurPosX]; 489 xRenderRangeL( iCurSPos, iLastSPos, iCurPosX, iError ); 751 752 m_iCurDepth = m_pcInputSamplesRow[iCurViewPos][iCurPosX].iD; 753 xRenderRangeL<bSet>( iCurSPos, iLastSPos, iCurPosX, iError ); 490 754 491 755 if ( iCurSPos < iMinChangedSPos ) … … 499 763 } 500 764 765 501 766 xIncViewRow(); 502 767 m_piNewDepthData += iStride; … … 505 770 } 506 771 507 508 __inline RMDist 509 TRenSingleModel::xRenderR( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Bool bAdd ) 510 { 511 m_bSet = bAdd; 512 m_iCurViewPos = 1; 513 m_iOtherViewPos = 0; 772 #ifdef LGE_VSO_EARLY_SKIP_A0093 773 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline RMDist 774 TRenSingleModelC<iBM,bBitInc>::xRenderR( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData , Bool bFast) 775 #else 776 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline RMDist 777 TRenSingleModelC<iBM,bBitInc>::xRenderR( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) 778 #endif 779 { 780 781 const Int iCurViewPos = 1; 782 const Int iOtherViewPos = 0; 783 784 m_iCurViewPos = iCurViewPos; 785 m_iOtherViewPos = iOtherViewPos; 514 786 515 787 m_piNewDepthData = piNewData; … … 521 793 522 794 // Get Data 523 m_ppiCurLUT = m_appiShiftLut [m_iCurViewPos]; 524 795 m_ppiCurLUT = m_appiShiftLut [iCurViewPos]; 525 796 xSetViewRow ( iStartPosY); 526 797 … … 534 805 for (Int iPosY = iStartPosY; iPosY < iStartPosY + iHeight; iPosY++ ) 535 806 { 807 808 #ifdef LGE_VSO_EARLY_SKIP_A0093 809 if( m_bEarlySkip && bFast ) 810 { 811 if ( m_pbHorSkip[iPosY-iStartPosY] ) 812 { 813 xIncViewRow(); 814 m_piNewDepthData += iStride; 815 continue; 816 } 817 } 818 #endif 536 819 m_bInOcclusion = false; 537 820 … … 547 830 m_iLastOccludedSPos = iCurSPos - 1; 548 831 m_iLastOccludedSPosFP = xRangeRightR( m_iLastOccludedSPos ); 549 xExtrapolateMarginR ( iCurSPos, iStartChangePos, iError ); 550 iMaxChangedSPos = max( iMaxChangedSPos, (iStartChangePos << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrement( max(m_apiBaseDepthPelRow[m_iCurViewPos][iStartChangePos], m_piNewDepthData[iPosXinNewData] )) ]); 832 xExtrapolateMarginR<bSet> ( iCurSPos, iStartChangePos, iError ); 833 834 iMaxChangedSPos = Max( iMaxChangedSPos, (iStartChangePos << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( Max(m_pcInputSamplesRow[iCurViewPos][iStartChangePos].iD, m_piNewDepthData[iPosXinNewData] )) ]); 551 835 iLastSPos = iCurSPos; 552 836 m_iLastDepth = m_iCurDepth; 837 if ( bSet ) 838 { 839 m_pcInputSamplesRow[iCurViewPos][iStartChangePos].iD = m_piNewDepthData[iPosXinNewData]; 840 } 841 842 553 843 iPosXinNewData++; 554 844 iStartChangePos++; … … 557 847 { 558 848 iLastSPos = xShift(iStartChangePos-1); 559 m_iLastDepth = m_apiBaseDepthPelRow[m_iCurViewPos][iStartChangePos-1]; 849 850 m_iLastDepth = m_pcInputSamplesRow[iCurViewPos][iStartChangePos-1].iD; 560 851 xInitRenderPartR( iStartChangePos, iLastSPos ); 561 852 } … … 566 857 { 567 858 // Get minimal changed sample position 568 iMaxChangedSPos = max( iMaxChangedSPos, (iCurPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrement( max(m_apiBaseDepthPelRow[m_iCurViewPos][iCurPosX], m_piNewDepthData[iPosXinNewData] )) ]); 859 860 iMaxChangedSPos = Max( iMaxChangedSPos, (iCurPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( Max(m_pcInputSamplesRow[iCurViewPos][iCurPosX].iD, m_piNewDepthData[iPosXinNewData] )) ]); 569 861 Int iCurSPos = xShiftNewData(iCurPosX,iPosXinNewData); 570 862 m_iCurDepth = m_piNewDepthData[iPosXinNewData]; 571 xRenderRangeR (iCurSPos, iLastSPos, iCurPosX, iError );863 xRenderRangeR<bSet>(iCurSPos, iLastSPos, iCurPosX, iError ); 572 864 iLastSPos = iCurSPos; 573 865 m_iLastDepth = m_iCurDepth; 866 867 if ( bSet ) 868 { 869 m_pcInputSamplesRow[iCurViewPos][iCurPosX].iD = m_piNewDepthData[iPosXinNewData]; 870 } 871 574 872 iPosXinNewData++; 575 873 } … … 579 877 { 580 878 Int iCurSPos = xShift(iCurPosX); 581 m_iCurDepth = m_apiBaseDepthPelRow[m_iCurViewPos][iCurPosX]; 582 xRenderRangeR( iCurSPos, iLastSPos, iCurPosX, iError ); 879 880 m_iCurDepth = m_pcInputSamplesRow[iCurViewPos][iCurPosX].iD; 881 xRenderRangeR<bSet>( iCurSPos, iLastSPos, iCurPosX, iError ); 583 882 584 883 if ( iCurSPos > iMaxChangedSPos ) … … 590 889 m_iLastDepth = m_iCurDepth; 591 890 } 891 592 892 xIncViewRow(); 593 893 m_piNewDepthData += iStride; … … 597 897 598 898 599 __inline Void 600 TRenSingleModel::xInitRenderPartL( Int iEndChangePos, Int iLastSPos ) 601 { 899 template <BlenMod iBM, Bool bBitInc> __inline Void 900 TRenSingleModelC<iBM,bBitInc>::xInitRenderPartL( Int iEndChangePos, Int iLastSPos ) 901 { 902 const Int iCurViewPos = 0; 602 903 // GET MINIMAL OCCLUDED SAMPLE POSITION 603 904 Int iCurPosX = iEndChangePos; 604 905 605 if ( ( iCurPosX + 1 < m_iWidth ) && (m_apbOccludedRow[m_iCurViewPos][ iCurPosX + 1] ) ) 906 907 if ( ( iCurPosX + 1 < m_iWidth ) && (m_pcInputSamplesRow[iCurViewPos][ iCurPosX + 1].bOccluded ) ) 606 908 { 607 909 iCurPosX++; 608 while ( (iCurPosX + 1 < m_iWidth) && (m_apbOccludedRow[m_iCurViewPos][ iCurPosX + 1] ) ) 910 911 while ( (iCurPosX + 1 < m_iWidth) && (m_pcInputSamplesRow[iCurViewPos][ iCurPosX + 1].bOccluded ) ) 912 609 913 iCurPosX++; 610 914 … … 630 934 }; 631 935 632 __inline Void 633 TRenSingleModel::xInitRenderPartR( Int iStartChangePos, Int iLastSPos ) 634 { 936 template <BlenMod iBM, Bool bBitInc> __inline Void 937 TRenSingleModelC<iBM,bBitInc>::xInitRenderPartR( Int iStartChangePos, Int iLastSPos ) 938 { 939 const Int iCurViewPos = 1; 635 940 // GET MINIMAL OCCLUDED SAMPLE POSITION 636 941 Int iCurPosX = iStartChangePos; 637 942 638 if ( ( iCurPosX - 1 > -1 ) && (m_ apbOccludedRow[m_iCurViewPos][ iCurPosX - 1]) )943 if ( ( iCurPosX - 1 > -1 ) && (m_pcInputSamplesRow[iCurViewPos][ iCurPosX - 1].bOccluded ) ) 639 944 { 640 945 iCurPosX--; 641 while ( (iCurPosX - 1 > -1 ) && (m_apbOccludedRow[m_iCurViewPos][ iCurPosX - 1] ) ) 946 947 while ( (iCurPosX - 1 > -1 ) && (m_pcInputSamplesRow[iCurViewPos][ iCurPosX - 1].bOccluded ) ) 642 948 iCurPosX--; 643 949 … … 663 969 664 970 665 __inline Void666 TRenSingleModel ::xRenderShiftedRangeL(Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError )971 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void 972 TRenSingleModelC<iBM,bBitInc>::xRenderShiftedRangeL(Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ) 667 973 { 668 974 assert( iCurSPos <= iLastSPos ); … … 672 978 if ( iDeltaSPos > m_iGapTolerance ) 673 979 { 674 xFillHoleL ( iCurSPos, iLastSPos, iCurPos, riError );980 xFillHoleL<bSet>( iCurSPos, iLastSPos, iCurPos, riError ); 675 981 } 676 982 else … … 679 985 return; 680 986 681 AOT( iDeltaSPos > m_iGapTolerance );987 RM_AOT( iDeltaSPos > m_iGapTolerance ); 682 988 683 989 m_iThisDepth = m_iCurDepth; 684 for (Int iFillSPos = max(0, xRangeLeftL(iCurSPos) ); iFillSPos <= min(xRangeRightL( iLastSPos ) ,m_iLastOccludedSPosFP-1); iFillSPos++ )990 for (Int iFillSPos = Max(0, xRangeLeftL(iCurSPos) ); iFillSPos <= min(xRangeRightL( iLastSPos ) ,m_iLastOccludedSPosFP-1); iFillSPos++ ) 685 991 { 686 992 Int iDeltaCurSPos = (iFillSPos << m_iShiftPrec) - iCurSPos; 687 993 688 AOT( iDeltaCurSPos > iDeltaSPos ); 689 AOT( iDeltaCurSPos < 0 ); 690 AOT( m_aaiSubPelShiftL[iDeltaSPos][iDeltaCurSPos] == 0xdeaddead); 691 692 Int iSourcePos = (iCurPos << m_iShiftPrec) + m_aaiSubPelShiftL[iDeltaSPos][iDeltaCurSPos]; // GT: = iPosX - iStep + ( iStep * iDeltaCurPos + ( iDeltaPos >> 1) ) / iDeltaPos; 693 xSetShiftedPel( iSourcePos, iFillSPos, REN_IS_FILLED, riError ); 994 RM_AOT( iDeltaCurSPos > iDeltaSPos ); 995 RM_AOT( iDeltaCurSPos < 0 ); 996 RM_AOT( m_aaiSubPelShiftL[iDeltaSPos][iDeltaCurSPos] == 0xdeaddead); 997 998 xSetShiftedPelL<bSet>( iCurPos, m_aaiSubPelShiftL[iDeltaSPos][iDeltaCurSPos], iFillSPos, REN_IS_FILLED, riError ); 694 999 } 695 1000 }; 696 1001 } 697 1002 698 __inline Void699 TRenSingleModel ::xRenderShiftedRangeR(Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError )1003 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void 1004 TRenSingleModelC<iBM,bBitInc>::xRenderShiftedRangeR(Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ) 700 1005 { 701 1006 assert( iCurSPos >= iLastSPos ); 702 //assert( iRightSPos < m_iWidth );703 1007 704 1008 Int iDeltaSPos = iCurSPos - iLastSPos; 705 1009 if ( iDeltaSPos > m_iGapTolerance ) 706 1010 { 707 xFillHoleR ( iCurSPos, iLastSPos, iCurPos, riError );1011 xFillHoleR<bSet>( iCurSPos, iLastSPos, iCurPos, riError ); 708 1012 } 709 1013 else … … 713 1017 714 1018 m_iThisDepth = m_iCurDepth; 715 AOT( iDeltaSPos > m_iGapTolerance );1019 RM_AOT( iDeltaSPos > m_iGapTolerance ); 716 1020 for (Int iFillSPos = max(m_iLastOccludedSPosFP+1, xRangeLeftR(iLastSPos) ); iFillSPos <= min(xRangeRightR( iCurSPos ) ,m_iWidth -1); iFillSPos++ ) 717 1021 { 718 1022 Int iDeltaCurSPos = (iFillSPos << m_iShiftPrec) - iLastSPos; 719 1023 720 AOT( iDeltaCurSPos > iDeltaSPos ); 721 AOT( iDeltaCurSPos < 0 ); 722 AOT( m_aaiSubPelShiftR[iDeltaSPos][iDeltaCurSPos] == 0xdeaddead); 723 724 Int iSourcePos = (iCurPos << m_iShiftPrec) + m_aaiSubPelShiftR[iDeltaSPos][iDeltaCurSPos]; // GT: = iPosX - iStep + ( iStep * iDeltaCurPos + ( iDeltaPos >> 1) ) / iDeltaPos; 725 726 xSetShiftedPel( iSourcePos, iFillSPos, REN_IS_FILLED, riError ); 1024 RM_AOT( iDeltaCurSPos > iDeltaSPos ); 1025 RM_AOT( iDeltaCurSPos < 0 ); 1026 RM_AOT( m_aaiSubPelShiftR[iDeltaSPos][iDeltaCurSPos] == 0xdeaddead); 1027 1028 xSetShiftedPelR<bSet>( iCurPos, m_aaiSubPelShiftR[iDeltaSPos][iDeltaCurSPos], iFillSPos, REN_IS_FILLED, riError ); 727 1029 } 728 1030 }; … … 731 1033 732 1034 733 __inline Void 734 TRenSingleModel::xRenderRangeL(Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ) 735 { 1035 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void 1036 TRenSingleModelC<iBM,bBitInc>::xRenderRangeL(Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ) 1037 { 1038 const Int iCurViewPos = 0; 736 1039 if ( !m_bInOcclusion ) 737 1040 { … … 744 1047 { 745 1048 m_iThisDepth = m_iLastDepth; 746 xSetShiftedPel( (iCurPos+1) << m_iShiftPrec, iRightSPosFP, REN_IS_FILLED, riError ); 1049 1050 xSetShiftedPelL<bSet>( iCurPos+1, 0, iRightSPosFP, REN_IS_FILLED, riError ); 747 1051 } 748 1052 m_iLastOccludedSPosFP = iRightSPosFP; … … 750 1054 m_bInOcclusion = true; 751 1055 752 if ( m_bSet )753 { 754 m_ apbOccludedRow[m_iCurViewPos][ iCurPos ]= true;1056 if ( bSet ) 1057 { 1058 m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded = true; 755 1059 } 756 1060 } 757 1061 else 758 1062 { 759 if ( m_bSet )760 { 761 m_ apbOccludedRow[m_iCurViewPos][ iCurPos ]= false;762 } 763 764 xRenderShiftedRangeL (iCurSPos, iLastSPos, iCurPos, riError );1063 if ( bSet ) 1064 { 1065 m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded = false; 1066 } 1067 1068 xRenderShiftedRangeL<bSet>(iCurSPos, iLastSPos, iCurPos, riError ); 765 1069 } 766 1070 } … … 770 1074 { 771 1075 m_bInOcclusion = false; 772 if ( m_bSet )773 { 774 m_ apbOccludedRow[m_iCurViewPos][ iCurPos ]= false;775 } 776 777 xRenderShiftedRangeL (iCurSPos, iLastSPos, iCurPos, riError );1076 if ( bSet ) 1077 { 1078 m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded = false; 1079 } 1080 1081 xRenderShiftedRangeL<bSet>(iCurSPos, iLastSPos, iCurPos, riError ); 778 1082 } 779 1083 else 780 1084 { 781 if ( m_bSet ) 782 { 783 m_apbOccludedRow[m_iCurViewPos][ iCurPos ] = true; 784 } 785 } 786 } 787 } 788 789 __inline Void 790 TRenSingleModel::xRenderRangeR(Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ) 791 { 1085 if ( bSet ) 1086 { 1087 m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded = true; 1088 } 1089 } 1090 } 1091 } 1092 1093 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void 1094 TRenSingleModelC<iBM,bBitInc>::xRenderRangeR(Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ) 1095 { 1096 const Int iCurViewPos = 1; 792 1097 // Find out if current sample is occluded 793 1098 if ( !m_bInOcclusion ) … … 801 1106 { 802 1107 m_iThisDepth = m_iLastDepth; 803 xSetShiftedPel ( (iCurPos-1) << m_iShiftPrec, iLeftSPosFP, REN_IS_FILLED, riError );1108 xSetShiftedPelR<bSet>( iCurPos-1,1 << m_iShiftPrec , iLeftSPosFP, REN_IS_FILLED, riError ); 804 1109 } 805 1110 m_iLastOccludedSPosFP = iLeftSPosFP; … … 807 1112 m_bInOcclusion = true; 808 1113 809 if ( m_bSet )810 { 811 m_ apbOccludedRow[m_iCurViewPos][ iCurPos ]= true;1114 if ( bSet ) 1115 { 1116 m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded = true; 812 1117 } 813 1118 } 814 1119 else 815 1120 { 816 if ( m_bSet )817 { 818 m_ apbOccludedRow[m_iCurViewPos][ iCurPos ]= false;819 } 820 821 xRenderShiftedRangeR (iCurSPos, iLastSPos, iCurPos, riError );1121 if ( bSet ) 1122 { 1123 m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded = false; 1124 } 1125 1126 xRenderShiftedRangeR<bSet>(iCurSPos, iLastSPos, iCurPos, riError ); 822 1127 } 823 1128 } … … 827 1132 { 828 1133 m_bInOcclusion = false; 829 if ( m_bSet )830 { 831 m_ apbOccludedRow[m_iCurViewPos][ iCurPos ]= false;832 } 833 834 xRenderShiftedRangeR (iCurSPos, iLastSPos, iCurPos, riError );1134 if ( bSet ) 1135 { 1136 m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded = false; 1137 } 1138 1139 xRenderShiftedRangeR<bSet>(iCurSPos, iLastSPos, iCurPos, riError ); 835 1140 } 836 1141 else 837 1142 { 838 if ( m_bSet )839 { 840 m_ apbOccludedRow[m_iCurViewPos][ iCurPos ]= true;841 } 842 } 843 } 844 } 845 846 __inline Void847 TRenSingleModel ::xFillHoleL( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError )1143 if ( bSet ) 1144 { 1145 m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded = true; 1146 } 1147 } 1148 } 1149 } 1150 1151 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void 1152 TRenSingleModelC<iBM,bBitInc>::xFillHoleL( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ) 848 1153 { 849 1154 if (iLastSPos < 0) … … 861 1166 { 862 1167 m_iThisDepth = m_iCurDepth; 863 xSetShiftedPel ( iStartFillPos << m_iShiftPrec, iStartFillSPosFP, REN_IS_FILLED, riError );1168 xSetShiftedPelL<bSet> ( iStartFillPos, 0, iStartFillSPosFP, REN_IS_FILLED, riError ); 864 1169 } 865 1170 } … … 870 1175 871 1176 m_iThisDepth = m_iLastDepth; 872 for (Int iFillSPos = max(iStartFillSPosFP+1,0); iFillSPos <= min(xRangeRightL( iLastSPos ), m_iLastOccludedSPosFP-1 ); iFillSPos++ )873 { 874 xSetShiftedPel ( iLastPos << m_iShiftPrec,iFillSPos, REN_IS_HOLE, riError );875 } 876 } 877 878 __inline Void879 TRenSingleModel ::xFillHoleR( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError )1177 for (Int iFillSPos = Max(iStartFillSPosFP+1,0); iFillSPos <= min(xRangeRightL( iLastSPos ), m_iLastOccludedSPosFP-1 ); iFillSPos++ ) 1178 { 1179 xSetShiftedPelL<bSet>( iLastPos, 0, iFillSPos, REN_IS_HOLE, riError ); 1180 } 1181 } 1182 1183 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void 1184 TRenSingleModelC<iBM,bBitInc>::xFillHoleR( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ) 880 1185 { 881 1186 if (iLastSPos < 0) … … 893 1198 { 894 1199 m_iThisDepth = m_iCurDepth; 895 xSetShiftedPel ( iEndFillPos << m_iShiftPrec, iStartFillSPosFP, REN_IS_FILLED, riError );1200 xSetShiftedPelR<bSet>( iEndFillPos, 1 << m_iShiftPrec , iStartFillSPosFP, REN_IS_FILLED, riError ); 896 1201 } 897 1202 } … … 904 1209 for (Int iFillSPos = max(xRangeLeftR( iLastSPos ), m_iLastOccludedSPosFP+1); iFillSPos <= min(iStartFillSPosFP,m_iWidth)-1 ; iFillSPos++ ) 905 1210 { 906 xSetShiftedPel ( iLastPos<< m_iShiftPrec, iFillSPos, REN_IS_HOLE, riError );907 } 908 } 909 910 __inline Void911 TRenSingleModel ::xExtrapolateMarginL(Int iCurSPos, Int iCurPos, RMDist& riError )1211 xSetShiftedPelR<bSet>( iLastPos, 1 << m_iShiftPrec, iFillSPos, REN_IS_HOLE, riError ); 1212 } 1213 } 1214 1215 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void 1216 TRenSingleModelC<iBM,bBitInc>::xExtrapolateMarginL(Int iCurSPos, Int iCurPos, RMDist& riError ) 912 1217 { 913 1218 // if (iLeftSPos < 0 ) 914 1219 // return; 915 1220 916 Int iSPosFullPel = max(0,xRangeLeftL(iCurSPos));1221 Int iSPosFullPel = Max(0,xRangeLeftL(iCurSPos)); 917 1222 918 1223 m_iThisDepth = m_iCurDepth; 919 1224 if (iSPosFullPel < m_iWidth) 920 1225 { 921 xSetShiftedPel ( iCurPos << m_iShiftPrec, iSPosFullPel, REN_IS_FILLED, riError );1226 xSetShiftedPelL<bSet>( iCurPos, 0, iSPosFullPel, REN_IS_FILLED, riError ); 922 1227 } 923 1228 924 1229 for (Int iFillSPos = iSPosFullPel +1; iFillSPos < m_iWidth; iFillSPos++ ) 925 1230 { 926 xSetShiftedPel ( iCurPos << m_iShiftPrec, iFillSPos, REN_IS_HOLE, riError );927 } 928 } 929 930 __inline Void931 TRenSingleModel ::xExtrapolateMarginR(Int iCurSPos, Int iCurPos, RMDist& riError )1231 xSetShiftedPelL<bSet>( iCurPos, 0, iFillSPos, REN_IS_HOLE, riError ); 1232 } 1233 } 1234 1235 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void 1236 TRenSingleModelC<iBM,bBitInc>::xExtrapolateMarginR(Int iCurSPos, Int iCurPos, RMDist& riError ) 932 1237 { 933 1238 // if (iLeftSPos < 0 ) … … 939 1244 if (iSPosFullPel > -1) 940 1245 { 941 xSetShiftedPel ( iCurPos<< m_iShiftPrec, iSPosFullPel, REN_IS_FILLED, riError );1246 xSetShiftedPelR<bSet>( iCurPos, 1 << m_iShiftPrec, iSPosFullPel, REN_IS_FILLED, riError ); 942 1247 } 943 1248 944 1249 for (Int iFillSPos = iSPosFullPel -1; iFillSPos > -1; iFillSPos-- ) 945 1250 { 946 xSetShiftedPel ( iCurPos<< m_iShiftPrec, iFillSPos, REN_IS_HOLE, riError );947 } 948 } 949 950 951 __inline Int 952 TRenSingleModel::xShiftNewData( Int iPosX, Int iPosInNewData ) 953 { 954 AOT( iPosInNewData < 0);955 AOF( iPosInNewData < m_iNewDataWidth ); 956 957 return (iPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrement( m_piNewDepthData[iPosInNewData] )]; 958 } 959 960 __inline Int 961 TRenSingleModel::xShift( Int iPosX ) 962 { 963 AOT( iPosX < 0);964 AOF( iPosX < m_iWidth); 965 return (iPosX << m_iShiftPrec) - m_ppiCurLUT[0][ Re moveBitIncrement( m_apiBaseDepthPelRow[m_iCurViewPos][iPosX])];966 } 967 968 969 __inline Int970 TRenSingleModel ::xShift( Int iPos, Int iPosInNewData )1251 xSetShiftedPelR<bSet>( iCurPos , 1 << m_iShiftPrec, iFillSPos, REN_IS_HOLE, riError ); 1252 } 1253 } 1254 1255 template <BlenMod iBM, Bool bBitInc> __inline Int 1256 TRenSingleModelC<iBM,bBitInc>::xShiftNewData( Int iPosX, Int iPosInNewData ) 1257 { 1258 RM_AOT( iPosInNewData < 0 ); 1259 RM_AOF( iPosInNewData < m_iNewDataWidth ); 1260 1261 return (iPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( m_piNewDepthData[iPosInNewData] )]; 1262 } 1263 1264 template <BlenMod iBM, Bool bBitInc> __inline Int 1265 TRenSingleModelC<iBM,bBitInc>::xShift( Int iPosX ) 1266 { 1267 RM_AOT( iPosX < 0); 1268 RM_AOF( iPosX < m_iWidth); 1269 1270 return (iPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( m_pcInputSamplesRow[m_iCurViewPos][iPosX].iD )]; 1271 } 1272 1273 1274 template <BlenMod iBM, Bool bBitInc> __inline Int 1275 TRenSingleModelC<iBM,bBitInc>::xShift( Int iPos, Int iPosInNewData ) 971 1276 { 972 1277 if ( (iPosInNewData >= 0) && (iPosInNewData < m_iNewDataWidth) ) … … 980 1285 } 981 1286 982 __inline Int983 TRenSingleModel ::xRangeLeftL( Int iPos )1287 template <BlenMod iBM, Bool bBitInc> __inline Int 1288 TRenSingleModelC<iBM,bBitInc>::xRangeLeftL( Int iPos ) 984 1289 { 985 1290 return ( iPos + (1 << m_iShiftPrec) - 1) >> m_iShiftPrec; … … 987 1292 988 1293 989 __inline Int990 TRenSingleModel ::xRangeLeftR( Int iPos )1294 template <BlenMod iBM, Bool bBitInc> __inline Int 1295 TRenSingleModelC<iBM,bBitInc>::xRangeLeftR( Int iPos ) 991 1296 { 992 1297 … … 995 1300 996 1301 997 __inline Int998 TRenSingleModel ::xRangeRightL( Int iPos )1302 template <BlenMod iBM, Bool bBitInc> __inline Int 1303 TRenSingleModelC<iBM,bBitInc>::xRangeRightL( Int iPos ) 999 1304 { 1000 1305 return xRangeLeftL(iPos) - 1; 1001 1306 } 1002 1307 1003 __inline Int1004 TRenSingleModel ::xRangeRightR( Int iPos )1308 template <BlenMod iBM, Bool bBitInc> __inline Int 1309 TRenSingleModelC<iBM,bBitInc>::xRangeRightR( Int iPos ) 1005 1310 { 1006 1311 return iPos >> m_iShiftPrec; … … 1008 1313 1009 1314 1010 __inline Int1011 TRenSingleModel ::xRoundL( Int iPos )1315 template <BlenMod iBM, Bool bBitInc> __inline Int 1316 TRenSingleModelC<iBM,bBitInc>::xRoundL( Int iPos ) 1012 1317 { 1013 1318 return (iPos + (( 1 << m_iShiftPrec ) >> 1 )) >> m_iShiftPrec; 1014 1319 } 1015 1320 1016 __inline Int1017 TRenSingleModel ::xRoundR( Int iPos )1321 template <BlenMod iBM, Bool bBitInc> __inline Int 1322 TRenSingleModelC<iBM,bBitInc>::xRoundR( Int iPos ) 1018 1323 { 1019 1324 return (m_iShiftPrec == 0) ? iPos : xRoundL(iPos - 1); … … 1021 1326 1022 1327 1023 Void1024 TRenSingleModel ::xSetPels( Pel* piPelSource , Int iSourceStride, Int iWidth, Int iHeight, Pel iVal )1328 template <BlenMod iBM, Bool bBitInc> Void 1329 TRenSingleModelC<iBM,bBitInc>::xSetPels( Pel* piPelSource , Int iSourceStride, Int iWidth, Int iHeight, Pel iVal ) 1025 1330 { 1026 1331 for (Int iYPos = 0; iYPos < iHeight; iYPos++) … … 1034 1339 } 1035 1340 1036 Void1037 TRenSingleModel ::xSetInts( Int* piPelSource , Int iSourceStride, Int iWidth, Int iHeight, Int iVal )1341 template <BlenMod iBM, Bool bBitInc> Void 1342 TRenSingleModelC<iBM,bBitInc>::xSetInts( Int* piPelSource , Int iSourceStride, Int iWidth, Int iHeight, Int iVal ) 1038 1343 { 1039 1344 for (Int iYPos = 0; iYPos < iHeight; iYPos++) … … 1048 1353 1049 1354 1050 Void1051 TRenSingleModel ::xSetBools( Bool* pbPelSource , Int iSourceStride, Int iWidth, Int iHeight, Bool bVal )1355 template <BlenMod iBM, Bool bBitInc> Void 1356 TRenSingleModelC<iBM,bBitInc>::xSetBools( Bool* pbPelSource , Int iSourceStride, Int iWidth, Int iHeight, Bool bVal ) 1052 1357 { 1053 1358 for (Int iYPos = 0; iYPos < iHeight; iYPos++) … … 1061 1366 } 1062 1367 1063 Void 1064 TRenSingleModel::xInitView( Int iViewPos ) 1065 { 1066 AOT( iViewPos == VIEWPOS_MERGED && ( m_iMode == 0 || m_iMode == 1 ) ); 1067 1068 xSetPels( m_aapiSynthVideoPel[iViewPos][0], m_iStride, m_iWidth, m_iHeight, 0 ); 1069 xSetPels( m_aapiSynthVideoPel[iViewPos][1], m_iStride, m_iWidth, m_iHeight, 128 << g_uiBitIncrement ); 1070 xSetPels( m_aapiSynthVideoPel[iViewPos][2], m_iStride, m_iWidth, m_iHeight, 128 << g_uiBitIncrement ); 1071 1072 if ( iViewPos != VIEWPOS_MERGED) 1073 { 1074 xSetBools( m_apbOccluded [iViewPos], m_iStride, m_iWidth, m_iHeight, false ); 1075 xSetPels ( m_apiFilled [iViewPos], m_iStride, m_iWidth, m_iHeight, REN_IS_HOLE); 1076 if ( m_iMode == 2 ) 1077 { 1078 xSetPels( m_apiSynthDepthPel [iViewPos], m_iStride, m_iWidth, m_iHeight, 0); 1079 } 1080 } 1081 } 1082 1083 __inline Void 1084 TRenSingleModel::xSetShiftedPel(Int iSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError ) 1085 { 1086 AOT( iSourcePos < 0 ); 1087 AOT( iSourcePos >= m_iSampledWidth ); 1088 1089 AOT( iTargetSPos < 0 ); 1090 AOT( iTargetSPos >= m_iWidth ); 1091 // AOT( m_apiFilledRow[m_iViewPos][iTargetSPos] != REN_IS_HOLE); 1092 1093 if ( m_iMode == 2) 1094 { 1095 xSetShiftedPelBlend(iSourcePos, iTargetSPos, iFilled, riError ); 1096 return; 1097 } 1098 1099 if ( m_bSet ) 1100 { 1101 m_aapiSynthVideoPelRow[m_iCurViewPos][0][iTargetSPos] = m_aapiBaseVideoPelRow[m_iCurViewPos][0][iSourcePos]; 1102 #if HHI_VSO_COLOR_PLANES 1103 m_aapiSynthVideoPelRow[m_iCurViewPos][1][iTargetSPos] = m_aapiBaseVideoPelRow[m_iCurViewPos][1][iSourcePos]; 1104 m_aapiSynthVideoPelRow[m_iCurViewPos][2][iTargetSPos] = m_aapiBaseVideoPelRow[m_iCurViewPos][2][iSourcePos]; 1105 #endif 1106 m_apiFilledRow [m_iCurViewPos] [iTargetSPos] = iFilled; 1107 Int iDiffY = m_aapiRefVideoPelRow [0][iTargetSPos] - m_aapiSynthVideoPelRow[m_iCurViewPos][0][iTargetSPos]; 1108 #if HHI_VSO_COLOR_PLANES 1109 Int iDiffU = m_aapiRefVideoPelRow [1][iTargetSPos] - m_aapiSynthVideoPelRow[m_iCurViewPos][1][iTargetSPos]; 1110 Int iDiffV = m_aapiRefVideoPelRow [2][iTargetSPos] - m_aapiSynthVideoPelRow[m_iCurViewPos][2][iTargetSPos]; 1111 m_apiErrorRow [iTargetSPos] = xGetDist( iDiffY, iDiffU, iDiffV); 1112 #else 1113 m_apiErrorRow [iTargetSPos] = xGetDist(iDiffY); 1114 #endif 1368 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void 1369 TRenSingleModelC<iBM,bBitInc>::xSetShiftedPelL(Int iSourcePos, Int iSubSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError ) 1370 { 1371 RM_AOT( iSourcePos < 0 ); 1372 RM_AOT( iSourcePos >= m_iWidth ); 1373 RM_AOT( iSubSourcePos < 0 ); 1374 RM_AOT( iSubSourcePos > (1 << m_iShiftPrec) ); 1375 RM_AOT( iTargetSPos < 0 ); 1376 RM_AOT( iTargetSPos >= m_iWidth ); 1377 1378 RenModelOutPels* pcOutSample = m_pcOutputSamplesRow + iTargetSPos; 1379 RenModelInPels * pcInSample = m_pcInputSamplesRow[VIEWPOS_LEFT] + iSourcePos ; 1380 1381 if ( iBM != BLEND_NONE ) 1382 { 1383 xSetShiftedPelBlendL<bSet> (pcInSample, iSubSourcePos, pcOutSample, iFilled, riError); 1115 1384 } 1116 1385 else 1117 1386 { 1118 Int iSDOld = m_apiErrorRow [iTargetSPos]; 1119 Int iDiffY = m_aapiRefVideoPelRow [0][iTargetSPos] - m_aapiBaseVideoPelRow [m_iCurViewPos][0][iSourcePos]; 1120 #if HHI_VSO_COLOR_PLANES 1121 Int iDiffU = m_aapiRefVideoPelRow [1][iTargetSPos] - m_aapiBaseVideoPelRow [m_iCurViewPos][1][iSourcePos]; 1122 Int iDiffV = m_aapiRefVideoPelRow [2][iTargetSPos] - m_aapiBaseVideoPelRow [m_iCurViewPos][2][iSourcePos]; 1123 riError += ( xGetDist(iDiffY,iDiffU,iDiffV) - iSDOld ); 1124 #else 1125 riError += ( xGetDist( iDiffY ) - iSDOld ); 1126 #endif 1127 } 1128 } 1129 1130 __inline Void 1131 TRenSingleModel::xSetShiftedPelBlend( Int iSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError ) 1132 { 1133 AOT( iSourcePos < 0 ); 1134 AOT( iSourcePos >= m_iSampledWidth ); 1135 1136 AOT( iTargetSPos < 0 ); 1137 AOT( iTargetSPos >= m_iWidth ); 1138 // AOT( m_apiFilledRow[m_iViewPos][iTargetSPos] != REN_IS_HOLE); 1139 1387 xSetShiftedPelNoBlendL<bSet>(pcInSample, iSubSourcePos, pcOutSample, iFilled, riError); 1388 } 1389 } 1390 1391 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void 1392 TRenSingleModelC<iBM,bBitInc>::xSetShiftedPelNoBlendL(RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ) 1393 { 1394 if ( bSet ) 1395 { 1396 // Filled 1397 pcOutSample->iFilledLeft = iFilled; 1398 1399 // Yuv 1400 pcOutSample->iYLeft = pcInSample->aiY[iSubSourcePos]; 1401 #if HHI_VSO_COLOR_PLANES 1402 pcOutSample->iULeft = pcInSample->aiU[iSubSourcePos]; 1403 pcOutSample->iVLeft = pcInSample->aiV[iSubSourcePos]; 1404 1405 pcOutSample->iError = xGetDist( pcOutSample->iYLeft - pcOutSample->iYRef, 1406 pcOutSample->iULeft - pcOutSample->iURef, 1407 pcOutSample->iVLeft - pcOutSample->iVRef 1408 ); 1409 #else 1410 pcOutSample->iError = xGetDist( pcOutSample->iYLeft - pcOutSample->iYRef ); 1411 #endif 1412 1413 } 1414 else 1415 { 1416 #if HHI_VSO_COLOR_PLANES 1417 riError += xGetDist( pcInSample->aiY[iSubSourcePos] - pcOutSample->iYRef, 1418 pcInSample->aiU[iSubSourcePos] - pcOutSample->iURef, 1419 pcInSample->aiV[iSubSourcePos] - pcOutSample->iVRef 1420 ); 1421 #else 1422 riError += xGetDist( pcInSample->aiY[iSubSourcePos] - pcOutSample->iYRef ); 1423 #endif 1424 1425 riError -= pcOutSample->iError; 1426 } 1427 } 1428 1429 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void 1430 TRenSingleModelC<iBM,bBitInc>::xSetShiftedPelBlendL(RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ) 1431 { 1140 1432 Pel piBlendedValueY; 1141 1433 #if HHI_VSO_COLOR_PLANES … … 1144 1436 #endif 1145 1437 1146 1147 if (m_iCurViewPos == 0) 1148 { 1149 xGetBlendedValue ( 1150 m_aapiBaseVideoPelRow [0][0][iSourcePos ] , 1151 m_aapiSynthVideoPelRow [1][0][iTargetSPos] , 1152 #if HHI_VSO_COLOR_PLANES 1153 m_aapiBaseVideoPelRow [0][1][iSourcePos ] , 1154 m_aapiSynthVideoPelRow [1][1][iTargetSPos] , 1155 m_aapiBaseVideoPelRow [0][2][iSourcePos ] , 1156 m_aapiSynthVideoPelRow [1][2][iTargetSPos] , 1157 #endif 1158 m_piInvZLUTLeft [RemoveBitIncrement(m_iThisDepth) ], 1159 m_piInvZLUTRight[RemoveBitIncrement(m_apiSynthDepthPelRow[1] [iTargetSPos])], 1160 iFilled, 1161 m_apiFilledRow [1] [iTargetSPos] , 1162 piBlendedValueY 1438 xGetBlendedValue ( 1439 pcInSample ->aiY[iSubSourcePos], 1440 pcOutSample->iYRight, 1441 #if HHI_VSO_COLOR_PLANES 1442 pcInSample ->aiU[iSubSourcePos], 1443 pcOutSample->iURight, 1444 pcInSample ->aiV[iSubSourcePos], 1445 pcOutSample->iVRight, 1446 #endif 1447 m_piInvZLUTLeft [RenModRemoveBitInc(m_iThisDepth) ], 1448 m_piInvZLUTRight[RenModRemoveBitInc(pcOutSample->iDRight)], 1449 iFilled, 1450 pcOutSample->iFilledRight , 1451 piBlendedValueY 1163 1452 #if HHI_VSO_COLOR_PLANES 1164 1453 , piBlendedValueU, 1165 1454 piBlendedValueV 1166 1455 #endif 1167 1456 ); 1457 1458 if ( bSet ) 1459 { 1460 // Set values 1461 pcOutSample->iDLeft = m_iThisDepth; 1462 pcOutSample->iYLeft = pcInSample ->aiY[iSubSourcePos]; 1463 pcOutSample->iYBlended = piBlendedValueY; 1464 #if HHI_VSO_COLOR_PLANES 1465 pcOutSample->iULeft = pcInSample ->aiU[iSubSourcePos]; 1466 pcOutSample->iUBlended = piBlendedValueU; 1467 pcOutSample->iVLeft = pcInSample ->aiV[iSubSourcePos]; 1468 pcOutSample->iVBlended = piBlendedValueV; 1469 #endif 1470 pcOutSample->iFilledLeft = iFilled; 1471 1472 // Get Error 1473 Int iDiffY = pcOutSample->iYRef - piBlendedValueY; 1474 #if HHI_VSO_COLOR_PLANES 1475 Int iDiffU = pcOutSample->iURef - piBlendedValueU; 1476 Int iDiffV = pcOutSample->iVRef - piBlendedValueV; 1477 pcOutSample->iError = xGetDist(iDiffY, iDiffU, iDiffV ); 1478 #else 1479 pcOutSample->iError = xGetDist(iDiffY ); 1480 #endif 1168 1481 } 1169 1482 else 1170 1483 { 1171 xGetBlendedValue ( 1172 m_aapiSynthVideoPelRow [0][0][iTargetSPos], 1173 m_aapiBaseVideoPelRow [1][0][iSourcePos ], 1174 #if HHI_VSO_COLOR_PLANES 1175 m_aapiSynthVideoPelRow [0][1][iTargetSPos], 1176 m_aapiBaseVideoPelRow [1][1][iSourcePos ], 1177 m_aapiSynthVideoPelRow [0][2][iTargetSPos], 1178 m_aapiBaseVideoPelRow [1][2][iSourcePos ], 1179 #endif 1180 m_piInvZLUTLeft [RemoveBitIncrement(m_apiSynthDepthPelRow[0] [iTargetSPos])], 1181 m_piInvZLUTRight[RemoveBitIncrement(m_iThisDepth) ], 1182 m_apiFilledRow [0] [iTargetSPos], 1183 iFilled , 1184 piBlendedValueY 1484 Int iDiffY = pcOutSample->iYRef - piBlendedValueY; 1485 #if HHI_VSO_COLOR_PLANES 1486 Int iDiffU = pcOutSample->iURef - piBlendedValueU; 1487 Int iDiffV = pcOutSample->iVRef - piBlendedValueV; 1488 riError += ( xGetDist( iDiffY, iDiffU, iDiffV ) - pcOutSample->iError ); 1489 1490 #else 1491 riError += ( xGetDist( iDiffY ) - pcOutSample->iError ); 1492 #endif 1493 1494 } 1495 } 1496 1497 1498 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void 1499 TRenSingleModelC<iBM,bBitInc>::xSetShiftedPelR(Int iSourcePos, Int iSubSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError ) 1500 { 1501 RM_AOT( iSourcePos < 0 ); 1502 RM_AOT( iSourcePos >= m_iWidth ); 1503 RM_AOT( iSubSourcePos < 0 ); 1504 RM_AOT( iSubSourcePos >= (1 << m_iShiftPrec)+1 ); 1505 RM_AOT( iTargetSPos < 0 ); 1506 RM_AOT( iTargetSPos >= m_iWidth ); 1507 1508 RenModelOutPels* pcOutSample = m_pcOutputSamplesRow + iTargetSPos; 1509 RenModelInPels * pcInSample = m_pcInputSamplesRow[VIEWPOS_RIGHT] + iSourcePos ; 1510 1511 if ( iBM != BLEND_NONE ) 1512 { 1513 xSetShiftedPelBlendR<bSet> (pcInSample, iSubSourcePos, pcOutSample, iFilled, riError); 1514 } 1515 else 1516 { 1517 xSetShiftedPelNoBlendR<bSet> (pcInSample, iSubSourcePos, pcOutSample, iFilled, riError); 1518 } 1519 } 1520 1521 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void 1522 TRenSingleModelC<iBM,bBitInc>::xSetShiftedPelNoBlendR(RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ) 1523 { 1524 if ( bSet ) 1525 { 1526 // Filled 1527 pcOutSample->iFilledRight = iFilled; 1528 1529 // Yuv 1530 pcOutSample->iYRight = pcInSample->aiY[iSubSourcePos]; 1531 #if HHI_VSO_COLOR_PLANES 1532 pcOutSample->iURight = pcInSample->aiU[iSubSourcePos]; 1533 pcOutSample->iVRight = pcInSample->aiV[iSubSourcePos]; 1534 1535 pcOutSample->iError = xGetDist( 1536 pcOutSample->iYRight - pcOutSample->iYRef, 1537 pcOutSample->iURight - pcOutSample->iURef, 1538 pcOutSample->iVRight - pcOutSample->iVRef 1539 ); 1540 #else 1541 pcOutSample->iError = xGetDist( pcOutSample->iYRight - pcOutSample->iYRef ); 1542 #endif 1543 1544 } 1545 else 1546 { 1547 #if HHI_VSO_COLOR_PLANES 1548 riError += xGetDist( pcInSample->aiY[iSubSourcePos] - pcOutSample->iYRef, 1549 pcInSample->aiU[iSubSourcePos] - pcOutSample->iURef, 1550 pcInSample->aiV[iSubSourcePos] - pcOutSample->iVRef 1551 ); 1552 #else 1553 riError += xGetDist( pcInSample->aiY[iSubSourcePos] - pcOutSample->iYRef ); 1554 #endif 1555 1556 riError -= pcOutSample->iError; 1557 } 1558 } 1559 1560 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void 1561 TRenSingleModelC<iBM,bBitInc>::xSetShiftedPelBlendR(RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ) 1562 { 1563 Pel piBlendedValueY; 1564 #if HHI_VSO_COLOR_PLANES 1565 Pel piBlendedValueU; 1566 Pel piBlendedValueV; 1567 #endif 1568 1569 xGetBlendedValue ( 1570 pcOutSample->iYLeft, 1571 pcInSample ->aiY[iSubSourcePos], 1572 #if HHI_VSO_COLOR_PLANES 1573 pcOutSample->iULeft, 1574 pcInSample ->aiU[iSubSourcePos], 1575 pcOutSample->iVLeft, 1576 pcInSample ->aiV[iSubSourcePos], 1577 #endif 1578 m_piInvZLUTLeft [RenModRemoveBitInc(pcOutSample->iDLeft)], 1579 m_piInvZLUTRight [RenModRemoveBitInc(m_iThisDepth) ], 1580 pcOutSample->iFilledLeft, 1581 iFilled, 1582 piBlendedValueY 1185 1583 #if HHI_VSO_COLOR_PLANES 1186 1584 , piBlendedValueU, 1187 1585 piBlendedValueV 1188 1586 #endif 1189 1587 ); 1190 } 1191 1192 if ( m_bSet ) 1193 { 1194 m_apiSynthDepthPelRow [m_iCurViewPos] [iTargetSPos] = m_iThisDepth; 1195 m_aapiSynthVideoPelRow[m_iCurViewPos][0][iTargetSPos] = m_aapiBaseVideoPelRow[m_iCurViewPos][0][iSourcePos]; 1196 m_aapiSynthVideoPelRow[2 ][0][iTargetSPos] = piBlendedValueY; 1197 #if HHI_VSO_COLOR_PLANES 1198 m_aapiSynthVideoPelRow[m_iCurViewPos][1][iTargetSPos] = m_aapiBaseVideoPelRow[m_iCurViewPos][1][iSourcePos]; 1199 m_aapiSynthVideoPelRow[2 ][1][iTargetSPos] = piBlendedValueU; 1200 m_aapiSynthVideoPelRow[m_iCurViewPos][2][iTargetSPos] = m_aapiBaseVideoPelRow[m_iCurViewPos][2][iSourcePos]; 1201 m_aapiSynthVideoPelRow[2 ][2][iTargetSPos] = piBlendedValueV; 1202 #endif 1203 m_apiFilledRow [m_iCurViewPos] [iTargetSPos] = iFilled; 1204 1205 Int iDiffY = m_aapiRefVideoPelRow [0][iTargetSPos] - piBlendedValueY; 1206 #if HHI_VSO_COLOR_PLANES 1207 Int iDiffU = m_aapiRefVideoPelRow [1][iTargetSPos] - piBlendedValueU; 1208 Int iDiffV = m_aapiRefVideoPelRow [2][iTargetSPos] - piBlendedValueV; 1209 m_apiErrorRow [iTargetSPos] = xGetDist(iDiffY, iDiffU, iDiffV ); 1210 #else 1211 m_apiErrorRow [iTargetSPos] = xGetDist(iDiffY); 1588 1589 if ( bSet ) 1590 { 1591 // Set values 1592 pcOutSample->iDRight = m_iThisDepth; 1593 pcOutSample->iYRight = pcInSample ->aiY[iSubSourcePos]; 1594 pcOutSample->iYBlended = piBlendedValueY; 1595 #if HHI_VSO_COLOR_PLANES 1596 pcOutSample->iURight = pcInSample ->aiU[iSubSourcePos]; 1597 pcOutSample->iUBlended = piBlendedValueU; 1598 pcOutSample->iVRight = pcInSample ->aiV[iSubSourcePos]; 1599 pcOutSample->iVBlended = piBlendedValueV; 1600 #endif 1601 pcOutSample->iFilledRight = iFilled; 1602 1603 // Get Error 1604 Int iDiffY = pcOutSample->iYRef - piBlendedValueY; 1605 #if HHI_VSO_COLOR_PLANES 1606 Int iDiffU = pcOutSample->iURef - piBlendedValueU; 1607 Int iDiffV = pcOutSample->iVRef - piBlendedValueV; 1608 pcOutSample->iError = xGetDist(iDiffY, iDiffU, iDiffV ); 1609 #else 1610 pcOutSample->iError = xGetDist(iDiffY ); 1212 1611 #endif 1213 1612 } 1214 1613 else 1215 1614 { 1216 Int iSDOld = m_apiErrorRow [iTargetSPos]; 1217 Int iDiffY = m_aapiRefVideoPelRow [0][iTargetSPos] - piBlendedValueY; 1218 #if HHI_VSO_COLOR_PLANES 1219 Int iDiffU = m_aapiRefVideoPelRow [1][iTargetSPos] - piBlendedValueU; 1220 Int iDiffV = m_aapiRefVideoPelRow [2][iTargetSPos] - piBlendedValueV; 1221 riError += ( xGetDist( iDiffY, iDiffU, iDiffV ) - iSDOld ); 1222 #else 1223 riError += ( xGetDist( iDiffY )- iSDOld ); 1224 #endif 1225 } 1226 } 1227 1228 1229 __inline Int 1230 TRenSingleModel::xGetDist( Int iDiffY, Int iDiffU, Int iDiffV ) 1231 { 1232 return ( ((iDiffY * iDiffY) >> m_iDistShift) 1233 + ((( ((iDiffU * iDiffU) >> m_iDistShift) 1234 +((iDiffV * iDiffV) >> m_iDistShift) 1615 Int iDiffY = pcOutSample->iYRef - piBlendedValueY; 1616 #if HHI_VSO_COLOR_PLANES 1617 Int iDiffU = pcOutSample->iURef - piBlendedValueU; 1618 Int iDiffV = pcOutSample->iVRef - piBlendedValueV; 1619 riError += ( xGetDist( iDiffY, iDiffU, iDiffV ) - pcOutSample->iError ); 1620 #else 1621 riError += ( xGetDist( iDiffY ) - pcOutSample->iError ); 1622 #endif 1623 } 1624 } 1625 1626 template <BlenMod iBM, Bool bBitInc> __inline Int 1627 TRenSingleModelC<iBM,bBitInc>::xGetDist( Int iDiffY, Int iDiffU, Int iDiffV ) 1628 { 1629 1630 if ( !bBitInc ) 1631 { 1632 return ( (iDiffY * iDiffY ) 1633 + ((( (iDiffU * iDiffU ) 1634 +(iDiffV * iDiffV ) 1635 ) 1636 ) >> 2 1235 1637 ) 1236 ) >> 2 1237 ) 1238 ); 1239 } 1240 1241 __inline Int 1242 TRenSingleModel::xGetDist( Int iDiffY ) 1243 { 1244 return ((iDiffY * iDiffY) >> m_iDistShift); 1245 } 1246 1247 #if HHI_VSO_COLOR_PLANES 1248 __inline Void 1249 TRenSingleModel::xGetBlendedValue( Pel iYL, Pel iYR, Pel iUL, Pel iUR, Pel iVL, Pel iVR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY, Pel& riU, Pel&riV ) 1250 #else 1251 Void 1252 TRenSingleModel::xGetBlendedValue( Pel iYL, Pel iYR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY ) 1253 #endif 1254 { 1255 if (m_iBlendMode != 0 ) 1256 { 1257 if (m_iBlendMode == 1 ) 1638 ); 1639 } 1640 else 1641 { 1642 return ( ((iDiffY * iDiffY) >> m_iDistShift) 1643 + ((( ((iDiffU * iDiffU) >> m_iDistShift) 1644 +((iDiffV * iDiffV) >> m_iDistShift) 1645 ) 1646 ) >> 2 1647 ) 1648 ); 1649 1650 } 1651 } 1652 1653 template <BlenMod iBM, Bool bBitInc> __inline Int 1654 TRenSingleModelC<iBM,bBitInc>::xGetDist( Int iDiffY ) 1655 { 1656 if ( !bBitInc ) 1657 { 1658 return (iDiffY * iDiffY); 1659 } 1660 else 1661 { 1662 return ((iDiffY * iDiffY) >> m_iDistShift); 1663 } 1664 1665 } 1666 1667 1668 #if HHI_VSO_COLOR_PLANES 1669 template <BlenMod iBM, Bool bBitInc> __inline Void 1670 TRenSingleModelC<iBM,bBitInc>::xGetBlendedValue( Pel iYL, Pel iYR, Pel iUL, Pel iUR, Pel iVL, Pel iVR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY, Pel& riU, Pel&riV ) 1671 #else 1672 template <BlenMod iBM, Bool bBitInc> __inline Void 1673 TRenSingleModelC<iBM,bBitInc>::xGetBlendedValue( Pel iYL, Pel iYR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY ) 1674 #endif 1675 { 1676 1677 RM_AOT( iBM != BLEND_AVRG && iBM != BLEND_LEFT && iBM != BLEND_RIGHT ); 1678 1679 if (iBM != BLEND_AVRG ) 1680 { 1681 if (iBM == BLEND_LEFT ) 1258 1682 { 1259 1683 #if HHI_VSO_COLOR_PLANES … … 1299 1723 else 1300 1724 { 1301 #if HHI_FIX1302 1725 riY = xBlend( iYL, iYR, m_iBlendDistWeight ); 1303 1726 #if HHI_VSO_COLOR_PLANES … … 1305 1728 riV = xBlend( iVL, iVR, m_iBlendDistWeight ); 1306 1729 #endif 1307 #else1308 riY = xBlend( iYR, iYL, m_iBlendDistWeight );1309 #if HHI_VSO_COLOR_PLANES1310 riU = xBlend( iUR, iUL, m_iBlendDistWeight );1311 riV = xBlend( iVR, iVL, m_iBlendDistWeight );1312 #endif1313 #endif1314 1730 } 1315 1731 } … … 1369 1785 } 1370 1786 } 1371 1372 } 1373 1374 __inline Void 1375 #if HHI_VSO_COLOR_PLANES 1376 TRenSingleModel::xGetBlendedValueBM1( Pel iYL, Pel iYR, Pel iUL, Pel iUR, Pel iVL, Pel iVR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY, Pel& riU, Pel&riV ) 1377 #else 1378 TRenSingleModel::xGetBlendedValueBM1( Pel iYL, Pel iYR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY ) 1379 #endif 1380 { 1381 if ( iFilledL == REN_IS_FILLED || iFilledR == REN_IS_HOLE ) 1787 } 1788 1789 template <BlenMod iBM, Bool bBitInc> __inline Void 1790 #if HHI_VSO_COLOR_PLANES 1791 TRenSingleModelC<iBM,bBitInc>::xGetBlendedValueBM1( Pel iYL, Pel iYR, Pel iUL, Pel iUR, Pel iVL, Pel iVR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY, Pel& riU, Pel&riV ) 1792 #else 1793 TRenSingleModelC<iBM,bBitInc>::xGetBlendedValueBM1( Pel iYL, Pel iYR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY ) 1794 #endif 1795 { 1796 if ( iFilledL == REN_IS_FILLED || iFilledR == REN_IS_HOLE ) 1382 1797 { 1383 1798 riY = iYL; … … 1405 1820 } 1406 1821 1407 __inline Void1408 #if HHI_VSO_COLOR_PLANES 1409 TRenSingleModel ::xGetBlendedValueBM2( Pel iYL, Pel iYR, Pel iUL, Pel iUR, Pel iVL, Pel iVR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY, Pel& riU, Pel&riV )1410 #else 1411 TRenSingleModel ::xGetBlendedValueBM2( Pel iYL, Pel iYR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY )1822 template <BlenMod iBM, Bool bBitInc> __inline Void 1823 #if HHI_VSO_COLOR_PLANES 1824 TRenSingleModelC<iBM,bBitInc>::xGetBlendedValueBM2( Pel iYL, Pel iYR, Pel iUL, Pel iUR, Pel iVL, Pel iVR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY, Pel& riU, Pel&riV ) 1825 #else 1826 TRenSingleModelC<iBM,bBitInc>::xGetBlendedValueBM2( Pel iYL, Pel iYR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY ) 1412 1827 #endif 1413 1828 { … … 1438 1853 } 1439 1854 1440 __inline Pel1441 TRenSingleModel ::xBlend( Pel pVal1, Pel pVal2, Int iWeightVal2 )1855 template <BlenMod iBM, Bool bBitInc> __inline Pel 1856 TRenSingleModelC<iBM,bBitInc>::xBlend( Pel pVal1, Pel pVal2, Int iWeightVal2 ) 1442 1857 { 1443 1858 return pVal1 + (Pel) ( ( (Int) ( pVal2 - pVal1) * iWeightVal2 + (1 << (REN_VDWEIGHT_PREC - 1)) ) >> REN_VDWEIGHT_PREC ); 1444 1859 } 1860 1861 template <BlenMod iBM, Bool bBitInc> Void 1862 TRenSingleModelC<iBM,bBitInc>::xCopy2PicYuv( Pel** ppiSrcVideoPel, Int* piStrides, TComPicYuv* rpcPicYuvTarget, UInt uiHorOffset ) 1863 { 1864 TRenFilter::copy ( ppiSrcVideoPel[0], piStrides[0], m_iWidth, m_iHeight, rpcPicYuvTarget->getLumaAddr() + uiHorOffset * rpcPicYuvTarget->getStride() , rpcPicYuvTarget->getStride () ); 1865 TRenFilter::sampleDown2Tap13( ppiSrcVideoPel[1], piStrides[1], m_iWidth, m_iHeight, rpcPicYuvTarget->getCbAddr () + (uiHorOffset >> 1) * rpcPicYuvTarget->getCStride(), rpcPicYuvTarget->getCStride() ); 1866 TRenFilter::sampleDown2Tap13( ppiSrcVideoPel[2], piStrides[2], m_iWidth, m_iHeight, rpcPicYuvTarget->getCrAddr () + (uiHorOffset >> 1) * rpcPicYuvTarget->getCStride(), rpcPicYuvTarget->getCStride() ); 1867 } 1868 1869 template class TRenSingleModelC<BLEND_NONE ,true>; 1870 template class TRenSingleModelC<BLEND_AVRG ,true>; 1871 template class TRenSingleModelC<BLEND_LEFT ,true>; 1872 template class TRenSingleModelC<BLEND_RIGHT,true>; 1873 1874 template class TRenSingleModelC<BLEND_NONE ,false>; 1875 template class TRenSingleModelC<BLEND_AVRG ,false>; 1876 template class TRenSingleModelC<BLEND_LEFT ,false>; 1877 template class TRenSingleModelC<BLEND_RIGHT,false>; 1878 1879 #ifdef LGE_VSO_EARLY_SKIP_A0093 1880 template <BlenMod iBM, Bool bBitInc> 1881 __inline Bool 1882 TRenSingleModelC<iBM,bBitInc>::xDetectEarlySkipL( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData,Pel* piOrgData, Int iOrgStride) 1883 { 1884 RM_AOF( m_bEarlySkip ); 1885 const Int iCurViewPos = 0; 1886 Int** ppiCurLUT = m_appiShiftLut [ iCurViewPos ]; 1887 1888 Bool bNoDiff = true; 1889 1890 for (Int iPosY=0; iPosY < iHeight; iPosY++) 1891 { 1892 m_pbHorSkip[iPosY] = true; 1893 1894 for (Int iPosX = 0; iPosX < iWidth; iPosX++) 1895 { 1896 Int iDisparityRec = abs(ppiCurLUT[0][ RenModRemoveBitInc(piNewData[iPosX])]); 1897 Int iDispartyOrg = abs(ppiCurLUT[0][ RenModRemoveBitInc(piOrgData[iPosX])]); 1898 1899 if( iDispartyOrg != iDisparityRec) 1900 { 1901 m_pbHorSkip[iPosY] = false; 1902 bNoDiff = false; 1903 break; 1904 } 1905 } 1906 piNewData += iStride; 1907 piOrgData += iOrgStride; 1908 } 1909 return bNoDiff; 1910 } 1911 1912 template <BlenMod iBM, Bool bBitInc> 1913 __inline Bool 1914 TRenSingleModelC<iBM,bBitInc>::xDetectEarlySkipR( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData,Pel* piOrgData, Int iOrgStride) 1915 { 1916 RM_AOF( m_bEarlySkip ); 1917 Bool bNoDiff = true; 1918 1919 const Int iCurViewPos = 1; 1920 Int** ppiCurLUT = m_appiShiftLut [ iCurViewPos ]; 1921 1922 for ( Int iPosY = 0; iPosY < iHeight; iPosY++ ) 1923 { 1924 m_pbHorSkip[iPosY] = true; 1925 1926 for (Int iPosX = 0; iPosX < iWidth; iPosX++) 1927 { 1928 Int iDisparityRec = abs( ppiCurLUT[0][ RenModRemoveBitInc(piNewData[iPosX])] ); 1929 Int iDisparityOrg = abs( ppiCurLUT[0][ RenModRemoveBitInc(piOrgData[iPosX])] ); 1930 1931 if( iDisparityRec != iDisparityOrg ) 1932 { 1933 m_pbHorSkip[iPosY] = false; 1934 bNoDiff = false; 1935 break; 1936 } 1937 } 1938 1939 piNewData += iStride; 1940 piOrgData += iOrgStride; 1941 } 1942 return bNoDiff; 1943 } 1944 #endif -
trunk/source/Lib/TLibRenderer/TRenSingleModel.h
r56 r100 55 55 56 56 57 #if HHI_VSO_RM_ASSERTIONS 58 #define RM_AOT( exp ) AOT ( exp ) 59 #define RM_AOF( exp ) AOF ( exp ) 60 #else 61 #define RM_AOT( exp ) ((void)0) 62 #define RM_AOF( exp ) ((void)0) 63 #endif 64 65 #define RenModRemoveBitInc( exp ) bBitInc ? ( RemoveBitIncrement( exp ) ) : ( exp ) 66 57 67 class TRenSingleModel 58 68 { 69 public: 70 #if LGE_VSO_EARLY_SKIP_A0093 71 virtual Void create ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bEarlySkip ) = 0; 72 #else 73 virtual Void create ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode ) = 0; 74 #endif 75 76 // Set Frame dependent data 77 virtual Void setLRView ( Int iViewPos, Pel** apiCurVideoPel, Int* aiCurVideoStride, Pel* piCurDepthPel, Int iCurDepthStride ) = 0; 78 virtual Void setup ( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, Bool bKeepReference, UInt uiHorOffset ) = 0; 79 80 // Set Data 81 #ifdef LGE_VSO_EARLY_SKIP_A0093 82 virtual Void setDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel* piOrgData, Int iOrgStride ) = 0; 83 #else 84 virtual Void setDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) = 0; 85 #endif 86 virtual Void setVideo ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) = 0; 87 88 // Get Distortion 89 #ifdef LGE_VSO_EARLY_SKIP_A0093 90 virtual RMDist getDistDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel * piOrgData , Int iOrgStride)=0; 91 #else 92 virtual RMDist getDistDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) = 0; 93 #endif 94 virtual RMDist getDistVideo ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) = 0; 95 96 virtual Void getSynthVideo ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset ) = 0; 97 virtual Void getSynthDepth ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset ) = 0; 98 virtual Void getRefVideo ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset ) = 0; 99 }; 100 101 template < BlenMod iBM, Bool bBitInc > 102 class TRenSingleModelC : public TRenSingleModel 103 { 104 struct RenModelInPels 105 { 106 // video 107 Pel aiY[5] ; // y-value 108 #if HHI_VSO_COLOR_PLANES 109 Pel aiU[5] ; // u-value 110 Pel aiV[5] ; // v-value 111 #endif 112 // depth 113 Pel iD ; // depth 114 115 // state 116 Bool bOccluded; // Occluded 117 }; 118 119 struct RenModelOutPels 120 { 121 // video 122 Pel iYLeft ; 123 Pel iYRight ; 124 Pel iYBlended ; 125 #if HHI_VSO_COLOR_PLANES 126 Pel iULeft ; 127 Pel iURight ; 128 Pel iUBlended ; 129 Pel iVLeft ; 130 Pel iVRight ; 131 Pel iVBlended ; 132 #endif 133 // depth 134 Pel iDLeft ; 135 Pel iDRight ; 136 Pel iDBlended ; 137 138 // state 139 Int iFilledLeft ; 140 Int iFilledRight; 141 142 // error 143 Int iError ; 144 145 // reference 146 Pel iYRef ; 147 #if HHI_VSO_COLOR_PLANES 148 Pel iURef ; 149 Pel iVRef ; 150 #endif 151 }; 152 153 59 154 60 155 public: 61 TRenSingleModel ();62 ~TRenSingleModel ();156 TRenSingleModelC(); 157 ~TRenSingleModelC(); 63 158 64 159 // Create Model 160 #if LGE_VSO_EARLY_SKIP_A0093 161 Void create ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bEarlySkip ); 162 #else 65 163 Void create ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode ); 164 #endif 66 165 67 166 // Set Frame dependent data 68 167 Void setLRView ( Int iViewPos, Pel** apiCurVideoPel, Int* aiCurVideoStride, Pel* piCurDepthPel, Int iCurDepthStride ); 69 Void setup ( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, Bool bKeepReference ); 70 71 // Set Data 168 Void setup ( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, Bool bKeepReference, UInt uiHorOffset ); 169 170 #if LGE_VSO_EARLY_SKIP_A0093 171 Void setDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel* piOrgData, Int iOrgStride ); 172 #else 72 173 Void setDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ); 174 #endif 73 175 Void setVideo ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ); 74 176 75 177 // Get Distortion 178 #ifdef LGE_VSO_EARLY_SKIP_A0093 179 RMDist getDistDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel * piOrgData , Int iOrgStride); 180 #else 76 181 RMDist getDistDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ); 182 #endif 77 183 RMDist getDistVideo ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ); 78 184 79 // Get Rendered Data 80 Void getSynthView( Int iViewPos, Pel**& rppiRenVideoPel, Pel*& rpiRenDepthPel, Int& riStride ); 81 82 // Get Reference Data 83 Void getRefView ( TComPicYuv*& rpcPicYuvRefView, Pel**& rppiRefVideoPel, Int*& raiStrides ); 185 Void getSynthVideo ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset ); 186 Void getSynthDepth ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset ); 187 Void getRefVideo ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset ); 84 188 85 189 private: … … 90 194 ///// Rendering ///// 91 195 // Left to Right 92 __inline RMDist xRenderL ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Bool bSet); 93 __inline Void xInitRenderPartL ( Int iEndChangePos, Int iLastSPos ); 94 __inline Void xRenderRangeL ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 95 __inline Void xRenderShiftedRangeL( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 96 __inline Void xFillHoleL ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 97 __inline Void xExtrapolateMarginL ( Int iCurSPos, Int iCurPos, RMDist& riError ); 98 __inline Int xRangeLeftL ( Int iPos ); 99 __inline Int xRangeRightL ( Int iPos ); 100 __inline Int xRoundL ( Int iPos ); 196 #ifdef LGE_VSO_EARLY_SKIP_A0093 197 __inline Bool xDetectEarlySkipL ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData,Pel* piOrgData, Int iOrgStride ); 198 __inline Bool xDetectEarlySkipR ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData,Pel* piOrgData, Int iOrgStride ); 199 template<Bool bSet> __inline RMDist xRenderL ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Bool bFast ); 200 template<Bool bSet> __inline RMDist xRenderR ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Bool bFast ); 201 #else 202 template<Bool bSet> __inline RMDist xRenderR ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ); 203 template<Bool bSet> __inline RMDist xRenderL ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ); 204 #endif 205 __inline Void xInitRenderPartL ( Int iEndChangePos, Int iLastSPos ); 206 template<Bool bSet> __inline Void xRenderRangeL ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 207 template<Bool bSet> __inline Void xRenderShiftedRangeL( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 208 template<Bool bSet> __inline Void xFillHoleL ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 209 template<Bool bSet> __inline Void xExtrapolateMarginL ( Int iCurSPos, Int iCurPos, RMDist& riError ); 210 __inline Int xRangeLeftL ( Int iPos ); 211 __inline Int xRangeRightL ( Int iPos ); 212 __inline Int xRoundL ( Int iPos ); 101 213 102 214 // Right to Left 103 __inline RMDist xRenderR ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Bool bSet ); 104 __inline Void xInitRenderPartR ( Int iStartChangePos, Int iLastSPos ); 105 __inline Void xRenderShiftedRangeR( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 106 __inline Void xRenderRangeR ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 107 __inline Void xFillHoleR ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 108 __inline Void xExtrapolateMarginR ( Int iCurSPos, Int iCurPos, RMDist& riError ); 109 __inline Int xRangeLeftR ( Int iPos ); 110 __inline Int xRangeRightR ( Int iPos ); 111 __inline Int xRoundR ( Int iPos ); 215 __inline Void xInitRenderPartR ( Int iStartChangePos, Int iLastSPos ); 216 template<Bool bSet> __inline Void xRenderShiftedRangeR( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 217 template<Bool bSet> __inline Void xRenderRangeR ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 218 template<Bool bSet> __inline Void xFillHoleR ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 219 template<Bool bSet> __inline Void xExtrapolateMarginR ( Int iCurSPos, Int iCurPos, RMDist& riError ); 220 __inline Int xRangeLeftR ( Int iPos ); 221 __inline Int xRangeRightR ( Int iPos ); 222 __inline Int xRoundR ( Int iPos ); 112 223 113 224 // Blending 114 __inline Void xSetShiftedPelBlend ( Int iSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError );225 template<Bool bSet> __inline Void xSetShiftedPelBlend ( Int iSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError ); 115 226 116 227 #if HHI_VSO_COLOR_PLANES … … 125 236 __inline Pel xBlend ( Pel pVal1, Pel pVal2, Int iWeightVal2 ); 126 237 127 // General 128 __inline Void xSetShiftedPel ( Int iSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError ); 238 // General 239 template<Bool bSet> __inline Void xSetShiftedPelL (Int iSourcePos, Int iSubSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError ); 240 template<Bool bSet> __inline Void xSetShiftedPelBlendL (RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ); 241 template<Bool bSet> __inline Void xSetShiftedPelNoBlendL(RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ); 242 243 template<Bool bSet> __inline Void xSetShiftedPelR (Int iSourcePos, Int iSubSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError ); 244 template<Bool bSet> __inline Void xSetShiftedPelBlendR (RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ); 245 template<Bool bSet> __inline Void xSetShiftedPelNoBlendR(RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ); 246 129 247 __inline Int xShiftNewData ( Int iPos, Int iPosInNewData ); 130 248 __inline Int xShift ( Int iPos ); … … 134 252 135 253 // Utilities 136 __inline Void xInitView ( Int iViewPos );137 254 __inline Void xSetPels ( Pel* piPelSource , Int iSourceStride, Int iWidth, Int iHeight, Pel iVal ); 138 255 __inline Void xSetBools ( Bool* pbSource , Int iSourceStride, Int iWidth, Int iHeight, Bool bVal ); 139 256 __inline Void xSetInts ( Int* piPelSource , Int iSourceStride, Int iWidth, Int iHeight, Int iVal ); 257 258 #if HHI_VSO_COLOR_PLANES 259 Void xGetSampleStrTextPtrs ( Int iViewNum, Pel RenModelOutPels::*& rpiSrcY, Pel RenModelOutPels::*& rpiSrcU, Pel RenModelOutPels::*& rpiSrcV ); 260 #else 261 Void xGetSampleStrTextPtrs ( Int iViewNum, Pel RenModelOutPels::*& rpiSrcY ); 262 #endif 263 Void xGetSampleStrDepthPtrs( Int iViewNum, Pel RenModelOutPels::*& rpiSrcD ); 264 265 Void xSetStructRefView (); 266 Void xResetStructError (); 267 Void xInitSampleStructs (); 268 Void xSetStructSynthViewAsRefView (); 269 Void xCopy2PicYuv ( Pel** ppiSrcVideoPel, Int* piStrides, TComPicYuv* rpcPicYuvTarget, UInt uiHorOffset ); 270 271 272 template< typename S, typename T> 273 Void xCopyFromSampleStruct ( S* ptSource , Int iSourceStride, T S::* ptSourceElement, T* ptTarget, Int iTargetStride, Int iWidth, Int iHeight ) 274 { 275 for (Int iPosY = 0; iPosY < m_iHeight; iPosY++) 276 { 277 for (Int iPosX = 0; iPosX < m_iWidth; iPosX++) 278 { 279 ptTarget[iPosX] = ptSource[iPosX].*ptSourceElement; 280 } 281 ptSource += iSourceStride; 282 ptTarget += iTargetStride; 283 } 284 } 285 286 template< typename S, typename T> 287 Void xCopyToSampleStruct ( T* ptSource , Int iSourceStride, S* ptTarget, Int iTargetStride, T S::* ptSourceElement, Int iWidth, Int iHeight ) 288 { 289 for (Int iPosY = 0; iPosY < m_iHeight; iPosY++) 290 { 291 for (Int iPosX = 0; iPosX < m_iWidth; iPosX++) 292 { 293 ptTarget[iPosX] = ptSource[iPosX].*ptSourceElement; 294 } 295 ptSource += iSourceStride; 296 ptTarget += iTargetStride; 297 } 298 } 140 299 141 300 private: … … 151 310 Int m_iSampledStride; 152 311 312 RenModelInPels* m_pcInputSamples[2]; 313 Int m_iInputSamplesStride; 314 153 315 // Base 154 316 Pel** m_aapiBaseVideoPel [2]; // Dim1: ViewPosition 0->Left, 1->Right; Dim2: Plane 0-> Y, 1->U, 2->V … … 157 319 Pel* m_apiBaseDepthPel [2]; // Dim1: ViewPosition 158 320 Int m_aiBaseDepthStrides [2]; // Dim1: ViewPosition 321 159 322 160 323 // LUT … … 170 333 //// Reference Data //// 171 334 TComPicYuv* m_pcPicYuvRef ; // Reference PIcYuv 335 336 //// Output Samples 337 RenModelOutPels* m_pcOutputSamples; 338 Int m_iOutputSamplesStride; 339 172 340 Pel* m_aapiRefVideoPel [3]; // Dim1: Plane 0-> Y, 1->U, 2->V 173 341 Int m_aiRefVideoStrides [3]; // Dim1: Plane 0-> Y, 1->U, 2->V 174 175 // Renderer State176 Int* m_piError ;177 Pel* m_apiFilled [2]; // Dim1: ViewPosition178 Bool* m_apbOccluded [2]; // Dim1: ViewPosition179 Pel* m_aapiSynthVideoPel [3][3]; // Dim1: ViewPosition 0: Left, 1:Right, 2: Merged, Dim2: Plane 0-> Y, 1->U, 2->V180 Pel* m_apiSynthDepthPel [3]; // Dim1: ViewPosition 0: Left, 1:Right, 2: Merged, Dim2: Plane 0-> Y, 1->U, 2->V181 342 182 343 // Rendering State … … 185 346 Int m_iLastOccludedSPosFP; // Position of last topmost shifted position in FullPels 186 347 187 Bool m_bSet; // Set Data, or get Error188 348 Int m_iCurViewPos; // Current View Position 0: Left, 1: Right 189 349 Int m_iOtherViewPos; // Other View Position 0: Left, 1: Right … … 201 361 Int m_iShiftPrec; 202 362 Int m_iHoleMargin; 203 Int m_iBlendMode; 363 #ifdef LGE_VSO_EARLY_SKIP_A0093 364 Bool m_bEarlySkip; 365 #endif 204 366 205 367 // Derived settings … … 209 371 210 372 //// Current Pointers //// 211 Pel* m_aapiBaseVideoPelRow [2][3]; // Dim1: ViewPosition 0->Left, 1->Right; Dim2: Plane 0-> Y, 1->U, 2->V 212 Pel* m_apiBaseDepthPelRow [2]; // Dim1: ViewPosition 213 Bool* m_apbOccludedRow [2]; // Dim1: ViewPosition 214 Pel* m_apiFilledRow [2]; // Dim1: ViewPosition 215 Int* m_apiErrorRow ; 216 217 Pel* m_aapiRefVideoPelRow [3]; // Dim1: Plane 0-> Y, 1->U, 2->V 218 Pel* m_aapiSynthVideoPelRow [3][3]; // Dim1: ViewPosition 0: Left, 1:Right, 2: Merged, Dim2: Plane 0-> Y, 1->U, 2->V 219 Pel* m_apiSynthDepthPelRow [3]; // Dim1: ViewPosition 0: Left, 1:Right, 2: Merged 220 373 374 RenModelInPels* m_pcInputSamplesRow [2]; 375 RenModelOutPels* m_pcOutputSamplesRow; 221 376 222 377 //// MISC //// 223 378 const Int m_iDistShift; // Shift in Distortion computation 379 380 //// Early Skip 381 #ifdef LGE_VSO_EARLY_SKIP_A0093 382 Bool* m_pbHorSkip; 383 #endif 224 384 }; 225 385 -
trunk/source/Lib/TLibRenderer/TRenTop.cpp
r81 r100 1013 1013 if ((iPrevShiftedPos + (iStep >> 1) ) > iPrevShiftedPosCeiled ) 1014 1014 { 1015 #if HHI_FIX1016 1015 if ( !((iInterPolPos < (Int) 0) || (iInterPolPos >= iOutputWidth))) 1017 1016 { … … 1026 1025 iInterPolPos++; 1027 1026 } 1028 #else1029 if ( (iInterPolPos < (Int) 0) || (iInterPolPos >= iOutputWidth))1030 {1031 // skip Interpolation if Interpolation position is outside frame1032 iPrevShiftedPos = iShiftedPos;1033 continue;1034 };1035 1036 for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)1037 {1038 apcOutputData[uiCurPlane][iInterPolPos] = apcInputData[uiCurPlane][iPosX - iStep];1039 }1040 pcFilledData[iInterPolPos] = REN_IS_FILLED;1041 iInterPolPos++;1042 }1043 #endif1044 1027 1045 1028 // Fill Disocclusion … … 1064 1047 { 1065 1048 iInterPolPos = iShiftedPosFloor >> m_iRelShiftLUTPrec; 1066 #if HHI_FIX1067 1049 if ( !((iInterPolPos < (Int) 0) || (iInterPolPos >= iOutputWidth))) 1068 1050 { … … 1074 1056 pcFilledData[iInterPolPos] = REN_IS_FILLED; 1075 1057 } 1076 #else1077 if ( (iInterPolPos < (Int) 0) || (iInterPolPos >= iOutputWidth))1078 {1079 // skip Interpolation if Interpolation position is outside frame1080 iPrevShiftedPos = iShiftedPos;1081 continue;1082 };1083 1084 for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)1085 {1086 apcOutputData[uiCurPlane][iInterPolPos] = apcInputData[uiCurPlane][iPosX ];1087 }1088 1089 pcFilledData[iInterPolPos] = REN_IS_FILLED;1090 #endif1091 1058 } 1092 1059 } … … 1959 1926 for( Int iCurPosX = 0; iCurPosX < 4; iCurPosX++) 1960 1927 { 1961 iSAD += abs( pcVideoLastDataBlk[iCurPosX] - pcVideoCurDataBlk[iCurPosX] ); 1928 iSAD += abs( pcVideoLastDataBlk[iCurPosX] - pcVideoCurDataBlk[iCurPosX] ); //SAD 1962 1929 } 1963 1930 pcVideoLastDataBlk += iVideoLastStride;
Note: See TracChangeset for help on using the changeset viewer.