Changeset 213 in 3DVCSoftware for branches/HTM-4.0.1-VSP-dev0/source
- Timestamp:
- 31 Dec 2012, 18:33:14 (12 years ago)
- Location:
- branches/HTM-4.0.1-VSP-dev0/source
- Files:
-
- 82 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-4.0.1-VSP-dev0/source/App/TAppDecoder/TAppDecTop.cpp
r193 r213 82 82 Void TAppDecTop::decode() 83 83 { 84 #if VIDYO_VPS_INTEGRATION 84 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 85 85 increaseNumberOfViews( 0, 0, 0 ); 86 86 #else … … 88 88 #endif 89 89 90 #if FLEX_CODING_ORDER_M23723 91 Int iDepthViewIdx = 0; 92 Int iTextureViewIdx=0; 93 Bool firstFrame=1; 94 Bool viewIdZero=true; 95 Int fcoIndex=0; //when the current frame is not first frame,use FCO_index stand for viewDepth. 96 #endif 97 90 98 #if SONY_COLPIC_AVAILABILITY 91 99 m_tDecTop[0]->setViewOrderIdx(0); … … 102 110 pcListPic[i] = NULL; 103 111 newPicture[i] = false; 112 #if FLEX_CODING_ORDER_M23723 113 #if FIX_FCO_COMP_WARNING 114 m_fcoOrder[i] = ' '; 115 #else 116 m_fcoOrder[i]=NULL; 117 #endif 118 #endif 119 104 120 } 105 121 … … 145 161 { 146 162 read(nalu, nalUnit); 163 #if QC_MVHEVC_B0046 164 viewDepthId = nalu.m_layerId; 165 Int depth = 0; 166 Int viewId = viewDepthId; 167 #else 147 168 #if VIDYO_VPS_INTEGRATION 148 169 Int viewId = 0; … … 156 177 depth = getVPSAccess()->getActiveVPS()->getDepthFlag(nalu.m_layerId); 157 178 } 179 #if FLEX_CODING_ORDER_M23723 180 if (viewId>0) 181 { 182 viewIdZero=false; 183 } 184 if (viewIdZero==false&&viewId==0) 185 { 186 firstFrame=0; //if viewId has been more than zero and now it set to zero again, we can see that it is not the first view 187 } 188 if (firstFrame) 189 { // if the current view is first frame, we set the viewDepthId as texture plus depth and get the FCO order 190 viewDepthId = iDepthViewIdx+iTextureViewIdx; 191 m_fcoViewDepthId=viewDepthId; 192 } 193 else 194 {//if current view is not first frame, we set the viewDepthId depended on the FCO order 195 viewDepthId=0; 196 if (depth) 197 { 198 for (fcoIndex=0;fcoIndex<2*MAX_VIEW_NUM;fcoIndex++ ) 199 { 200 if (m_fcoOrder[fcoIndex]=='D') 201 { 202 if (viewId==viewDepthId) 203 break; 204 else 205 viewDepthId++; 206 } 207 } 208 } 209 else 210 { 211 for (fcoIndex=0;fcoIndex<2*MAX_VIEW_NUM;fcoIndex++ ) 212 { 213 if (m_fcoOrder[fcoIndex]=='T') 214 { 215 if (viewId==viewDepthId) 216 break; 217 else 218 viewDepthId++; 219 } 220 } 221 } 222 223 viewDepthId=fcoIndex; 224 225 } 226 227 228 #else 158 229 viewDepthId = nalu.m_layerId; // coding order T0D0T1D1T2D2 230 #endif 231 159 232 #else 160 233 Int viewId = nalu.m_viewId; 161 234 Int depth = nalu.m_isDepth ? 1 : 0; 235 #if FLEX_CODING_ORDER_M23723 236 if (viewId>0) 237 { 238 viewIdZero=false; 239 } 240 if (viewIdZero==false&&viewId==0) 241 { 242 firstFrame=0; 243 } 244 if (firstFrame) 245 { 246 viewDepthId = iDepthViewIdx+iTextureViewIdx; 247 m_fcoViewDepthId=viewDepthId; 248 } 249 else 250 { 251 viewDepthId=0; 252 if (depth) 253 { 254 for (fcoIndex=0;fcoIndex<2*MAX_VIEW_NUM;fcoIndex++ ) 255 { 256 if (m_fcoOrder[fcoIndex]=='D') 257 { 258 if (viewId==viewDepthId) 259 break; 260 else 261 viewDepthId++; 262 } 263 } 264 } 265 else 266 { 267 for (fcoIndex=0;fcoIndex<2*MAX_VIEW_NUM;fcoIndex++ ) 268 { 269 if (m_fcoOrder[fcoIndex]=='T') 270 { 271 if (viewId==viewDepthId) 272 break; 273 else 274 viewDepthId++; 275 } 276 } 277 } 278 viewDepthId=fcoIndex; 279 } 280 #else 162 281 viewDepthId = viewId * 2 + depth; // coding order T0D0T1D1T2D2 163 282 #endif 164 283 #endif 284 #endif 165 285 newPicture[viewDepthId] = false; 166 286 if( viewDepthId >= m_tDecTop.size() ) 167 287 { 168 #if VIDYO_VPS_INTEGRATION 288 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 169 289 increaseNumberOfViews( viewDepthId, viewId, depth ); 170 290 #else … … 195 315 if( !(m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) ) 196 316 { 317 #if QC_MVHEVC_B0046 318 if(viewDepthId && m_tDecTop[viewDepthId]->m_bFirstNal== false) 319 { 320 m_tDecTop[viewDepthId]->m_bFirstNal = true; 321 ParameterSetManagerDecoder* pDecV0 = m_tDecTop[0]->xGetParaSetDec(); 322 m_tDecTop[viewDepthId]->xCopyVPS(pDecV0->getPrefetchedVPS(0)); 323 m_tDecTop[viewDepthId]->xCopySPS(pDecV0->getPrefetchedSPS(0)); 324 m_tDecTop[viewDepthId]->xCopyPPS(pDecV0->getPrefetchedPPS(0)); 325 } 326 #endif 197 327 newPicture[viewDepthId] = m_tDecTop[viewDepthId]->decode(nalu, m_iSkipFrame, m_pocLastDisplay[viewDepthId]); 198 328 if (newPicture[viewDepthId]) … … 209 339 { 210 340 previousPictureDecoded = true; 341 #if FLEX_CODING_ORDER_M23723 342 if (firstFrame) 343 { 344 if (depth) 345 { 346 iDepthViewIdx++; 347 m_fcoOrder[viewDepthId]='D'; 348 } 349 else 350 { 351 iTextureViewIdx++; 352 m_fcoOrder[viewDepthId]='T'; 353 } 354 } 355 356 #endif 211 357 } 212 358 } … … 218 364 if( pcListPic[viewDepthId] ) 219 365 { 366 #if QC_REM_IDV_B0046 367 Int iviewId = m_tDecTop[viewDepthId]->getViewId(); 368 if( newPicture[viewDepthId] && (nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR || ((nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR && iviewId) && m_tDecTop[viewDepthId]->getNalUnitTypeBaseView() == NAL_UNIT_CODED_SLICE_IDR)) ) 369 #else 220 370 if( newPicture[viewDepthId] && (nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR || (nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDV && m_tDecTop[viewDepthId]->getNalUnitTypeBaseView() == NAL_UNIT_CODED_SLICE_IDR)) ) 371 #endif 221 372 { 222 373 xFlushOutput( pcListPic[viewDepthId], viewDepthId ); … … 275 426 m_tDecTop[viewDepthIdx]->destroy() ; 276 427 } 428 #if QC_MVHEVC_B0046 429 if(viewDepthIdx) 430 { 431 //Call clear function to remove the record, which has been freed during viewDepthIdx = 0 case. 432 m_tDecTop[viewDepthIdx]->xGetParaSetDec()->clearSPS(); 433 m_tDecTop[viewDepthIdx]->xGetParaSetDec()->clearVPS(); 434 m_tDecTop[viewDepthIdx]->xGetParaSetDec()->clearPPS(); 435 } 436 #endif 277 437 delete m_tDecTop[viewDepthIdx] ; 278 438 m_tDecTop[viewDepthIdx] = NULL ; … … 416 576 m_pocLastDisplay[viewDepthId] = -MAX_INT; 417 577 } 418 #if VIDYO_VPS_INTEGRATION 578 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 419 579 Void TAppDecTop::increaseNumberOfViews ( UInt layerId, UInt viewId, UInt isDepth ) 420 580 #else … … 422 582 #endif 423 583 { 424 #if VIDYO_VPS_INTEGRATION 584 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 425 585 Int newNumberOfViewDepth = layerId + 1; 426 586 #endif … … 429 589 m_outputBitDepth = g_uiBitDepth + g_uiBitIncrement; 430 590 } 431 #if !VIDYO_VPS_INTEGRATION 591 #if !VIDYO_VPS_INTEGRATION&!QC_MVHEVC_B0046 432 592 Int viewId = (newNumberOfViewDepth-1)>>1; // coding order T0D0T1D1T2D2 433 593 Bool isDepth = ((newNumberOfViewDepth % 2) == 0); // coding order T0D0T1D1T2D2 … … 436 596 m_useDepth = true; 437 597 438 #if FIX_DECODING_WO_WRITING439 598 if ( m_pchReconFile ) 440 599 { 441 #endif442 600 while( m_tVideoIOYuvReconFile.size() < newNumberOfViewDepth) 443 601 { 444 602 m_tVideoIOYuvReconFile.push_back(new TVideoIOYuv); 445 603 Char buffer[4]; 446 #if VIDYO_VPS_INTEGRATION 604 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 447 605 sprintf(buffer,"_%i", viewId ); 448 606 #else … … 450 608 #endif 451 609 Char* nextFilename = NULL; 452 #if VIDYO_VPS_INTEGRATION 610 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 453 611 if( isDepth) 454 612 #else … … 465 623 xAppendToFileNameEnd( m_pchReconFile, buffer, nextFilename); 466 624 } 467 #if !VIDYO_VPS_INTEGRATION 625 #if !VIDYO_VPS_INTEGRATION&!QC_MVHEVC_B0046 468 626 if( isDepth || ( !isDepth && (m_tVideoIOYuvReconFile.size() % 2) == 1 ) ) 469 627 #endif … … 473 631 free ( nextFilename ); 474 632 } 475 #if FIX_DECODING_WO_WRITING 476 } 477 #endif 633 } 478 634 479 635 while( m_pocLastDisplay.size() < newNumberOfViewDepth ) … … 484 640 { 485 641 m_tDecTop.push_back(new TDecTop); 486 #if !VIDYO_VPS_INTEGRATION 642 #if !VIDYO_VPS_INTEGRATION&!QC_MVHEVC_B0046 487 643 if( isDepth || ( !isDepth && (m_tVideoIOYuvReconFile.size() % 2) == 1 ) ) 488 644 { … … 494 650 m_tDecTop.back()->setPictureDigestEnabled(m_pictureDigestEnabled); 495 651 m_tDecTop.back()->setCamParsCollector( &m_cCamParsCollector ); 496 #if !VIDYO_VPS_INTEGRATION 652 #if !VIDYO_VPS_INTEGRATION&!QC_MVHEVC_B0046 497 653 } 498 654 #endif … … 502 658 TDecTop* TAppDecTop::getTDecTop( Int viewId, Bool isDepth ) 503 659 { 660 #if FLEX_CODING_ORDER_M23723 661 Int viewnumber=0; 662 Int i=0; 663 Bool fcoFlag=0; 664 if (viewId>m_fcoViewDepthId) 665 { 666 return NULL; 667 } 668 else 669 { 670 if (isDepth) 671 { 672 for ( i=0; i<=m_fcoViewDepthId;i++) 673 { 674 if (m_fcoOrder[i]=='D') 675 { 676 if (viewnumber==viewId) 677 { 678 fcoFlag=1; 679 break; 680 } 681 else 682 viewnumber++; 683 } 684 } 685 } 686 else 687 { 688 for ( i=0; i<=m_fcoViewDepthId;i++) 689 { 690 if (m_fcoOrder[i]=='T') 691 { 692 if (viewnumber==viewId) 693 { 694 fcoFlag=1; 695 break; 696 } 697 else 698 viewnumber++; 699 } 700 } 701 } 702 if (fcoFlag) 703 { 704 return m_tDecTop[i]; 705 } 706 else 707 return NULL; 708 709 } 710 711 // coding order T0D0T1D1T2D2 712 #else 504 713 return m_tDecTop[(isDepth ? 1 : 0) + viewId * 2]; // coding order T0D0T1D1T2D2 714 #endif 715 505 716 } 506 717 … … 521 732 assert( ( viewId >= 0 ) ); 522 733 734 #if FLEX_CODING_ORDER_M23723 735 if (getTDecTop(viewId,isDepth)) 736 { 523 737 TComList<TComPic*>* apcListPic = getTDecTop( viewId, isDepth )->getListPic(); 524 738 TComPic* pcPic = NULL; … … 532 746 } 533 747 return pcPic; 748 } 749 else 750 return NULL; 751 #else 752 753 TComList<TComPic*>* apcListPic = getTDecTop( viewId, isDepth )->getListPic(); 754 TComPic* pcPic = NULL; 755 for( TComList<TComPic*>::iterator it=apcListPic->begin(); it!=apcListPic->end(); it++ ) 756 { 757 if( (*it)->getPOC() == poc ) 758 { 759 pcPic = *it; 760 break; 761 } 762 } 763 return pcPic; 764 #endif 534 765 } 535 766 … … 557 788 AOF(pcPicYuvAvail); 558 789 559 TComPic* pcPic = getPicFromView( iCodedViewIdx, iCurPoc, bDepth ); 790 //TComPic* pcPic = getPicFromView( iCodedViewIdx, iCurPoc, bDepth ); 791 TComPic* pcPic = NULL; 792 for( Int i=0; i<m_tDecTop.size() && pcPic==NULL; i++) 793 { 794 if( iCodedViewIdx == m_tDecTop[i]->getViewId() && bDepth == m_tDecTop[i]->getIsDepth() ) 795 { 796 797 TComList<TComPic*>* apcListPic = m_tDecTop[i]->getListPic(); 798 for( TComList<TComPic*>::iterator it=apcListPic->begin(); it!=apcListPic->end(); it++ ) 799 { 800 if( (*it)->getPOC() == iCurPoc ) 801 { 802 pcPic = *it; 803 break; 804 } 805 } 806 807 } 808 } 560 809 pcPic->setPicYuvSynth( pcPicYuvVSP ); 561 810 pcPic->setPicYuvAvail( pcPicYuvAvail ); -
branches/HTM-4.0.1-VSP-dev0/source/App/TAppDecoder/TAppDecTop.h
r193 r213 74 74 Bool m_useDepth; 75 75 76 #if FLEX_CODING_ORDER_M23723 77 Int m_fcoViewDepthId; 78 Char m_fcoOrder[MAX_VIEW_NUM*2]; 79 #endif 80 76 81 FILE* m_pScaleOffsetFile; 77 82 CamParsCollector m_cCamParsCollector; 78 83 #if DEPTH_MAP_GENERATION 79 #if VIDYO_VPS_INTEGRATION 84 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 80 85 TComVPSAccess m_cVPSAccess; 81 86 #endif … … 95 100 Void destroy (); ///< destroy internal members 96 101 Void decode (); ///< main decoding function 97 #if VIDYO_VPS_INTEGRATION 102 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 98 103 Void increaseNumberOfViews (UInt layerId, UInt viewId, UInt isDepth); 99 104 #else -
branches/HTM-4.0.1-VSP-dev0/source/App/TAppEncoder/TAppEncCfg.cpp
r193 r213 74 74 { 75 75 m_aidQP = NULL; 76 #if FIXES77 76 m_aidQPdepth = NULL; 78 #endif79 77 } 80 78 … … 86 84 } 87 85 88 #if FIXES89 86 if ( m_aidQPdepth ) 90 87 { 91 88 delete[] m_aidQPdepth; m_aidQPdepth = NULL; 92 89 } 93 #endif94 90 95 91 for(Int i = 0; i< m_pchInputFileList.size(); i++ ) … … 115 111 if (m_pchBitstreamFile != NULL) 116 112 free (m_pchBitstreamFile) ; 113 #if FLEX_CODING_ORDER_M23723 114 if (m_pchMVCJointCodingOrder != NULL) 115 { 116 free(m_pchMVCJointCodingOrder) ; 117 } 118 #endif 117 119 #if HHI_VSO 118 120 if ( m_pchVSOConfig != NULL) … … 120 122 #endif 121 123 122 #if FIX_MEM_LEAKS123 124 if ( m_pchCameraParameterFile != NULL ) 124 125 free ( m_pchCameraParameterFile ); … … 139 140 free ( m_scalingListFile ); 140 141 141 #endif142 142 143 143 } … … 225 225 string cfg_RowHeight; 226 226 string cfg_ScalingListFile; 227 228 #if FLEX_CODING_ORDER_M23723 229 string cfg_JointCodingOrdering; 230 #endif 231 227 232 po::Options opts; 228 233 opts.addOptions() … … 268 273 269 274 ("NumberOfViews", m_iNumberOfViews, 0, "Number of views") 275 #if FLEX_CODING_ORDER_M23723 276 ("FCO", m_b3DVFlexOrder, false, "flexible coding order flag" ) 277 ("FCOCodingOrder", cfg_JointCodingOrdering, string(""), "The coding order for joint texture-depth coding") 278 #endif 270 279 /* Unit definition parameters */ 271 280 ("MaxCUWidth", m_uiMaxCUWidth, 64u) … … 298 307 ("FastSearch", m_iFastSearch, 1, "0:Full search 1:Diamond 2:PMVFAST") 299 308 ("SearchRange,-sr",m_iSearchRange, 96, "motion search range") 309 #if DV_V_RESTRICTION_B0037 310 ("DisparitySearchRangeRestriction",m_bUseDisparitySearchRangeRestriction, false, "restrict disparity search range") 311 ("VerticalDisparitySearchRange",m_iVerticalDisparitySearchRange, 56, "vertical disparity search range") 312 #endif 300 313 ("BipredSearchRange", m_bipredSearchRange, 4, "motion search range for bipred refinement") 301 314 ("HadamardME", m_bUseHADME, true, "hadamard ME for fractional-pel") … … 342 355 ("LoopFilterBetaOffset_div2", m_loopFilterBetaOffsetDiv2, 0 ) 343 356 ("LoopFilterTcOffset_div2", m_loopFilterTcOffsetDiv2, 0 ) 357 #if LGE_ILLUCOMP_B0045 358 ("IlluCompEnable", m_bUseIC , true , "Use illumination compensation for inter-view prediction" ) 359 #endif 344 360 #if DBL_CONTROL 345 #if FIX_DBL_CONTROL_DEFAULT346 361 ("DeblockingFilterControlPresent", m_DeblockingFilterControlPresent, true) 347 #else348 ("DeblockingFilterControlPresent", m_DeblockingFilterControlPresent, false)349 #endif350 362 #endif 351 363 352 364 /* Camera Paremetes */ 353 365 ("CameraParameterFile,cpf", m_pchCameraParameterFile, (Char *) 0, "Camera Parameter File Name") 366 #if QC_MVHEVC_B0046 367 ("BaseViewCameraNumbers" , m_aiVId, std::vector<Int>(1, MAX_VIEW_NUM), "Numbers of base views") 368 #endif 354 369 ("BaseViewCameraNumbers" , m_pchBaseViewCameraNumbers, (Char *) 0, "Numbers of base views") 355 370 … … 362 377 ("LambdaScaleVSO", m_dLambdaScaleVSO , (Double) 1 , "Lambda Scaling for VSO") 363 378 364 #if HHI_VSO_LS_TABLE 379 #if HHI_VSO_LS_TABLE_M23714 365 380 ("VSOLSTable", m_bVSOLSTable , true , "Depth QP dependent video/depth rate allocation by Lagrange multiplier" ) 366 381 #endif … … 377 392 #endif 378 393 #if LGE_WVSO_A0119 379 ("WVSO", m_bUseWVSO , false, "Use depth fidelity term for VSO" )394 ("WVSO", m_bUseWVSO , true , "Use depth fidelity term for VSO" ) 380 395 ("VSOWeight", m_iVSOWeight , 10 , "Synthesized View Distortion Change weight" ) 381 396 ("VSDWeight", m_iVSDWeight , 1 , "View Synthesis Distortion estimate weight" ) … … 383 398 #endif 384 399 385 #if OL_DEPTHLIMIT_A0044 386 ("DPL", m_bDepthPartitionLimiting , false , "Use DepthPartitionLimiting" ) 387 #endif 400 #if OL_QTLIMIT_PREDCODING_B0068 401 ("QTLPC", m_bUseQTLPC , true , "Use depth Quadtree Limitation + Predictive Coding" ) 402 #endif 403 388 404 #endif 389 405 … … 474 490 "\t0: disable") 475 491 492 #if TMVP_DEPTH_SWITCH 493 ("TMVP", m_enableTMVP, std::vector<Bool>(1,true), "Enable TMVP" ) 494 #else 476 495 ("TMVP", m_enableTMVP, true, "Enable TMVP" ) 496 #endif 477 497 478 498 ("FEN", m_bUseFastEnc, false, "fast encoder setting") … … 493 513 #if HHI_MPI 494 514 ("MVI", m_bUseMVI, false, "use motion vector inheritance for depth map coding") 515 #endif 516 #if RWTH_SDC_DLT_B0036 517 ("DLT", m_bUseDLT, true, "use depth lookup table for depth map coding") 518 ("SDC", m_bUseSDC, true, "use simplified depth coding tree") 495 519 #endif 496 520 ; … … 545 569 m_pchBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str()); 546 570 m_pchdQPFile = cfg_dQPFile.empty() ? NULL : strdup(cfg_dQPFile.c_str()); 547 571 #if FLEX_CODING_ORDER_M23723 572 m_pchMVCJointCodingOrder= cfg_JointCodingOrdering.empty()?NULL:strdup(cfg_JointCodingOrdering.c_str()); 573 // If flexible order is enabled and if depth comes before the texture for a view, disable VSO 574 #if HHI_VSO && DISABLE_FCO_FOR_VSO 575 Bool depthComesFirst = false; 576 int iter = 0; 577 if ( m_b3DVFlexOrder ) 578 { 579 for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++) 580 { 581 iter = 0; 582 for ( Int ii=1; ii<12; ii+=2 ) 583 { 584 Int iViewIdxCfg = (Int)(m_pchMVCJointCodingOrder[ii]-'0'); 585 if ( iViewIdxCfg == iViewIdx ) 586 { 587 iter ++; 588 if ( m_pchMVCJointCodingOrder[ii-1]=='D' ) // depth comes first for this view 589 { 590 if(iter == 1) 591 { 592 depthComesFirst = true; 593 break; 594 } 595 } 596 else 597 { 598 assert(m_pchMVCJointCodingOrder[ii-1]=='T'); 599 } 600 } 601 } 602 } 603 } 604 if (depthComesFirst) 605 { 606 m_bUseVSO = false; 607 } 608 #endif 609 #endif 548 610 m_pchColumnWidth = cfg_ColumnWidth.empty() ? NULL: strdup(cfg_ColumnWidth.c_str()); 549 611 m_pchRowHeight = cfg_RowHeight.empty() ? NULL : strdup(cfg_RowHeight.c_str()); … … 704 766 xCleanUpVectors(); 705 767 768 769 #if TMVP_DEPTH_SWITCH 770 if ( m_enableTMVP.size() < 2) 771 { 772 m_enableTMVP.push_back( m_enableTMVP[0] ); 773 } 774 #endif 775 776 706 777 #if HHI_VSO 707 778 if ( m_abUseALF .size() < 2) … … 732 803 #if HHI_VSO 733 804 734 #if HHI_VSO_LS_TABLE 805 #if HHI_VSO_LS_TABLE_M23714 735 806 // Q&D 736 807 Double adLambdaScaleTable[] = … … 796 867 } 797 868 #else 869 #if !QC_MVHEVC_B0046 798 870 m_cCameraData .init ( (UInt)m_iNumberOfViews, 799 871 m_uiInputBitDepth, … … 807 879 LOG2_DISP_PREC_LUT ); 808 880 #endif 881 #endif 809 882 810 883 811 884 // check validity of input parameters 812 885 xCheckParameter(); 886 #if !QC_MVHEVC_B0046 813 887 m_cCameraData.check( false, true ); 814 888 #endif 815 889 // print-out parameters 816 890 xPrintParameter(); … … 860 934 xConfirmPara( m_iFastSearch < 0 || m_iFastSearch > 2, "Fast Search Mode is not supported value (0:Full search 1:Diamond 2:PMVFAST)" ); 861 935 xConfirmPara( m_iSearchRange < 0 , "Search Range must be more than 0" ); 936 #if DV_V_RESTRICTION_B0037 937 xConfirmPara( m_iVerticalDisparitySearchRange <= 0 , "Vertical Disparity Search Range must be more than 0" ); 938 #endif 862 939 xConfirmPara( m_bipredSearchRange < 0 , "Search Range must be more than 0" ); 863 940 xConfirmPara( m_iMaxDeltaQP > 7, "Absolute Delta QP exceeds supported range (0 to 7)" ); … … 1650 1727 printf("Min PCM size : %d\n", 1 << m_uiPCMLog2MinSize); 1651 1728 printf("Motion search range : %d\n", m_iSearchRange ); 1729 #if DV_V_RESTRICTION_B0037 1730 printf("Disp search range restriction: %d\n", m_bUseDisparitySearchRangeRestriction ); 1731 printf("Vertical disp search range : %d\n", m_iVerticalDisparitySearchRange ); 1732 #endif 1652 1733 printf("Intra period : %d\n", m_iIntraPeriod ); 1653 1734 printf("Decoding refresh type : %d\n", m_iDecodingRefreshType ); … … 1685 1766 printf("VSO Negative Distortion : %d\n", m_bAllowNegDist ? 1 : 0); 1686 1767 #endif 1687 #if HHI_VSO_LS_TABLE 1768 #if HHI_VSO_LS_TABLE_M23714 1688 1769 printf("VSO LS Table : %d\n", m_bVSOLSTable ? 1 : 0); 1689 1770 #endif … … 1769 1850 printf(" ScalingList:%d ", m_useScalingListId ); 1770 1851 1852 #if !TMVP_DEPTH_SWITCH 1771 1853 printf("TMVP:%d ", m_enableTMVP ); 1854 #endif 1772 1855 1773 1856 #if ADAPTIVE_QP_SELECTION … … 1783 1866 printf("SAO:%d ", (m_abUseSAO [0] ? 1 : 0)); 1784 1867 printf("RDQ:%d ", (m_abUseRDOQ[0] ? 1 : 0) ); 1868 #if TMVP_DEPTH_SWITCH 1869 printf("TMVP:%d ", (m_enableTMVP[0] ? 1 : 0) ); 1870 #endif 1871 #if LGE_ILLUCOMP_B0045 1872 printf("IlluCompEnable: %d ", m_bUseIC); 1873 #endif 1874 1785 1875 printf("\n"); 1786 1876 … … 1789 1879 printf("SAO:%d ", (m_abUseSAO [1] ? 1 : 0)); 1790 1880 printf("RDQ:%d ", (m_abUseRDOQ[1] ? 1 : 0)); 1881 #if TMVP_DEPTH_SWITCH 1882 printf("TMVP:%d ", (m_enableTMVP[1] ? 1 : 0) ); 1883 #endif 1884 #if FLEX_CODING_ORDER_M23723 1885 printf("FCO:%d ", (m_b3DVFlexOrder ? 1: 0)); 1886 1887 if(m_b3DVFlexOrder) 1888 { 1889 printf("CodingOrder: %s ", m_pchMVCJointCodingOrder); 1890 } 1891 #endif 1791 1892 #if HHI_VSO 1792 1893 printf("VSO:%d ", m_bUseVSO ); … … 1795 1896 printf("WVSO:%d ", m_bUseWVSO ); 1796 1897 #endif 1797 #if OL_ DEPTHLIMIT_A00441798 printf(" DPL:%d ", m_bDepthPartitionLimiting);1898 #if OL_QTLIMIT_PREDCODING_B0068 1899 printf("QTLPC:%d ", m_bUseQTLPC); 1799 1900 #endif 1800 1901 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX … … 1804 1905 printf("MVI:%d ", m_bUseMVI ? 1 : 0 ); 1805 1906 #endif 1907 #if RWTH_SDC_DLT_B0036 1908 printf("SDC:%d ", m_bUseSDC ? 1 : 0 ); 1909 printf("DLT:%d ", m_bUseDLT ? 1 : 0 ); 1910 #endif 1806 1911 #if LGE_WVSO_A0119 1807 printf("\nVSO : VSD : SAD weight = %d : %d : %d ", m_iVSOWeight, m_iVSDWeight, m_iDWeight ); 1912 if ( m_bUseWVSO ) 1913 printf("\nVSO : VSD : SAD weight = %d : %d : %d ", m_iVSOWeight, m_iVSDWeight, m_iDWeight ); 1808 1914 #endif 1809 1915 printf("\n\n"); -
branches/HTM-4.0.1-VSP-dev0/source/App/TAppEncoder/TAppEncCfg.h
r193 r213 88 88 Int m_iNumberOfViews; ///< number Views to Encode 89 89 Bool m_bUsingDepthMaps; 90 91 #if FLEX_CODING_ORDER_M23723 92 Char* m_pchMVCJointCodingOrder; ///< texture-depth coding order 93 Bool m_b3DVFlexOrder; ///< flexible coding order flag 94 #endif 95 90 96 // coding structure 91 97 Int m_iIntraPeriod; ///< period of I-slice (random access period) … … 109 115 std::vector<Double> m_adQP; ///< QP value of key-picture (floating point) [0] video, [1] depth 110 116 std::vector<Int> m_aiQP; ///< QP value of key-picture (integer) [0] video, [1] depth 117 #if QC_MVHEVC_B0046 118 std::vector<Int> m_aiVId; ///< view id 119 #endif 111 120 Int m_aiTLayerQPOffset[MAX_TLAYER]; ///< QP offset corresponding to temporal layer depth 112 121 char* m_pchdQPFile; ///< QP offset for each slice (initialized from external file) … … 160 169 #endif 161 170 vector<Bool> m_abUseSAO; 171 #if LGE_ILLUCOMP_B0045 172 Bool m_bUseIC; ///< flag for using illumination compensation for inter-view prediction 173 #endif 162 174 #if SAO_UNIT_INTERLEAVING 163 175 Int m_maxNumOffsetsPerPic; ///< SAO maximun number of offset per picture … … 197 209 Int m_iFastSearch; ///< ME mode, 0 = full, 1 = diamond, 2 = PMVFAST 198 210 Int m_iSearchRange; ///< ME search range 211 #if DV_V_RESTRICTION_B0037 212 Bool m_bUseDisparitySearchRangeRestriction; ///< restrict vertical search range for inter-view prediction 213 Int m_iVerticalDisparitySearchRange; ///< ME vertical search range for inter-view prediction 214 #endif 199 215 Int m_bipredSearchRange; ///< ME search range for bipred refinement 200 216 Bool m_bUseFastEnc; ///< flag for using fast encoder setting … … 258 274 UInt m_uiBiPredIdc; ///< Use of Bi-Directional Weighting Prediction (B_SLICE): explicit(1) or implicit(2) 259 275 276 #if TMVP_DEPTH_SWITCH 277 vector<Bool> m_enableTMVP; ///< Enable TMVP [0] video, [1] depth 278 #else 260 279 Bool m_enableTMVP; 280 #endif 281 261 282 #if MULTIBITS_DATA_HIDING 262 283 Int m_signHideFlag; … … 266 287 Bool m_bUseMVI; ///< flag for using Motion Vector Inheritance for depth map coding 267 288 #endif 289 #if RWTH_SDC_DLT_B0036 290 Bool m_bUseDLT; 291 Bool m_bUseSDC; 292 #endif 268 293 269 294 Int m_useScalingListId; ///< using quantization matrix … … 273 298 Char* m_pchCameraParameterFile; ///< camera parameter file 274 299 Char* m_pchBaseViewCameraNumbers; 300 #if !QC_MVHEVC_B0046 275 301 TAppComCamPara m_cCameraData; 276 302 #endif 277 303 Int m_iCodedCamParPrecision; ///< precision for coding of camera parameters 278 304 … … 280 306 Char* m_pchVSOConfig; 281 307 Bool m_bUseVSO; ///< flag for using View Synthesis Optimization 282 #if HHI_VSO_LS_TABLE 308 #if HHI_VSO_LS_TABLE_M23714 283 309 Bool m_bVSOLSTable; ///< Depth QP dependent Lagrange parameter optimization (m23714) 284 310 #endif … … 313 339 #endif 314 340 315 #if OL_ DEPTHLIMIT_A0044316 Bool m_b DepthPartitionLimiting;341 #if OL_QTLIMIT_PREDCODING_B0068 342 Bool m_bUseQTLPC; ///< flag for using depth QuadTree Limitation + Predictive Coding 317 343 #endif 318 344 -
branches/HTM-4.0.1-VSP-dev0/source/App/TAppEncoder/TAppEncTop.cpp
r193 r213 67 67 Void TAppEncTop::xInitLibCfg() 68 68 { 69 #if VIDYO_VPS_INTEGRATION 69 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 70 #if !QC_MVHEVC_B0046 70 71 UInt layerId = 0; 72 #endif 71 73 // TODO: fix the assumption here that the temporal structures are all equal across all layers??? 72 74 m_cVPS.setMaxTLayers( m_maxTempLayer[0] ); 75 #if QC_MVHEVC_B0046 76 m_cVPS.setMaxLayers( m_iNumberOfViews ); 77 #else 73 78 m_cVPS.setMaxLayers( m_iNumberOfViews * (m_bUsingDepthMaps ? 2:1) ); 79 #endif 74 80 for(Int i = 0; i < MAX_TLAYER; i++) 75 81 { … … 81 87 for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++) 82 88 { 89 #if VSP_N 90 #if FLEX_CODING_ORDER_M23723 91 Bool isTextureFirst = false; 92 if ( m_b3DVFlexOrder ) 93 { 94 for ( Int ii=1; ii<12; ii+=2 ) 95 { 96 Int iViewIdxCfg = (Int)(m_pchMVCJointCodingOrder[ii]-'0'); 97 if ( iViewIdxCfg == iViewIdx ) 98 { 99 if ( m_pchMVCJointCodingOrder[ii-1]=='T' ) 100 { 101 isTextureFirst = true; 102 } 103 else 104 { 105 assert(m_pchMVCJointCodingOrder[ii-1]=='D'); 106 } 107 break; 108 } 109 } 110 } 111 else 112 { 113 isTextureFirst = true; 114 } 115 #endif 116 #endif 83 117 m_frameRcvd.push_back(0); 84 118 m_acTEncTopList.push_back(new TEncTop); … … 101 135 m_acTEncTopList[iViewIdx]->setViewId ( iViewIdx ); 102 136 m_acTEncTopList[iViewIdx]->setIsDepth ( false ); 137 #if QC_MVHEVC_B0046 138 m_acTEncTopList[iViewIdx]->setLayerId ( iViewIdx ); 139 m_cVPS.setViewId ( m_aiVId[ iViewIdx ], iViewIdx ); 140 #else 103 141 m_acTEncTopList[iViewIdx]->setViewOrderIdx ( m_cCameraData.getViewOrderIndex()[ iViewIdx ] ); 104 142 #if VIDYO_VPS_INTEGRATION … … 113 151 #endif 114 152 153 #if VSP_N 115 154 m_acTEncTopList[iViewIdx]->setCamParPrecision ( m_cCameraData.getCamParsCodedPrecision () ); 116 155 m_acTEncTopList[iViewIdx]->setCamParInSliceHeader ( m_cCameraData.getVaryingCameraParameters() ); 117 156 m_acTEncTopList[iViewIdx]->setCodedScale ( m_cCameraData.getCodedScale () ); 118 157 m_acTEncTopList[iViewIdx]->setCodedOffset ( m_cCameraData.getCodedOffset () ); 158 #else 159 m_acTEncTopList[iViewIdx]->setCamParPrecision ( 0 ); 160 m_acTEncTopList[iViewIdx]->setCamParInSliceHeader ( false ); 161 m_acTEncTopList[iViewIdx]->setCodedScale ( 0 ); 162 m_acTEncTopList[iViewIdx]->setCodedOffset ( 0 ); 163 #endif 164 #endif 119 165 120 166 //====== Coding Structure ======== … … 170 216 m_acTEncTopList[iViewIdx]->setSearchRange ( m_iSearchRange ); 171 217 m_acTEncTopList[iViewIdx]->setBipredSearchRange ( m_bipredSearchRange ); 172 218 #if DV_V_RESTRICTION_B0037 219 m_acTEncTopList[iViewIdx]->setUseDisparitySearchRangeRestriction ( m_bUseDisparitySearchRangeRestriction ); 220 m_acTEncTopList[iViewIdx]->setVerticalDisparitySearchRange( m_iVerticalDisparitySearchRange ); 221 #endif 173 222 //====== Quality control ======== 174 223 m_acTEncTopList[iViewIdx]->setMaxDeltaQP ( m_iMaxDeltaQP ); … … 300 349 m_acTEncTopList[iViewIdx]->setLFCrossSliceBoundaryFlag( m_bLFCrossSliceBoundaryFlag ); 301 350 m_acTEncTopList[iViewIdx]->setUseSAO ( m_abUseSAO[0] ); 351 #if LGE_ILLUCOMP_B0045 352 m_acTEncTopList[iViewIdx]->setUseIC ( m_bUseIC ); 353 #endif 302 354 #if SAO_UNIT_INTERLEAVING 303 355 m_acTEncTopList[iViewIdx]->setMaxNumOffsetsPerPic (m_maxNumOffsetsPerPic); … … 342 394 m_acTEncTopList[iViewIdx]->setWaveFrontFlush ( m_iWaveFrontFlush ); 343 395 m_acTEncTopList[iViewIdx]->setWaveFrontSubstreams ( m_iWaveFrontSubstreams ); 396 #if TMVP_DEPTH_SWITCH 397 m_acTEncTopList[iViewIdx]->setEnableTMVP ( m_enableTMVP[0] ); 398 #else 344 399 m_acTEncTopList[iViewIdx]->setEnableTMVP ( m_enableTMVP ); 400 #endif 345 401 m_acTEncTopList[iViewIdx]->setUseScalingListId ( m_useScalingListId ); 346 402 m_acTEncTopList[iViewIdx]->setScalingListFile ( m_scalingListFile ); … … 364 420 m_acTEncTopList[iViewIdx]->setUseDMM ( false ); 365 421 #endif 366 #if OL_ DEPTHLIMIT_A0044367 m_acTEncTopList[iViewIdx]->setUse DPL( false );422 #if OL_QTLIMIT_PREDCODING_B0068 423 m_acTEncTopList[iViewIdx]->setUseQTLPC ( false ); 368 424 #endif 369 425 #if HHI_MPI 370 426 m_acTEncTopList[iViewIdx]->setUseMVI( false ); 427 #endif 428 #if RWTH_SDC_DLT_B0036 429 m_acTEncTopList[iViewIdx]->setUseDLT ( false ); 430 m_acTEncTopList[iViewIdx]->setUseSDC ( false ); 371 431 #endif 372 432 … … 374 434 m_acTEncTopList[iViewIdx]->setUseVSP( m_bUseVSP ); 375 435 m_acTEncTopList[iViewIdx]->setVSPDepthDisable( m_bVSPDepthDisable ); 436 #if FLEX_CODING_ORDER_M23723 437 m_acTEncTopList[iViewIdx]->setIsFirstInView( isTextureFirst ); 438 #else 439 m_acTEncTopList[iViewIdx]->setIsFirstInView( true ); 440 #endif 376 441 #endif 377 442 } … … 380 445 for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++) 381 446 { 447 448 #if FLEX_CODING_ORDER_M23723 449 // Detect whether depth comes before than texture for this view 450 Bool isDepthFirst = false; 451 if ( m_b3DVFlexOrder ) 452 { 453 for ( Int ii=1; ii<12; ii+=2 ) 454 { 455 Int iViewIdxCfg = (Int)(m_pchMVCJointCodingOrder[ii]-'0'); 456 if ( iViewIdxCfg == iViewIdx ) 457 { 458 if ( m_pchMVCJointCodingOrder[ii-1]=='D' ) // depth comes first for this view 459 { 460 isDepthFirst = true; 461 } 462 else 463 { 464 assert(m_pchMVCJointCodingOrder[ii-1]=='T'); 465 } 466 break; 467 } 468 } 469 } 470 #endif 471 382 472 m_depthFrameRcvd.push_back(0); 383 473 m_acTEncDepthTopList.push_back(new TEncTop); … … 400 490 m_acTEncDepthTopList[iViewIdx]->setViewId ( iViewIdx ); 401 491 m_acTEncDepthTopList[iViewIdx]->setIsDepth ( true ); 492 #if QC_MVHEVC_B0046 493 m_acTEncDepthTopList[iViewIdx]->setLayerId ( iViewIdx ); 494 #else 402 495 m_acTEncDepthTopList[iViewIdx]->setViewOrderIdx ( m_cCameraData.getViewOrderIndex()[ iViewIdx ] ); 496 #endif 403 497 #if VIDYO_VPS_INTEGRATION 404 498 layerId = iViewIdx * 2 + 1; … … 410 504 m_cVPS.setDependentLayer ( layerId-1, layerId); 411 505 #endif 506 507 #if VSP_N 508 m_acTEncDepthTopList[iViewIdx]->setCamParPrecision ( m_cCameraData.getCamParsCodedPrecision () ); 509 m_acTEncDepthTopList[iViewIdx]->setCamParInSliceHeader ( m_cCameraData.getVaryingCameraParameters() ); 510 m_acTEncDepthTopList[iViewIdx]->setCodedScale ( m_cCameraData.getCodedScale () ); 511 m_acTEncDepthTopList[iViewIdx]->setCodedOffset ( m_cCameraData.getCodedOffset () ); 512 #else 412 513 m_acTEncDepthTopList[iViewIdx]->setCamParPrecision ( 0 ); 413 514 m_acTEncDepthTopList[iViewIdx]->setCamParInSliceHeader ( false ); 414 515 m_acTEncDepthTopList[iViewIdx]->setCodedScale ( 0 ); 415 516 m_acTEncDepthTopList[iViewIdx]->setCodedOffset ( 0 ); 517 #endif 416 518 417 519 //====== Coding Structure ======== … … 467 569 m_acTEncDepthTopList[iViewIdx]->setSearchRange ( m_iSearchRange ); 468 570 m_acTEncDepthTopList[iViewIdx]->setBipredSearchRange ( m_bipredSearchRange ); 469 571 #if DV_V_RESTRICTION_B0037 572 m_acTEncDepthTopList[iViewIdx]->setUseDisparitySearchRangeRestriction ( m_bUseDisparitySearchRangeRestriction ); 573 m_acTEncDepthTopList[iViewIdx]->setVerticalDisparitySearchRange( m_iVerticalDisparitySearchRange ); 574 #endif 470 575 //====== Quality control ======== 471 576 m_acTEncDepthTopList[iViewIdx]->setMaxDeltaQP ( m_iMaxDeltaQP ); … … 584 689 m_acTEncDepthTopList[iViewIdx]->setLFCrossSliceBoundaryFlag( m_bLFCrossSliceBoundaryFlag ); 585 690 m_acTEncDepthTopList[iViewIdx]->setUseSAO ( m_abUseSAO[1] ); 691 #if LGE_ILLUCOMP_B0045 692 m_acTEncDepthTopList[iViewIdx]->setUseIC ( false ); 693 #endif 586 694 #if SAO_UNIT_INTERLEAVING 587 695 m_acTEncDepthTopList[iViewIdx]->setMaxNumOffsetsPerPic (m_maxNumOffsetsPerPic); … … 626 734 m_acTEncDepthTopList[iViewIdx]->setWaveFrontFlush ( m_iWaveFrontFlush ); 627 735 m_acTEncDepthTopList[iViewIdx]->setWaveFrontSubstreams ( m_iWaveFrontSubstreams ); 736 #if TMVP_DEPTH_SWITCH 737 m_acTEncDepthTopList[iViewIdx]->setEnableTMVP ( m_enableTMVP[1] ); 738 #else 628 739 m_acTEncDepthTopList[iViewIdx]->setEnableTMVP ( m_enableTMVP ); 740 #endif 629 741 m_acTEncDepthTopList[iViewIdx]->setUseScalingListId ( m_useScalingListId ); 630 742 m_acTEncDepthTopList[iViewIdx]->setScalingListFile ( m_scalingListFile ); … … 648 760 m_acTEncDepthTopList[iViewIdx]->setUseDMM ( m_bUseDMM ); 649 761 #endif 650 #if OL_DEPTHLIMIT_A0044 651 m_acTEncDepthTopList[iViewIdx]->setUseDPL (m_bDepthPartitionLimiting); 762 #if FLEX_CODING_ORDER_M23723 && HHI_DMM_PRED_TEX 763 m_acTEncDepthTopList[iViewIdx]->setUseDMM34( (m_b3DVFlexOrder && isDepthFirst) ? false : m_bUseDMM ); 764 #endif 765 766 #if OL_QTLIMIT_PREDCODING_B0068 767 m_acTEncDepthTopList[iViewIdx]->setUseQTLPC (m_bUseQTLPC); 652 768 #endif 653 769 #if HHI_MPI 654 m_acTEncDepthTopList[iViewIdx]->setUseMVI( m_bUseMVI ); 770 #if FLEX_CODING_ORDER_M23723 771 m_acTEncDepthTopList[iViewIdx]->setUseMVI( (m_b3DVFlexOrder && isDepthFirst) ? false : m_bUseMVI ); 772 #else 773 m_acTEncDepthTopList[iViewIdx]->setUseMVI( m_bUseMVI ); 774 #endif 775 #endif 776 #if RWTH_SDC_DLT_B0036 777 m_acTEncDepthTopList[iViewIdx]->setUseDLT ( m_bUseDLT ); 778 m_acTEncDepthTopList[iViewIdx]->setUseSDC ( m_bUseSDC ); 655 779 #endif 656 780 … … 658 782 m_acTEncDepthTopList[iViewIdx]->setUseVSP( m_bUseVSP ); 659 783 m_acTEncDepthTopList[iViewIdx]->setVSPDepthDisable( m_bVSPDepthDisable ); 784 #if FLEX_CODING_ORDER_M23723 785 m_acTEncDepthTopList[iViewIdx]->setIsFirstInView( isDepthFirst ); 786 #else 787 m_acTEncDepthTopList[iViewIdx]->setIsFirstInView( false ); 788 #endif 660 789 #endif 661 790 } … … 677 806 if ( m_uiVSOMode == 4 ) 678 807 { 679 #if HHI_VSO_SPEEDUP_A0033680 808 #if LGE_VSO_EARLY_SKIP_A0093 681 809 m_cRendererModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, g_uiMaxCUHeight , LOG2_DISP_PREC_LUT, 0, m_bVSOEarlySkip ); 682 810 #else 683 811 m_cRendererModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, g_uiMaxCUHeight , LOG2_DISP_PREC_LUT, 0 ); 684 #endif685 #else686 m_cRendererModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, m_iSourceHeight, LOG2_DISP_PREC_LUT, 0 );687 812 #endif 688 813 … … 820 945 { 821 946 m_acTEncTopList[iViewIdx]->init( this ); 947 #if QC_MVHEVC_B0046 948 //set setNumDirectRefLayer 949 Int iNumDirectRef = m_acTEncTopList[iViewIdx]->getSPS()->getNumberOfUsableInterViewRefs(); 950 m_acTEncTopList[iViewIdx]->getEncTop()->getVPS()->setNumDirectRefLayer(iNumDirectRef, iViewIdx); 951 for(Int iNumIvRef = 0; iNumIvRef < iNumDirectRef; iNumIvRef ++) 952 { 953 Int iLayerId = m_acTEncTopList[iViewIdx]->getSPS()->getUsableInterViewRef(iNumIvRef); 954 m_acTEncTopList[iViewIdx]->getEncTop()->getVPS()->setDirectRefLayerId( iLayerId + iViewIdx, iViewIdx, iNumIvRef); 955 } 956 #endif 822 957 } 823 958 for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++) … … 861 996 TComPicYuv* pcPicYuvOrg = new TComPicYuv; 862 997 TComPicYuv* pcDepthPicYuvOrg = new TComPicYuv; 998 #if !QC_MVHEVC_B0046 863 999 TComPicYuv* pcPdmDepthOrg = new TComPicYuv; 1000 #endif 864 1001 TComPicYuv* pcPicYuvRec = NULL; 865 1002 TComPicYuv* pcDepthPicYuvRec = NULL; 866 1003 867 1004 // initialize internal class & member variables 868 1005 xInitLibCfg(); … … 884 1021 eos.push_back( false ); 885 1022 depthEos.push_back( false ); 1023 1024 #if RWTH_SDC_DLT_B0036 1025 if( m_bUsingDepthMaps && m_bUseDLT ) 1026 xAnalyzeInputBaseDepth(iViewIdx, m_iIntraPeriod); 1027 #endif 886 1028 } 887 1029 … … 957 1099 { 958 1100 Int iNumEncoded = 0; 1101 #if !QC_MVHEVC_B0046 959 1102 UInt iNextPoc = m_acTEncTopList[0] -> getFrameId( gopId ); 960 1103 if ( iNextPoc < m_iFrameToBeEncoded ) … … 962 1105 m_cCameraData.update( iNextPoc ); 963 1106 } 1107 #endif 1108 1109 #if FLEX_CODING_ORDER_M23723 1110 if (m_b3DVFlexOrder) 1111 { 1112 Int iNumDepthEncoded = 0; 1113 iNumEncoded = 0; 1114 Int i=0; 1115 Int iViewIdx=0; 1116 Int iNumberofDepthViews = m_bUsingDepthMaps?m_iNumberOfViews:0; 1117 for (Int j=0; j < (m_iNumberOfViews+ iNumberofDepthViews); j++ ) 1118 { 1119 if (m_pchMVCJointCodingOrder[i]=='T') 1120 { 1121 1122 i++; 1123 assert(isdigit(m_pchMVCJointCodingOrder[i])); 1124 iViewIdx = (Int)(m_pchMVCJointCodingOrder[i]-'0'); 1125 1126 #if VSP_SLICE_HEADER && !VSP_CFG 1127 if( m_acTEncTopList[iViewIdx]->getUseVSP() ) m_acTEncTopList[iViewIdx]->setUseVSP( (gopId%VSP_FRAME_INTERVAL==0) ); 1128 #endif 1129 1130 #if VSP_N 1131 #if VSP_SLICE_HEADER 1132 if( m_acTEncTopList[iViewIdx]->getUseVSP() ) 1133 #endif 1134 if( m_bUsingDepthMaps ) 1135 { 1136 // Forward Warping 1137 xStoreVSPInBuffer( m_acTEncTopList[iViewIdx]->getVSPBuf(), m_acTEncTopList[iViewIdx]->getVSPAvailBuf(), iViewIdx, false, gopId ); 1138 } 1139 #endif 1140 1141 m_acTEncTopList[iViewIdx]->encode( eos[iViewIdx], pcPicYuvOrg, *m_picYuvRec[iViewIdx], outputAccessUnits, iNumEncoded, gopId ); 1142 xWriteOutput(bitstreamFile, iNumEncoded, outputAccessUnits, iViewIdx, false); 1143 outputAccessUnits.clear(); 1144 i++; 1145 } 1146 else if ( m_pchMVCJointCodingOrder[i] == 'D') 1147 { 1148 1149 i++; 1150 if( m_bUsingDepthMaps ) 1151 { 1152 assert(isdigit(m_pchMVCJointCodingOrder[i])); 1153 iViewIdx = (Int)(m_pchMVCJointCodingOrder[i]-'0'); 1154 #if SAIT_VSO_EST_A0033 1155 if( m_bUseVSO && iNextPoc < m_iFrameToBeEncoded ) 1156 { 1157 m_cCameraData.xSetDispCoeff( iNextPoc, iViewIdx ); 1158 m_acTEncDepthTopList[iViewIdx]->setDispCoeff( m_cCameraData.getDispCoeff() ); 1159 } 1160 #endif 1161 1162 #if VSP_SLICE_HEADER && !VSP_CFG 1163 if( m_acTEncDepthTopList[iViewIdx]->getUseVSP() ) m_acTEncDepthTopList[iViewIdx]->setUseVSP( (gopId%VSP_FRAME_INTERVAL==0) ); 1164 #endif 1165 1166 #if VSP_N 1167 #if VSP_SLICE_HEADER 1168 if( m_acTEncDepthTopList[iViewIdx]->getUseVSP() ) 1169 if( !m_acTEncDepthTopList[iViewIdx]->getVSPDepthDisable() ) 1170 #endif 1171 xStoreVSPInBuffer( m_acTEncDepthTopList[iViewIdx]->getVSPBuf(), m_acTEncDepthTopList[iViewIdx]->getVSPAvailBuf(), iViewIdx, true, gopId ); 1172 #endif 1173 1174 m_acTEncDepthTopList[iViewIdx]->encode( depthEos[iViewIdx], pcDepthPicYuvOrg, *m_picYuvDepthRec[iViewIdx], outputAccessUnits, iNumDepthEncoded, gopId ); 1175 xWriteOutput(bitstreamFile, iNumDepthEncoded, outputAccessUnits, iViewIdx, true); 1176 outputAccessUnits.clear(); 1177 i++; 1178 } 1179 } 1180 } 1181 } 1182 else 1183 { 1184 1185 #endif 964 1186 for(Int iViewIdx=0; iViewIdx < m_iNumberOfViews; iViewIdx++ ) 965 1187 { … … 1008 1230 } 1009 1231 } 1232 1233 #if FLEX_CODING_ORDER_M23723 1234 } 1235 #endif 1236 1010 1237 #if HHI_INTERVIEW_SKIP || HHI_INTER_VIEW_MOTION_PRED || HHI_INTER_VIEW_RESIDUAL_PRED 1011 1238 for( Int iViewIdx = 0; iViewIdx < m_iNumberOfViews; iViewIdx++ ) … … 1040 1267 pcDepthPicYuvOrg = NULL; 1041 1268 1042 #if FIX_MEM_LEAKS 1269 #if !QC_MVHEVC_B0046 1270 #if FIX_DEL_NULLPTR 1271 if ( pcPdmDepthOrg != NULL && m_uiMultiviewMvRegMode ) 1272 #else 1043 1273 if ( pcPdmDepthOrg != NULL ) 1274 #endif 1044 1275 { 1045 1276 pcPdmDepthOrg->destroy(); … … 1048 1279 }; 1049 1280 #endif 1050 1051 1281 1052 1282 for(Int iViewIdx=0; iViewIdx < m_iNumberOfViews; iViewIdx++ ) … … 1252 1482 case NAL_UNIT_CODED_SLICE: 1253 1483 #if H0566_TLA 1484 #if !QC_REM_IDV_B0046 1254 1485 case NAL_UNIT_CODED_SLICE_IDV: 1486 #endif 1255 1487 case NAL_UNIT_CODED_SLICE_TLA: 1256 1488 case NAL_UNIT_CODED_SLICE_CRA: … … 1306 1538 #endif 1307 1539 #if HHI_VSO 1308 #if HHI_VSO_SPEEDUP_A00331309 1540 Void TAppEncTop::setupRenModel( Int iPoc, Int iEncViewIdx, Int iEncContent, Int iHorOffset ) 1310 1541 { 1311 #if FIX_VSO_SETUP1312 1542 m_cRendererModel.setupPart( iHorOffset, Min( g_uiMaxCUHeight, m_iSourceHeight - iHorOffset ) ); 1313 #else1314 m_cRendererModel.setHorOffset( iHorOffset );1315 #endif1316 #else1317 Void TAppEncTop::setupRenModel( Int iPoc, Int iEncViewIdx, Int iEncContent )1318 {1319 #endif1320 1543 Int iEncViewSIdx = m_cCameraData.getBaseId2SortedId()[ iEncViewIdx ]; 1321 1544 … … 1455 1678 return pcPic; 1456 1679 }; 1680 1681 #if RWTH_SDC_DLT_B0036 1682 Void TAppEncTop::xAnalyzeInputBaseDepth(Int iViewIdx, UInt uiNumFrames) 1683 { 1684 TComPicYuv* pcDepthPicYuvOrg = new TComPicYuv; 1685 // allocate original YUV buffer 1686 pcDepthPicYuvOrg->create( m_iSourceWidth, m_iSourceHeight, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); 1687 1688 TVideoIOYuv* depthVideoFile = new TVideoIOYuv; 1689 1690 UInt uiMaxDepthValue = g_uiIBDI_MAX; 1691 1692 Bool abValidDepths[256]; 1693 1694 depthVideoFile->open( m_pchDepthInputFileList[iViewIdx], false, m_uiInputBitDepth, m_uiInternalBitDepth ); // read mode 1695 1696 // initialize boolean array 1697 for(Int p=0; p<=uiMaxDepthValue; p++) 1698 abValidDepths[p] = false; 1699 1700 Int iHeight = pcDepthPicYuvOrg->getHeight(); 1701 Int iWidth = pcDepthPicYuvOrg->getWidth(); 1702 Int iStride = pcDepthPicYuvOrg->getStride(); 1703 1704 Pel* pInDM = pcDepthPicYuvOrg->getLumaAddr(); 1705 1706 for(Int uiFrame=0; uiFrame < uiNumFrames; uiFrame++ ) 1707 { 1708 depthVideoFile->read( pcDepthPicYuvOrg, m_aiPad, false ); 1709 1710 // check all pixel values 1711 for (Int i=0; i<iHeight; i++) 1712 { 1713 Int rowOffset = i*iStride; 1714 1715 for (Int j=0; j<iWidth; j++) 1716 { 1717 Pel depthValue = pInDM[rowOffset+j]; 1718 abValidDepths[depthValue] = true; 1719 } 1720 } 1721 } 1722 1723 depthVideoFile->close(); 1724 1725 pcDepthPicYuvOrg->destroy(); 1726 delete pcDepthPicYuvOrg; 1727 1728 // convert boolean array to idx2Depth LUT 1729 UInt* auiIdx2DepthValue = (UInt*) calloc(uiMaxDepthValue, sizeof(UInt)); 1730 UInt uiNumDepthValues = 0; 1731 for(UInt p=0; p<=uiMaxDepthValue; p++) 1732 { 1733 if( abValidDepths[p] == true) 1734 { 1735 auiIdx2DepthValue[uiNumDepthValues++] = p; 1736 } 1737 } 1738 1739 if( uiNumFrames == 0 || ceil(Log2(uiNumDepthValues)) == ceil(Log2(g_uiIBDI_MAX)) ) 1740 { 1741 // don't use DLT 1742 m_acTEncDepthTopList[iViewIdx]->setUseDLT(false); 1743 m_acTEncDepthTopList[iViewIdx]->getSPS()->setUseDLT(false); 1744 } 1745 1746 // assign LUT 1747 if( m_acTEncDepthTopList[iViewIdx]->getUseDLT() ) 1748 m_acTEncDepthTopList[iViewIdx]->getSPS()->setDepthLUTs(auiIdx2DepthValue, uiNumDepthValues); 1749 else 1750 m_acTEncDepthTopList[iViewIdx]->getSPS()->setDepthLUTs(); 1751 1752 // free temporary memory 1753 free(auiIdx2DepthValue); 1754 } 1755 #endif 1457 1756 1458 1757 #if VSP_N -
branches/HTM-4.0.1-VSP-dev0/source/App/TAppEncoder/TAppEncTop.h
r166 r213 87 87 #endif 88 88 89 #if VIDYO_VPS_INTEGRATION 89 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 90 90 TComVPS m_cVPS; 91 91 #endif … … 141 141 #endif 142 142 #if HHI_VSO 143 #if HHI_VSO_SPEEDUP_A0033144 143 Void setupRenModel ( Int iPoc, Int iEncViewIdx, Int iEncContent, Int iHorOffset ); 145 #else146 Void setupRenModel ( Int iPoc, Int iEncViewIdx, Int iEncContent );147 #endif148 144 #endif 149 145 146 #if QC_MVHEVC_B0046 147 TComVPS* getVPS() { return &m_cVPS; } 148 #endif 150 149 #if VIDYO_VPS_INTEGRATION 151 150 TComVPS* getVPS() { return &m_cVPS; } … … 166 165 Void xStoreVSORefPicsInBuffer(); ///< read in External Ref pic from file and store in buffer 167 166 #endif 167 168 #if RWTH_SDC_DLT_B0036 169 Void xAnalyzeInputBaseDepth(Int iViewIdx, UInt uiNumFrames); 170 #endif 168 171 169 172 #if VSP_N -
branches/HTM-4.0.1-VSP-dev0/source/App/TAppRenderer/RendererMain.cpp
r100 r213 43 43 int main(int argc, char* argv[]) 44 44 { 45 #if !QC_MVHEVC_B0046 45 46 TAppRendererTop cTAppRendererTop; 46 47 … … 78 79 79 80 return 0; 81 #endif 80 82 } 81 83 -
branches/HTM-4.0.1-VSP-dev0/source/App/TAppRenderer/TAppRendererCfg.cpp
r100 r213 59 59 // Constructor / destructor / initialization / destroy 60 60 // ==================================================================================================================== 61 61 #if !QC_MVHEVC_B0046 62 62 TAppRendererCfg::TAppRendererCfg() 63 63 { … … 120 120 121 121 /* File I/O */ 122 ("VideoInputFileBaseName ", m_pchVideoInputFileBaseName, (Char*) 0, "Basename to generate video input file names")123 ("DepthInputFileBaseName ", m_pchDepthInputFileBaseName, (Char*) 0, "Basename to generate depth input file names")124 ("SynthOutputFileBaseName ", m_pchSynthOutputFileBaseName, (Char*) 0, "Basename to generate synthesized output file names")122 ("VideoInputFileBaseName,v", m_pchVideoInputFileBaseName, (Char*) 0, "Basename to generate video input file names") 123 ("DepthInputFileBaseName,d", m_pchDepthInputFileBaseName, (Char*) 0, "Basename to generate depth input file names") 124 ("SynthOutputFileBaseName,s", m_pchSynthOutputFileBaseName, (Char*) 0, "Basename to generate synthesized output file names") 125 125 ("ContOutputFileNumbering", m_bContOutputFileNumbering , false , "Continuous Output File Numbering") 126 126 ("Sweep" , m_bSweep , false , "Store all views in first Output File") … … 137 137 138 138 /* Camera Specification */ 139 ("CameraParameterFile, cpf", m_pchCameraParameterFile, (Char *) 0, "Camera Parameter File Name")139 ("CameraParameterFile,-cpf", m_pchCameraParameterFile, (Char *) 0, "Camera Parameter File Name") 140 140 ("BaseViewCameraNumbers" , m_pchBaseViewCameraNumbers, (Char *) 0, "Numbers of base views") 141 141 ("SynthViewCameraNumbers" , m_pchSynthViewCameraNumbers, (Char *) 0, "Numbers of views to synthesis") … … 516 516 g_uiIBDI_MAX = ((1<<(g_uiBitDepth+g_uiBitIncrement))-1); 517 517 } 518 #endif -
branches/HTM-4.0.1-VSP-dev0/source/App/TAppRenderer/TAppRendererCfg.h
r100 r213 50 50 #include <string> 51 51 #include <vector> 52 52 #if !QC_MVHEVC_B0046 53 53 // ==================================================================================================================== 54 54 // Class definition … … 134 134 135 135 136 136 #endif 137 137 #endif // __TAppRENDERERCFG__ 138 138 -
branches/HTM-4.0.1-VSP-dev0/source/App/TAppRenderer/TAppRendererTop.cpp
r193 r213 45 45 // Constructor / destructor / initialization / destroy 46 46 // ==================================================================================================================== 47 47 #if !QC_MVHEVC_B0046 48 48 TAppRendererTop::TAppRendererTop() 49 49 { … … 532 532 #endif 533 533 534 #if HHI_VSO_SPEEDUP_A0033535 #if FIX_VSO_SETUP536 534 cCurModel.setupPart( 0, m_iSourceHeight ); 537 #else538 cCurModel.setHorOffset( 0 );539 #endif540 #endif541 535 542 536 for ( Int iViewIdx = 0; iViewIdx < m_iNumberOfInputViews; iViewIdx++ ) … … 713 707 714 708 AOT( m_iLog2SamplingFactor != 0 ); 715 #if HHI_VSO_SPEEDUP_A0033716 #if FIX_VSO_SETUP717 709 cCurModel.setupPart( 0, m_iSourceHeight ); 718 #else719 cCurModel.setHorOffset( 0 );720 #endif721 #endif722 710 #if LGE_VSO_EARLY_SKIP_A0093 723 711 cCurModel.create( m_iNumberOfInputViews, m_iNumberOfOutputViews, m_iSourceWidth, m_iSourceHeight, m_iShiftPrecision, m_iBlendHoleMargin, false ); … … 1046 1034 1047 1035 } 1036 #endif -
branches/HTM-4.0.1-VSP-dev0/source/App/TAppRenderer/TAppRendererTop.h
r100 r213 50 50 #include "../../Lib/TLibRenderer/TRenModel.h" 51 51 52 52 #if !QC_MVHEVC_B0046 53 53 // ==================================================================================================================== 54 54 // Class definition … … 87 87 };// END CLASS DEFINITION TAppRendererTop 88 88 89 #endif // __TAppRendererTOP__89 #endif 90 90 91 #endif -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/CommonDef.h
r193 r213 58 58 59 59 #define HM_VERSION "6.1" 60 #define NV_VERSION " 4.1" ///< Current software version60 #define NV_VERSION "5.1" ///< Current software version 61 61 62 62 // ==================================================================================================================== … … 144 144 #define PDM_NO_INTER_UPDATE 1 // no update for inter (but not inter-view) predicted blocks 145 145 #define PDM_MERGE_POS 0 // position of pdm in merge list (0..4) 146 #if SAIT_IMPROV_MOTION_PRED_M24829&!QC_MULTI_DIS_CAN 146 147 #if QC_MRG_CANS_B0048 148 #if OL_DISMV_POS_B0069 149 #define DMV_MERGE_POS 4 150 #else 151 #define DMV_MERGE_POS 1 152 #endif 153 #endif 154 155 #if SAIT_IMPROV_MOTION_PRED_M24829&!QC_MULTI_DIS_CAN_A0097 147 156 #define PDM_AMVP_POS 0 // position of pdm in amvp list (0..3) 148 157 #else … … 181 190 // VPS constants 182 191 // ==================================================================================================================== 192 #if QC_MVHEVC_B0046 193 #define MAX_LAYER_NUM MAX_VIEW_NUM 194 #endif 183 195 #if VIDYO_VPS_INTEGRATION 184 196 #define MAX_LAYER_NUM MAX_VIEW_NUM … … 476 488 NAL_UNIT_CODED_SLICE, 477 489 #if H0566_TLA 490 #if QC_REM_IDV_B0046 491 NAL_UNIT_RESERVED, 492 #else 478 493 NAL_UNIT_CODED_SLICE_IDV, 494 #endif 479 495 NAL_UNIT_CODED_SLICE_TLA, 480 496 NAL_UNIT_CODED_SLICE_CRA, … … 504 520 NAL_UNIT_RESERVED_23, 505 521 NAL_UNIT_UNSPECIFIED_24, 506 #if VIDYO_VPS_INTEGRATION 522 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 507 523 NAL_UNIT_VPS, 508 524 #else -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/ContextTables.h
r100 r213 52 52 #define NUM_SKIP_FLAG_CTX 3 ///< number of context models for skip flag 53 53 54 #if LGE_ILLUCOMP_B0045 55 #define NUM_IC_FLAG_CTX 3 ///< number of context models for illumination compensation flag 56 #endif 57 54 58 #define NUM_MERGE_FLAG_EXT_CTX 1 ///< number of context models for merge flag of merge extended 55 59 #if MRG_IDX_CTX_RED … … 152 156 #endif 153 157 154 #if LGE_EDGE_INTRA 158 #if LGE_EDGE_INTRA_A0070 155 159 #define NUM_EDGE_INTRA_CTX 1 156 160 #if LGE_EDGE_INTRA_DELTA_DC … … 159 163 #endif 160 164 165 #if RWTH_SDC_DLT_B0036 166 #define SDC_NUM_FLAG_CTX 3 167 #define SDC_NUM_RESIDUAL_FLAG_CTX 1 168 #define SDC_NUM_SIGN_FLAG_CTX 1 169 #define SDC_NUM_RESIDUAL_CTX 10 170 171 #define SDC_NUM_PRED_MODE_CTX 5 172 #endif 173 161 174 // ==================================================================================================================== 162 175 // Tables … … 180 193 { 197, 185, 201, }, 181 194 }; 195 196 #if LGE_ILLUCOMP_B0045 197 static const UChar 198 INIT_IC_FLAG[3][NUM_IC_FLAG_CTX] = 199 { 200 { CNU, CNU, CNU, }, 201 { 197, 185, 201, }, 202 { 197, 185, 201, }, 203 }; 204 #endif 182 205 183 206 static const UChar … … 1280 1303 }; 1281 1304 1282 #if LGE_EDGE_INTRA 1305 #if LGE_EDGE_INTRA_A0070 1283 1306 static const Short 1284 1307 INIT_EDGE_INTRA[3][NUM_EDGE_INTRA_CTX] = … … 1314 1337 #endif 1315 1338 1339 #if RWTH_SDC_DLT_B0036 1340 static const Short INIT_SDC_FLAG[3][SDC_NUM_FLAG_CTX][2] = 1341 { 1342 { 1343 { 0, 64 }, { 0, 64 }, { 0, 64 } 1344 }, 1345 { 1346 { 0, 64 }, { 0, 64 }, { 0, 64 } 1347 }, 1348 { 1349 { 0, 64 }, { 0, 64 }, { 0, 64 } 1350 } 1351 }; 1352 1353 static const Short INIT_SDC_RESIDUAL_FLAG[3][3*SDC_NUM_RESIDUAL_FLAG_CTX][2] = 1354 { 1355 { 1356 { -5, 35 }, 1357 { -0, 56 }, 1358 { -0, 56 } 1359 1360 }, 1361 { 1362 { -5, 35 }, 1363 { -0, 56 }, 1364 { -0, 56 } 1365 }, 1366 { 1367 { -5, 35 }, 1368 { -0, 56 }, 1369 { -0, 56 } 1370 } 1371 }; 1372 1373 static const Short INIT_SDC_SIGN_FLAG[3][3*SDC_NUM_SIGN_FLAG_CTX][2] = 1374 { 1375 { 1376 { -1, 56 }, 1377 { -4, 55 }, 1378 { -4, 55 } 1379 }, 1380 { 1381 { -1, 56 }, 1382 { -4, 55 }, 1383 { -4, 55 } 1384 }, 1385 { 1386 { -1, 56 }, 1387 { -4, 55 }, 1388 { -4, 55 } 1389 } 1390 }; 1391 1392 static const Short INIT_SDC_RESIDUAL[3][3*SDC_NUM_RESIDUAL_CTX][2] = 1393 { 1394 { 1395 { -1, 64 }, { 2, 64 }, { 6, 67 }, { 8, 61 }, { 7, 47 }, { 10, 33 }, { 12, 14 }, { 33, -13 }, { 12, 14 }, { 33, -13 }, 1396 { 2, 66 }, { -0, 63 }, { 1, 64 }, { 6, 65 }, { 7, 59 }, { 12, 50 }, { 14, 27 }, { -0, -17 }, { 14, 27 }, { -0, -17 }, 1397 { 2, 66 }, { -0, 63 }, { 1, 64 }, { 6, 65 }, { 7, 59 }, { 12, 50 }, { 14, 27 }, { -0, -17 }, { 14, 27 }, { -0, -17 } 1398 }, 1399 { 1400 { -1, 64 }, { 2, 64 }, { 6, 67 }, { 8, 61 }, { 7, 47 }, { 10, 33 }, { 12, 14 }, { 33, -13 }, { 12, 14 }, { 33, -13 }, 1401 { 2, 66 }, { -0, 63 }, { 1, 64 }, { 6, 65 }, { 7, 59 }, { 12, 50 }, { 14, 27 }, { -0, -17 }, { 14, 27 }, { -0, -17 }, 1402 { 2, 66 }, { -0, 63 }, { 1, 64 }, { 6, 65 }, { 7, 59 }, { 12, 50 }, { 14, 27 }, { -0, -17 }, { 14, 27 }, { -0, -17 } 1403 }, 1404 { 1405 { -1, 64 }, { 2, 64 }, { 6, 67 }, { 8, 61 }, { 7, 47 }, { 10, 33 }, { 12, 14 }, { 33, -13 }, { 12, 14 }, { 33, -13 }, 1406 { 2, 66 }, { -0, 63 }, { 1, 64 }, { 6, 65 }, { 7, 59 }, { 12, 50 }, { 14, 27 }, { -0, -17 }, { 14, 27 }, { -0, -17 }, 1407 { 2, 66 }, { -0, 63 }, { 1, 64 }, { 6, 65 }, { 7, 59 }, { 12, 50 }, { 14, 27 }, { -0, -17 }, { 14, 27 }, { -0, -17 } 1408 } 1409 }; 1410 1411 static const Short INIT_SDC_PRED_MODE[3][3*SDC_NUM_PRED_MODE_CTX][2] = 1412 { 1413 { 1414 { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 }, 1415 { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 }, 1416 { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 } 1417 }, 1418 { 1419 { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 }, 1420 { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 }, 1421 { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 } 1422 }, 1423 { 1424 { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 }, 1425 { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 }, 1426 { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 } 1427 } 1428 }; 1429 #endif 1430 1316 1431 //! \} 1317 1432 -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/NAL.h
r165 r213 51 51 NalRefIdc m_nalRefIDC; ///< nal_ref_idc 52 52 #endif 53 #if VIDYO_VPS_INTEGRATION 53 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 54 54 unsigned m_layerId; 55 55 unsigned m_temporalId; ///< temporal_id … … 69 69 NalUnitType nalUnitType, 70 70 Bool nalRefFlag, 71 #if !VIDYO_VPS_INTEGRATION 71 #if !VIDYO_VPS_INTEGRATION & !QC_MVHEVC_B0046 72 72 Int viewId, 73 73 Bool isDepth, … … 78 78 :m_nalUnitType (nalUnitType) 79 79 ,m_nalRefFlag (nalRefFlag) 80 #if !VIDYO_VPS_INTEGRATION 80 #if !VIDYO_VPS_INTEGRATION & !QC_MVHEVC_B0046 81 81 ,m_viewId (viewId) 82 82 ,m_isDepth (isDepth) … … 139 139 return m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR 140 140 #if H0566_TLA 141 #if !QC_REM_IDV_B0046 141 142 || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDV 143 #endif 142 144 || m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA 143 145 || m_nalUnitType == NAL_UNIT_CODED_SLICE_TLA -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComDataCU.cpp
r193 r213 137 137 m_phQP = NULL; 138 138 m_pbMergeFlag = NULL; 139 #if LGE_ILLUCOMP_B0045 140 m_pbICFlag = NULL; 141 #endif 139 142 m_puhMergeIndex = NULL; 140 143 m_puhLumaIntraDir = NULL; … … 152 155 m_pcTrCoeffCr = NULL; 153 156 #if ADAPTIVE_QP_SELECTION 154 #if FIX_MEM_LEAKS155 157 m_ArlCoeffIsAliasedAllocation = false; 156 158 m_pcArlCoeffY = NULL; … … 158 160 m_pcArlCoeffCr = NULL; 159 161 #endif 160 #endif161 162 162 163 m_pbIPCMFlag = NULL; … … 206 207 m_pbResPredFlag = NULL; 207 208 #endif 208 #if LGE_EDGE_INTRA 209 #if LGE_EDGE_INTRA_A0070 209 210 m_pucEdgeCode = NULL; 210 211 m_pucEdgeNumber = NULL; … … 217 218 #endif 218 219 #endif 219 #if OL_DEPTHLIMIT_A0044 220 //add a variable to store the partition information 221 //a 2D array in part_symbol, uidepth format 222 //initialize m_partInfo to OL_END_CU 223 for (Int i=0; i < OL_PART_BUF_SIZE; i++) 224 { 225 for (Int j=0; j < 2; j++) 226 { 227 m_uiPartInfo[i][j] = OL_END_CU; 228 } 229 } 220 #if RWTH_SDC_DLT_B0036 221 m_pbSDCFlag = NULL; 222 m_apSegmentDCOffset[0] = NULL; 223 m_apSegmentDCOffset[1] = NULL; 230 224 #endif 231 225 } … … 268 262 m_pePredMode = new Char[ uiNumPartition ]; 269 263 264 #if RWTH_SDC_DLT_B0036 265 m_pbSDCFlag = (Bool* )xMalloc(Bool, uiNumPartition); 266 m_apSegmentDCOffset[0] = (Pel*)xMalloc(Pel, uiNumPartition); 267 m_apSegmentDCOffset[1] = (Pel*)xMalloc(Pel, uiNumPartition); 268 #endif 269 270 270 m_puiAlfCtrlFlag = new Bool[ uiNumPartition ]; 271 271 272 272 m_pbMergeFlag = (Bool* )xMalloc(Bool, uiNumPartition); 273 #if LGE_ILLUCOMP_B0045 274 m_pbICFlag = (Bool* )xMalloc(Bool, uiNumPartition); 275 #endif 273 276 m_puhMergeIndex = (UChar* )xMalloc(UChar, uiNumPartition); 274 277 #if HHI_INTER_VIEW_RESIDUAL_PRED … … 312 315 m_pcArlCoeffCb = m_pcGlbArlCoeffCb; 313 316 m_pcArlCoeffCr = m_pcGlbArlCoeffCr; 314 #if FIX_MEM_LEAKS315 317 m_ArlCoeffIsAliasedAllocation = true; 316 #endif317 318 } 318 319 else … … 350 351 m_piContourPredTexDeltaDC2 = (Int* )xMalloc(Int, uiNumPartition); 351 352 #endif 352 #if LGE_EDGE_INTRA 353 #if LGE_EDGE_INTRA_A0070 353 354 m_pucEdgeCode = (UChar*)xMalloc(UChar, uiNumPartition * LGE_EDGE_INTRA_MAX_EDGE_NUM_PER_4x4); 354 355 m_pucEdgeNumber = (UChar*)xMalloc(UChar, uiNumPartition); … … 411 412 #endif 412 413 if ( m_pePredMode ) { delete[] m_pePredMode; m_pePredMode = NULL; } 414 #if RWTH_SDC_DLT_B0036 415 if ( m_pbSDCFlag ) { xFree(m_pbSDCFlag); m_pbSDCFlag = NULL; } 416 if ( m_apSegmentDCOffset[0] ) { xFree(m_apSegmentDCOffset[0]); m_apSegmentDCOffset[0] = NULL; } 417 if ( m_apSegmentDCOffset[1] ) { xFree(m_apSegmentDCOffset[1]); m_apSegmentDCOffset[1] = NULL; } 418 #endif 413 419 if ( m_puhCbf[0] ) { xFree(m_puhCbf[0]); m_puhCbf[0] = NULL; } 414 420 if ( m_puhCbf[1] ) { xFree(m_puhCbf[1]); m_puhCbf[1] = NULL; } … … 417 423 if ( m_puhInterDir ) { xFree(m_puhInterDir); m_puhInterDir = NULL; } 418 424 if ( m_pbMergeFlag ) { xFree(m_pbMergeFlag); m_pbMergeFlag = NULL; } 425 #if LGE_ILLUCOMP_B0045 426 if ( m_pbICFlag ) { xFree(m_pbICFlag); m_pbICFlag = NULL; } 427 #endif 419 428 if ( m_puhMergeIndex ) { xFree(m_puhMergeIndex); m_puhMergeIndex = NULL; } 420 429 #if HHI_INTER_VIEW_RESIDUAL_PRED … … 430 439 if ( m_pcTrCoeffCr ) { xFree(m_pcTrCoeffCr); m_pcTrCoeffCr = NULL; } 431 440 #if ADAPTIVE_QP_SELECTION 432 #if FIX_MEM_LEAKS433 441 if (!m_ArlCoeffIsAliasedAllocation) 434 442 { … … 437 445 xFree(m_pcArlCoeffCr); m_pcArlCoeffCr = 0; 438 446 } 439 #endif440 447 if ( m_pcGlbArlCoeffY ) { xFree(m_pcGlbArlCoeffY); m_pcGlbArlCoeffY = NULL; } 441 448 if ( m_pcGlbArlCoeffCb ) { xFree(m_pcGlbArlCoeffCb); m_pcGlbArlCoeffCb = NULL; } … … 469 476 if ( m_piContourPredTexDeltaDC2 ) { xFree(m_piContourPredTexDeltaDC2); m_piContourPredTexDeltaDC2 = NULL; } 470 477 #endif 471 #if LGE_EDGE_INTRA 478 #if LGE_EDGE_INTRA_A0070 472 479 if ( m_pbEdgeLeftFirst ) { xFree(m_pbEdgeLeftFirst); m_pbEdgeLeftFirst = NULL; } 473 480 if ( m_pucEdgeStartPos ) { xFree(m_pucEdgeStartPos); m_pucEdgeStartPos = NULL; } … … 544 551 Void TComDataCU::initCU( TComPic* pcPic, UInt iCUAddr ) 545 552 { 546 #if OL_DEPTHLIMIT_A0044547 TComDataCU* pcCU = pcPic->getCU(iCUAddr);548 #endif549 550 553 m_pcPic = pcPic; 551 554 m_pcSlice = pcPic->getSlice(pcPic->getCurrSliceIdx()); … … 599 602 m_piTextureModeDepth[ui] = pcFrom->getTextureModeDepth(ui); 600 603 #endif 604 #if RWTH_SDC_DLT_B0036 605 m_pbSDCFlag[ui] = pcFrom->getSDCFlag(ui); 606 #endif 601 607 m_puhWidth [ui] = pcFrom->getWidth(ui); 602 608 m_puhHeight [ui] = pcFrom->getHeight(ui); … … 610 616 m_puiAlfCtrlFlag[ui]=pcFrom->m_puiAlfCtrlFlag[ui]; 611 617 m_pbMergeFlag[ui]=pcFrom->m_pbMergeFlag[ui]; 618 #if LGE_ILLUCOMP_B0045 619 m_pbICFlag[ui]=pcFrom->m_pbICFlag[ui]; 620 #endif 612 621 m_puhMergeIndex[ui]=pcFrom->m_puhMergeIndex[ui]; 613 622 m_puhLumaIntraDir[ui]=pcFrom->m_puhLumaIntraDir[ui]; … … 630 639 #if HHI_MPI 631 640 memset( m_piTextureModeDepth+ firstElement,-1, numElements * sizeof( *m_piTextureModeDepth ) ); 641 #endif 642 #if RWTH_SDC_DLT_B0036 643 memset( m_pbSDCFlag + firstElement, 0, numElements * sizeof( *m_pbSDCFlag ) ); 644 memset( m_apSegmentDCOffset[0] + firstElement, 0, numElements * sizeof( *m_apSegmentDCOffset[0] ) ); 645 memset( m_apSegmentDCOffset[1] + firstElement, 0, numElements * sizeof( *m_apSegmentDCOffset[1] ) ); 632 646 #endif 633 647 memset( m_puhTrIdx + firstElement, 0, numElements * sizeof( *m_puhTrIdx ) ); … … 642 656 memset( m_puiAlfCtrlFlag + firstElement, false, numElements * sizeof( *m_puiAlfCtrlFlag ) ); 643 657 memset( m_pbMergeFlag + firstElement, false, numElements * sizeof( *m_pbMergeFlag ) ); 658 #if LGE_ILLUCOMP_B0045 659 memset( m_pbICFlag + firstElement, false, numElements * sizeof( *m_pbICFlag ) ); 660 #endif 644 661 memset( m_puhMergeIndex + firstElement, 0, numElements * sizeof( *m_puhMergeIndex ) ); 645 662 memset( m_puhLumaIntraDir + firstElement, 2, numElements * sizeof( *m_puhLumaIntraDir ) ); … … 763 780 m_apcCUColocated[1] = getSlice()->getRefPic( REF_PIC_LIST_1, 0)->getCU( m_uiCUAddr ); 764 781 } 765 #if OL_DEPTHLIMIT_A0044766 setPartDumpFlag (pcCU->getPartDumpFlag());767 #endif768 782 } 769 783 … … 825 839 m_puiAlfCtrlFlag[ui]= false; 826 840 m_pbMergeFlag[ui] = 0; 841 #if LGE_ILLUCOMP_B0045 842 m_pbICFlag[ui] = false; 843 #endif 827 844 m_puhMergeIndex[ui] = 0; 828 845 #if HHI_INTER_VIEW_RESIDUAL_PRED … … 854 871 m_piContourPredTexDeltaDC2[ui] = 0; 855 872 #endif 873 #if RWTH_SDC_DLT_B0036 874 m_pbSDCFlag[ui] = false; 875 m_apSegmentDCOffset[0][ui] = 0; 876 m_apSegmentDCOffset[1][ui] = 0; 877 #endif 856 878 } 857 879 } … … 926 948 memset( m_puiAlfCtrlFlag, 0, iSizeInBool ); 927 949 memset( m_pbMergeFlag, 0, iSizeInBool ); 950 #if LGE_ILLUCOMP_B0045 951 memset( m_pbICFlag, 0, iSizeInBool ); 952 #endif 928 953 #if HHI_INTERVIEW_SKIP 929 954 memset( m_pbRenderable, 0, iSizeInBool ); … … 963 988 memset( m_piContourPredTexDeltaDC1, 0, sizeof( Int ) * m_uiNumPartition ); 964 989 memset( m_piContourPredTexDeltaDC2, 0, sizeof( Int ) * m_uiNumPartition ); 965 #endif 990 #endif 991 #if RWTH_SDC_DLT_B0036 992 memset( m_pbSDCFlag, 0, sizeof(Bool) * m_uiNumPartition ); 993 memset( m_apSegmentDCOffset[0], 0, sizeof(Pel) * m_uiNumPartition); 994 memset( m_apSegmentDCOffset[1], 0, sizeof(Pel) * m_uiNumPartition); 995 #endif 966 996 967 997 UChar uhWidth = g_uiMaxCUWidth >> uiDepth; … … 1001 1031 m_puiAlfCtrlFlag[ui]=pcCU->m_puiAlfCtrlFlag[uiPartOffset+ui]; 1002 1032 m_pbMergeFlag[ui]=pcCU->m_pbMergeFlag[uiPartOffset+ui]; 1033 #if LGE_ILLUCOMP_B0045 1034 m_pbICFlag[ui]=pcCU->m_pbICFlag[uiPartOffset+ui]; 1035 #endif 1003 1036 m_puhMergeIndex[ui]=pcCU->m_puhMergeIndex[uiPartOffset+ui]; 1004 1037 m_puhLumaIntraDir[ui]=pcCU->m_puhLumaIntraDir[uiPartOffset+ui]; … … 1030 1063 m_pbResPredAvailable[ui] = pcCU->m_pbResPredAvailable[ uiPartOffset + ui ]; 1031 1064 m_pbResPredFlag [ui] = pcCU->m_pbResPredFlag [ uiPartOffset + ui ]; 1065 #endif 1066 #if RWTH_SDC_DLT_B0036 1067 m_pbSDCFlag [ui] = pcCU->m_pbSDCFlag [ uiPartOffset + ui ]; 1068 m_apSegmentDCOffset[0][ui] = pcCU->m_apSegmentDCOffset[0][ uiPartOffset + ui ]; 1069 m_apSegmentDCOffset[1][ui] = pcCU->m_apSegmentDCOffset[1][ uiPartOffset + ui ]; 1032 1070 #endif 1033 1071 } … … 1095 1133 memcpy(m_uiSliceStartCU,pcCU->m_uiSliceStartCU+uiPartOffset,sizeof(UInt)*m_uiNumPartition); 1096 1134 memcpy(m_uiEntropySliceStartCU,pcCU->m_uiEntropySliceStartCU+uiPartOffset,sizeof(UInt)*m_uiNumPartition); 1097 #if OL_DEPTHLIMIT_A00441098 setPartDumpFlag (pcCU->getPartDumpFlag());1099 #endif1100 1135 } 1101 1136 … … 1140 1175 1141 1176 m_pbMergeFlag = pcCU->getMergeFlag() + uiPart; 1177 #if LGE_ILLUCOMP_B0045 1178 m_pbICFlag = pcCU->getICFlag() + uiPart; 1179 #endif 1142 1180 m_puhMergeIndex = pcCU->getMergeIndex() + uiPart; 1143 1181 #if HHI_INTER_VIEW_RESIDUAL_PRED … … 1223 1261 m_piContourPredTexDeltaDC2 = pcCU->getContourPredTexDeltaDC2() + uiPart; 1224 1262 #endif 1225 #if LGE_EDGE_INTRA 1263 #if LGE_EDGE_INTRA_A0070 1226 1264 if( pcCU->getSlice()->getSPS()->isDepth() ) 1227 1265 { … … 1237 1275 } 1238 1276 #endif 1277 #if RWTH_SDC_DLT_B0036 1278 m_pbSDCFlag = pcCU->getSDCFlag() + uiPart; 1279 m_apSegmentDCOffset[0] = pcCU->getSDCSegmentDCOffset(0) + uiPart; 1280 m_apSegmentDCOffset[1] = pcCU->getSDCSegmentDCOffset(1) + uiPart; 1281 #endif 1239 1282 } 1240 1283 … … 1272 1315 1273 1316 m_pbMergeFlag = pcCU->getMergeFlag() + uiAbsPartIdx; 1317 #if LGE_ILLUCOMP_B0045 1318 m_pbICFlag = pcCU->getICFlag() + uiAbsPartIdx; 1319 #endif 1274 1320 m_puhMergeIndex = pcCU->getMergeIndex() + uiAbsPartIdx; 1275 1321 #if HHI_INTER_VIEW_RESIDUAL_PRED … … 1318 1364 memcpy( m_puiAlfCtrlFlag + uiOffset, pcCU->getAlfCtrlFlag(), iSizeInBool ); 1319 1365 memcpy( m_pbMergeFlag + uiOffset, pcCU->getMergeFlag(), iSizeInBool ); 1366 #if LGE_ILLUCOMP_B0045 1367 memcpy( m_pbICFlag + uiOffset, pcCU->getICFlag(), iSizeInBool ); 1368 #endif 1320 1369 memcpy( m_puhMergeIndex + uiOffset, pcCU->getMergeIndex(), iSizeInUchar ); 1321 1370 #if HHI_INTER_VIEW_RESIDUAL_PRED … … 1395 1444 #endif 1396 1445 1397 #if LGE_EDGE_INTRA 1446 #if LGE_EDGE_INTRA_A0070 1398 1447 if( getSlice()->getSPS()->isDepth() ) 1399 1448 { … … 1413 1462 memcpy( m_piTextureModeDepth + uiOffset, pcCU->getTextureModeDepth(), sizeof( Int ) * uiNumPartition ); 1414 1463 #endif 1464 #if RWTH_SDC_DLT_B0036 1465 memcpy( m_pbSDCFlag + uiOffset, pcCU->getSDCFlag(), iSizeInBool ); 1466 memcpy( m_apSegmentDCOffset[0] + uiOffset, pcCU->getSDCSegmentDCOffset(0), sizeof( Pel ) * uiNumPartition); 1467 memcpy( m_apSegmentDCOffset[1] + uiOffset, pcCU->getSDCSegmentDCOffset(1), sizeof( Pel ) * uiNumPartition); 1468 #endif 1415 1469 } 1416 1470 … … 1444 1498 1445 1499 memcpy( rpcCU->getMergeFlag() + m_uiAbsIdxInLCU, m_pbMergeFlag, iSizeInBool ); 1500 #if LGE_ILLUCOMP_B0045 1501 memcpy( rpcCU->getICFlag() + m_uiAbsIdxInLCU, m_pbICFlag, iSizeInBool ); 1502 #endif 1446 1503 memcpy( rpcCU->getMergeIndex() + m_uiAbsIdxInLCU, m_puhMergeIndex, iSizeInUchar ); 1447 1504 #if HHI_INTER_VIEW_RESIDUAL_PRED … … 1513 1570 #endif 1514 1571 1515 #if LGE_EDGE_INTRA 1572 #if LGE_EDGE_INTRA_A0070 1516 1573 if( rpcCU->getSlice()->getSPS()->isDepth() ) 1517 1574 { … … 1531 1588 memcpy( rpcCU->getTextureModeDepth() + m_uiAbsIdxInLCU, m_piTextureModeDepth, sizeof( Int ) * m_uiNumPartition ); 1532 1589 #endif 1590 #if RWTH_SDC_DLT_B0036 1591 memcpy( rpcCU->getSDCFlag() + m_uiAbsIdxInLCU, m_pbSDCFlag, iSizeInBool ); 1592 memcpy( rpcCU->getSDCSegmentDCOffset(0) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[0], sizeof( Pel ) * m_uiNumPartition); 1593 memcpy( rpcCU->getSDCSegmentDCOffset(1) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[1], sizeof( Pel ) * m_uiNumPartition); 1594 #endif 1533 1595 } 1534 1596 … … 1562 1624 memcpy( rpcCU->getAlfCtrlFlag() + uiPartOffset, m_puiAlfCtrlFlag, iSizeInBool ); 1563 1625 memcpy( rpcCU->getMergeFlag() + uiPartOffset, m_pbMergeFlag, iSizeInBool ); 1626 #if LGE_ILLUCOMP_B0045 1627 memcpy( rpcCU->getICFlag() + uiPartOffset, m_pbICFlag, iSizeInBool ); 1628 #endif 1564 1629 memcpy( rpcCU->getMergeIndex() + uiPartOffset, m_puhMergeIndex, iSizeInUchar ); 1565 1630 #if HHI_INTER_VIEW_RESIDUAL_PRED … … 1632 1697 #endif 1633 1698 1634 #if LGE_EDGE_INTRA 1699 #if LGE_EDGE_INTRA_A0070 1635 1700 if( rpcCU->getSlice()->getSPS()->isDepth() ) 1636 1701 { … … 1649 1714 #if HHI_MPI 1650 1715 memcpy( rpcCU->getTextureModeDepth() + uiPartOffset, m_piTextureModeDepth, sizeof( Int ) * uiQNumPart ); 1716 #endif 1717 #if RWTH_SDC_DLT_B0036 1718 memcpy( rpcCU->getSDCFlag() + uiPartOffset, m_pbSDCFlag, iSizeInBool ); 1719 memcpy( rpcCU->getSDCSegmentDCOffset(0) + uiPartOffset, m_apSegmentDCOffset[0], sizeof( Pel ) * uiQNumPart); 1720 memcpy( rpcCU->getSDCSegmentDCOffset(1) + uiPartOffset, m_apSegmentDCOffset[1], sizeof( Pel ) * uiQNumPart); 1651 1721 #endif 1652 1722 } … … 2383 2453 #if H0204_QP_PREDICTION 2384 2454 UInt lPartIdx, aPartIdx; 2385 #if FIX_COMP_WARNING_INIT2386 2455 lPartIdx = 0; 2387 2456 aPartIdx = 0; 2388 #endif2389 2457 TComDataCU* cULeft = getQpMinCuLeft ( lPartIdx, m_uiAbsIdxInLCU + uiCurrAbsIdxInLCU ); 2390 2458 TComDataCU* cUAbove = getQpMinCuAbove( aPartIdx, m_uiAbsIdxInLCU + uiCurrAbsIdxInLCU ); … … 2528 2596 mapDMMtoIntraMode( iLeftIntraDir ); 2529 2597 #endif 2530 #if LGE_EDGE_INTRA 2598 #if LGE_EDGE_INTRA_A0070 2531 2599 mapEdgeIntratoDC( iLeftIntraDir ); 2532 2600 #endif … … 2543 2611 mapDMMtoIntraMode( iAboveIntraDir ); 2544 2612 #endif 2545 #if LGE_EDGE_INTRA 2613 #if LGE_EDGE_INTRA_A0070 2546 2614 mapEdgeIntratoDC( iAboveIntraDir ); 2547 2615 #endif … … 2629 2697 } 2630 2698 2631 #if LGE_EDGE_INTRA 2699 #if LGE_EDGE_INTRA_A0070 2632 2700 UInt TComDataCU::getCtxEdgeIntra( UInt uiAbsPartIdx ) 2633 2701 { … … 2740 2808 return uiCtx; 2741 2809 } 2810 2811 #if LGE_ILLUCOMP_B0045 2812 UInt TComDataCU::getCtxICFlag( UInt uiAbsPartIdx ) 2813 { 2814 UInt uiCtx = 0; 2815 2816 return uiCtx; 2817 } 2818 #endif 2742 2819 2743 2820 UInt TComDataCU::getCtxInterDir( UInt uiAbsPartIdx ) … … 2970 3047 } 2971 3048 3049 #if RWTH_SDC_DLT_B0036 3050 Void TComDataCU::setSDCFlagSubParts ( Bool bSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 3051 { 3052 setSubPart( bSDCFlag, m_pbSDCFlag, uiAbsPartIdx, uiDepth, uiPartIdx ); 3053 } 3054 3055 UInt TComDataCU::getCtxSDCFlag( UInt uiAbsPartIdx ) 3056 { 3057 TComDataCU* pcTempCU; 3058 UInt uiTempPartIdx; 3059 UInt uiCtx = 0; 3060 3061 // left PU 3062 pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx, true, false ); 3063 uiCtx = ( pcTempCU ) ? pcTempCU->getSDCFlag( uiTempPartIdx ) : 0; 3064 3065 // above PU 3066 pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx, true, false ); 3067 uiCtx += ( pcTempCU ) ? pcTempCU->getSDCFlag( uiTempPartIdx ) : 0; 3068 3069 return uiCtx; 3070 } 3071 3072 Bool TComDataCU::getSDCAvailable( UInt uiAbsPartIdx ) 3073 { 3074 if( !getSlice()->getSPS()->isDepth() || getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N ) 3075 return false; 3076 3077 UInt uiLumaPredMode = getLumaIntraDir( uiAbsPartIdx ); 3078 3079 if(!isIntra(uiAbsPartIdx)) 3080 return false; 3081 3082 for(UInt ui=0; ui<RWTH_SDC_NUM_PRED_MODES; ui++) 3083 { 3084 if( g_auiSDCPredModes[ui] == uiLumaPredMode ) 3085 return true; 3086 } 3087 // else 3088 return false; 3089 } 3090 #endif 3091 2972 3092 Void TComDataCU::setMergeIndexSubParts ( UInt uiMergeIndex, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 2973 3093 { … … 2998 3118 setSubPart<UChar>( uiDir, m_puhInterDir, uiAbsPartIdx, uiDepth, uiPartIdx ); 2999 3119 } 3120 3121 #if LGE_ILLUCOMP_B0045 3122 Void TComDataCU::setICFlagSubParts( Bool bICFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 3123 { 3124 memset( m_pbICFlag + uiAbsPartIdx, bICFlag, (m_pcPic->getNumPartInCU() >> ( 2 * uiDepth ))*sizeof(Bool) ); 3125 } 3126 3127 Bool TComDataCU::isICFlagRequired(UInt uiAbsPartIdx) 3128 { 3129 UInt uiPartAddr; 3130 UInt iNumbPart; 3131 Int iWidth, iHeight; 3132 3133 UInt uiPartMode = getPartitionSize(uiAbsPartIdx); 3134 3135 iNumbPart = (uiPartMode == SIZE_2Nx2N ? 1 : (uiPartMode == SIZE_NxN ? 4 : 2) ); 3136 3137 for(UInt i = 0; i < iNumbPart; i++) 3138 { 3139 getPartIndexAndSize(i, uiPartAddr, iWidth, iHeight, uiAbsPartIdx, true); 3140 uiPartAddr += uiAbsPartIdx; 3141 3142 for(UInt uiRefIdx = 0; uiRefIdx < 2; uiRefIdx++) 3143 { 3144 RefPicList eRefList = uiRefIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 3145 Int iBestRefIdx = getCUMvField(eRefList)->getRefIdx(uiPartAddr); 3146 3147 #if VSP_AIC 3148 if((getInterDir(uiPartAddr) & (uiRefIdx+1)) && iBestRefIdx >= 0 && getSlice()->getPOC() == getSlice()->getRefPOC(eRefList, iBestRefIdx)) 3149 #else 3150 if((getInterDir(uiPartAddr) & (uiRefIdx+1)) && iBestRefIdx >= 0 && getSlice()->getViewId() != getSlice()->getRefViewId(eRefList, iBestRefIdx)) 3151 #endif 3152 { 3153 return true; 3154 } 3155 } 3156 } 3157 return false; 3158 } 3159 #endif 3000 3160 3001 3161 Void TComDataCU::setMVPIdxSubParts( Int iMVPIdx, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) … … 3570 3730 3571 3731 //===== add merge with predicted depth maps ===== 3732 #if QC_MRG_CANS_B0048 3733 TComMv acPdmMv [4]; 3734 Int aiPdmRefIdx [4] = {-1, -1, -1, -1}; 3735 Bool bLeftAvai = false; 3736 #if OL_DISMV_POS_B0069 3737 Int iPosLeftAbove[2] = {-1, -1}; 3738 #endif 3739 #else 3572 3740 TComMv acPdmMv [2]; 3573 3741 Int aiPdmRefIdx [2] = {-1, -1}; 3574 3575 #if LGE_DVMCP 3742 #endif 3743 3744 #if LGE_DVMCP_A0126 3745 #if QC_MRG_CANS_B0048 3746 acPdmMv[0].m_bDvMcp = acPdmMv[1].m_bDvMcp = acPdmMv[2].m_bDvMcp = acPdmMv[3].m_bDvMcp = false; 3747 #else 3576 3748 acPdmMv[0].m_bDvMcp = acPdmMv[1].m_bDvMcp = false; 3577 3749 #endif 3578 3579 #if QC_MULTI_DIS_CAN 3750 #endif 3751 3752 #if QC_MULTI_DIS_CAN_A0097 3580 3753 DisInfo cDisInfo; 3581 3754 cDisInfo.iN = 0; 3582 3755 if(!bNoPdmMerge) 3583 3756 { 3584 #if LGE_DVMCP 3585 getDisMvpCand2(uiPUIdx, uiAbsPartIdx, &cDisInfo, true ); 3757 #if LGE_DVMCP_A0126 3758 #if LGE_IVMP_PARALLEL_MERGE_B0136 && !QC_SIMPLE_NBDV_B0047 3759 getDisMvpCand2(uiPUIdx, uiAbsPartIdx, &cDisInfo, true, REF_PIC_LIST_X, -1, true ); 3760 #else 3761 getDisMvpCand2(uiPUIdx, uiAbsPartIdx, &cDisInfo 3762 #if LGE_IVMP_PARALLEL_MERGE_B0136==QC_SIMPLE_NBDV_B0047 3763 , 3764 true 3765 #endif 3766 ); 3767 #endif 3586 3768 #else 3587 3769 getDisMvpCand (uiPUIdx, uiAbsPartIdx, &cDisInfo ); … … 3595 3777 cDisInfo.m_aVIdxCan[0] = 0; 3596 3778 } 3597 Int iPdmInterDir = cDisInfo.iN==0? 0:getPdmMergeCandidateDisCan ( uiPUIdx, aiPdmRefIdx, acPdmMv, &cDisInfo ); 3779 #if QC_MRG_CANS_B0048 3780 Int iPdmDir[2] = {0, 0}; 3781 #endif 3782 Int iPdmInterDir = cDisInfo.iN==0? 0:getPdmMergeCandidateDisCan ( uiPUIdx, aiPdmRefIdx, acPdmMv, &cDisInfo 3783 #if QC_MRG_CANS_B0048 3784 , iPdmDir 3785 #endif 3786 ); 3598 3787 #else 3599 3788 Int iPdmInterDir = getPdmMergeCandidate( uiPUIdx, aiPdmRefIdx, acPdmMv ); 3600 3789 #endif 3601 3790 #if QC_MRG_CANS_B0048 3791 if( iPdmDir[0] && !bNoPdmMerge && PDM_MERGE_POS == 0 ) 3792 #else 3602 3793 if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 0 ) 3794 #endif 3603 3795 { 3604 3796 abCandIsInter [ iCount ] = true; 3797 #if QC_MRG_CANS_B0048 3798 puhInterDirNeighbours[ iCount ] = iPdmDir[0]; 3799 iPdmInterDir = iPdmDir[0]; 3800 #else 3605 3801 puhInterDirNeighbours[ iCount ] = iPdmInterDir; 3802 #endif 3606 3803 if( ( iPdmInterDir & 1 ) == 1 ) 3607 3804 { 3608 3805 pcMvFieldNeighbours[ iCount<<1 ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] ); 3609 3806 } 3807 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 3808 else 3809 { 3810 pcMvFieldNeighbours[ iCount<<1 ].setMvField( TComMv(0,0), NOT_VALID ); 3811 } 3812 #endif 3610 3813 if( ( iPdmInterDir & 2 ) == 2 ) 3611 3814 { 3612 3815 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] ); 3613 3816 } 3817 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 3818 else 3819 { 3820 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID ); 3821 } 3822 #endif 3614 3823 #if SIMP_MRG_PRUN 3615 3824 if ( mrgCandIdx == iCount ) … … 3619 3828 #endif 3620 3829 iCount ++; 3830 } 3831 #endif 3832 3833 #if QC_MRG_CANS_B0048 3834 if(extraMergeCand) 3835 { 3836 if(!bNoPdmMerge && iPdmDir[1] && DMV_MERGE_POS == 1) 3837 { 3838 assert(iCount < MRG_MAX_NUM_CANDS_MEM); 3839 abCandIsInter [ iCount ] = true; 3840 puhInterDirNeighbours[ iCount ] = iPdmDir[1]; 3841 if( ( iPdmDir[1] & 1 ) == 1 ) 3842 { 3843 pcMvFieldNeighbours[ iCount<<1 ].setMvField( acPdmMv[ 2 ], aiPdmRefIdx[ 2 ] ); 3844 } 3845 if( ( iPdmDir[1] & 2 ) == 2 ) 3846 { 3847 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 3 ], aiPdmRefIdx[ 3 ] ); 3848 } 3849 #if LGE_DVMCP_A0126 3850 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 3851 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 3852 #endif 3853 #if SIMP_MRG_PRUN 3854 if ( mrgCandIdx == iCount ) 3855 return; 3856 #endif 3857 iCount ++; 3858 } 3621 3859 } 3622 3860 #endif … … 3663 3901 pcCULeft->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3664 3902 } 3665 #if LGE_DVMCP 3903 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 3904 else 3905 { 3906 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID ); 3907 } 3908 #endif 3909 #if QC_MRG_CANS_B0048 3910 Bool bRemoveSpa = false; //prunign to inter-view candidates 3911 Int iCnloop = iCount - 1; 3912 for(; iCnloop >= 0; iCnloop --) 3913 { 3914 if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1]) 3915 { 3916 bRemoveSpa = true; 3917 abCandIsInter [ iCount ] = false; 3918 #if FIX_MISUSE_REFINDEX 3919 //reset to the default value for IC, MC 3920 puhInterDirNeighbours[iCount] = 0; 3921 TComMv cZeroMv; 3922 pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID ); 3923 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID ); 3924 break; 3925 #endif 3926 } 3927 } 3928 if(!bRemoveSpa) 3929 { 3930 bLeftAvai = true; 3931 #if OL_DISMV_POS_B0069 3932 iPosLeftAbove[0] = iCount; 3933 #endif 3934 #endif 3935 #if LGE_DVMCP_A0126 3666 3936 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 3667 3937 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; … … 3677 3947 #endif 3678 3948 iCount ++; 3949 #if QC_MRG_CANS_B0048 3950 } 3951 #endif 3679 3952 } 3680 3953 } 3681 3954 3682 3955 #if HHI_INTER_VIEW_MOTION_PRED 3956 #if QC_MRG_CANS_B0048 3957 if( iPdmDir[0] && !bNoPdmMerge && PDM_MERGE_POS == 1 ) 3958 #else 3683 3959 if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 1 ) 3960 #endif 3684 3961 { 3685 3962 abCandIsInter [ iCount ] = true; … … 3689 3966 pcMvFieldNeighbours[ iCount<<1 ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] ); 3690 3967 } 3968 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 3969 else 3970 { 3971 pcMvFieldNeighbours[ iCount<<1 ].setMvField( TComMv(0,0), NOT_VALID ); 3972 } 3973 #endif 3691 3974 if( ( iPdmInterDir & 2 ) == 2 ) 3692 3975 { 3693 3976 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] ); 3694 3977 } 3978 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 3979 else 3980 { 3981 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID ); 3982 } 3983 #endif 3695 3984 #if SIMP_MRG_PRUN 3696 3985 if ( mrgCandIdx == iCount ) … … 3751 4040 pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3752 4041 } 3753 #if LGE_DVMCP 4042 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 4043 else 4044 { 4045 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID ); 4046 } 4047 #endif 4048 #if QC_MRG_CANS_B0048 4049 Bool bRemoveSpa = false; //prunign to inter-view candidates 4050 Int iCnloop = bLeftAvai? (iCount-2): (iCount-1); 4051 for(; iCnloop >= 0; iCnloop --) 4052 { 4053 if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1]) 4054 { 4055 bRemoveSpa = true; 4056 abCandIsInter [ iCount ] = false; 4057 #if FIX_MISUSE_REFINDEX 4058 //reset to the default value for IC, MC 4059 puhInterDirNeighbours[iCount] = 0; 4060 TComMv cZeroMv; 4061 pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID ); 4062 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID ); 4063 break; 4064 #endif 4065 } 4066 } 4067 if(!bRemoveSpa) 4068 { 4069 #if OL_DISMV_POS_B0069 4070 iPosLeftAbove[1] = iCount; 4071 #endif 4072 #endif 4073 #if LGE_DVMCP_A0126 3754 4074 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 3755 4075 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; … … 3765 4085 #endif 3766 4086 iCount ++; 4087 #if QC_MRG_CANS_B0048 4088 } 4089 #endif 3767 4090 } 3768 4091 #if !SIMP_MRG_PRUN … … 3771 4094 3772 4095 #if HHI_INTER_VIEW_MOTION_PRED 4096 #if QC_MRG_CANS_B0048 4097 if( iPdmDir[0] && !bNoPdmMerge && PDM_MERGE_POS == 2 ) 4098 #else 3773 4099 if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 2 ) 4100 #endif 3774 4101 { 3775 4102 abCandIsInter [ iCount ] = true; … … 3779 4106 pcMvFieldNeighbours[ iCount<<1 ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] ); 3780 4107 } 4108 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 4109 else 4110 { 4111 pcMvFieldNeighbours[ iCount<<1 ].setMvField( TComMv(0,0), NOT_VALID ); 4112 } 4113 #endif 3781 4114 if( ( iPdmInterDir & 2 ) == 2 ) 3782 4115 { 3783 4116 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] ); 3784 4117 } 4118 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 4119 else 4120 { 4121 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID ); 4122 } 4123 #endif 3785 4124 #if SIMP_MRG_PRUN 3786 4125 if ( mrgCandIdx == iCount ) … … 3835 4174 pcCUAboveRight->getMvField( pcCUAboveRight, uiAboveRightPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3836 4175 } 3837 #if LGE_DVMCP 4176 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 4177 else 4178 { 4179 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID ); 4180 } 4181 #endif 4182 #if LGE_DVMCP_A0126 3838 4183 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 3839 4184 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; … … 3852 4197 3853 4198 #if HHI_INTER_VIEW_MOTION_PRED 4199 #if QC_MRG_CANS_B0048 4200 if( iPdmDir[0] && !bNoPdmMerge && PDM_MERGE_POS == 3 ) 4201 #else 3854 4202 if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 3 ) 4203 #endif 3855 4204 { 3856 4205 abCandIsInter [ iCount ] = true; … … 3860 4209 pcMvFieldNeighbours[ iCount<<1 ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] ); 3861 4210 } 4211 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 4212 else 4213 { 4214 pcMvFieldNeighbours[ iCount<<1 ].setMvField( TComMv(0,0), NOT_VALID ); 4215 } 4216 #endif 3862 4217 if( ( iPdmInterDir & 2 ) == 2 ) 3863 4218 { 3864 4219 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] ); 3865 4220 } 4221 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 4222 else 4223 { 4224 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID ); 4225 } 4226 #endif 3866 4227 #if SIMP_MRG_PRUN 3867 4228 if ( mrgCandIdx == iCount ) … … 3871 4232 #endif 3872 4233 iCount ++; 4234 } 4235 #endif 4236 4237 #if OL_DISMV_POS_B0069 4238 if(extraMergeCand) 4239 { 4240 if(!bNoPdmMerge && iPdmDir[1] && DMV_MERGE_POS == 4) 4241 { 4242 assert(iCount < MRG_MAX_NUM_CANDS_MEM); 4243 Bool bRemoveSpa = false; //prunign to A1, B1 4244 abCandIsInter [ iCount ] = true; 4245 puhInterDirNeighbours[ iCount ] = iPdmDir[1]; 4246 if( ( iPdmDir[1] & 1 ) == 1 ) 4247 { 4248 pcMvFieldNeighbours[ iCount<<1 ].setMvField( acPdmMv[ 2 ], aiPdmRefIdx[ 2 ] ); 4249 } 4250 if( ( iPdmDir[1] & 2 ) == 2 ) 4251 { 4252 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 3 ], aiPdmRefIdx[ 3 ] ); 4253 } 4254 for(Int i = 0; i < 2; i ++) 4255 { 4256 Int iCnloop = iPosLeftAbove[i]; 4257 if(iCnloop == -1) 4258 continue; 4259 if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1]) 4260 { 4261 bRemoveSpa = true; 4262 abCandIsInter [ iCount ] = false; 4263 #if FIX_MISUSE_REFINDEX 4264 //reset to the default value for IC, MC 4265 puhInterDirNeighbours[iCount] = 0; 4266 TComMv cZeroMv; 4267 pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID ); 4268 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID ); 4269 break; 4270 #endif 4271 } 4272 } 4273 if(!bRemoveSpa) 4274 { 4275 #if LGE_DVMCP_A0126 4276 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 4277 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 4278 #endif 4279 #if SIMP_MRG_PRUN 4280 if ( mrgCandIdx == iCount ) 4281 return; 4282 #endif 4283 iCount ++; 4284 } 4285 } 3873 4286 } 3874 4287 #endif … … 3924 4337 pcCULeftBottom->getMvField( pcCULeftBottom, uiLeftBottomPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3925 4338 } 3926 #if LGE_DVMCP 4339 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 4340 else 4341 { 4342 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID ); 4343 } 4344 #endif 4345 #if LGE_DVMCP_A0126 3927 4346 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 3928 4347 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; … … 3944 4363 3945 4364 #if HHI_INTER_VIEW_MOTION_PRED 4365 #if QC_MRG_CANS_B0048 4366 if( iPdmDir[0] && !bNoPdmMerge && PDM_MERGE_POS == 4 ) 4367 #else 3946 4368 if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 4 ) 4369 #endif 3947 4370 { 3948 4371 abCandIsInter [ iCount ] = true; … … 3952 4375 pcMvFieldNeighbours[ iCount<<1 ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] ); 3953 4376 } 4377 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 4378 else 4379 { 4380 pcMvFieldNeighbours[ iCount<<1 ].setMvField( TComMv(0,0), NOT_VALID ); 4381 } 4382 #endif 3954 4383 if( ( iPdmInterDir & 2 ) == 2 ) 3955 4384 { 3956 4385 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] ); 3957 4386 } 4387 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 4388 else 4389 { 4390 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID ); 4391 } 4392 #endif 3958 4393 #if SIMP_MRG_PRUN 3959 4394 if ( mrgCandIdx == iCount ) … … 4019 4454 pcCUAboveLeft->getMvField( pcCUAboveLeft, uiAboveLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 4020 4455 } 4021 #if LGE_DVMCP 4456 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 4457 else 4458 { 4459 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID ); 4460 } 4461 #endif 4462 #if LGE_DVMCP_A0126 4022 4463 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 4023 4464 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; … … 4049 4490 #endif 4050 4491 4051 if ( getSlice()->getPPS()->getEnableTMVPFlag() ) 4492 if ( getSlice()->getPPS()->getEnableTMVPFlag() 4493 #if QC_MRG_CANS_B0048 4494 && iCount < (MRG_MAX_NUM_CANDS_SIGNALED + extraMergeCand) 4495 #endif 4496 ) 4052 4497 { 4053 4498 // col [2] 4499 #if !QC_TMVP_IDX_MOD_B0046 4054 4500 Int iRefIdxSkip[2] = {-1, -1}; 4055 4501 for (Int i=0; i<2; i++) … … 4071 4517 iRefIdxSkip[i] = (iRefIdxTmp != -1) ? iRefIdxTmp : 0; 4072 4518 } 4519 #endif 4073 4520 //>> MTK colocated-RightBottom 4074 4521 UInt uiPartIdxRB; … … 4082 4529 4083 4530 TComMv cColMv; 4531 #if QC_TMVP_IDX_MOD_B0046 4532 Int iRefIdx = 0; 4533 #else 4084 4534 Int iRefIdx; 4085 4535 #endif 4086 4536 if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) // image boundary check 4087 4537 { … … 4116 4566 } 4117 4567 } 4568 #if !QC_TMVP_IDX_MOD_B0046 4118 4569 iRefIdx = iRefIdxSkip[0]; 4119 4570 #else 4571 iRefIdx = 0; 4572 #endif 4120 4573 Bool bExistMV = false; 4121 4574 UInt uiPartIdxCenter; … … 4135 4588 if ( getSlice()->isInterB() ) 4136 4589 { 4590 #if !QC_TMVP_IDX_MOD_B0046 4137 4591 iRefIdx = iRefIdxSkip[1]; 4592 #else 4593 iRefIdx = 0; 4594 #endif 4138 4595 bExistMV = uiLCUIdx >= 0 && xGetColMVP( REF_PIC_LIST_1, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx); 4139 4596 if( bExistMV == false ) … … 4149 4606 { 4150 4607 puhInterDirNeighbours[uiArrayAddr] = 1; 4608 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 4609 pcMvFieldNeighbours[ ( uiArrayAddr << 1 ) + 1 ].setMvField( TComMv(0,0), NOT_VALID ); 4610 #endif 4151 4611 } 4152 4612 } … … 4154 4614 { 4155 4615 puhInterDirNeighbours[uiArrayAddr] = 1; 4156 } 4157 #if LGE_DVMCP 4616 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 4617 pcMvFieldNeighbours[ ( uiArrayAddr << 1 ) + 1 ].setMvField( TComMv(0,0), NOT_VALID ); 4618 #endif 4619 } 4620 #if LGE_DVMCP_A0126 4158 4621 pcMvFieldNeighbours[uiArrayAddr<<1 ].getMv().m_bDvMcp = false; 4159 4622 pcMvFieldNeighbours[(uiArrayAddr<<1)+1].getMv().m_bDvMcp = false; … … 4391 4854 pcMvFieldNeighbours[(uiArrayAddr << 1) + 1].setMvField(TComMv(0, 0), r); 4392 4855 } 4856 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 4857 else 4858 { 4859 pcMvFieldNeighbours[ ( uiArrayAddr << 1 ) + 1 ].setMvField( TComMv(0,0), NOT_VALID ); 4860 } 4861 #endif 4393 4862 uiArrayAddr++; 4394 4863 } … … 4636 5105 return m_pcSlice->getSPS()->getAMVPMode(m_puhDepth[uiIdx]); 4637 5106 } 4638 #if QC_MULTI_DIS_CAN 5107 #if QC_MULTI_DIS_CAN_A0097 4639 5108 /** construct a list of disparity motion vectors from the neighbouring PUs **/ 4640 5109 Void TComDataCU::getDisMvpCand ( UInt uiPartIdx, UInt uiPartAddr,DisInfo* pDInfo ) … … 4667 5136 { 4668 5137 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 4669 #if VSP_N & VSP_BUGFIX4670 Int refPOC = pcTmpCU->getSlice()->getRefPOC( eRefPicList, refId);4671 //if( !pcTmpCU->isVspRef( eRefPicList, refId ) )4672 if ( refViewIdx!= m_pcSlice->getViewId() || refPOC != m_pcSlice->getPOC())4673 #else4674 5138 if (refViewIdx!= m_pcSlice->getViewId()) 4675 #endif4676 5139 { 4677 5140 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); … … 4699 5162 { 4700 5163 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 4701 #if VSP_N & VSP_BUGFIX4702 Int refPOC = pcTmpCU->getSlice()->getRefPOC( eRefPicList, refId);4703 //if( !pcTmpCU->isVspRef( eRefPicList, refId ) )4704 if ( refViewIdx!= m_pcSlice->getViewId() || refPOC != m_pcSlice->getPOC())4705 #else4706 5164 if (refViewIdx!= m_pcSlice->getViewId()) 4707 #endif4708 5165 { 4709 5166 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); … … 4731 5188 { 4732 5189 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 4733 #if VSP_N & VSP_BUGFIX4734 Int refPOC = pcTmpCU->getSlice()->getRefPOC( eRefPicList, refId);4735 //if( !pcTmpCU->isVspRef( eRefPicList, refId ) )4736 if ( refViewIdx!= m_pcSlice->getViewId() || refPOC != m_pcSlice->getPOC())4737 #else4738 5190 if (refViewIdx!= m_pcSlice->getViewId()) 4739 #endif4740 5191 { 4741 5192 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); … … 4762 5213 { 4763 5214 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 4764 #if VSP_N & VSP_BUGFIX4765 Int refPOC = pcTmpCU->getSlice()->getRefPOC( eRefPicList, refId);4766 //if( !pcTmpCU->isVspRef( eRefPicList, refId ) )4767 if ( refViewIdx!= m_pcSlice->getViewId() || refPOC != m_pcSlice->getPOC())4768 #else4769 5215 if (refViewIdx!= m_pcSlice->getViewId()) 4770 #endif4771 5216 { 4772 5217 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); … … 4796 5241 { 4797 5242 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 4798 #if VSP_N & VSP_BUGFIX4799 Int refPOC = pcTmpCU->getSlice()->getRefPOC( eRefPicList, refId);4800 //if( !pcTmpCU->isVspRef( eRefPicList, refId ) )4801 if ( refViewIdx!= m_pcSlice->getViewId() || refPOC != m_pcSlice->getPOC())4802 #else4803 5243 if (refViewIdx!= m_pcSlice->getViewId()) 4804 #endif4805 5244 { 4806 5245 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); … … 4992 5431 } 4993 5432 4994 #if LGE_DVMCP 4995 Void TComDataCU::getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr,DisInfo* pDInfo, Bool bMerge, RefPicList eRefPicList0, Int iRefIdx0 ) 5433 #if LGE_DVMCP_A0126 5434 #if QC_SIMPLE_NBDV_B0047 5435 Void TComDataCU::getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr,DisInfo* pDInfo 5436 #if LGE_IVMP_PARALLEL_MERGE_B0136 5437 , Bool bParMerge 5438 #endif 5439 #else 5440 Void TComDataCU::getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr,DisInfo* pDInfo, Bool bMerge, RefPicList eRefPicList0, Int iRefIdx0 5441 #if LGE_IVMP_PARALLEL_MERGE_B0136 5442 , Bool bParMerge 5443 #endif 5444 #endif 5445 ) 4996 5446 { 4997 5447 PartSize eCUMode = getPartitionSize( uiPartAddr ); 4998 5448 TComDataCU* pcTmpCU = NULL; 5449 #if !QC_SIMPLE_NBDV_B0047 4999 5450 TComDataCU* pcCULeft = NULL; 5451 #endif 5000 5452 pDInfo->iN = 0; 5001 5453 … … 5005 5457 UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth(); 5006 5458 5007 Int aiDvMcpDvCand[2][7] = {{0,}, {0,}}; // dummy, 5 spatial + 1 temporal, DV-MCP ÁÖº¯ ºúÓ°¿¡¼ »ç¿EÈ DV¸¦ ÀúÀE 5459 #if QC_SIMPLE_NBDV_B0047 5460 const Int iNumofDvMCP = 7; 5461 Int aiDvMcpDvCand[2][iNumofDvMCP] = {{0,}, {0,}}; // dummy, 5 spatial + 1 temporal 5462 Bool abDvMcpFlag [2][iNumofDvMCP] = {{false,},{false,}}; 5463 #else 5464 Int aiDvMcpDvCand[2][7] = {{0,}, {0,}}; // dummy, 5 spatial + 1 temporal 5008 5465 Bool abDvMcpFlag [2][7] = {{false,},{false,}}; 5009 5466 //Int aiRefPOC [2][7] = {{-1,},{-1}}; // debug 5467 #endif 5010 5468 TComMv cTmpMvPred, cMv; 5011 5469 Bool bTmpIsSkipped = false; 5012 5470 Bool bDvMcpIsFound = false; 5471 #if LGE_DVMCP_MEM_REDUCTION_B0135 5472 Int iLCUAddrDiff = 0; 5473 #endif 5474 5475 #if LGE_IVMP_PARALLEL_MERGE_B0136 5476 Int xP, yP, nPSW, nPSH; 5477 if( bParMerge) 5478 this->getPartPosition(uiPartIdx, xP, yP, nPSW, nPSH); 5479 #endif 5013 5480 5014 5481 deriveLeftRightTopIdxGeneral( eCUMode, uiPartAddr, uiPartIdx, uiPartIdxLT, uiPartIdxRT ); … … 5021 5488 pcTmpCU = getPULeft(uiIdx, uiPartIdxLB); 5022 5489 #endif 5023 5490 #if DV_DERIVATION_PARALLEL_B0096 5491 if ( uiPartIdx == 1 && (eCUMode == SIZE_Nx2N || eCUMode == SIZE_nLx2N || eCUMode == SIZE_nRx2N) ) 5492 { 5493 pcTmpCU = NULL; 5494 } 5495 #endif 5496 #if LGE_IVMP_PARALLEL_MERGE_B0136 5497 if (pcTmpCU && bParMerge) 5498 { 5499 if (!pcTmpCU->isDiffMER(xP -1, yP+nPSH-1, xP, yP)) 5500 { 5501 pcTmpCU = NULL; 5502 } 5503 } 5504 #endif 5505 5506 #if !QC_SIMPLE_NBDV_B0047 5024 5507 pcCULeft = pcTmpCU; 5025 5508 UInt uiLeftPartIdx = uiIdx; 5509 #endif 5510 5026 5511 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) ) 5027 5512 { … … 5042 5527 return; 5043 5528 } 5529 else // MCP 5530 { 5044 5531 #if VSP_N & VSP_BUGFIX 5045 else if (pcTmpCU->getSlice()->getRefPOC( eRefPicList, refId) != m_pcSlice->getPOC()) // MCP 5046 #else 5047 else // MCP 5048 #endif 5049 { 5532 if (pcTmpCU->getSlice()->getRefPOC( eRefPicList, refId) != m_pcSlice->getPOC()) 5533 { 5534 #endif 5050 5535 cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5051 5536 if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped ) … … 5055 5540 bDvMcpIsFound = true; 5056 5541 } 5542 #if VSP_N & VSP_BUGFIX 5543 } 5544 #endif 5057 5545 } 5058 5546 } … … 5065 5553 pcTmpCU = getPUAbove(uiIdx, uiPartIdxRT); 5066 5554 #endif 5555 #if DV_DERIVATION_PARALLEL_B0096 5556 if ( uiPartIdx == 1 && (eCUMode == SIZE_2NxN || eCUMode == SIZE_2NxnU || eCUMode == SIZE_2NxnD) ) 5557 { 5558 pcTmpCU = NULL; 5559 } 5560 #endif 5561 #if LGE_IVMP_PARALLEL_MERGE_B0136 5562 if (pcTmpCU && bParMerge) 5563 { 5564 if (!pcTmpCU->isDiffMER(xP+nPSW-1, yP-1, xP, yP)) 5565 { 5566 pcTmpCU = NULL; 5567 } 5568 } 5569 #endif 5067 5570 5068 5571 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 5069 5572 { 5573 #if LGE_DVMCP_MEM_REDUCTION_B0135 5574 iLCUAddrDiff = getAddr() - pcTmpCU->getAddr(); 5575 #endif 5070 5576 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); 5071 5577 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) … … 5084 5590 return; 5085 5591 } 5592 #if LGE_DVMCP_MEM_REDUCTION_B0135 5593 else if(iLCUAddrDiff == 0) //MCP, within same LCU 5594 #else 5595 else // MCP 5596 #endif 5597 { 5086 5598 #if VSP_N & VSP_BUGFIX 5087 else if (pcTmpCU->getSlice()->getRefPOC( eRefPicList, refId) != m_pcSlice->getPOC()) // MCP 5088 #else 5089 else // MCP 5090 #endif 5091 { 5599 if(pcTmpCU->getSlice()->getRefPOC( eRefPicList, refId) != m_pcSlice->getPOC()) 5600 { 5601 #endif 5092 5602 cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5093 5603 if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped ) … … 5097 5607 bDvMcpIsFound = true; 5098 5608 } 5609 #if VSP_N & VSP_BUGFIX 5610 } 5611 #endif 5099 5612 } 5100 5613 } … … 5107 5620 pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true, true, true); 5108 5621 #endif 5622 #if LGE_IVMP_PARALLEL_MERGE_B0136 5623 if (pcTmpCU && bParMerge) 5624 { 5625 if (!pcTmpCU->isDiffMER(xP+nPSW, yP-1, xP, yP)) 5626 { 5627 pcTmpCU = NULL; 5628 } 5629 } 5630 #endif 5631 5109 5632 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) ) 5110 5633 { 5634 #if LGE_DVMCP_MEM_REDUCTION_B0135 5635 iLCUAddrDiff = getAddr() - pcTmpCU->getAddr(); 5636 #endif 5111 5637 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); 5112 5638 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) … … 5125 5651 return; 5126 5652 } 5653 #if LGE_DVMCP_MEM_REDUCTION_B0135 5654 else if(iLCUAddrDiff == 0) 5655 #else 5656 else // MCP 5657 #endif 5658 { 5127 5659 #if VSP_N & VSP_BUGFIX 5128 else if (pcTmpCU->getSlice()->getRefPOC( eRefPicList, refId) != m_pcSlice->getPOC()) // MCP 5129 #else 5130 else // MCP 5131 #endif 5132 { 5660 if (pcTmpCU->getSlice()->getRefPOC( eRefPicList, refId) != m_pcSlice->getPOC()) 5661 { 5662 #endif 5133 5663 cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5134 5664 if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped ) … … 5138 5668 bDvMcpIsFound = true; 5139 5669 } 5670 #if VSP_N & VSP_BUGFIX 5671 } 5672 #endif 5140 5673 } 5141 5674 } … … 5147 5680 #else 5148 5681 pcTmpCU = getPUBelowLeft(uiIdx, uiPartIdxLB); 5682 #endif 5683 #if LGE_IVMP_PARALLEL_MERGE_B0136 5684 if (pcTmpCU && bParMerge) 5685 { 5686 if (!pcTmpCU->isDiffMER(xP-1, yP+nPSH, xP, yP)) 5687 { 5688 pcTmpCU = NULL; 5689 } 5690 } 5149 5691 #endif 5150 5692 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) … … 5166 5708 return; 5167 5709 } 5710 else // MCP 5711 { 5168 5712 #if VSP_N & VSP_BUGFIX 5169 else if (pcTmpCU->getSlice()->getRefPOC( eRefPicList, refId) != m_pcSlice->getPOC()) // MCP 5170 #else 5171 else // MCP 5172 #endif 5173 { 5713 if (pcTmpCU->getSlice()->getRefPOC( eRefPicList, refId) != m_pcSlice->getPOC()) 5714 { 5715 #endif 5174 5716 cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5175 5717 if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped ) … … 5179 5721 bDvMcpIsFound = true; 5180 5722 } 5723 #if VSP_N & VSP_BUGFIX 5724 } 5725 #endif 5181 5726 } 5182 5727 } … … 5191 5736 pcTmpCU = getPUAboveLeft(uiIdx, uiPartIdxLT, true, true, true); 5192 5737 #endif 5738 #if LGE_IVMP_PARALLEL_MERGE_B0136 5739 if (pcTmpCU && bParMerge) 5740 { 5741 if (!pcTmpCU->isDiffMER(xP-1, yP-1, xP, yP)) 5742 { 5743 pcTmpCU = NULL; 5744 } 5745 } 5746 #endif 5747 5193 5748 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 5194 5749 { 5750 #if LGE_DVMCP_MEM_REDUCTION_B0135 5751 iLCUAddrDiff = getAddr() - pcTmpCU->getAddr(); 5752 #endif 5195 5753 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); 5196 5754 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) … … 5209 5767 return; 5210 5768 } 5769 #if LGE_DVMCP_MEM_REDUCTION_B0135 5770 else if(iLCUAddrDiff <= 1) 5771 #else 5772 else // MCP 5773 #endif 5774 { 5211 5775 #if VSP_N & VSP_BUGFIX 5212 else if (pcTmpCU->getSlice()->getRefPOC( eRefPicList, refId) != m_pcSlice->getPOC()) // MCP 5213 #else 5214 else // MCP 5215 #endif 5216 { 5776 if (pcTmpCU->getSlice()->getRefPOC( eRefPicList, refId) != m_pcSlice->getPOC()) 5777 { 5778 #endif 5217 5779 cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5218 5780 if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped ) … … 5222 5784 bDvMcpIsFound = true; 5223 5785 } 5786 #if VSP_N & VSP_BUGFIX 5787 } 5788 #endif 5224 5789 } 5225 5790 } … … 5230 5795 if ( getSlice()->getPPS()->getEnableTMVPFlag() ) 5231 5796 { 5797 #if !QC_SIMPLE_NBDV_B0047 5232 5798 UInt uiPUIdx = uiPartIdx; 5233 5799 UInt uiAbsPartAddr = uiPartAddr; … … 5387 5953 } 5388 5954 } 5955 #else 5956 TComMv cColMv; 5957 Int iTargetViewIdx = 0; 5958 Int iTStartViewIdx = 0; 5959 UInt uiPartIdxRB, uiBRIdx; 5960 Int uiViewIdxCurr= getSlice()->getViewId(); 5961 UInt uiPartIdxCenter; 5962 xDeriveCenterIdx( eCUMode, uiPartIdx, uiPartIdxCenter ); 5963 5964 Int uiLCUIdx = getAddr(); 5965 Int uiLCUnew = uiLCUIdx; 5966 eCUMode = getPartitionSize( 0 ); 5967 deriveRightBottomIdx( eCUMode, uiPartIdx, uiPartIdxRB ); 5968 uiBRIdx = uiPartIdxLT; 5969 UInt uiAbsPartIdxTmp = g_auiZscanToRaster[uiPartIdxRB]; 5970 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 5971 { 5972 if ( ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) && // is not at the last column of LCU 5973 ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) ) // is not at the last row of LCU 5974 { 5975 uiBRIdx = g_auiRasterToZscan[ uiAbsPartIdxTmp + uiNumPartInCUWidth + 1 ]; 5976 } 5977 else if ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) // is not at the last column of LCU But is last row of LCU 5978 { 5979 uiBRIdx = g_auiRasterToZscan[ (uiAbsPartIdxTmp + uiNumPartInCUWidth + 1) % m_pcPic->getNumPartInCU() ]; 5980 uiLCUnew = uiLCUIdx + m_pcPic->getFrameWidthInCU(); 5981 } 5982 else if ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) // is not at the last row of LCU But is last column of LCU 5983 { 5984 uiBRIdx = g_auiRasterToZscan[ uiAbsPartIdxTmp + 1 ]; 5985 uiLCUnew = uiLCUIdx + 1; 5986 } 5987 else //is the right bottom corner of LCU 5988 { 5989 uiBRIdx = 0; 5990 uiLCUnew = uiLCUIdx + m_pcPic->getFrameWidthInCU() + 1; 5991 } 5992 } 5993 const Int iNumofCandPic = 2; 5994 for(Int i =0; i < iNumofCandPic; i++) 5995 { 5996 Int lpRef=0; 5997 if(i == 0) 5998 { //check the col-located picture 5999 eRefPicList = RefPicList(getSlice()->isInterB() ? getSlice()->getColDir() : 0); 6000 #if COLLOCATED_REF_IDX 6001 lpRef = getSlice()->getColRefIdx(); 6002 #else 6003 Int lpRef = 0; 6004 #endif 6005 } 6006 else 6007 { 6008 if(!(getPic()->getRapbCheck())) 6009 break; 6010 eRefPicList=getPic()->getRapRefList(); 6011 lpRef=getPic()->getRapRefIdx(); 6012 } 6013 6014 if( m_pcSlice->getViewId() == getSlice()->getRefPic( eRefPicList, lpRef)->getViewId() ) 6015 { 6016 if (uiViewIdxCurr > 1) 6017 { 6018 if( (uiLCUnew >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUnew, uiBRIdx, cColMv, iTargetViewIdx, iTStartViewIdx)) ) 6019 { 6020 clipMv(cColMv); 6021 pDInfo->m_acMvCand[pDInfo->iN] = cColMv; 6022 pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx; 6023 return ; 6024 } 6025 } 6026 6027 if(xGetColDisMV( eRefPicList, lpRef, uiLCUIdx, uiPartIdxCenter, cColMv, iTargetViewIdx, iTStartViewIdx )) 6028 { 6029 clipMv(cColMv); 6030 pDInfo->m_acMvCand[pDInfo->iN] = cColMv; 6031 pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx; 6032 return ; 6033 } 6034 if(uiViewIdxCurr == 1) 6035 { 6036 if( (uiLCUnew >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUnew, uiBRIdx, cColMv, iTargetViewIdx, iTStartViewIdx)) ) 6037 { 6038 clipMv(cColMv); 6039 pDInfo->m_acMvCand[pDInfo->iN] = cColMv; 6040 pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx; 6041 return ; 6042 } 6043 } 6044 } 6045 } 6046 #endif 5389 6047 } // if TMVP Flag 5390 6048 5391 6049 if( bDvMcpIsFound ) // skip dvmcp 5392 6050 { 6051 #if QC_SIMPLE_NBDV_B0047 6052 for( Int i=1 ; i<iNumofDvMCP-1 ; i++ ) // 5 spatial 6053 #else 5393 6054 for( Int i=1 ; i<7 ; i++ ) // 5 spatial + 1 temporal 6055 #endif 5394 6056 { 5395 6057 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) … … 5407 6069 } 5408 6070 } 5409 5410 6071 return; 5411 5412 } 5413 #endif 5414 6072 } 6073 #endif 5415 6074 #endif 5416 6075 … … 5422 6081 * \param pInfo 5423 6082 */ 6083 #if SHARP_INTERVIEW_DECOUPLE_B0111 6084 Void TComDataCU::fillMvpCand ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo, Int iMVPIdx) 6085 { 6086 if (!m_pcSlice->getSPS()->getViewId() || !m_pcSlice->getSPS()->getMultiviewMvPredMode()) 6087 { 6088 // HEVC 6089 fillMvpCandBase(uiPartIdx, uiPartAddr, eRefPicList, iRefIdx, pInfo); 6090 } 6091 else 6092 { 6093 if (iMVPIdx!=0) 6094 { 6095 // HEVC part 6096 fillMvpCandBase(uiPartIdx, uiPartAddr, eRefPicList, iRefIdx, pInfo); 6097 if (iRefIdx < 0) 6098 { 6099 return; 6100 } 6101 for (Int j = AMVP_MAX_NUM_CANDS - 1; j >= 0; j--) 6102 { 6103 pInfo->m_acMvCand[j+1] = pInfo->m_acMvCand[j]; 6104 } 6105 pInfo->iN++; 6106 } 6107 if (iMVPIdx<=0) 6108 { 6109 // extention part 6110 DisInfo cDisInfo; 6111 cDisInfo.iN = 0; 6112 #if LGE_DVMCP_A0126 6113 #if QC_SIMPLE_NBDV_B0047 6114 #if FIX_LGE_IVMP_PARALLEL_MERGE_B0136 6115 getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo, false); 6116 #else 6117 getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo); 6118 #endif 6119 #else 6120 getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo, false, eRefPicList, iRefIdx ); 6121 #endif 6122 #else 6123 getDisMvpCand (uiPartIdx, uiPartAddr, &cDisInfo ); 6124 #endif 6125 if(cDisInfo.iN==0) 6126 { 6127 cDisInfo.iN = 1; 6128 cDisInfo.m_acMvCand[0].setHor(0); 6129 cDisInfo.m_acMvCand[0].setVer(0); 6130 cDisInfo.m_aVIdxCan[0] = 0; 6131 } 6132 TComMv cPdmMvPred; 6133 #if QC_MULTI_DIS_CAN_A0097 6134 if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) ) 6135 #else 6136 if( getPdmMvPred( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred ) ) 6137 #endif 6138 { 6139 clipMv( cPdmMvPred ); 6140 pInfo->m_acMvCand[0] = cPdmMvPred; 6141 } 6142 else 6143 { 6144 pInfo->m_acMvCand[0].set(0,0); 6145 } 6146 } 6147 } 6148 } 6149 6150 6151 Void TComDataCU::fillMvpCandBase( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo ) 6152 #else 5424 6153 Void TComDataCU::fillMvpCand ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo ) 6154 #endif 5425 6155 { 5426 6156 PartSize eCUMode = getPartitionSize( 0 ); … … 5435 6165 } 5436 6166 5437 #if QC_MULTI_DIS_CAN 6167 #if QC_MULTI_DIS_CAN_A0097 && !SHARP_INTERVIEW_DECOUPLE_B0111 5438 6168 DisInfo cDisInfo; 5439 6169 cDisInfo.iN = 0; 5440 6170 if(m_pcSlice->getSPS()->getViewId() && m_pcSlice->getSPS()->getMultiviewMvPredMode()) 5441 6171 { 5442 #if LGE_DVMCP 6172 #if LGE_DVMCP_A0126 6173 #if QC_SIMPLE_NBDV_B0047 6174 #if FIX_LGE_IVMP_PARALLEL_MERGE_B0136 6175 getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo, false); 6176 #else 6177 getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo); 6178 #endif 6179 #else 5443 6180 getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo, false, eRefPicList, iRefIdx ); 6181 #endif 5444 6182 #else 5445 6183 getDisMvpCand (uiPartIdx, uiPartAddr, &cDisInfo ); … … 5454 6192 } 5455 6193 #endif 5456 #if HHI_INTER_VIEW_MOTION_PRED 6194 #if HHI_INTER_VIEW_MOTION_PRED && !SHARP_INTERVIEW_DECOUPLE_B0111 5457 6195 #if ( PDM_AMVP_POS == 0 ) 5458 6196 // get inter-view mv predictor (at position 0) 5459 6197 TComMv cPdmMvPred; 5460 #if QC_MULTI_DIS_CAN 6198 #if QC_MULTI_DIS_CAN_A0097 5461 6199 if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) ) 5462 6200 #else … … 5513 6251 } 5514 6252 5515 #if HHI_INTER_VIEW_MOTION_PRED 6253 #if HHI_INTER_VIEW_MOTION_PRED && !SHARP_INTERVIEW_DECOUPLE_B0111 5516 6254 #if ( PDM_AMVP_POS == 1 ) 5517 6255 // get inter-view mv predictor (at position 1) 5518 6256 TComMv cPdmMvPred; 5519 #if QC_MULTI_DIS_CAN 6257 #if QC_MULTI_DIS_CAN_A0097 5520 6258 if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) ) 5521 6259 #else … … 5565 6303 } 5566 6304 5567 #if HHI_INTER_VIEW_MOTION_PRED 6305 #if HHI_INTER_VIEW_MOTION_PRED && !SHARP_INTERVIEW_DECOUPLE_B0111 5568 6306 #if ( PDM_AMVP_POS == 2 ) 5569 6307 // get inter-view mv predictor (at position 2) 5570 6308 TComMv cPdmMvPred; 5571 #if QC_MULTI_DIS_CAN 6309 #if QC_MULTI_DIS_CAN_A0097 5572 6310 if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) ) 5573 6311 #else … … 5587 6325 { 5588 6326 pInfo->iN = 1; 5589 } 5590 } 5591 #if QC_MULTI_DIS_CAN 6327 #if FIX_MISUSE_REFINDEX 6328 pInfo->m_acMvCand[ 1 ].set(0, 0); 6329 #endif 6330 } 6331 } 6332 #if QC_MULTI_DIS_CAN_A0097 && !SHARP_INTERVIEW_DECOUPLE_B0111 5592 6333 if ( getSlice()->getViewId()!=0 && pInfo->iN == 3 ) 5593 6334 { … … 5663 6404 if ( uiLCUIdx >= 0 && xGetColMVP( eRefPicList, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx_Col ) ) 5664 6405 { 6406 #if FIX_LGE_DVMCP_B0133 6407 cColMv.m_bDvMcp = false; 6408 #endif 5665 6409 pInfo->m_acMvCand[pInfo->iN++] = cColMv; 5666 6410 } … … 5672 6416 if (xGetColMVP( eRefPicList, uiCurLCUIdx, uiPartIdxCenter, cColMv, iRefIdx_Col )) 5673 6417 { 6418 #if FIX_LGE_DVMCP_B0133 6419 cColMv.m_bDvMcp = false; 6420 #endif 5674 6421 pInfo->m_acMvCand[pInfo->iN++] = cColMv; 5675 6422 } … … 5678 6425 } 5679 6426 5680 #if HHI_INTER_VIEW_MOTION_PRED 6427 #if HHI_INTER_VIEW_MOTION_PRED && !SHARP_INTERVIEW_DECOUPLE_B0111 5681 6428 #if ( PDM_AMVP_POS == 3 ) 5682 6429 // get inter-view mv predictor (at position 3) 5683 6430 TComMv cPdmMvPred; 5684 #if QC_MULTI_DIS_CAN 6431 #if QC_MULTI_DIS_CAN_A0097 5685 6432 if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) ) 5686 6433 #else … … 5699 6446 #endif 5700 6447 5701 #if HHI_INTER_VIEW_MOTION_PRED 6448 #if HHI_INTER_VIEW_MOTION_PRED && !SHARP_INTERVIEW_DECOUPLE_B0111 5702 6449 const Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 ); 5703 6450 if (pInfo->iN > iNumAMVPCands) … … 5953 6700 { 5954 6701 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5955 #if LGE_DVMCP 6702 #if LGE_DVMCP_A0126 5956 6703 cMvPred.m_bDvMcp = false; 5957 6704 #endif … … 5982 6729 if( pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) >= 0 ) 5983 6730 { 5984 if( pcTmpCU->getSlice()->getRefViewId( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) ) != m_pcSlice->getRefViewId( eRefPicList, iRefIdx ) )5985 {5986 return false;5987 }5988 6731 #if VSP_N /// 5989 6732 if( pcTmpCU->isVspRef( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) ) ) 5990 6733 return false; 5991 6734 #endif 6735 #if QC_IV_AS_LT_B0046 6736 Bool bIsCurrRefLongTerm = m_pcSlice->getRefPic( eRefPicList, iRefIdx)->getIsLongTerm(); 6737 Bool bIsNeibRefLongTerm = m_pcSlice->getRefPic( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx))->getIsLongTerm(); 6738 iNeibRefPOC = pcTmpCU->getSlice()->getRefPOC( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) ); 6739 if ( (bIsCurrRefLongTerm == bIsNeibRefLongTerm) && (iNeibRefPOC == iCurrRefPOC) ) 6740 #else 6741 if( pcTmpCU->getSlice()->getRefViewId( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) ) != m_pcSlice->getRefViewId( eRefPicList, iRefIdx ) ) 6742 { 6743 return false; 6744 } 5992 6745 iNeibRefPOC = pcTmpCU->getSlice()->getRefPOC( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) ); 5993 6746 if( iNeibRefPOC == iCurrRefPOC ) // Same Reference Frame But Diff List// 6747 #endif 5994 6748 { 5995 6749 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList2nd)->getMv(uiIdx); 5996 #if LGE_DVMCP 6750 #if LGE_DVMCP_A0126 5997 6751 cMvPred.m_bDvMcp = false; 5998 6752 #endif … … 6138 6892 Int iNeibRefPOC; 6139 6893 6894 #if QC_IV_AS_LT_B0046 6895 Bool bIsCurrRefLongTerm = m_pcSlice->getRefPic( eRefPicList, iRefIdx)->getIsLongTerm(); 6896 Bool bIsNeibRefLongTerm = false; 6897 #endif 6140 6898 if( pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) >= 0 ) 6141 6899 { 6142 iNeibRefPOC = pcTmpCU->getSlice()->getRefPOC( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) );6143 if( pcTmpCU->getSlice()->getRefViewId( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) ) != m_pcSlice->getRefViewId( eRefPicList, iRefIdx ) )6144 return false;6145 6900 #if VSP_N /// 6146 6901 if( pcTmpCU->isVspRef( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) ) ) 6147 6902 return false; 6148 6903 #endif 6904 iNeibRefPOC = pcTmpCU->getSlice()->getRefPOC( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) ); 6905 #if QC_IV_AS_LT_B0046 6906 bIsNeibRefLongTerm = m_pcSlice->getRefPic( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx))->getIsLongTerm() ; 6907 if ( (bIsCurrRefLongTerm == bIsNeibRefLongTerm) && (iNeibRefPOC == iCurrRefPOC) ) 6908 #else 6909 if( pcTmpCU->getSlice()->getRefViewId( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) ) != m_pcSlice->getRefViewId( eRefPicList, iRefIdx ) ) 6910 return false; 6149 6911 if( iNeibRefPOC == iCurrRefPOC ) // Same Reference Frame But Diff List// 6912 #endif 6150 6913 { 6151 6914 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList2nd)->getMv(uiIdx); 6152 #if LGE_DVMCP 6915 #if LGE_DVMCP_A0126 6153 6916 cMvPred.m_bDvMcp = false; 6154 6917 #endif … … 6165 6928 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 6166 6929 TComMv rcMv; 6167 6930 #if QC_IV_AS_LT_B0046 6931 bIsNeibRefLongTerm = m_pcSlice->getRefPic( eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx))->getIsLongTerm(); 6932 if ( bIsCurrRefLongTerm == bIsNeibRefLongTerm ) 6933 { 6934 #else 6168 6935 if( pcTmpCU->getSlice()->getRefViewId( eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ) != m_pcSlice->getRefViewId( eRefPicList, iRefIdx ) ) 6169 6936 { 6170 6937 return false; 6171 6938 } 6939 #endif 6172 6940 #if VSP_N /// 6173 6941 if( pcTmpCU->isVspRef( eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ) ) … … 6192 6960 rcMv = cMvPred.scaleMv( iScale ); 6193 6961 } 6194 #if LGE_DVMCP 6962 #if LGE_DVMCP_A0126 6195 6963 rcMv.m_bDvMcp = false; 6196 6964 #endif 6197 6965 pInfo->m_acMvCand[ pInfo->iN++] = rcMv; 6198 6966 return true; 6967 #if QC_IV_AS_LT_B0046 6968 } 6969 #endif 6199 6970 } 6200 6971 //---------------------- V2(END) --------------------// … … 6204 6975 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList2nd)->getMv(uiIdx); 6205 6976 TComMv rcMv; 6206 6977 #if QC_IV_AS_LT_B0046 6978 bIsNeibRefLongTerm = m_pcSlice->getRefPic( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx))->getIsLongTerm(); ; 6979 if ( bIsCurrRefLongTerm == bIsNeibRefLongTerm ) 6980 { 6981 #else 6207 6982 if( pcTmpCU->getSlice()->getRefViewId( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) ) != m_pcSlice->getRefViewId( eRefPicList, iRefIdx ) ) 6208 6983 { 6209 6984 return false; 6210 6985 } 6986 #endif 6211 6987 #if VSP_N /// 6212 6988 if( pcTmpCU->isVspRef( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) ) ) … … 6231 7007 rcMv = cMvPred.scaleMv( iScale ); 6232 7008 } 6233 #if LGE_DVMCP 7009 #if LGE_DVMCP_A0126 6234 7010 rcMv.m_bDvMcp = false; 6235 7011 #endif 6236 7012 pInfo->m_acMvCand[ pInfo->iN++] = rcMv; 6237 7013 return true; 7014 #if QC_IV_AS_LT_B0046 7015 } 7016 #endif 6238 7017 } 6239 7018 //---------------------- V3(END) --------------------// … … 6241 7020 } 6242 7021 6243 #if QC_MULTI_DIS_CAN 7022 #if QC_MULTI_DIS_CAN_A0097 6244 7023 Bool TComDataCU::xGetColDisMV( RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv , Int & iTargetViewIdx, Int & iStartViewIdx ) 6245 7024 { 6246 #if LGE_DVMCP 7025 #if LGE_DVMCP_A0126 && !QC_SIMPLE_NBDV_B0047 6247 7026 Int iDvMcpDispX[2] = {-1,}; 6248 7027 Bool bDvMcpFlag [2] = { false, }; … … 6269 7048 return false; 6270 7049 } 6271 #if LGE_DVMCP 7050 #if LGE_DVMCP_A0126 && !QC_SIMPLE_NBDV_B0047 6272 7051 Bool bColIsSkipped = pColCU->isSkipped( uiAbsPartAddr ); 6273 7052 #endif … … 6299 7078 if ( iColViewIdx == iColRefViewIdx ) // temporal vector 6300 7079 { 6301 #if LGE_DVMCP 7080 #if LGE_DVMCP_A0126 && !QC_SIMPLE_NBDV_B0047 6302 7081 if( iColViewIdx >0 ) 6303 7082 { … … 6317 7096 { 6318 7097 rcMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiAbsPartAddr); 6319 #if LGE_DVMCP 7098 #if LGE_DVMCP_A0126 6320 7099 rcMv.m_bDvMcp = false; 6321 7100 #endif … … 6326 7105 } 6327 7106 6328 #if LGE_DVMCP 7107 #if LGE_DVMCP_A0126 && !QC_SIMPLE_NBDV_B0047 6329 7108 for( Int ilist=0 ; ilist<2 ; ilist++ ) 6330 7109 { … … 6357 7136 RefPicList eColRefPicList; 6358 7137 Int iColPOC, iColRefPOC, iCurrPOC, iCurrRefPOC, iScale; 6359 #if SONY_COLPIC_AVAILABILITY 7138 #if SONY_COLPIC_AVAILABILITY || VSP_N 7139 #if QC_IV_AS_LT_B0046 7140 Int iColViewOrderIdx, iCurrViewOrderIdx, iCurrRefViewOrderIdx; 7141 #else 6360 7142 Int iColViewOrderIdx, iColRefViewOrderIdx, iCurrViewOrderIdx, iCurrRefViewOrderIdx; 6361 7143 #endif 7144 #endif 6362 7145 TComMv cColMv; 6363 7146 6364 #if SONY_COLPIC_AVAILABILITY6365 iCurrViewOrderIdx = m_pcSlice->getViewOrderIdx();6366 iCurrRefViewOrderIdx = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewOrderIdx();6367 #endif6368 7147 // use coldir. 6369 7148 #if COLLOCATED_REF_IDX … … 6379 7158 iCurrPOC = m_pcSlice->getPOC(); 6380 7159 iCurrRefPOC = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getPOC(); 6381 iColPOC = pColCU->getSlice()->getPOC(); 6382 #if SONY_COLPIC_AVAILABILITY 7160 iColPOC = pColCU->getSlice()->getPOC(); 7161 7162 #if SONY_COLPIC_AVAILABILITY || VSP_N 7163 iCurrViewOrderIdx = m_pcSlice->getViewOrderIdx(); 7164 iCurrRefViewOrderIdx = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewOrderIdx(); 6383 7165 iColViewOrderIdx = pColCU->getSlice()->getViewOrderIdx(); 6384 7166 #endif … … 6389 7171 } 6390 7172 6391 #if !SONY_COLPIC_AVAILABILITY 7173 #if !SONY_COLPIC_AVAILABILITY&!QC_IV_AS_LT_B0046 6392 7174 if( m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewId() != m_pcSlice->getViewId() ) 6393 7175 return false; … … 6413 7195 } 6414 7196 } 7197 7198 7199 #if VSP_N 7200 Bool bIsCurrRefVsp = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getIsVsp(); 7201 Bool bIsColRefVsp = pColCU->getSlice()->getRefPic( eColRefPicList,pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getIsVsp(); 7202 7203 if(bIsCurrRefVsp) 7204 { 7205 #if (VSP_TMVP==0) 7206 rcMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiAbsPartAddr); 7207 #elif (VSP_TMVP==1 || VSP_TMVP==2) 7208 #if !VSP_TMVP_ENABLE 7209 if(!bIsColRefVsp) return false; 7210 #endif 7211 rcMv.setZero(); 7212 #if !VSP_MV_ZERO 7213 if( bIsColRefVsp ) rcMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiAbsPartAddr); 7214 #endif 7215 #endif // (VSP_TMVP==1 || VSP_TMVP==2) 7216 return true; 7217 } 7218 if(bIsColRefVsp) 7219 #if (VSP_TMVP==0) 7220 { 7221 if(iCurrPOC != iCurrRefPOC) 7222 return false; 7223 else 7224 { 7225 Int iColRefViewOrderIdx = pColCU->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewOrderIdx(); 7226 iScale = xGetDistScaleFactor(iCurrViewOrderIdx, iCurrRefViewOrderIdx, iColViewOrderIdx, iColRefViewOrderIdx); 7227 cColMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiAbsPartAddr); 7228 if ( iScale == 4096 ) 7229 rcMv = cColMv; 7230 else 7231 rcMv = cColMv.scaleMv( iScale ); 7232 return true; 7233 } 7234 } 7235 #elif (VSP_TMVP==1) 7236 return false; 7237 #elif (VSP_TMVP==2) 7238 { 7239 for(Int i=0; i < m_pcSlice->getNumRefIdx(eRefPicList); i++) 7240 { 7241 if( m_pcSlice->getRefPic(eRefPicList, i)->getIsVsp() ) 7242 { 7243 riRefIdx = i; 7244 #if VSP_MV_ZERO 7245 rcMv.setZero(); 7246 #else 7247 rcMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiAbsPartAddr); 7248 #endif 7249 return true; 7250 } 7251 } 7252 return false; 7253 } 7254 #endif // VSP_TMVP 7255 #endif // VSP_N 7256 6415 7257 6416 7258 // Scale the vector. 6417 7259 iColRefPOC = pColCU->getSlice()->getRefPOC(eColRefPicList, iColRefIdx); 6418 7260 7261 #if !QC_IV_AS_LT_B0046 6419 7262 #if SONY_COLPIC_AVAILABILITY 6420 7263 iColRefViewOrderIdx = pColCU->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewOrderIdx(); … … 6425 7268 } 6426 7269 #endif 7270 #else 7271 Bool bIsCurrRefLongTerm = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getIsLongTerm(); 7272 Bool bIsColRefLongTerm = pColCU->getSlice()->getWasLongTerm(eColRefPicList, iColRefIdx); 7273 if(bIsCurrRefLongTerm != bIsColRefLongTerm) 7274 { 7275 assert( ((iColPOC == iColRefPOC)&&(iCurrPOC != iCurrRefPOC))||((iColPOC != iColRefPOC)&&(iCurrPOC == iCurrRefPOC))); 7276 return false; 7277 } 7278 #endif 6427 7279 6428 7280 cColMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiAbsPartAddr); 6429 7281 6430 iCurrRefPOC = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getPOC(); 7282 #if QC_IV_AS_LT_B0046 7283 { 7284 assert( ((iColPOC != iColRefPOC)&&(iCurrPOC != iCurrRefPOC))||((iColPOC == iColRefPOC)&&(iCurrPOC == iCurrRefPOC))); 7285 if(!bIsCurrRefLongTerm) //short-term 7286 { 7287 iScale = xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iColPOC, iColRefPOC); 7288 if ( iScale == 4096 ) 7289 { 7290 rcMv = cColMv; 7291 } 7292 else 7293 { 7294 rcMv = cColMv.scaleMv( iScale ); 7295 } 7296 }else 7297 #if QC_MVHEVC_B0046 7298 rcMv = cColMv; //inter-view 7299 #else 7300 { 7301 #if SONY_COLPIC_AVAILABILITY 7302 Int iColRefViewOrderIdx = pColCU->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewOrderIdx(); 7303 iScale = xGetDistScaleFactor(iCurrViewOrderIdx, iCurrRefViewOrderIdx, iColViewOrderIdx, iColRefViewOrderIdx); 7304 if ( iScale == 4096 ) 7305 { 7306 rcMv = cColMv; 7307 } 7308 else 7309 { 7310 rcMv = cColMv.scaleMv( iScale ); 7311 } 7312 #else 7313 return false; 7314 #endif 7315 } 7316 #endif 7317 } 7318 #else 6431 7319 #if SONY_COLPIC_AVAILABILITY 6432 7320 iScale = 0; 6433 iCurrRefViewOrderIdx = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewOrderIdx(); 6434 #if VSP_N 6435 // UInt uiColRefViewId = pColCU->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewId(); 6436 UInt uiCurRefViewId = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewId(); 6437 if( uiCurRefViewId == m_pcSlice->getViewId() && m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getPOC() == m_pcSlice->getPOC() ) 6438 iScale = 4096; 6439 else 6440 #endif 7321 // iCurrRefViewOrderIdx = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewOrderIdx(); 6441 7322 if((iColPOC != iColRefPOC)&&(iCurrPOC != iCurrRefPOC)) 6442 7323 iScale = xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iColPOC, iColRefPOC); … … 6444 7325 iScale = xGetDistScaleFactor(iCurrViewOrderIdx, iCurrRefViewOrderIdx, iColViewOrderIdx, iColRefViewOrderIdx); 6445 7326 else 6446 return false; 6447 7327 return false; 6448 7328 #else 6449 7329 iScale = xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iColPOC, iColRefPOC); … … 6451 7331 if ( iScale == 4096 ) 6452 7332 { 6453 #if VSP_MV_ZERO6454 if( uiCurRefViewId == m_pcSlice->getViewId() && m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getPOC() == m_pcSlice->getPOC() )6455 rcMv.setZero();6456 else6457 #endif6458 7333 rcMv = cColMv; 6459 7334 } … … 6462 7337 rcMv = cColMv.scaleMv( iScale ); 6463 7338 } 6464 7339 #endif 6465 7340 return true; 6466 7341 } … … 7391 8266 memcpy( m_puhInterDir + uiAbsPartIdxDst, pcCU->getInterDir() + uiAbsPartIdxSrc, sizeof( m_puhInterDir[0] ) * uiNumPartition ); 7392 8267 8268 #if !MTK_UNCONSTRAINED_MVI_B0083 7393 8269 memcpy( m_apiMVPIdx[0] + uiAbsPartIdxDst, pcCU->getMVPIdx(REF_PIC_LIST_0) + uiAbsPartIdxSrc, sizeof(*m_apiMVPIdx[0]) * uiNumPartition ); 7394 8270 memcpy( m_apiMVPIdx[1] + uiAbsPartIdxDst, pcCU->getMVPIdx(REF_PIC_LIST_1) + uiAbsPartIdxSrc, sizeof(*m_apiMVPIdx[0]) * uiNumPartition ); 7395 8271 memcpy( m_apiMVPNum[0] + uiAbsPartIdxDst, pcCU->getMVPNum(REF_PIC_LIST_0) + uiAbsPartIdxSrc, sizeof(*m_apiMVPNum[0]) * uiNumPartition ); 7396 8272 memcpy( m_apiMVPNum[1] + uiAbsPartIdxDst, pcCU->getMVPNum(REF_PIC_LIST_1) + uiAbsPartIdxSrc, sizeof(*m_apiMVPNum[0]) * uiNumPartition ); 8273 #endif 7397 8274 7398 8275 pcCU->getCUMvField( REF_PIC_LIST_0 )->copyTo( &m_acCUMvField[0], -Int(uiAbsPartIdxSrc) + uiAbsPartIdxDst, uiAbsPartIdxSrc, uiNumPartition ); 7399 8276 pcCU->getCUMvField( REF_PIC_LIST_1 )->copyTo( &m_acCUMvField[1], -Int(uiAbsPartIdxSrc) + uiAbsPartIdxDst, uiAbsPartIdxSrc, uiNumPartition ); 8277 8278 #if MTK_UNCONSTRAINED_MVI_B0083 8279 if( pcCU->getSlice()->getSliceType() == P_SLICE) 8280 { 8281 #if NTT_FIX_UNCONSTRAINED_MVI 8282 m_acCUMvField[0].setUndefinedMv( uiAbsPartIdxDst, uiNumPartition, m_pePredMode, m_puhInterDir, 0, 1, getSlice()->getNumRefIdx( RefPicList(0) ) ); 8283 m_acCUMvField[1].setUndefinedMv( uiAbsPartIdxDst, uiNumPartition, m_pePredMode, m_puhInterDir, -1, 1, getSlice()->getNumRefIdx( RefPicList(1) ) ); 8284 #else 8285 m_acCUMvField[0].setUndefinedMv( uiAbsPartIdxDst, uiNumPartition, m_pePredMode, m_puhInterDir, 0, 1); 8286 m_acCUMvField[1].setUndefinedMv( uiAbsPartIdxDst, uiNumPartition, m_pePredMode, m_puhInterDir, -1, 1); 8287 #endif 8288 } 8289 else 8290 { 8291 #if NTT_FIX_UNCONSTRAINED_MVI 8292 m_acCUMvField[0].setUndefinedMv( uiAbsPartIdxDst, uiNumPartition, m_pePredMode, m_puhInterDir, 0, 3, getSlice()->getNumRefIdx( RefPicList(0) ) ); 8293 m_acCUMvField[1].setUndefinedMv( uiAbsPartIdxDst, uiNumPartition, m_pePredMode, m_puhInterDir, 0, 3, getSlice()->getNumRefIdx( RefPicList(1) ) ); 8294 #else 8295 m_acCUMvField[0].setUndefinedMv( uiAbsPartIdxDst, uiNumPartition, m_pePredMode, m_puhInterDir, 0, 3); 8296 m_acCUMvField[1].setUndefinedMv( uiAbsPartIdxDst, uiNumPartition, m_pePredMode, m_puhInterDir, 0, 3); 8297 #endif 8298 } 8299 #endif 8300 7400 8301 7401 8302 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC … … 7410 8311 // ------------------------------------------------------------------------------------------------------------------- 7411 8312 #if HHI_INTER_VIEW_MOTION_PRED 7412 #if !QC_MULTI_DIS_CAN 8313 #if !QC_MULTI_DIS_CAN_A0097 7413 8314 Int 7414 8315 TComDataCU::getPdmMergeCandidate( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv ) … … 7429 8330 #else 7430 8331 Int 7431 TComDataCU::getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo ) 8332 TComDataCU::getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo 8333 #if QC_MRG_CANS_B0048 8334 , Int* iPdm 8335 #endif 8336 ) 7432 8337 { 7433 8338 TComDepthMapGenerator* pcDepthMapGenerator = m_pcSlice->getSPS()->getDepthMapGenerator(); 7434 8339 ROFRS( pcDepthMapGenerator, 0 ); 7435 return pcDepthMapGenerator->getPdmMergeCandidate( this, uiPartIdx, paiPdmRefIdx, pacPdmMv, pDInfo ); 8340 return pcDepthMapGenerator->getPdmMergeCandidate( this, uiPartIdx, paiPdmRefIdx, pacPdmMv, pDInfo 8341 #if QC_MRG_CANS_B0048 8342 , iPdm 8343 #endif 8344 ); 7436 8345 } 7437 8346 Bool … … 7466 8375 TComResidualGenerator* pcResidualGenerator = m_pcSlice->getSPS()->getResidualGenerator(); 7467 8376 ROFRS( pcResidualGenerator, false ); 7468 #if QC_MULTI_DIS_CAN 8377 #if QC_MULTI_DIS_CAN_A0097 7469 8378 DisInfo cDisInfo; 7470 8379 cDisInfo.iN = 0; 7471 8380 PartSize m_peSaved = getPartitionSize( 0 ); 7472 8381 m_pePartSize[0] = SIZE_2Nx2N; 7473 #if LGE_DVMCP 8382 #if LGE_DVMCP_A0126 8383 #if QC_SIMPLE_NBDV_B0047 8384 #if FIX_LGE_IVMP_PARALLEL_MERGE_B0136 8385 getDisMvpCand2( 0, 0, &cDisInfo, false); 8386 #else 8387 getDisMvpCand2( 0, 0, &cDisInfo); 8388 #endif 8389 #else 7474 8390 getDisMvpCand2( 0, 0, &cDisInfo, true ); 8391 #endif 7475 8392 #else 7476 8393 getDisMvpCand ( 0, 0, &cDisInfo ); … … 7501 8418 #endif 7502 8419 7503 #if LGE_EDGE_INTRA 8420 #if LGE_EDGE_INTRA_A0070 7504 8421 Void TComDataCU::reconPartition( UInt uiAbsPartIdx, UInt uiDepth, Bool bLeft, UChar ucStartPos, UChar ucNumEdge, UChar* pucEdgeCode, Bool* pbRegion ) 7505 8422 { … … 8125 9042 8126 9043 //! \} 8127 -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComDataCU.h
r193 r213 159 159 Int* m_pcArlCoeffCb; ///< ARL coefficient buffer (Cb) 160 160 Int* m_pcArlCoeffCr; ///< ARL coefficient buffer (Cr) 161 #if FIX_MEM_LEAKS162 161 Bool m_ArlCoeffIsAliasedAllocation; ///< ARL coefficient buffer is an alias of the global buffer and must not be free()'d 163 #endif164 162 165 163 static Int* m_pcGlbArlCoeffY; ///< ARL coefficient buffer (Y) 166 164 static Int* m_pcGlbArlCoeffCb; ///< ARL coefficient buffer (Cb) 167 165 static Int* m_pcGlbArlCoeffCr; ///< ARL coefficient buffer (Cr) 166 168 167 #endif 169 168 … … 194 193 195 194 Bool* m_pbMergeFlag; ///< array of merge flags 195 #if LGE_ILLUCOMP_B0045 196 Bool* m_pbICFlag; ///< array of IC flags 197 #endif 196 198 UChar* m_puhMergeIndex; ///< array of merge candidate indices 197 199 #if AMP_MRG … … 217 219 #endif 218 220 219 #if LGE_EDGE_INTRA 221 #if LGE_EDGE_INTRA_A0070 220 222 UChar* m_pucEdgeCode; ///< array of edge code 221 223 UChar* m_pucEdgeNumber; ///< total number of edge … … 235 237 Bool m_bDecSubCu; ///< indicates decoder-mode 236 238 Double m_dTotalCost; ///< sum of partition RD costs 239 #if FIX_RDO_NEGDIST 240 Dist m_uiTotalDistortion; ///< sum of partition distortion 241 #else 237 242 UInt m_uiTotalDistortion; ///< sum of partition distortion 243 #endif 238 244 UInt m_uiTotalBits; ///< sum of partition bits 239 245 UInt m_uiTotalBins; ///< sum of partition bins 240 246 UInt* m_uiSliceStartCU; ///< Start CU address of current slice 241 247 UInt* m_uiEntropySliceStartCU; ///< Start CU address of current slice 242 243 #if OL_DEPTHLIMIT_A0044244 //add a variable to store the partition information245 //a 2D array in uidepth, part_symbol format246 UInt m_uiPartInfo[OL_PART_BUF_SIZE][2];247 UInt m_uiPartNum;248 Bool m_dumpPartInfo;249 #endif250 248 251 249 // ------------------------------------------------------------------------------------------------------------------- … … 269 267 Int* m_piContourPredTexDeltaDC1; 270 268 Int* m_piContourPredTexDeltaDC2; 269 #endif 270 271 #if RWTH_SDC_DLT_B0036 272 Bool* m_pbSDCFlag; 273 Pel* m_apSegmentDCOffset[2]; 271 274 #endif 272 275 … … 283 286 Void deriveRightBottomIdx ( PartSize eCUMode, UInt uiPartIdx, UInt& ruiPartIdxRB ); 284 287 Bool xGetColMVP( RefPicList eRefPicList, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx ); 285 #if QC_MULTI_DIS_CAN 288 #if QC_MULTI_DIS_CAN_A0097 286 289 Bool xGetColDisMV( RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx ); 287 290 #endif … … 475 478 Void setSubPart ( T bParameter, T* pbBaseLCU, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx ); 476 479 480 #if LGE_ILLUCOMP_B0045 481 Bool* getICFlag () { return m_pbICFlag; } 482 Bool getICFlag ( UInt uiIdx ) { return m_pbICFlag[uiIdx]; } 483 Void setICFlag ( UInt uiIdx, Bool uh ) { m_pbICFlag[uiIdx] = uh; } 484 Void setICFlagSubParts ( Bool bICFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 485 Bool isICFlagRequired (UInt uiAbsPartIdx); 486 #endif 487 477 488 #if AMP_MRG 478 489 Void setMergeAMP( Bool b ) { m_bIsMergeAMP = b; } … … 533 544 534 545 #if HHI_INTER_VIEW_MOTION_PRED 535 #if !QC_MULTI_DIS_CAN 546 #if !QC_MULTI_DIS_CAN_A0097 536 547 Int getPdmMergeCandidate( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv ); 537 548 Bool getPdmMvPred( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, Bool bMerge = false ); 538 549 #else 539 550 Bool getPdmMvPredDisCan( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge = false ); 540 Int getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo ); 551 Int getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo 552 #if QC_MRG_CANS_B0048 553 , Int* iPdm 554 #endif 555 ); 541 556 Void getDisMvpCand ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo ); 542 #if LGE_DVMCP 543 Void getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo, Bool bMerge=false, RefPicList eRefPicList=REF_PIC_LIST_X, Int iRefIdx=-1 ); 557 #if LGE_DVMCP_A0126 558 #if QC_SIMPLE_NBDV_B0047 559 Void getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo 560 #if LGE_IVMP_PARALLEL_MERGE_B0136 561 , Bool bParMerg = false 562 #endif 563 ); 564 #else 565 Void getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo, Bool bMerge=false, RefPicList eRefPicList=REF_PIC_LIST_X, Int iRefIdx=-1 566 #if LGE_IVMP_PARALLEL_MERGE_B0136 567 , Bool bParMerg = false 568 #endif 569 ); 570 #endif 544 571 #endif 545 572 … … 589 616 590 617 AMVP_MODE getAMVPMode ( UInt uiIdx ); 618 #if SHARP_INTERVIEW_DECOUPLE_B0111 619 Void fillMvpCandBase ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo ); 620 Void fillMvpCand ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo , Int iMVPIdx=-1); 621 #else 591 622 Void fillMvpCand ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo ); 623 #endif 592 624 #if PARALLEL_MERGE 593 625 Bool isDiffMER ( Int xN, Int yN, Int xP, Int yP); … … 611 643 612 644 Void compressMV (); 613 614 #if OL_DEPTHLIMIT_A0044615 Void resetPartInfo () {m_uiPartNum = 0;};616 Void incrementPartInfo () {m_uiPartNum ++;};617 Void updatePartInfo(UInt uiSymbol, UInt uiDepth) { m_uiPartInfo[m_uiPartNum][0] = uiSymbol; m_uiPartInfo[m_uiPartNum][1] = uiDepth;};618 UInt* readPartInfo() { return (UInt*)m_uiPartInfo;};619 Void setPartDumpFlag(Bool flag) { m_dumpPartInfo = flag; };620 Bool getPartDumpFlag() { return m_dumpPartInfo; };621 #endif622 645 623 646 // ------------------------------------------------------------------------------------------------------------------- … … 706 729 707 730 UInt getCtxSkipFlag ( UInt uiAbsPartIdx ); 731 #if LGE_ILLUCOMP_B0045 732 UInt getCtxICFlag ( UInt uiAbsPartIdx ); 733 #endif 708 734 UInt getCtxInterDir ( UInt uiAbsPartIdx ); 709 735 … … 716 742 UInt& getTotalBins () { return m_uiTotalBins; } 717 743 718 #if LGE_EDGE_INTRA 744 #if LGE_EDGE_INTRA_A0070 719 745 UInt getCtxEdgeIntra ( UInt uiAbsPartIdx ); 720 746 #endif … … 725 751 726 752 Double& getTotalCost() { return m_dTotalCost; } 753 #if FIX_RDO_NEGDIST 754 Dist& getTotalDistortion() { return m_uiTotalDistortion; } 755 #else 727 756 UInt& getTotalDistortion() { return m_uiTotalDistortion; } 757 #endif 728 758 UInt& getTotalBits() { return m_uiTotalBits; } 729 759 UInt& getTotalNumPart() { return m_uiNumPartition; } … … 796 826 #endif 797 827 798 #if LGE_EDGE_INTRA 828 #if LGE_EDGE_INTRA_A0070 799 829 UChar* getEdgeCode( UInt uiIdx ) { return &m_pucEdgeCode[uiIdx * LGE_EDGE_INTRA_MAX_EDGE_NUM_PER_4x4]; } 800 830 UChar* getEdgeNumber( ) { return m_pucEdgeNumber; } … … 818 848 Void setEdgeDeltaDC1( UInt uiIdx, Int val ) { m_piEdgeDeltaDC1[uiIdx] = val; } 819 849 #endif 850 #endif 851 852 #if RWTH_SDC_DLT_B0036 853 Bool* getSDCFlag () { return m_pbSDCFlag; } 854 Bool getSDCFlag ( UInt uiIdx ) { return m_pbSDCFlag[uiIdx]; } 855 Void setSDCFlagSubParts ( Bool bSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 856 857 UInt getCtxSDCFlag ( UInt uiAbsPartIdx ); 858 859 Bool getSDCAvailable ( UInt uiAbsPartIdx ); 860 861 Pel* getSDCSegmentDCOffset( UInt uiSeg ) { return m_apSegmentDCOffset[uiSeg]; } 862 Pel getSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentDCOffset[uiSeg][uiPartIdx]; } 863 Void setSDCSegmentDCOffset( Pel pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentDCOffset[uiSeg][uiPartIdx] = pOffset; } 820 864 #endif 821 865 }; -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComDepthMapGenerator.cpp
r193 r213 78 78 m_uiSubSampExpX = uiSubSampExpX; 79 79 m_uiSubSampExpY = uiSubSampExpY; 80 #if !QC_MULTI_DIS_CAN 80 #if !QC_MULTI_DIS_CAN_A0097 81 81 m_ppcYuv = new TComYuv* [ m_uiMaxDepth ]; 82 82 m_ppcCU = new TComDataCU* [ m_uiMaxDepth ]; … … 102 102 { 103 103 m_bCreated = false; 104 #if !QC_MULTI_DIS_CAN 104 #if !QC_MULTI_DIS_CAN_A0097 105 105 for( UInt uiDepth = 0; uiDepth < m_uiMaxDepth; uiDepth++ ) 106 106 { … … 377 377 } 378 378 379 #if !QC_MULTI_DIS_CAN 379 #if !QC_MULTI_DIS_CAN_A0097 380 380 Bool 381 381 TComDepthMapGenerator::predictDepthMap( TComPic* pcPic ) … … 613 613 614 614 #if HHI_INTER_VIEW_MOTION_PRED 615 #if QC_MULTI_DIS_CAN 615 #if QC_MULTI_DIS_CAN_A0097 616 616 Int 617 TComDepthMapGenerator::getPdmMergeCandidate( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo ) 617 TComDepthMapGenerator::getPdmMergeCandidate( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo 618 #if QC_MRG_CANS_B0048 619 , Int* iPdm 620 #endif 621 ) 618 622 #else 619 623 Int … … 624 628 AOF ( m_bCreated && m_bInit ); 625 629 626 #if !QC_MULTI_DIS_CAN 630 #if !QC_MULTI_DIS_CAN_A0097 627 631 ROFRS( m_bPDMAvailable, 0 ); 628 632 #endif … … 634 638 ROTRS( !bPdmMerge, 0 ); 635 639 640 #if QC_MRG_CANS_B0048 641 Bool abPdmAvailable[4] = {false, false, false, false}; 642 #else 636 643 Bool abPdmAvailable[2] = {false,false}; 644 #endif 637 645 638 646 Int iValid = 0; … … 665 673 TComPicYuv* pcBaseRec = pcBasePic->getPicYuvRec (); 666 674 667 #if QC_MULTI_DIS_CAN 675 #if QC_MULTI_DIS_CAN_A0097 668 676 Int iCurrPosX, iCurrPosY; 669 677 UInt uiPartAddr; … … 719 727 paiPdmRefIdx [ uiBaseRefListId ] = iPdmRefIdx; 720 728 TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer()); 721 #if LGE_DVMCP 729 #if LGE_DVMCP_A0126 722 730 cMv.m_bDvMcp = true; 723 731 cMv.m_iDvMcpDispX = pDInfo->m_acMvCand[0].getHor(); … … 733 741 } 734 742 Int iPdmInterDir = ( abPdmAvailable[0] ? 1 : 0 ) + ( abPdmAvailable[1] ? 2 : 0 ); 735 743 #if QC_MRG_CANS_B0048 744 iPdm[0] = iPdmInterDir; 745 #else 736 746 if (iPdmInterDir == 0) 737 747 { 748 #endif 738 749 for( Int iRefListId = 0; iRefListId < 2 ; iRefListId++ ) 739 750 { … … 747 758 if( pcSlice->getRefPOC( eRefPicList, iPdmRefIdx ) == pcSlice->getPOC()) 748 759 { 760 #if QC_MRG_CANS_B0048 761 abPdmAvailable[ iRefListId+2 ] = true; 762 paiPdmRefIdx [ iRefListId+2 ] = iPdmRefIdx; 763 #else 749 764 abPdmAvailable[ iRefListId ] = true; 750 765 paiPdmRefIdx [ iRefListId ] = iPdmRefIdx; 751 #if QC_MULTI_DIS_CAN 766 #endif 767 #if QC_MULTI_DIS_CAN_A0097 752 768 TComMv cMv = pDInfo->m_acMvCand[0]; 753 769 cMv.setVer(0); … … 756 772 #endif 757 773 pcCU->clipMv( cMv ); 774 #if QC_MRG_CANS_B0048 775 pacPdmMv [ iRefListId + 2] = cMv; 776 #else 758 777 pacPdmMv [ iRefListId ] = cMv; 778 #endif 759 779 break; 760 780 } 761 781 } 762 782 } 783 #if QC_MRG_CANS_B0048 784 iPdmInterDir = ( abPdmAvailable[2] ? 1 : 0 ) + ( abPdmAvailable[3] ? 2 : 0 ) ; 785 iPdm[1] = iPdmInterDir; 786 #else 763 787 iPdmInterDir = ( abPdmAvailable[0] ? 1 : 0 ) + ( abPdmAvailable[1] ? 2 : 0 ) ; 764 788 } 789 #endif 765 790 766 791 return iPdmInterDir; … … 781 806 if( pcCU->getSlice()->getRefPOC( eRefPicList, iPdmRefIdx ) != pcCU->getSlice()->getPOC() ) 782 807 { 783 #if QC_MULTI_DIS_CAN 808 #if QC_MULTI_DIS_CAN_A0097 784 809 if( getDisCanPdmMvPred (pcCU, uiPartIdx, eRefPicList, iPdmRefIdx, cMv, pDInfo, true ) ) 785 810 #else … … 807 832 for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ ) 808 833 { 809 #if QC_MULTI_DIS_CAN 834 #if QC_MULTI_DIS_CAN_A0097 810 835 if ( getDisCanPdmMvPred (pcCU, uiPartIdx, eRefPicList, iPdmRefIdx, cMv, pDInfo, true ) ) 811 836 #else … … 827 852 } 828 853 829 #if QC_MULTI_DIS_CAN 854 #if QC_MULTI_DIS_CAN_A0097 830 855 Bool 831 856 TComDepthMapGenerator::getDisCanPdmMvPred ( TComDataCU* pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge ) 832 857 { 833 #if LGE_DVMCP 858 #if LGE_DVMCP_A0126 834 859 rcMv.m_bDvMcp = false; 835 860 #endif … … 910 935 { 911 936 rcMv.set( cBaseMvField.getHor(), cBaseMvField.getVer() ); 912 #if LGE_DVMCP 937 #if LGE_DVMCP_A0126 913 938 // save disparity vector when a merge candidate for IVMP is set as DV-MCP 914 939 if( bMerge ) … … 1069 1094 1070 1095 1071 #if !QC_MULTI_DIS_CAN 1096 #if !QC_MULTI_DIS_CAN_A0097 1072 1097 /*=======================================================* 1073 1098 *===== =====* -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComDepthMapGenerator.h
r166 r213 136 136 137 137 Void initViewComponent ( TComPic* pcPic ); 138 #if !QC_MULTI_DIS_CAN 138 #if !QC_MULTI_DIS_CAN_A0097 139 139 Bool predictDepthMap ( TComPic* pcPic ); 140 140 Void updateDepthMap ( TComPic* pcPic ); … … 154 154 Int getDisparity ( TComPic* pcPic, Int iPosX, Int iPosY, UInt uiRefViewId ); 155 155 #if HHI_INTER_VIEW_MOTION_PRED 156 #if QC_MULTI_DIS_CAN 157 Int getPdmMergeCandidate ( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo ); 156 #if QC_MULTI_DIS_CAN_A0097 157 Int getPdmMergeCandidate ( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo 158 #if QC_MRG_CANS_B0048 159 , Int* iPdm 160 #endif 161 ); 162 158 163 Bool getPdmMvPredDisCan ( TComDataCU* pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge ); 159 164 Bool getDisCanPdmMvPred ( TComDataCU* pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge ); … … 174 179 private: 175 180 // picture operations 176 #if !QC_MULTI_DIS_CAN 181 #if !QC_MULTI_DIS_CAN_A0097 177 182 Bool xConvertDepthMapCurr2Ref ( TComPic* pcRef, TComPic* pcCur ); 178 183 Bool xConvertDepthMapRef2Curr ( TComPic* pcCur, TComPic* pcRef ); … … 237 242 Bool m_bDecoder; 238 243 TComPrediction* m_pcPrediction; 239 #if VIDYO_VPS_INTEGRATION 244 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 240 245 TComVPSAccess* m_pcVPSAccess; 241 246 #endif -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComMotionInfo.cpp
r56 r213 374 374 } 375 375 #endif 376 377 378 379 #if MTK_UNCONSTRAINED_MVI_B0083 380 Void TComCUMvField::setUndefinedMv( Int iPartAddr, Int iNumPart, Char* pePredMode, UChar* puhInterDir, Int refIdx, Int InterDir 381 #if NTT_FIX_UNCONSTRAINED_MVI 382 , Int iNumRefIdx 383 #endif 384 ) 385 { 386 PredMode predMode = MODE_INTRA; 387 TComMv cMv(0,0); 388 389 for ( Int i = 0; i < iNumPart; i++ ) 390 { 391 predMode = static_cast<PredMode>( pePredMode[ iPartAddr+i ] ); 392 #if NTT_FIX_UNCONSTRAINED_MVI 393 if( predMode==MODE_INTRA || m_piRefIdx[iPartAddr+i] >= iNumRefIdx ) 394 #else 395 if( predMode==MODE_INTRA ) 396 #endif 397 { 398 m_pcMv[iPartAddr+i] = cMv; 399 puhInterDir[iPartAddr+i] = InterDir; 400 m_piRefIdx[iPartAddr+i] = refIdx; 401 } 402 } 403 } 404 #endif 405 376 406 //! \} -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComMotionInfo.h
r100 r213 43 43 #include "CommonDef.h" 44 44 #include "TComMv.h" 45 #if VSP_N 46 #include "TComSlice.h" 47 #endif 45 48 46 49 //! \ingroup TLibCommon … … 59 62 60 63 // ==================================================================================================================== 61 #if QC_MULTI_DIS_CAN 64 #if QC_MULTI_DIS_CAN_A0097 62 65 typedef struct _DisCand 63 66 { … … 94 97 Int getHor () const { return m_acMv.getHor(); } 95 98 Int getVer () const { return m_acMv.getVer(); } 99 #if QC_MRG_CANS_B0048 100 Bool operator== ( const TComMvField& rcMv ) const 101 { 102 return (m_acMv.getHor()==rcMv.getHor() && m_acMv.getVer()==rcMv.getVer() && m_iRefIdx == rcMv.getRefIdx()); 103 } 104 #endif 96 105 }; 97 106 … … 169 178 Void decreaseMvAccuracy( Int iPartAddr, Int iNumPart, Int iShift ); 170 179 #endif 180 181 #if MTK_UNCONSTRAINED_MVI_B0083 182 Void setUndefinedMv( Int iPartAddr, Int iNumPart, Char* pePredMode, UChar* puhInterDir, Int refIdx, Int InterDir 183 #if NTT_FIX_UNCONSTRAINED_MVI 184 , Int iNumRefIdx 185 #endif 186 ); 187 #endif 171 188 }; 172 189 -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComMv.h
r100 r213 57 57 public: 58 58 59 #if LGE_DVMCP 59 #if LGE_DVMCP_A0126 60 60 Bool m_bDvMcp; // is dv-mcp ? 61 61 Int m_iDvMcpDispX; // disparity for dv-mcp … … 69 69 m_iHor(0), 70 70 m_iVer(0) 71 #if LGE_DVMCP 71 #if LGE_DVMCP_A0126 72 72 , m_bDvMcp(false) 73 73 , m_iDvMcpDispX(0) … … 79 79 m_iHor(iHor), 80 80 m_iVer(iVer) 81 #if LGE_DVMCP 81 #if LGE_DVMCP_A0126 82 82 , m_bDvMcp(false) 83 83 , m_iDvMcpDispX(0) -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComPattern.cpp
r100 r213 675 675 { 676 676 Int* piSrc; 677 #if LGE_EDGE_INTRA 677 #if LGE_EDGE_INTRA_A0070 678 678 mapEdgeIntratoDC( uiDirMode ); 679 679 #endif -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComPattern.h
r56 r213 111 111 TComPatternParam m_cPatternCr; 112 112 113 #if LGE_ILLUCOMP_B0045 114 Bool m_bICFlag; 115 #endif 116 113 117 #if LOGI_INTRA_NAME_3MPM 114 118 static const UChar m_aucIntraFilter[5]; … … 124 128 Int getROIYHeight() { return m_cPatternY.m_iROIHeight; } 125 129 Int getPatternLStride() { return m_cPatternY.m_iPatternStride; } 130 131 #if LGE_ILLUCOMP_B0045 132 Bool getICFlag() { return m_bICFlag; } 133 Void setICFlag(Bool bICFlag) { m_bICFlag = bICFlag; } 134 #endif 126 135 127 136 // access functions of ADI buffers -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComPic.cpp
r193 r213 56 56 m_apcPicYuvAvail = NULL; 57 57 m_apcPicYuvSynth = NULL; 58 m_bIsVsp = false; 58 59 #endif 59 60 #if DEPTH_MAP_GENERATION … … 85 86 m_aaiCodedScale = 0; 86 87 m_aaiCodedOffset = 0; 88 #if OL_QTLIMIT_PREDCODING_B0068 89 m_bReduceBitsQTL = 0; 90 #endif 91 #if QC_SIMPLE_NBDV_B0047 92 m_bRapCheck = false; 93 m_eRapRefList = REF_PIC_LIST_0; 94 m_uiRapRefIdx = 0; 95 #endif 96 87 97 } 88 98 … … 484 494 } 485 495 } 496 #if QC_SIMPLE_NBDV_B0047 497 Bool TComPic::getDisCandRefPictures(Int iColPOC) 498 { 499 UInt uiTempLayerCurr=7; 500 TComSlice* currSlice = getCurrSlice(); 501 UInt iPOCCurr=currSlice->getPOC(); 502 UInt iPOCDiff = 255; 503 Bool bRAP=false; 504 Bool bCheck = false; 505 Int MaxRef = currSlice->getNumRefIdx(RefPicList(0)); 506 RefPicList eRefPicList = REF_PIC_LIST_0 ; 507 if(currSlice->isInterB()) 508 { 509 if(currSlice->getNumRefIdx(RefPicList(0))< currSlice->getNumRefIdx(RefPicList(1))) 510 MaxRef = currSlice->getNumRefIdx(RefPicList(1)); 511 } 512 for(Int lpRef = 0; lpRef < MaxRef; lpRef++) 513 { 514 for(Int lpNr = 0; lpNr < (currSlice->isInterB() ? 2: 1); lpNr ++) 515 { 516 eRefPicList = RefPicList(0); 517 if(currSlice->isInterB()) 518 eRefPicList = RefPicList(lpNr==0 ? (currSlice->getColDir()): (1-currSlice->getColDir())); 519 if(iColPOC == currSlice->getRefPOC(eRefPicList, lpRef)) 520 continue; 521 if(lpRef >= currSlice->getNumRefIdx(eRefPicList)||(currSlice->getViewId() != currSlice->getRefPic( eRefPicList, lpRef)->getViewId())) 522 continue; 523 Int iTempPoc = currSlice->getRefPic(eRefPicList, lpRef)->getPOC(); 524 UInt uiTempLayer = currSlice->getRefPic(eRefPicList, lpRef)->getCurrSlice()->getTLayer(); 525 Int iTempDiff = (iTempPoc > iPOCCurr) ? (iTempPoc - iPOCCurr): (iPOCCurr - iTempPoc); 526 #if QC_REM_IDV_B0046 527 TComSlice* refSlice = currSlice->getRefPic(eRefPicList, lpRef)->getCurrSlice(); 528 bRAP = (refSlice->getSPS()->getViewId() && (refSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || refSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA))? 1: 0; 529 #else 530 bRAP = (currSlice->getRefPic(eRefPicList, lpRef)->getCurrSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDV? 1:0); 531 #endif 532 if( bRAP) 533 { 534 bCheck = true; 535 this->setRapRefIdx(lpRef); 536 this->setRapRefList(eRefPicList); 537 return bCheck; 538 } 539 if(uiTempLayerCurr > uiTempLayer) 540 { 541 bCheck = true; 542 if(uiTempLayerCurr == uiTempLayer) 543 { 544 if(iPOCDiff > iTempDiff) 545 { 546 iPOCDiff=iTempDiff; 547 if(iPOCDiff < 255) 548 { 549 this->setRapRefIdx(lpRef); 550 this->setRapRefList(eRefPicList); 551 } 552 } 553 } 554 else 555 { 556 iPOCDiff=iTempDiff; 557 uiTempLayerCurr = uiTempLayer; 558 this->setRapRefIdx(lpRef); 559 this->setRapRefList(eRefPicList); 560 } 561 } 562 } 563 } 564 return bCheck; 565 } 566 #endif 486 567 487 568 #if HHI_INTERVIEW_SKIP -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComPic.h
r193 r213 68 68 TComPicYuv* m_apcPicYuvAvail; // Availability Map - Does the given pixel can be synthesised in receiver 69 69 TComPicYuv* m_apcPicYuvSynth; // Sythesied image 70 Bool m_bIsVsp; 70 71 #endif 71 72 … … 78 79 #endif 79 80 80 #if LG_ZEROINTRADEPTHRESI_ M2603981 #if LG_ZEROINTRADEPTHRESI_A0087 81 82 Int m_uiIntraPeriod; 82 83 #endif … … 84 85 #if HHI_INTER_VIEW_MOTION_PRED 85 86 TComPicYuv* m_pcOrgDepthMap; // original depth map 86 #if QC_MULTI_DIS_CAN 87 #if QC_MULTI_DIS_CAN_A0097 87 88 Bool m_checked; 89 #endif 90 #if QC_SIMPLE_NBDV_B0047 91 UInt m_uiRapRefIdx; 92 RefPicList m_eRapRefList; 93 Bool m_bRapCheck; 88 94 #endif 89 95 #endif … … 112 118 TComPicYuv* m_pcUsedPelsMap; 113 119 #endif 114 #if SONY_COLPIC_AVAILABILITY 120 #if SONY_COLPIC_AVAILABILITY || VSP_N 115 121 Int m_iViewOrderIdx; 116 122 #endif … … 118 124 Int** m_aaiCodedOffset; 119 125 120 #if OL_DEPTHLIMIT_A0044 121 UInt* m_texPartInfo; 122 UInt m_uiTexPartIndex; 126 #if OL_QTLIMIT_PREDCODING_B0068 127 Bool m_bReduceBitsQTL; 123 128 #endif 124 129 … … 141 146 TComSlice* getSlice(Int i) { return m_apcPicSym->getSlice(i); } 142 147 TComSlice* getCurrSlice() { return m_apcPicSym->getSlice(m_uiCurrSliceIdx); } 143 #if VIDYO_VPS_INTEGRATION 148 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 144 149 TComVPS* getVPS() { return m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getVPS(); } 145 150 #endif 146 #if LG_ZEROINTRADEPTHRESI_ M26039151 #if LG_ZEROINTRADEPTHRESI_A0087 147 152 Int getIntraPeriod() { return m_uiIntraPeriod; } 148 153 Void setIntraPeriod(Int uiIntraPeriod) { m_uiIntraPeriod = uiIntraPeriod; } … … 161 166 TComPicYuv* getPicYuvSynth() { return m_apcPicYuvSynth; } 162 167 Void checkSynthesisAvailability( /*TComDataCU*& rpcBestCU, */UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth, Bool *&rpbCUSynthesied); 168 Void setIsVsp( Bool b ) { m_bIsVsp = b; } 169 Bool getIsVsp() { return m_bIsVsp; } 163 170 #endif 164 171 #if HHI_INTERVIEW_SKIP … … 177 184 #if HHI_INTER_VIEW_MOTION_PRED 178 185 TComPicYuv* getOrgDepthMap() { return m_pcOrgDepthMap; } 179 #if QC_MULTI_DIS_CAN 186 #if QC_MULTI_DIS_CAN_A0097 180 187 Void setCandPicCheckedFlag (Bool bchecked) { m_checked = bchecked; } 181 188 Bool getCandPicCheckedFlag () { return m_checked;} … … 186 193 TComPicYuv* getResidual() { return m_pcResidual; } 187 194 #endif 188 189 #if SONY_COLPIC_AVAILABILITY 195 #if QC_SIMPLE_NBDV_B0047 196 UInt getRapRefIdx() {return m_uiRapRefIdx;} 197 RefPicList getRapRefList() {return m_eRapRefList;} 198 Void setRapRefIdx(UInt uiRapRefIdx) {m_uiRapRefIdx = uiRapRefIdx;} 199 Void setRapRefList(RefPicList eRefPicList) {m_eRapRefList = eRefPicList;} 200 Bool getRapbCheck() {return m_bRapCheck;} 201 Void setRapbCheck(Bool bCheck) {m_bRapCheck = bCheck;} 202 Bool getDisCandRefPictures(Int iColPOC); 203 #endif 204 205 #if SONY_COLPIC_AVAILABILITY || VSP_N 190 206 Void setViewOrderIdx(Int i) { m_iViewOrderIdx = i; } 191 207 Int getViewOrderIdx() { return m_iViewOrderIdx; } 192 208 #endif 209 210 #if OL_QTLIMIT_PREDCODING_B0068 211 Bool getReduceBitsFlag () { return m_bReduceBitsQTL; } 212 Void setReduceBitsFlag ( Bool bFlag ) { m_bReduceBitsQTL = bFlag; } 213 #endif 214 193 215 Void setScaleOffset( Int** pS, Int** pO ) { m_aaiCodedScale = pS; m_aaiCodedOffset = pO; } 194 216 Int** getCodedScale () { return m_aaiCodedScale; } … … 261 283 #endif 262 284 263 #if OL_DEPTHLIMIT_A0044264 UInt accessPartInfo ( UInt count ) { return m_texPartInfo[m_uiTexPartIndex + count]; };265 Void incrementTexPartIndex ( ) { m_uiTexPartIndex += 2; };266 UInt getTexPartIndex () { return m_uiTexPartIndex; };267 Void setTexPartIndex ( UInt idx ) { m_uiTexPartIndex = idx; };268 Void setPartInfo ( UInt* texPart) { m_texPartInfo = texPart; };269 #endif270 271 285 Bool getValidSlice (Int sliceID) {return m_pbValidSlice[sliceID];} 272 286 Int getSliceGranularityForNDBFilter () {return m_sliceGranularityForNDBFilter;} -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComPicSym.cpp
r193 r213 127 127 128 128 129 #if FIX_MEM_LEAKS130 129 if( m_apcTComTile ) 131 130 { … … 135 134 } 136 135 } 137 #endif138 136 139 137 delete [] m_apcTComTile; -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComPrediction.cpp
r100 r213 46 46 // ==================================================================================================================== 47 47 48 #if LGE_EDGE_INTRA 48 #if LGE_EDGE_INTRA_A0070 49 49 #define MAX_DISTANCE_EDGEINTRA 255 50 50 #endif … … 423 423 } 424 424 425 #if LGE_EDGE_INTRA 425 #if LGE_EDGE_INTRA_A0070 426 426 Void TComPrediction::predIntraLumaEdge ( TComDataCU* pcCU, TComPattern* pcTComPattern, UInt uiAbsPartIdx, Int iWidth, Int iHeight, Pel* piPred, UInt uiStride, Bool bDelta ) 427 427 { … … 628 628 if ( eRefPicList != REF_PIC_LIST_X ) 629 629 { 630 #if LGE_ILLUCOMP_B0045 631 if( pcCU->getSlice()->getPPS()->getUseWP() && !pcCU->getICFlag(uiPartAddr)) 632 #else 630 633 if( pcCU->getSlice()->getPPS()->getUseWP()) 634 #endif 631 635 { 632 636 #if DEPTH_MAP_GENERATION … … 644 648 #endif 645 649 } 650 #if LGE_ILLUCOMP_B0045 651 if( pcCU->getSlice()->getPPS()->getUseWP() && !pcCU->getICFlag(uiPartAddr) ) 652 #else 646 653 if ( pcCU->getSlice()->getPPS()->getUseWP() ) 654 #endif 647 655 { 648 656 xWeightedPredictionUni( pcCU, pcYuvPred, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx ); … … 689 697 if ( eRefPicList != REF_PIC_LIST_X ) 690 698 { 699 #if LGE_ILLUCOMP_B0045 700 if( pcCU->getSlice()->getPPS()->getUseWP() && !pcCU->getICFlag(uiPartAddr)) 701 #else 691 702 if( pcCU->getSlice()->getPPS()->getUseWP()) 703 #endif 692 704 { 693 705 #if DEPTH_MAP_GENERATION … … 710 722 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, false ); 711 723 #endif 724 #if LGE_ILLUCOMP_B0045 725 if( pcCU->getSlice()->getPPS()->getUseWP() && !pcCU->getICFlag(uiPartAddr)) 726 #else 712 727 if ( pcCU->getSlice()->getPPS()->getUseWP() ) 728 #endif 713 729 { 714 730 xWeightedPredictionUni( pcCU, pcYuvPred, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx ); … … 779 795 { 780 796 #endif 797 #if LGE_ILLUCOMP_B0045 798 #if VSP_AIC 799 Bool bICFlag = pcCU->getICFlag(uiPartAddr) && (pcCU->getSlice()->getRefPOC( eRefPicList, iRefIdx ) == pcCU->getSlice()->getPOC()); 800 #else 801 Bool bICFlag = pcCU->getICFlag(uiPartAddr) && (pcCU->getSlice()->getRefViewId( eRefPicList, iRefIdx ) != pcCU->getSlice()->getViewId()); 802 #endif 803 804 xPredInterLumaBlk ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi, bICFlag); 805 #else 781 806 xPredInterLumaBlk ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi ); 807 #endif 782 808 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC 783 809 } 784 810 #endif 811 #if LGE_ILLUCOMP_B0045 812 #if VSP_AIC 813 Bool bICFlag = pcCU->getICFlag(uiPartAddr) && (pcCU->getSlice()->getRefPOC( eRefPicList, iRefIdx ) == pcCU->getSlice()->getPOC()); 814 #else 815 Bool bICFlag = pcCU->getICFlag(uiPartAddr) && (pcCU->getSlice()->getRefViewId( eRefPicList, iRefIdx ) != pcCU->getSlice()->getViewId()); 816 #endif 817 818 xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi, bICFlag ); 819 #else 785 820 xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi ); 821 #endif 786 822 } 787 823 … … 896 932 } 897 933 #endif 934 #if !QC_MVHEVC_B0046 898 935 Int ixFrac = iHor & 0x3; 899 936 Int iyFrac = iVer & 0x3; 937 #endif 900 938 Int iRefOffset = ( iHor >> 2 ) + ( iVer >> 2 ) * iRefStride; 901 939 #endif … … 926 964 * \param bi Flag indicating whether bipred is used 927 965 */ 966 #if LGE_ILLUCOMP_B0045 967 Void TComPrediction::xPredInterLumaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi, Bool bICFlag) 968 #else 928 969 Void TComPrediction::xPredInterLumaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi ) 970 #endif 929 971 { 930 972 Int refStride = refPic->getStride(); … … 961 1003 m_if.filterVerLuma(tmp + (halfFilterSize-1)*tmpStride, tmpStride, dst, dstStride, width, height, yFrac, false, !bi); 962 1004 } 1005 1006 #if LGE_ILLUCOMP_B0045 1007 if(bICFlag) 1008 { 1009 Int a, b, iShift, i, j; 1010 1011 xGetLLSICPrediction(cu, mv, refPic, a, b, iShift); 1012 1013 for (i = 0; i < height; i++) 1014 { 1015 for (j = 0; j < width; j++) 1016 { 1017 if(bi) 1018 { 1019 Int iIFshift = IF_INTERNAL_PREC - ( g_uiBitDepth + g_uiBitIncrement ); 1020 dst[j] = ( (a*dst[j]+a*IF_INTERNAL_OFFS) >> iShift ) + b*(1<<iIFshift) - IF_INTERNAL_OFFS; 1021 } 1022 else 1023 dst[j] = Clip( ( (a*dst[j]) >> iShift ) + b ); 1024 } 1025 dst += dstStride; 1026 } 1027 } 1028 #endif 963 1029 } 964 1030 … … 975 1041 * \param bi Flag indicating whether bipred is used 976 1042 */ 1043 #if LGE_ILLUCOMP_B0045 1044 Void TComPrediction::xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi, Bool bICFlag ) 1045 #else 977 1046 Void TComPrediction::xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi ) 1047 #endif 978 1048 { 979 1049 Int refStride = refPic->getCStride(); … … 1018 1088 m_if.filterVerChroma(extY + (halfFilterSize-1)*extStride, extStride, dstCr, dstStride, cxWidth, cxHeight , yFrac, false, !bi); 1019 1089 } 1090 #if LGE_ILLUCOMP_B0045 1091 if(bICFlag) 1092 { 1093 Int a, b, iShift, i, j; 1094 xGetLLSICPredictionChroma(cu, mv, refPic, a, b, iShift, 0); // Cb 1095 for (i = 0; i < cxHeight; i++) 1096 { 1097 for (j = 0; j < cxWidth; j++) 1098 { 1099 if(bi) 1100 { 1101 Int iIFshift = IF_INTERNAL_PREC - ( g_uiBitDepth + g_uiBitIncrement ); 1102 dstCb[j] = ( (a*dstCb[j]+a*IF_INTERNAL_OFFS) >> iShift ) + b*(1<<iIFshift) - IF_INTERNAL_OFFS; 1103 } 1104 else 1105 dstCb[j] = Clip3(0, 255, ((a*dstCb[j])>>iShift)+b); 1106 } 1107 dstCb += dstStride; 1108 } 1109 1110 xGetLLSICPredictionChroma(cu, mv, refPic, a, b, iShift, 1); // Cr 1111 for (i = 0; i < cxHeight; i++) 1112 { 1113 for (j = 0; j < cxWidth; j++) 1114 { 1115 if(bi) 1116 { 1117 Int iIFshift = IF_INTERNAL_PREC - ( g_uiBitDepth + g_uiBitIncrement ); 1118 dstCr[j] = ( (a*dstCr[j]+a*IF_INTERNAL_OFFS) >> iShift ) + b*(1<<iIFshift) - IF_INTERNAL_OFFS; 1119 } 1120 else 1121 dstCr[j] = Clip3(0, 255, ((a*dstCr[j])>>iShift)+b); 1122 } 1123 dstCr += dstStride; 1124 } 1125 } 1126 #endif 1020 1127 } 1021 1128 … … 1443 1550 } 1444 1551 1552 1553 #if LGE_ILLUCOMP_B0045 1554 /** Function for deriving LM illumination compensation. 1555 */ 1556 Void TComPrediction::xGetLLSICPrediction(TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, Int &iShift) 1557 { 1558 TComPicYuv *pRecPic = pcCU->getPic()->getPicYuvRec(); 1559 Pel *pRec, *pRef; 1560 UInt uiWidth, uiHeight, uiTmpPartIdx; 1561 Int iRecStride = pRecPic->getStride(), iRefStride = pRefPic->getStride(); 1562 Int iCUPelX, iCUPelY, iRefX, iRefY, iRefOffset; 1563 1564 iCUPelX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]]; 1565 iCUPelY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]]; 1566 iRefX = iCUPelX + (pMv->getHor() >> 2); 1567 iRefY = iCUPelY + (pMv->getVer() >> 2); 1568 uiWidth = pcCU->getWidth(0); 1569 uiHeight = pcCU->getHeight(0); 1570 1571 Int i, j, iCountShift = 0; 1572 1573 // LLS parameters estimation --> 1574 1575 Int x = 0, y = 0, xx = 0, xy = 0; 1576 1577 if(pcCU->getPUAbove(uiTmpPartIdx, pcCU->getZorderIdxInCU()) && iCUPelY > 0 && iRefY > 0) 1578 { 1579 iRefOffset = ( pMv->getHor() >> 2 ) + ( pMv->getVer() >> 2 ) * iRefStride - iRefStride; 1580 pRef = pRefPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 1581 pRec = pRecPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - iRecStride; 1582 1583 for( j = 0; j < uiWidth; j++ ) 1584 { 1585 x += pRef[j]; 1586 y += pRec[j]; 1587 xx += pRef[j] * pRef[j]; 1588 xy += pRef[j] * pRec[j]; 1589 } 1590 iCountShift += g_aucConvertToBit[ uiWidth ] + 2; 1591 } 1592 1593 1594 if(pcCU->getPULeft(uiTmpPartIdx, pcCU->getZorderIdxInCU()) && iCUPelX > 0 && iRefX > 0) 1595 { 1596 iRefOffset = ( pMv->getHor() >> 2 ) + ( pMv->getVer() >> 2 ) * iRefStride - 1; 1597 pRef = pRefPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 1598 pRec = pRecPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - 1; 1599 1600 for( i = 0; i < uiHeight; i++ ) 1601 { 1602 x += pRef[0]; 1603 y += pRec[0]; 1604 xx += pRef[0] * pRef[0]; 1605 xy += pRef[0] * pRec[0]; 1606 1607 pRef += iRefStride; 1608 pRec += iRecStride; 1609 } 1610 iCountShift += iCountShift > 0 ? 1 : ( g_aucConvertToBit[ uiWidth ] + 2 ); 1611 } 1612 1613 Int iTempShift = ( g_uiBitDepth + g_uiBitIncrement ) + g_aucConvertToBit[ uiWidth ] + 3 - 15; 1614 1615 if(iTempShift > 0) 1616 { 1617 x = ( x + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift; 1618 y = ( y + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift; 1619 xx = ( xx + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift; 1620 xy = ( xy + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift; 1621 iCountShift -= iTempShift; 1622 } 1623 1624 iShift = 13; 1625 1626 if( iCountShift == 0 ) 1627 { 1628 a = 1; 1629 b = 0; 1630 iShift = 0; 1631 } 1632 else 1633 { 1634 Int a1 = ( xy << iCountShift ) - y * x; 1635 Int a2 = ( xx << iCountShift ) - x * x; 1636 1637 { 1638 const Int iShiftA2 = 6; 1639 const Int iShiftA1 = 15; 1640 const Int iAccuracyShift = 15; 1641 1642 Int iScaleShiftA2 = 0; 1643 Int iScaleShiftA1 = 0; 1644 Int a1s = a1; 1645 Int a2s = a2; 1646 1647 iScaleShiftA1 = GetMSB( abs( a1 ) ) - iShiftA1; 1648 iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2; 1649 1650 if( iScaleShiftA1 < 0 ) 1651 { 1652 iScaleShiftA1 = 0; 1653 } 1654 1655 if( iScaleShiftA2 < 0 ) 1656 { 1657 iScaleShiftA2 = 0; 1658 } 1659 1660 Int iScaleShiftA = iScaleShiftA2 + iAccuracyShift - iShift - iScaleShiftA1; 1661 1662 a2s = a2 >> iScaleShiftA2; 1663 1664 a1s = a1 >> iScaleShiftA1; 1665 1666 if (a2s >= 1) 1667 { 1668 a = a1s * m_uiaShift[ a2s - 1]; 1669 } 1670 else 1671 { 1672 a = 0; 1673 } 1674 1675 if( iScaleShiftA < 0 ) 1676 { 1677 a = a << -iScaleShiftA; 1678 } 1679 else 1680 { 1681 a = a >> iScaleShiftA; 1682 } 1683 1684 a = Clip3(-( 1 << 15 ), ( 1 << 15 ) - 1, a); 1685 1686 Int minA = -(1 << (6)); 1687 Int maxA = (1 << 6) - 1; 1688 if( a <= maxA && a >= minA ) 1689 { 1690 // do nothing 1691 } 1692 else 1693 { 1694 Short n = CountLeadingZerosOnes(a); 1695 a = a >> (9-n); 1696 iShift -= (9-n); 1697 } 1698 1699 b = ( y - ( ( a * x ) >> iShift ) + ( 1 << ( iCountShift - 1 ) ) ) >> iCountShift; 1700 } 1701 } 1702 } 1703 1704 Void TComPrediction::xGetLLSICPredictionChroma(TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, Int &iShift, Int iChromaId) 1705 { 1706 TComPicYuv *pRecPic = pcCU->getPic()->getPicYuvRec(); 1707 Pel *pRec = NULL, *pRef = NULL; 1708 UInt uiWidth, uiHeight, uiTmpPartIdx; 1709 Int iRecStride = pRecPic->getCStride(), iRefStride = pRefPic->getCStride(); 1710 Int iCUPelX, iCUPelY, iRefX, iRefY, iRefOffset; 1711 1712 iCUPelX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]]; 1713 iCUPelY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]]; 1714 iRefX = iCUPelX + (pMv->getHor() >> 3); 1715 iRefY = iCUPelY + (pMv->getVer() >> 3); 1716 uiWidth = pcCU->getWidth(0) >> 1; 1717 uiHeight = pcCU->getHeight(0) >> 1; 1718 1719 Int i, j, iCountShift = 0; 1720 1721 // LLS parameters estimation --> 1722 1723 Int x = 0, y = 0, xx = 0, xy = 0; 1724 1725 if(pcCU->getPUAbove(uiTmpPartIdx, pcCU->getZorderIdxInCU()) && iCUPelY > 0 && iRefY > 0) 1726 { 1727 iRefOffset = ( pMv->getHor() >> 3 ) + ( pMv->getVer() >> 3 ) * iRefStride - iRefStride; 1728 if (iChromaId == 0) // Cb 1729 { 1730 pRef = pRefPic->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 1731 pRec = pRecPic->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - iRecStride; 1732 } 1733 else if (iChromaId == 1) // Cr 1734 { 1735 pRef = pRefPic->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 1736 pRec = pRecPic->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - iRecStride; 1737 } 1738 1739 for( j = 0; j < uiWidth; j++ ) 1740 { 1741 x += pRef[j]; 1742 y += pRec[j]; 1743 xx += pRef[j] * pRef[j]; 1744 xy += pRef[j] * pRec[j]; 1745 } 1746 iCountShift += g_aucConvertToBit[ uiWidth ] + 2; 1747 } 1748 1749 1750 if(pcCU->getPULeft(uiTmpPartIdx, pcCU->getZorderIdxInCU()) && iCUPelX > 0 && iRefX > 0) 1751 { 1752 iRefOffset = ( pMv->getHor() >> 3 ) + ( pMv->getVer() >> 3 ) * iRefStride - 1; 1753 if (iChromaId == 0) // Cb 1754 { 1755 pRef = pRefPic->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 1756 pRec = pRecPic->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - 1; 1757 } 1758 else if (iChromaId == 1) // Cr 1759 { 1760 pRef = pRefPic->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 1761 pRec = pRecPic->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - 1; 1762 } 1763 1764 for( i = 0; i < uiHeight; i++ ) 1765 { 1766 x += pRef[0]; 1767 y += pRec[0]; 1768 xx += pRef[0] * pRef[0]; 1769 xy += pRef[0] * pRec[0]; 1770 1771 pRef += iRefStride; 1772 pRec += iRecStride; 1773 } 1774 iCountShift += iCountShift > 0 ? 1 : ( g_aucConvertToBit[ uiWidth ] + 2 ); 1775 } 1776 1777 Int iTempShift = ( g_uiBitDepth + g_uiBitIncrement ) + g_aucConvertToBit[ uiWidth ] + 3 - 15; 1778 1779 if(iTempShift > 0) 1780 { 1781 x = ( x + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift; 1782 y = ( y + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift; 1783 xx = ( xx + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift; 1784 xy = ( xy + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift; 1785 iCountShift -= iTempShift; 1786 } 1787 1788 iShift = 13; 1789 1790 if( iCountShift == 0 ) 1791 { 1792 a = 1; 1793 b = 0; 1794 iShift = 0; 1795 } 1796 else 1797 { 1798 Int a1 = ( xy << iCountShift ) - y * x; 1799 Int a2 = ( xx << iCountShift ) - x * x; 1800 1801 { 1802 const Int iShiftA2 = 6; 1803 const Int iShiftA1 = 15; 1804 const Int iAccuracyShift = 15; 1805 1806 Int iScaleShiftA2 = 0; 1807 Int iScaleShiftA1 = 0; 1808 Int a1s = a1; 1809 Int a2s = a2; 1810 1811 iScaleShiftA1 = GetMSB( abs( a1 ) ) - iShiftA1; 1812 iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2; 1813 1814 if( iScaleShiftA1 < 0 ) 1815 { 1816 iScaleShiftA1 = 0; 1817 } 1818 1819 if( iScaleShiftA2 < 0 ) 1820 { 1821 iScaleShiftA2 = 0; 1822 } 1823 1824 Int iScaleShiftA = iScaleShiftA2 + iAccuracyShift - iShift - iScaleShiftA1; 1825 1826 a2s = a2 >> iScaleShiftA2; 1827 1828 a1s = a1 >> iScaleShiftA1; 1829 1830 if (a2s >= 1) 1831 { 1832 a = a1s * m_uiaShift[ a2s - 1]; 1833 } 1834 else 1835 { 1836 a = 0; 1837 } 1838 1839 if( iScaleShiftA < 0 ) 1840 { 1841 a = a << -iScaleShiftA; 1842 } 1843 else 1844 { 1845 a = a >> iScaleShiftA; 1846 } 1847 1848 a = Clip3(-( 1 << 15 ), ( 1 << 15 ) - 1, a); 1849 1850 Int minA = -(1 << (6)); 1851 Int maxA = (1 << 6) - 1; 1852 if( a <= maxA && a >= minA ) 1853 { 1854 // do nothing 1855 } 1856 else 1857 { 1858 Short n = CountLeadingZerosOnes(a); 1859 a = a >> (9-n); 1860 iShift -= (9-n); 1861 } 1862 1863 b = ( y - ( ( a * x ) >> iShift ) + ( 1 << ( iCountShift - 1 ) ) ) >> iCountShift; 1864 } 1865 } 1866 }