Changeset 443 in 3DVCSoftware for trunk/source/Lib/TLibCommon
- Timestamp:
- 26 May 2013, 15:41:34 (12 years ago)
- Location:
- trunk/source/Lib/TLibCommon
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibCommon/CommonDef.h
r333 r443 58 58 59 59 #define HM_VERSION "6.1" 60 #define NV_VERSION " 6.2" ///< Current software version60 #define NV_VERSION "7.0" ///< Current software version 61 61 62 62 // ==================================================================================================================== -
trunk/source/Lib/TLibCommon/ContextTables.h
r332 r443 101 101 #define NUM_ALF_SVLC_CTX 3 ///< number of context models for ALF SVLC (filter coeff.) 102 102 103 #if LGE_SAO_MIGRATION_D0091 104 #define NUM_SAO_MERGE_FLAG_CTX 1 ///< number of context models for SAO merge flags 105 #define NUM_SAO_TYPE_IDX_CTX 1 ///< number of context models for SAO type index 106 #else 103 107 #define NUM_SAO_FLAG_CTX 1 ///< number of context models for SAO flag 104 108 #define NUM_SAO_UVLC_CTX 2 ///< number of context models for SAO UVLC … … 108 112 #define NUM_SAO_MERGE_UP_FLAG_CTX 1 ///< number of context models for AO SVLC (filter coeff.) 109 113 #define NUM_SAO_TYPE_IDX_CTX 2 ///< number of context models for AO SVLC (filter coeff.) 114 #endif 110 115 #define CNU 154 ///< dummy initialization value for unused context models 'Context model Not Used' 111 116 … … 128 133 129 134 #if RWTH_SDC_DLT_B0036 135 #if PKU_QC_DEPTH_INTRA_UNI_D0195 136 #define DEPTH_MODE_NUM_FLAG_CTX 8 137 #define DMM_DELTA_NUM_FLAG_CTX 1 138 #else 130 139 #define SDC_NUM_FLAG_CTX 3 140 #endif 131 141 #define SDC_NUM_RESIDUAL_FLAG_CTX 1 142 #if !RWTH_SDC_CTX_SIMPL_D0032 132 143 #define SDC_NUM_SIGN_FLAG_CTX 1 144 #endif 145 #if LGE_CONCATENATE_D0141 146 #define SDC_NUM_RESIDUAL_CTX 1 147 #else 148 #if RWTH_SDC_CTX_SIMPL_D0032 149 #define SDC_NUM_RESIDUAL_CTX 8 150 #else 133 151 #define SDC_NUM_RESIDUAL_CTX 10 152 #endif 153 #endif 134 154 135 155 #define SDC_NUM_PRED_MODE_CTX 5 … … 376 396 { 141, 154, 159, }, 377 397 }; 378 398 #if LGE_SAO_MIGRATION_D0091 399 static const UChar 400 INIT_SAO_MERGE_FLAG[3][NUM_SAO_MERGE_FLAG_CTX] = 401 { 402 { 153, }, 403 { 153, }, 404 { 153, }, 405 }; 406 407 static const UChar 408 INIT_SAO_TYPE_IDX[3][NUM_SAO_TYPE_IDX_CTX] = 409 { 410 { 200, }, 411 { 185, }, 412 { 160, }, 413 }; 414 #else 379 415 static const UChar 380 416 INIT_SAO_FLAG[3][NUM_SAO_FLAG_CTX] = … … 424 460 { 200, 140, }, 425 461 }; 462 #endif 426 463 427 464 static const UChar … … 487 524 #endif 488 525 }; 526 #if QC_ARP_D0177 527 #define NUM_ARPW_CTX 4 ///< number of context models for generalized residual prediction weighting factor 528 static const UChar 529 INIT_ARPW[3][NUM_ARPW_CTX] = 530 { 531 { 154 , 154 , 154 , 154 }, 532 { 154 , 154 , 154 , 154 }, 533 { 154 , 154 , 154 , 154 }, 534 }; 535 #endif 489 536 490 537 #if LGE_EDGE_INTRA_A0070 … … 523 570 524 571 #if RWTH_SDC_DLT_B0036 572 #if PKU_QC_DEPTH_INTRA_UNI_D0195 573 static const UChar INIT_DEPTHMODE_FLAG[3][DEPTH_MODE_NUM_FLAG_CTX]= 574 { 575 {0, 0, 64, 0, CNU, 0, CNU, 0}, 576 {0, 64, 0, CNU, 0, CNU, 0, 0}, 577 {64, 0, CNU, 0, CNU, 0, 0, 0} 578 }; 579 static const UChar INIT_DMMDELTA_FLAG[3][DMM_DELTA_NUM_FLAG_CTX]= 580 { 581 {0}, 582 {0}, 583 {64} 584 }; 585 #else 525 586 static const Short INIT_SDC_FLAG[3][SDC_NUM_FLAG_CTX][2] = 526 587 { … … 535 596 } 536 597 }; 537 598 #endif 599 600 #if RWTH_SDC_CTX_SIMPL_D0032 601 static const UChar INIT_SDC_RESIDUAL_FLAG[3][SDC_NUM_RESIDUAL_FLAG_CTX] = 602 { 603 { 604 CNU 605 606 }, 607 { 608 CNU 609 }, 610 { 611 CNU 612 } 613 }; 614 615 #if LGE_CONCATENATE_D0141 616 static const UChar INIT_SDC_RESIDUAL[3][SDC_NUM_RESIDUAL_CTX] = 617 { 618 { 619 155 620 }, 621 { 622 155 623 }, 624 { 625 155 626 } 627 }; 628 #else 629 static const UChar INIT_SDC_RESIDUAL[3][SDC_NUM_RESIDUAL_CTX] = 630 { 631 { 632 CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU 633 }, 634 { 635 CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU 636 }, 637 { 638 CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU 639 } 640 }; 641 #endif 642 643 static const UChar INIT_SDC_PRED_MODE[3][3*SDC_NUM_PRED_MODE_CTX] = 644 { 645 { 646 CNU, CNU 647 ,CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU 648 }, 649 { 650 CNU, CNU 651 ,CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU 652 }, 653 { 654 CNU, CNU 655 ,CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU 656 } 657 }; 658 #else 538 659 static const Short INIT_SDC_RESIDUAL_FLAG[3][3*SDC_NUM_RESIDUAL_FLAG_CTX][2] = 539 660 { … … 613 734 }; 614 735 #endif 736 #endif 615 737 616 738 //! \} -
trunk/source/Lib/TLibCommon/TComDataCU.cpp
r332 r443 53 53 #if MERL_VSP_C0152 54 54 55 #if MTK_D0156 56 #define CHECK_ADD_YET(pcCURef,uiIdx,vspIdx) && ( (!m_pcSlice->getSPS()->getUseVSPCompensation()) || (!( (pcCURef)->getVSPIndex(uiIdx) == vspIdx && bVspMvZeroDone[vspIdx-1] ))) 57 #else 55 58 #define CHECK_ADD_YET(pcCURef,uiIdx,vspIdx) && !( (pcCURef)->getVSPIndex(uiIdx) == vspIdx && bVspMvZeroDone[vspIdx-1] ) 56 57 inline Void TComDataCU::xInheritVspMode( TComDataCU* pcCURef, UInt uiIdx, Bool* bVspMvZeroDone, Int iCount, Int* iVSPIndexTrue, TComMvField* pcMvFieldNeighbours, DisInfo* pDInfo ) 58 { 59 #endif 60 61 inline Void TComDataCU::xInheritVspMode( TComDataCU* pcCURef, UInt uiIdx, Bool* bVspMvZeroDone, Int iCount, Int* iVSPIndexTrue, TComMvField* pcMvFieldNeighbours, DisInfo* pDInfo 62 #if QC_BVSP_CleanUP_D0191 63 , UChar *puhInterDirNeighbours 64 #endif 65 #if MERL_VSP_NBDV_RefVId_Fix_D0166 66 , Int* iVSPDirTrue 67 #endif 68 ) 69 { 70 #if MTK_D0156 71 if( !m_pcSlice->getSPS()->getUseVSPCompensation() ) 72 { 73 return; 74 } 75 #endif 76 59 77 Int vspIdx = (Int) pcCURef->getVSPIndex(uiIdx); 60 78 if( vspIdx != 0 ) … … 69 87 if (vspIdx < 4) 70 88 { 89 #if QC_BVSP_CleanUP_D0191 90 puhInterDirNeighbours[ iCount] = 1; 91 #endif 92 #if MERL_VSP_NBDV_RefVId_Fix_D0166 93 if(pDInfo->iN > 0 ) 94 { // using derived disparity and store corresponding used reference list and ref idx 95 iVSPDirTrue[idx] = pDInfo->m_aListIdx[0]; 96 assert(pDInfo->m_aRefIdx[0] < 0); 97 #if MTK_VSP_USING_NBDV_D0105 98 pcMvFieldNeighbours[iCount<<1].setMvField( pDInfo->m_acMvCandNoRef[0], pDInfo->m_aRefIdx[0] ); 99 #else 100 pcMvFieldNeighbours[iCount<<1].setMvField( pDInfo->m_acMvCand[0], pDInfo->m_aRefIdx[0] ); 101 #endif 102 if ( pcCURef->getSlice()->isInterB() ) 103 { 104 #if MTK_VSP_USING_NBDV_D0105 105 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCandNoRef[0], pDInfo->m_aRefIdx[0] ); 106 #else 107 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCand[0], pDInfo->m_aRefIdx[0] ); 108 #endif 109 } 110 } 111 else 112 { // using the original neighboring block vsp reference list 113 TComMv cMvPred = pcCURef->getCUMvField(REF_PIC_LIST_0)->getMv(uiIdx); 114 Int refId = pcCURef->getCUMvField(REF_PIC_LIST_0)->getRefIdx(uiIdx); 115 116 assert(refId < 0); 117 iVSPDirTrue[idx] = pcCURef->getVSPDir(uiIdx); 118 pcMvFieldNeighbours[iCount<<1].setMvField( cMvPred, refId ); 119 if ( pcCURef->getSlice()->isInterB() ) 120 { 121 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cMvPred, refId ); 122 } 123 } 124 125 #else // !MERL_VSP_NBDV_RefVId_Fix_D0166 126 127 #if MTK_VSP_USING_NBDV_D0105 128 pcMvFieldNeighbours[ iCount<<1].setMvField ( pDInfo->m_acMvCandNoRef[0], NOT_VALID ); 129 #else 71 130 pcMvFieldNeighbours[ iCount<<1].setMvField ( pDInfo->m_acMvCand[0], NOT_VALID ); 131 #endif 72 132 if ( pcCURef->getSlice()->isInterB() ) 73 133 { 134 #if MTK_VSP_USING_NBDV_D0105 135 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField ( pDInfo->m_acMvCandNoRef[0], NOT_VALID ); 136 #else 74 137 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField ( pDInfo->m_acMvCand[0], NOT_VALID ); 75 } 76 } 77 } 78 } 79 80 inline Bool TComDataCU::xAddVspMergeCand( UChar ucVspMergePos, Int vspIdx, Bool* bVspMvZeroDone, UInt uiDepth, Bool* abCandIsInter, Int& iCount, 81 UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, Int* iVSPIndexTrue, Int mrgCandIdx, DisInfo* pDInfo ) 82 { 138 #endif 139 } 140 #endif 141 } 142 } 143 } 144 145 inline Bool TComDataCU::xAddVspMergeCand( 146 UChar ucVspMergePos, 147 #if !LGE_VSP_INHERIT_D0092 148 Int vspIdx, 149 Bool* bVspMvZeroDone, 150 #endif 151 UInt uiDepth, 152 Bool* abCandIsInter, 153 Int& iCount, 154 UChar* puhInterDirNeighbours, 155 TComMvField* pcMvFieldNeighbours, 156 Int* iVSPIndexTrue, 157 Int mrgCandIdx, 158 DisInfo* pDInfo 159 #if MERL_VSP_NBDV_RefVId_Fix_D0166 160 , Int* iVspDirTrue 161 #endif 162 ) 163 { 164 #if MTK_D0156 165 if( !m_pcSlice->getSPS()->getUseVSPCompensation() ) 166 { 167 return true; 168 } 169 #endif 170 171 #if MTK_LGE_VSP_DEPTH_OFF_D0105_D0139 172 if (getSlice()->getSPS()->isDepth()) 173 { 174 return true; 175 } 176 #endif 177 83 178 #if MERL_VSP_C0152_BugFix_ForNoDepthCase 84 179 TComPic* pRefPicBaseDepth = NULL; 85 180 pRefPicBaseDepth = getSlice()->getRefPicBaseDepth(); 86 if(ucVspMergePos == VSP_MERGE_POS && pRefPicBaseDepth) // VSP can be used only when depth is used as input181 if(ucVspMergePos == VSP_MERGE_POS && pRefPicBaseDepth) // VSP can be used only when depth is used as input 87 182 #else 88 183 if( ucVspMergePos == VSP_MERGE_POS ) … … 90 185 if( ucVspMergePos == VSP_MERGE_POS ) 91 186 { 187 #if !LGE_VSP_INHERIT_D0092 92 188 Int idx = vspIdx - 1; 93 { 189 #endif 190 { 191 #if LGE_VSP_INHERIT_D0092 192 if( getSlice()->getSPS()->getViewId() != 0 ) 193 #else 94 194 if( getSlice()->getSPS()->getViewId() != 0 && bVspMvZeroDone[idx] == false ) 195 #endif 95 196 { 96 197 { 97 198 abCandIsInter [iCount] = true; 199 #if !LGE_VSP_INHERIT_D0092 98 200 bVspMvZeroDone[idx] = true; 201 #endif 99 202 100 203 // get Inter Dir … … 102 205 (getSlice()->getNumRefIdx(REF_PIC_LIST_0) > 0 ? 1 : 2)); 103 206 puhInterDirNeighbours[iCount] = iInterDir; // The direction information does not matter 207 #if QC_BVSP_CleanUP_D0191 208 puhInterDirNeighbours[iCount] = 1; 209 #endif 210 #if LGE_VSP_INHERIT_D0092 211 #if MERL_VSP_NBDV_RefVId_Fix_D0166 212 assert(pDInfo->m_aRefIdx[0] < 0); 213 iVspDirTrue[0] = pDInfo->m_aListIdx[0]; 214 Int iRefIdxList0 = NOT_VALID; 215 Int iRefIdxList1 = NOT_VALID; 216 iRefIdxList0 = getSlice()->getRefPic(REF_PIC_LIST_0, 0)->getPOC()==getSlice()->getPOC() ? 0 : (getSlice()->getNewRefIdx(REF_PIC_LIST_0)==-1 ? NOT_VALID : getSlice()->getNewRefIdx(REF_PIC_LIST_0)); 217 if ( getSlice()->isInterB() ) 218 { 219 iRefIdxList1 = getSlice()->getRefPic(REF_PIC_LIST_1, 0)->getPOC()==getSlice()->getPOC() ? 0 : (getSlice()->getNewRefIdx(REF_PIC_LIST_1)==-1 ? NOT_VALID : getSlice()->getNewRefIdx(REF_PIC_LIST_1)); 220 } 221 222 #if MTK_VSP_USING_NBDV_D0105 223 //pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCandNoRef[0], pDInfo->m_aListIdx[0]==REF_PIC_LIST_0 ? iRefIdxList0 :NOT_VALID ); 224 pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCandNoRef[0], iRefIdxList0 ); 225 #else 226 pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCand[0], iRefIdxList0 ); 227 #endif 228 if ( getSlice()->isInterB() ) 229 { 230 #if MTK_VSP_USING_NBDV_D0105 231 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCandNoRef[0], iRefIdxList1 ); 232 //pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCandNoRef[0], iRefIdxList1); 233 #else 234 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCand[0], iRefIdxList1); 235 #endif 236 } 237 iVSPIndexTrue[iCount] = 1; 238 #else 239 240 #if !MERL_General_Fix 241 Int iRefIdxList0 = NOT_VALID; 242 Int iRefIdxList1 = NOT_VALID; 243 iRefIdxList0 = getSlice()->getRefPic(REF_PIC_LIST_0, 0)->getPOC()==getSlice()->getPOC() ? 0 : (getSlice()->getNewRefIdx(REF_PIC_LIST_0)==-1 ? NOT_VALID : getSlice()->getNewRefIdx(REF_PIC_LIST_0)); 244 if ( getSlice()->isInterB() ) 245 { 246 iRefIdxList1 = getSlice()->getRefPic(REF_PIC_LIST_1, 0)->getPOC()==getSlice()->getPOC() ? 0 : (getSlice()->getNewRefIdx(REF_PIC_LIST_1)==-1 ? NOT_VALID : getSlice()->getNewRefIdx(REF_PIC_LIST_1)); 247 } 248 #if MTK_VSP_USING_NBDV_D0105 249 pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCandNoRef[0], iRefIdxList0 ); 250 #else 251 pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCand[0], iRefIdxList0 ); 252 #endif 253 if ( getSlice()->isInterB() ) 254 { 255 #if MTK_VSP_USING_NBDV_D0105 256 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCandNoRef[0], iRefIdxList1 ); 257 #else 258 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCand[0], iRefIdxList1); 259 #endif 260 } 261 iVSPIndexTrue[iCount] = 1; 262 #else 263 Int iRefIdx = NOT_VALID; 264 265 #if QC_BVSP_CleanUP_D0191 266 iRefIdx = getSlice()->getRefPic(REF_PIC_LIST_0, 0)->getPOC()==getSlice()->getPOC() ? 0: getSlice()->getNewRefIdx(REF_PIC_LIST_0); 267 #endif 268 #if MTK_VSP_USING_NBDV_D0105 269 pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCandNoRef[0], iRefIdx ); 270 #else 271 pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCand[0], iRefIdx ); 272 #endif 273 if ( getSlice()->isInterB() ) 274 { 275 #if MTK_VSP_USING_NBDV_D0105 276 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCandNoRef[0], iRefIdx ); 277 #else 278 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCand[0], iRefIdx ); 279 #endif 280 } 281 iVSPIndexTrue[iCount] = 1; 282 #endif 283 #endif 284 #else 104 285 // get Mv using checked disparity vector 105 286 if (vspIdx < 4) // spatial 106 287 { 107 pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCand[0], NOT_VALID ); 288 #if MERL_VSP_NBDV_RefVId_Fix_D0166 289 assert(pDInfo->m_aRefIdx[0] < 0); 290 iVspDirTrue[idx] = pDInfo->m_aListIdx[0]; 291 292 #if MTK_VSP_USING_NBDV_D0105 293 pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCandNoRef[0], pDInfo->m_aRefIdx[0] ); 294 #else 295 pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCand[0], pDInfo->m_aRefIdx[0] ); 296 #endif 108 297 if ( getSlice()->isInterB() ) 109 298 { 299 #if MTK_VSP_USING_NBDV_D0105 300 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCandNoRef[0], pDInfo->m_aRefIdx[0] ); 301 #else 302 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCand[0], pDInfo->m_aRefIdx[0] ); 303 #endif 304 } 305 306 #else 307 308 #if MTK_VSP_USING_NBDV_D0105 309 pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCandNoRef[0], NOT_VALID ); 310 #else 311 pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCand[0], NOT_VALID ); 312 #endif 313 if ( getSlice()->isInterB() ) 314 { 315 #if MTK_VSP_USING_NBDV_D0105 316 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCandNoRef[0], NOT_VALID ); 317 #else 110 318 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCand[0], NOT_VALID ); 319 #endif 111 320 } 321 #endif 112 322 } 113 323 iVSPIndexTrue[idx] = iCount; 324 #endif 114 325 if ( mrgCandIdx == iCount ) 115 326 { … … 155 366 #if MERL_VSP_C0152 156 367 m_piVSPIndex = NULL; 368 #if MERL_VSP_NBDV_RefVId_Fix_D0166 369 m_piVSPDir = NULL; 370 #endif 157 371 #endif 158 372 m_puhLumaIntraDir = NULL; … … 225 439 m_pbResPredFlag = NULL; 226 440 #endif 441 #if QC_ARP_D0177 442 m_puhARPW = NULL; 443 #endif 227 444 #if LGE_EDGE_INTRA_A0070 228 445 m_pucEdgeCode = NULL; … … 241 458 m_apSegmentDCOffset[1] = NULL; 242 459 #endif 460 #if QC_CU_NBDV_D0181 461 m_pDvInfo = NULL; 462 #endif 243 463 } 244 464 … … 288 508 m_pbICFlag = (Bool* )xMalloc(Bool, uiNumPartition); 289 509 #endif 510 #if QC_CU_NBDV_D0181 511 m_pDvInfo = (DisInfo* )xMalloc(DisInfo, uiNumPartition); 512 #endif 290 513 m_puhMergeIndex = (UChar* )xMalloc(UChar, uiNumPartition); 291 514 #if MERL_VSP_C0152 292 515 m_piVSPIndex = (Char* )xMalloc(Char, uiNumPartition); 516 #if MERL_VSP_NBDV_RefVId_Fix_D0166 517 m_piVSPDir = (Char* )xMalloc(Char, uiNumPartition); 518 #endif 293 519 #endif 294 520 #if H3D_IVRP 295 521 m_pbResPredAvailable = (Bool* )xMalloc(Bool, uiNumPartition); 296 522 m_pbResPredFlag = (Bool* )xMalloc(Bool, uiNumPartition); 523 #if QC_ARP_D0177 524 m_puhARPW = new UChar[ uiNumPartition]; 525 #endif 297 526 #endif 298 527 m_puhLumaIntraDir = (UChar* )xMalloc(UChar, uiNumPartition); … … 448 677 #if MERL_VSP_C0152 449 678 if ( m_piVSPIndex ) { xFree(m_piVSPIndex); m_piVSPIndex = NULL; } 679 #if MERL_VSP_NBDV_RefVId_Fix_D0166 680 if ( m_piVSPDir ) { xFree(m_piVSPDir ); m_piVSPDir = NULL; } 681 #endif 450 682 #endif 451 683 if ( m_puhMergeIndex ) { xFree(m_puhMergeIndex); m_puhMergeIndex = NULL; } … … 453 685 if ( m_pbResPredAvailable ) { xFree(m_pbResPredAvailable); m_pbResPredAvailable= NULL; } 454 686 if ( m_pbResPredFlag ) { xFree(m_pbResPredFlag); m_pbResPredFlag = NULL; } 687 #endif 688 #if QC_CU_NBDV_D0181 689 if ( m_pDvInfo ) { xFree(m_pDvInfo); m_pDvInfo = NULL; } 690 #endif 691 #if QC_ARP_D0177 692 if ( m_puhARPW ) { delete[] m_puhARPW; m_puhARPW = NULL; } 455 693 #endif 456 694 if ( m_puhLumaIntraDir ) { xFree(m_puhLumaIntraDir); m_puhLumaIntraDir = NULL; } … … 627 865 m_pbSDCFlag[ui] = pcFrom->getSDCFlag(ui); 628 866 #endif 867 #if QC_ARP_D0177 868 m_puhARPW[ui] = pcFrom->getARPW( ui ); 869 #endif 629 870 m_puhWidth [ui] = pcFrom->getWidth(ui); 630 871 m_puhHeight [ui] = pcFrom->getHeight(ui); … … 644 885 #if MERL_VSP_C0152 645 886 m_piVSPIndex[ui] = pcFrom->m_piVSPIndex[ui]; 887 #if MERL_VSP_NBDV_RefVId_Fix_D0166 888 m_piVSPDir [ui] = pcFrom->m_piVSPDir [ui]; 889 #endif 646 890 #endif 647 891 m_puhLumaIntraDir[ui]=pcFrom->m_puhLumaIntraDir[ui]; … … 687 931 #if MERL_VSP_C0152 688 932 memset( m_piVSPIndex + firstElement, 0, numElements * sizeof( *m_piVSPIndex ) ); 933 #if MERL_VSP_NBDV_RefVId_Fix_D0166 934 memset( m_piVSPDir + firstElement, 0, numElements * sizeof( *m_piVSPDir ) ); 935 #endif 689 936 #endif 690 937 memset( m_puhLumaIntraDir + firstElement, 2, numElements * sizeof( *m_puhLumaIntraDir ) ); … … 723 970 memset( m_pbResPredAvailable + firstElement, 0 , sizeof( Bool ) * numElements ); 724 971 memset( m_pbResPredFlag + firstElement, 0 , sizeof( Bool ) * numElements ); 972 #endif 973 #if QC_ARP_D0177 974 memset( m_puhARPW + firstElement, 0 , sizeof( UChar ) * numElements ); 725 975 #endif 726 976 } … … 861 1111 #if MERL_VSP_C0152 862 1112 m_piVSPIndex[ui] = 0; 1113 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1114 m_piVSPDir [ui] = 0; 1115 #endif 863 1116 #endif 864 1117 #if H3D_IVRP 865 1118 m_pbResPredAvailable[ui] = 0; 866 1119 m_pbResPredFlag[ui] = 0; 1120 #endif 1121 #if QC_ARP_D0177 1122 m_puhARPW[ui] = 0; 867 1123 #endif 868 1124 m_puhLumaIntraDir[ui] = 2; … … 972 1228 #if MERL_VSP_C0152 973 1229 memset( m_piVSPIndex, 0, iSizeInChar ); 1230 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1231 memset( m_piVSPDir , 0, iSizeInChar ); 1232 #endif 974 1233 #endif 975 1234 #if H3D_IVRP 976 1235 memset( m_pbResPredAvailable, 0, iSizeInBool ); 977 1236 memset( m_pbResPredFlag, 0, iSizeInBool ); 1237 #endif 1238 #if QC_ARP_D0177 1239 memset( m_puhARPW, 0, iSizeInUchar ); 978 1240 #endif 979 1241 memset( m_puhLumaIntraDir, 2, iSizeInUchar ); … … 1015 1277 memset( m_apSegmentDCOffset[1], 0, sizeof(Pel) * m_uiNumPartition); 1016 1278 #endif 1017 1279 #if QC_CU_NBDV_D0181 1280 m_pDvInfo->bDV = false; 1281 #endif 1018 1282 UChar uhWidth = g_uiMaxCUWidth >> uiDepth; 1019 1283 UChar uhHeight = g_uiMaxCUHeight >> uiDepth; … … 1058 1322 #if MERL_VSP_C0152 1059 1323 m_piVSPIndex[ui]=pcCU->m_piVSPIndex[uiPartOffset+ui]; 1324 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1325 m_piVSPDir [ui]=pcCU->m_piVSPDir [uiPartOffset+ui]; 1326 #endif 1060 1327 #endif 1061 1328 m_puhLumaIntraDir[ui]=pcCU->m_puhLumaIntraDir[uiPartOffset+ui]; … … 1090 1357 m_pbResPredAvailable[ui] = pcCU->m_pbResPredAvailable[ uiPartOffset + ui ]; 1091 1358 m_pbResPredFlag [ui] = pcCU->m_pbResPredFlag [ uiPartOffset + ui ]; 1359 #endif 1360 #if QC_ARP_D0177 1361 m_puhARPW [ui] = pcCU->getARPW( uiPartOffset+ui ); 1092 1362 #endif 1093 1363 #if RWTH_SDC_DLT_B0036 … … 1208 1478 #if MERL_VSP_C0152 1209 1479 m_piVSPIndex = pcCU->getVSPIndex() + uiPart; 1480 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1481 m_piVSPDir = pcCU->getVSPDir () + uiPart; 1482 #endif 1210 1483 #endif 1211 1484 #if H3D_IVRP 1212 1485 m_pbResPredAvailable = pcCU->getResPredAvail() + uiPart; 1213 1486 m_pbResPredFlag = pcCU->getResPredFlag () + uiPart; 1487 #endif 1488 #if QC_ARP_D0177 1489 m_puhARPW = pcCU->getARPW() + uiPart; 1214 1490 #endif 1215 1491 m_puhLumaIntraDir = pcCU->getLumaIntraDir() + uiPart; … … 1313 1589 m_apSegmentDCOffset[1] = pcCU->getSDCSegmentDCOffset(1) + uiPart; 1314 1590 #endif 1315 } 1316 1591 #if QC_CU_NBDV_D0181 1592 m_pDvInfo = pcCU->getDvInfo() + uiPart; 1593 #endif 1594 } 1595 #if QC_CU_NBDV_D0181 1596 Void TComDataCU::copyDVInfoFrom (TComDataCU* pcCU, UInt uiAbsPartIdx) 1597 { 1598 m_pDvInfo = pcCU->getDvInfo() + uiAbsPartIdx; 1599 } 1600 #endif 1317 1601 // Copy inter prediction info from the biggest CU 1318 Void TComDataCU::copyInterPredInfoFrom ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList ) 1602 Void TComDataCU::copyInterPredInfoFrom ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList 1603 #if QC_CU_NBDV_D0181 1604 , Bool bNBDV 1605 #endif 1606 ) 1319 1607 { 1320 1608 m_pcPic = pcCU->getPic(); … … 1336 1624 1337 1625 m_pePartSize = pcCU->getPartitionSize () + uiAbsPartIdx; 1626 #if QC_CU_NBDV_D0181 1627 if(bNBDV == true) 1628 { 1629 m_puhWidth = pcCU->getWidth () + uiAbsPartIdx; 1630 m_puhHeight = pcCU->getHeight() + uiAbsPartIdx; 1631 m_puhDepth = pcCU->getDepth () + uiAbsPartIdx; 1632 } 1633 else 1634 { 1635 #endif 1338 1636 #if HHI_INTERVIEW_SKIP 1339 1637 m_pbRenderable = pcCU->getRenderable() + uiAbsPartIdx; … … 1354 1652 #if MERL_VSP_C0152 1355 1653 m_piVSPIndex = pcCU->getVSPIndex() + uiAbsPartIdx; 1654 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1655 m_piVSPDir = pcCU->getVSPDir () + uiAbsPartIdx; 1656 #endif 1356 1657 #endif 1357 1658 #if H3D_IVRP … … 1359 1660 m_pbResPredFlag = pcCU->getResPredFlag () + uiAbsPartIdx; 1360 1661 #endif 1662 #if QC_ARP_D0177 1663 m_puhARPW = pcCU->getARPW() + uiAbsPartIdx; 1664 #endif 1361 1665 m_apiMVPIdx[eRefPicList] = pcCU->getMVPIdx(eRefPicList) + uiAbsPartIdx; 1362 1666 m_apiMVPNum[eRefPicList] = pcCU->getMVPNum(eRefPicList) + uiAbsPartIdx; … … 1369 1673 memcpy(m_uiSliceStartCU,pcCU->m_uiSliceStartCU+uiAbsPartIdx,sizeof(UInt)*m_uiNumPartition); 1370 1674 memcpy(m_uiEntropySliceStartCU,pcCU->m_uiEntropySliceStartCU+uiAbsPartIdx,sizeof(UInt)*m_uiNumPartition); 1675 #if QC_CU_NBDV_D0181 1676 } 1677 #endif 1371 1678 } 1372 1679 1373 1680 // Copy small CU to bigger CU. 1374 1681 // One of quarter parts overwritten by predicted sub part. 1375 Void TComDataCU::copyPartFrom( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth ) 1682 Void TComDataCU::copyPartFrom( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth 1683 #if QC_ARP_D0177 1684 , 1685 Bool bRP 1686 #endif 1687 ) 1376 1688 { 1377 1689 assert( uiPartUnitIdx<4 ); … … 1405 1717 #if MERL_VSP_C0152 1406 1718 memcpy( m_piVSPIndex + uiOffset, pcCU->getVSPIndex(), iSizeInChar ); 1719 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1720 memcpy( m_piVSPDir + uiOffset, pcCU->getVSPDir (), iSizeInChar ); 1721 #endif 1407 1722 #endif 1408 1723 #if H3D_IVRP 1409 1724 memcpy( m_pbResPredAvailable + uiOffset, pcCU->getResPredAvail(), iSizeInBool ); 1410 1725 memcpy( m_pbResPredFlag + uiOffset, pcCU->getResPredFlag(), iSizeInBool ); 1726 #endif 1727 #if QC_ARP_D0177 1728 memcpy( m_puhARPW + uiOffset, pcCU->getARPW(), iSizeInUchar ); 1411 1729 #endif 1412 1730 memcpy( m_puhLumaIntraDir + uiOffset, pcCU->getLumaIntraDir(), iSizeInUchar ); … … 1486 1804 1487 1805 #if LGE_EDGE_INTRA_A0070 1806 #if QC_ARP_D0177 1807 if( !bRP && pcCU->getSlice()->getSPS()->isDepth() ) 1808 #else 1488 1809 if( getSlice()->getSPS()->isDepth() ) 1810 #endif 1489 1811 { 1490 1812 memcpy( getEdgeCode( uiOffset ), pcCU->getEdgeCode(0), iSizeInUchar * LGE_EDGE_INTRA_MAX_EDGE_NUM_PER_4x4 ); … … 1541 1863 memcpy( rpcCU->getICFlag() + m_uiAbsIdxInLCU, m_pbICFlag, iSizeInBool ); 1542 1864 #endif 1865 #if QC_CU_NBDV_D0181 1866 memcpy( rpcCU->getDvInfo() + m_uiAbsIdxInLCU, m_pDvInfo, sizeof(* m_pDvInfo) * m_uiNumPartition ); 1867 #endif 1543 1868 memcpy( rpcCU->getMergeIndex() + m_uiAbsIdxInLCU, m_puhMergeIndex, iSizeInUchar ); 1544 1869 #if MERL_VSP_C0152 1545 1870 memcpy( rpcCU->getVSPIndex() + m_uiAbsIdxInLCU, m_piVSPIndex, iSizeInChar ); 1871 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1872 memcpy( rpcCU->getVSPDir () + m_uiAbsIdxInLCU, m_piVSPDir , iSizeInChar ); 1873 #endif 1546 1874 #endif 1547 1875 #if H3D_IVRP 1548 1876 memcpy( rpcCU->getResPredAvail() + m_uiAbsIdxInLCU, m_pbResPredAvailable, iSizeInBool ); 1549 1877 memcpy( rpcCU->getResPredFlag() + m_uiAbsIdxInLCU, m_pbResPredFlag, iSizeInBool ); 1878 #endif 1879 #if QC_ARP_D0177 1880 memcpy( rpcCU->getARPW() + m_uiAbsIdxInLCU, m_puhARPW, iSizeInUchar ); 1550 1881 #endif 1551 1882 memcpy( rpcCU->getLumaIntraDir() + m_uiAbsIdxInLCU, m_puhLumaIntraDir, iSizeInUchar ); … … 1674 2005 memcpy( rpcCU->getMergeIndex() + uiPartOffset, m_puhMergeIndex, iSizeInUchar ); 1675 2006 #if MERL_VSP_C0152 1676 memcpy( rpcCU->getVSPIndex() + uiPartOffset, m_piVSPIndex, iSizeInChar ); 2007 memcpy( rpcCU->getVSPIndex() + uiPartOffset, m_piVSPIndex, iSizeInChar ); 2008 #if MERL_VSP_NBDV_RefVId_Fix_D0166 2009 memcpy( rpcCU->getVSPDir () + uiPartOffset, m_piVSPDir , iSizeInChar ); 2010 #endif 1677 2011 #endif 1678 2012 #if H3D_IVRP 1679 2013 memcpy( rpcCU->getResPredAvail() + uiPartOffset, m_pbResPredAvailable, iSizeInBool ); 1680 2014 memcpy( rpcCU->getResPredFlag() + uiPartOffset, m_pbResPredFlag, iSizeInBool ); 2015 #endif 2016 #if QC_ARP_D0177 2017 memcpy( rpcCU->getARPW() + uiPartOffset, m_puhARPW, iSizeInUchar ); 1681 2018 #endif 1682 2019 memcpy( rpcCU->getLumaIntraDir() + uiPartOffset, m_puhLumaIntraDir, iSizeInUchar ); … … 2670 3007 return uiCtx; 2671 3008 } 2672 3009 #if QC_ARP_D0177 3010 UInt TComDataCU::getCTXARPWFlag( UInt uiAbsPartIdx ) 3011 { 3012 TComDataCU* pcTempCU; 3013 UInt uiTempPartIdx; 3014 UInt uiCtx = 0; 3015 3016 pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx ); 3017 uiCtx = ( pcTempCU ) ? ((pcTempCU->getARPW( uiTempPartIdx )==0)?0:1) : 0; 3018 3019 pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx ); 3020 uiCtx += ( pcTempCU ) ? ((pcTempCU->getARPW( uiTempPartIdx )==0)?0:1): 0; 3021 3022 return uiCtx; 3023 } 3024 #endif 2673 3025 #if LGE_ILLUCOMP_B0045 2674 3026 UInt TComDataCU::getCtxICFlag( UInt uiAbsPartIdx ) … … 2907 3259 } 2908 3260 3261 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 2909 3262 UInt TComDataCU::getCtxSDCFlag( UInt uiAbsPartIdx ) 2910 3263 { … … 2923 3276 return uiCtx; 2924 3277 } 3278 #endif 2925 3279 2926 3280 Bool TComDataCU::getSDCAvailable( UInt uiAbsPartIdx ) … … 2954 3308 setSubPart<Char>( iVSPIdx, m_piVSPIndex, uiAbsPartIdx, uiDepth, uiPartIdx ); 2955 3309 } 2956 #endif 3310 3311 #if MERL_VSP_NBDV_RefVId_Fix_D0166 3312 Void TComDataCU::setVSPDirSubParts ( Char iVSPDir, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 3313 { 3314 setSubPart<Char>( iVSPDir, m_piVSPDir, uiAbsPartIdx, uiDepth, uiPartIdx ); 3315 } 3316 #endif 3317 3318 #endif // MERL_VSP_C0152 2957 3319 2958 3320 #if H3D_IVRP … … 2967 3329 } 2968 3330 #endif 2969 3331 #if QC_CU_NBDV_D0181 3332 Void TComDataCU::setDvInfoSubParts( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiDepth ) 3333 { 3334 UInt uiCurrPartNumb = m_pcPic->getNumPartInCU() >> (uiDepth << 1); 3335 for (UInt ui = 0; ui < uiCurrPartNumb; ui++ ) 3336 { 3337 m_pDvInfo[uiAbsPartIdx + ui] = cDvInfo; 3338 } 3339 } 3340 #endif 2970 3341 Void TComDataCU::setChromIntraDirSubParts( UInt uiDir, UInt uiAbsPartIdx, UInt uiDepth ) 2971 3342 { … … 2993 3364 UInt iNumbPart; 2994 3365 3366 #if SHARP_ILLUCOMP_PARSE_D0060 3367 if (!(getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N)) 3368 { 3369 return false; 3370 } 3371 if (getSlice()->getIcSkipParseFlag()) 3372 { 3373 if (getMergeFlag(uiAbsPartIdx) && getMergeIndex(uiAbsPartIdx) == 0) 3374 { 3375 return false; 3376 } 3377 } 3378 if (getMergeFlag(uiAbsPartIdx)) 3379 { 3380 return true; 3381 } 3382 #endif 3383 #if !SHARP_ILLUCOMP_PARSE_D0060 2995 3384 if(!getSlice()->getIsDepth()) 2996 3385 { 3386 #endif 2997 3387 Int iWidth, iHeight; 2998 3388 … … 3015 3405 } 3016 3406 } 3407 #if !SHARP_ILLUCOMP_PARSE_D0060 3017 3408 } 3018 3409 else … … 3036 3427 } 3037 3428 } 3429 #endif 3038 3430 3039 3431 return false; … … 3046 3438 Int iWidth, iHeight; 3047 3439 3440 #if SHARP_ILLUCOMP_PARSE_D0060 3441 if (!(getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N)) 3442 { 3443 return false; 3444 } 3445 if (getSlice()->getIcSkipParseFlag()) 3446 { 3447 if (getMergeFlag(uiAbsPartIdx) && getMergeIndex(uiAbsPartIdx) == 0) 3448 { 3449 return false; 3450 } 3451 } 3452 if (getMergeFlag(uiAbsPartIdx)) 3453 { 3454 return true; 3455 } 3456 #endif 3048 3457 UInt uiPartMode = getPartitionSize(uiAbsPartIdx); 3049 3458 … … 3527 3936 */ 3528 3937 #if MERL_VSP_C0152 3529 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int* iVSPIndexTrue, Int mrgCandIdx ) 3938 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int* iVSPIndexTrue 3939 #if MERL_VSP_NBDV_RefVId_Fix_D0166 3940 , Int* iVSPDirTrue 3941 #endif 3942 , Int mrgCandIdx ) 3530 3943 #else 3531 3944 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx ) … … 3560 3973 this->getPartPosition(uiPUIdx, xP, yP, nPSW, nPSH); 3561 3974 3562 #if MERL_VSP_C0152 3975 #if MERL_VSP_C0152 && !LGE_VSP_INHERIT_D0092 3563 3976 Bool bVspMvZeroDone[3] = {false, false, false}; 3564 3977 #endif … … 3584 3997 #endif //H3D_NBDV 3585 3998 3586 #if H3D_IVRP 3999 #if H3D_IVRP & !QC_ARP_D0177 3587 4000 Bool bDVAvail = true; 3588 4001 #endif … … 3590 4003 #if H3D_NBDV 3591 4004 DisInfo cDisInfo; 4005 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4006 cDisInfo.bDV = false; // default setting 4007 cDisInfo.iN = 0; 4008 #endif 4009 4010 #if !QC_CU_NBDV_D0181 3592 4011 cDisInfo.iN = 0; 4012 #endif 3593 4013 if(!bNoPdmMerge) 3594 4014 { … … 3596 4016 if( !getPic()->getDepthCoded() ) 3597 4017 #endif 4018 #if QC_CU_NBDV_D0181 4019 { 4020 cDisInfo.iN = getDvInfo(uiAbsPartIdx).iN; 4021 cDisInfo.bDV = getDvInfo(uiAbsPartIdx).bDV; 4022 cDisInfo.m_acMvCand[0] = getDvInfo(uiAbsPartIdx).m_acMvCand[0]; 4023 cDisInfo.m_aVIdxCan[0] = getDvInfo(uiAbsPartIdx).m_aVIdxCan[0]; 4024 #if MTK_VSP_USING_NBDV_D0105 4025 cDisInfo.m_acMvCandNoRef[0] = getDvInfo(uiAbsPartIdx).m_acMvCandNoRef[0]; 4026 #endif 4027 #if MERL_General_Fix 4028 #if MERL_VSP_C0152 4029 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4030 cDisInfo.m_aListIdx[0] = getDvInfo(uiAbsPartIdx).m_aListIdx[0]; 4031 cDisInfo.m_aRefIdx[0] = getDvInfo(uiAbsPartIdx).m_aRefIdx[0]; 4032 #endif 4033 #endif 4034 #endif 4035 } 4036 #else 3598 4037 getDisMvpCandNBDV(uiPUIdx, uiAbsPartIdx, &cDisInfo , true 3599 4038 #if MERL_VSP_C0152 … … 3601 4040 #endif 3602 4041 ); 3603 } 4042 #endif 4043 } 4044 3604 4045 #if FCO_DVP_REFINE_C0132_C0170 3605 4046 if(getPic()->getDepthCoded() ) … … 3618 4059 } 3619 4060 #endif 4061 #if !QC_CU_NBDV_D0181 3620 4062 if(cDisInfo.iN==0) 3621 { 4063 #else 4064 if(cDisInfo.bDV == false) 4065 #endif 4066 { 4067 #if !QC_CU_NBDV_D0181 3622 4068 cDisInfo.iN = 1; 3623 4069 cDisInfo.m_acMvCand[0].setHor(0); 3624 4070 cDisInfo.m_acMvCand[0].setVer(0); 3625 4071 cDisInfo.m_aVIdxCan[0] = 0; 3626 #if H3D_IVRP 4072 #endif 4073 #if H3D_IVRP & !QC_ARP_D0177 3627 4074 bDVAvail = false; 3628 4075 #endif 3629 4076 } 4077 4078 #if MERL_VSP_NBDV_RefVId_Fix_D0166 && !MTK_LGE_VSP_DEPTH_OFF_D0105_D0139 4079 if (bNoPdmMerge && cDisInfo.bDV == false) 4080 { // purely for default setting 4081 cDisInfo.iN = 1; 4082 cDisInfo.m_acMvCand[0].setHor(0); 4083 cDisInfo.m_acMvCand[0].setVer(0); 4084 cDisInfo.m_acMvCandNoRef[0].setHor(0); 4085 cDisInfo.m_acMvCandNoRef[0].setVer(0); 4086 cDisInfo.m_aVIdxCan[0] = 0; 4087 4088 RefPicList eRefPicList = REF_PIC_LIST_0 ; 4089 Int refFrmIdx = 0; 4090 getRefListAndRefFrmIdx(0, eRefPicList, refFrmIdx); 4091 cDisInfo.m_aListIdx[0] = eRefPicList; 4092 cDisInfo.m_aRefIdx [0] = -1-refFrmIdx; 4093 } 4094 #endif 3630 4095 3631 4096 #if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137 … … 3652 4117 clipMv(cMvPred); 3653 4118 pcMvFieldNeighbours[iCount<<1].setMvField(cMvPred,pcMvFieldNeighbours[iCount<<1].getRefIdx()); 4119 #if MTK_LGE_VSP_DEPTH_OFF_D0105_D0139 4120 if (pcMvFieldNeighbours[iCount<<1].getRefIdx()<0) 4121 { 4122 assert(pcTextureCU->getVSPIndex(uiPartIdxCenter)!=0); 4123 for (Int i=0; i<getSlice()->getNumRefIdx(REF_PIC_LIST_0); i++) 4124 { 4125 if (getSlice()->getRefPOC(REF_PIC_LIST_0, i) == getSlice()->getPOC()) 4126 { 4127 pcMvFieldNeighbours[iCount<<1].setMvField(cMvPred,i); 4128 break; 4129 } 4130 } 4131 } 4132 #endif 3654 4133 } 3655 4134 if ( getSlice()->isInterB() ) … … 3664 4143 clipMv(cMvPred); 3665 4144 pcMvFieldNeighbours[(iCount<<1)+1].setMvField(cMvPred,pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()); 4145 #if MTK_LGE_VSP_DEPTH_OFF_D0105_D0139 4146 if (pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()<0) 4147 { 4148 assert(pcTextureCU->getVSPIndex(uiPartIdxCenter)!=0); 4149 for (Int i=0; i<getSlice()->getNumRefIdx(REF_PIC_LIST_1); i++) 4150 { 4151 if (getSlice()->getRefPOC(REF_PIC_LIST_1, i) == getSlice()->getPOC()) 4152 { 4153 pcMvFieldNeighbours[(iCount<<1)+1].setMvField(cMvPred,i); 4154 break; 4155 } 4156 } 4157 } 4158 #endif 3666 4159 } 3667 4160 } 3668 #if MERL_VSP_C0152 3669 xInheritVspMode( pcTextureCU, uiPartIdxCenter, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ; 3670 #endif 3671 if ( mrgCandIdx == iCount ) 3672 { 3673 return; 3674 } 3675 iCount ++; 4161 #if MERL_VSP_C0152 && !QC_BVSP_CleanUP_D0191 && !LGE_VSP_INHERIT_D0092 4162 #if !MTK_LGE_VSP_DEPTH_OFF_D0105_D0139 4163 xInheritVspMode( pcTextureCU, uiPartIdxCenter, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo 4164 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4165 , iVSPDirTrue 4166 #endif 4167 ) ; 4168 #endif 4169 #endif 4170 #if MTK_LGE_VSP_DEPTH_OFF_D0105_D0139 4171 if (!((pcMvFieldNeighbours[iCount<<1].getRefIdx()<0 && !getSlice()->isInterB()) 4172 || (pcMvFieldNeighbours[iCount<<1].getRefIdx()<0 && pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()<0 && getSlice()->isInterB()))) 4173 { 4174 #endif 4175 if ( mrgCandIdx == iCount ) 4176 { 4177 return; 4178 } 4179 iCount ++; 4180 #if MTK_LGE_VSP_DEPTH_OFF_D0105_D0139 4181 } 4182 else 4183 { 4184 assert(0); 4185 } 4186 #endif 3676 4187 } 3677 4188 } … … 3687 4198 iPdmDir[1] = iPdmInterDir; 3688 4199 #endif // H3D_NBDV 3689 #if H3D_IVRP 4200 #if H3D_IVRP & !QC_ARP_D0177 3690 4201 if (m_pcSlice->getSPS()->getMultiviewResPredMode()==1 && iPdmDir[0] && !bNoPdmMerge && cCurPS == SIZE_2Nx2N && bDVAvail) 3691 4202 { … … 3727 4238 } 3728 4239 3729 #endif // H3D_IVMP 3730 4240 #endif // H3D_IVMP 4241 4242 #if !FIX_MERGE_D 3731 4243 #if MERL_VSP_COMPENSATION_C0152 3732 4244 //===== vsp 0 ===== 3733 4245 if( iCount < 4 + extraMergeCand ) 3734 if ( !xAddVspMergeCand(0, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) ) 4246 if ( !xAddVspMergeCand(0, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo 4247 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4248 , iVSPDirTrue 4249 #endif 4250 ) 4251 ) 3735 4252 return; 4253 #endif 3736 4254 #endif 3737 4255 … … 3751 4269 { 3752 4270 if ( pcCULeft && !pcCULeft->isIntra( uiLeftPartIdx ) 3753 #if MERL_VSP_C0152 4271 #if MERL_VSP_C0152 && !LGE_VSP_INHERIT_D0092 3754 4272 CHECK_ADD_YET(pcCULeft, uiLeftPartIdx, 1) 3755 4273 #endif … … 3800 4318 #endif 3801 4319 #if MERL_VSP_C0152 3802 xInheritVspMode( pcCULeft, uiLeftPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ; 4320 #if LGE_VSP_INHERIT_D0092 4321 if (pcCULeft->getVSPIndex(uiLeftPartIdx)==1) 4322 { 4323 iVSPIndexTrue[iCount] = 1; 4324 } 4325 #else 4326 xInheritVspMode( pcCULeft, uiLeftPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo 4327 #if QC_BVSP_CleanUP_D0191 4328 ,puhInterDirNeighbours 4329 #endif 4330 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4331 , iVSPDirTrue 4332 #endif 4333 ); 4334 #endif 3803 4335 #endif 3804 4336 if ( mrgCandIdx == iCount ) … … 3825 4357 } 3826 4358 if ( pcCUAbove && !pcCUAbove->isIntra( uiAbovePartIdx ) 3827 #if MERL_VSP_C0152 4359 #if MERL_VSP_C0152 && !LGE_VSP_INHERIT_D0092 3828 4360 CHECK_ADD_YET(pcCUAbove, uiAbovePartIdx, 1) 3829 4361 #endif … … 3873 4405 #endif 3874 4406 #if MERL_VSP_C0152 3875 xInheritVspMode( pcCUAbove, uiAbovePartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ; 4407 #if LGE_VSP_INHERIT_D0092 4408 if (pcCUAbove->getVSPIndex(uiAbovePartIdx)==1) 4409 { 4410 iVSPIndexTrue[iCount] = 1; 4411 } 4412 #else 4413 xInheritVspMode( pcCUAbove, uiAbovePartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo 4414 #if QC_BVSP_CleanUP_D0191 4415 ,puhInterDirNeighbours 4416 #endif 4417 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4418 , iVSPDirTrue 4419 #endif 4420 ) ; 4421 #endif 3876 4422 #endif 3877 4423 if ( mrgCandIdx == iCount ) … … 3897 4443 } 3898 4444 if ( pcCUAboveRight && !pcCUAboveRight->isIntra( uiAboveRightPartIdx ) 3899 #if MERL_VSP_C0152 4445 #if MERL_VSP_C0152 && !LGE_VSP_INHERIT_D0092 3900 4446 CHECK_ADD_YET(pcCUAboveRight, uiAboveRightPartIdx, 1) 3901 4447 #endif … … 3922 4468 #endif 3923 4469 #if MERL_VSP_C0152 3924 xInheritVspMode( pcCUAboveRight, uiAboveRightPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ; 4470 #if LGE_VSP_INHERIT_D0092 4471 if (pcCUAboveRight->getVSPIndex(uiAboveRightPartIdx)==1) 4472 { 4473 iVSPIndexTrue[iCount] = 1; 4474 } 4475 #else 4476 xInheritVspMode( pcCUAboveRight, uiAboveRightPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo 4477 #if QC_BVSP_CleanUP_D0191 4478 ,puhInterDirNeighbours 4479 #endif 4480 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4481 , iVSPDirTrue 4482 #endif 4483 ) ; 4484 #endif 3925 4485 #endif 3926 4486 if ( mrgCandIdx == iCount ) … … 3980 4540 #endif // H3D_IVMP 3981 4541 4542 #if MERL_VSP_COMPENSATION_C0152 4543 //===== vsp 3 ===== 4544 #if LGE_VSP_INHERIT_D0092 4545 if ( !xAddVspMergeCand(3, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo 4546 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4547 , iVSPDirTrue 4548 #endif 4549 ) ) 4550 #else 4551 if( iCount < 4 + extraMergeCand ) 4552 if ( !xAddVspMergeCand(3, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo 4553 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4554 , iVSPDirTrue 4555 #endif 4556 ) ) 4557 #endif 4558 return; 4559 #endif 4560 4561 #if MERL_VSP_C0152 4562 #if VSP_MERGE_POS < 4 4563 #if H3D_IVMP 4564 if( iCount < 4 + extraMergeCand ) 4565 #else 4566 if( iCount < 4 ) 4567 #endif 4568 { 4569 #endif 4570 #endif 3982 4571 3983 4572 //left bottom … … 3993 4582 } 3994 4583 if ( pcCULeftBottom && !pcCULeftBottom->isIntra( uiLeftBottomPartIdx ) 3995 #if MERL_VSP_C0152 4584 #if MERL_VSP_C0152 && !LGE_VSP_INHERIT_D0092 3996 4585 CHECK_ADD_YET(pcCULeftBottom, uiLeftBottomPartIdx, 1) 3997 4586 #endif … … 4018 4607 #endif 4019 4608 #if MERL_VSP_C0152 4020 xInheritVspMode( pcCULeftBottom, uiLeftBottomPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ; 4609 #if LGE_VSP_INHERIT_D0092 4610 if (pcCULeftBottom->getVSPIndex(uiLeftBottomPartIdx)==1) 4611 { 4612 iVSPIndexTrue[iCount] = 1; 4613 } 4614 #else 4615 xInheritVspMode( pcCULeftBottom, uiLeftBottomPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo 4616 #if QC_BVSP_CleanUP_D0191 4617 ,puhInterDirNeighbours 4618 #endif 4619 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4620 , iVSPDirTrue 4621 #endif 4622 ) ; 4623 #endif 4021 4624 #endif 4022 4625 if ( mrgCandIdx == iCount ) … … 4026 4629 iCount ++; 4027 4630 } 4028 4029 4631 4632 #if MERL_VSP_C0152 // Is this correct here? 4633 #if VSP_MERGE_POS < 4 4634 } 4635 #endif 4636 #endif 4637 4030 4638 // above left 4031 4639 #if H3D_IVMP … … 4046 4654 } 4047 4655 if( pcCUAboveLeft && !pcCUAboveLeft->isIntra( uiAboveLeftPartIdx ) 4048 #if MERL_VSP_C0152 4656 #if MERL_VSP_C0152 && !LGE_VSP_INHERIT_D0092 4049 4657 CHECK_ADD_YET(pcCUAboveLeft, uiAboveLeftPartIdx, 1) 4050 4658 #endif … … 4073 4681 #endif 4074 4682 #if MERL_VSP_C0152 4075 xInheritVspMode( pcCUAboveLeft, uiAboveLeftPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ; 4683 #if LGE_VSP_INHERIT_D0092 4684 if (pcCUAboveLeft->getVSPIndex(uiAboveLeftPartIdx)==1) 4685 { 4686 iVSPIndexTrue[iCount] = 1; 4687 } 4688 #else 4689 xInheritVspMode( pcCUAboveLeft, uiAboveLeftPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo 4690 #if QC_BVSP_CleanUP_D0191 4691 ,puhInterDirNeighbours 4692 #endif 4693 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4694 , iVSPDirTrue 4695 #endif 4696 ) ; 4697 #endif 4076 4698 #endif 4077 4699 if ( mrgCandIdx == iCount ) … … 4086 4708 //===== vsp 5 ===== 4087 4709 if( iCount < 4 + extraMergeCand ) 4088 if ( !xAddVspMergeCand(5, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) ) 4710 #if LGE_VSP_INHERIT_D0092 4711 if ( !xAddVspMergeCand(5, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo 4712 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4713 , iVSPDirTrue 4714 #endif 4715 )) 4716 #else 4717 if ( !xAddVspMergeCand(5, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo 4718 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4719 , iVSPDirTrue 4720 #endif 4721 )) 4722 #endif 4089 4723 return; 4090 4724 #endif … … 4276 4910 #if MERL_VSP_C0152 4277 4911 Bool bValid = true; 4912 #if LGE_VSP_INHERIT_D0092 4913 if (iVSPIndexTrue[i]==1 || iVSPIndexTrue[j]==1) // NOT_VALID 4914 #else 4278 4915 if (pcMvFieldNeighbours[i<<1].getRefIdx() < 0 || pcMvFieldNeighbours[(j<<1)+1].getRefIdx() < 0) // NOT_VALID 4916 #endif 4279 4917 bValid = false; 4280 4918 #endif 4919 4920 #if MTK_D0156 4921 if( !m_pcSlice->getSPS()->getUseVSPCompensation()) 4922 { 4923 bValid = true; 4924 } 4925 #endif 4926 4281 4927 if (abCandIsInter[i] && abCandIsInter[j]&& (puhInterDirNeighbours[i]&0x1)&&(puhInterDirNeighbours[j]&0x2) 4282 4928 #if MERL_VSP_C0152 … … 4447 5093 { 4448 5094 if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) 4449 #if MERL_VSP_C0152 5095 #if MERL_VSP_C0152 & !QC_BVSP_CleanUP_D0191 4450 5096 && !pcCorner->getVSPIndex( uiCornerPUIdx ) 4451 5097 #endif … … 4593 5239 pcTmpCU = getPULeft(uiIdx, uiPartIdxLB, true, false); 4594 5240 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) ) 4595 #if MERL_VSP_C0152 5241 #if MERL_VSP_C0152 & !QC_BVSP_CleanUP_D0191 4596 5242 if(! pcTmpCU->getVSPIndex(uiIdx)) 4597 5243 #endif … … 4618 5264 4619 5265 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 4620 #if MERL_VSP_C0152 5266 #if MERL_VSP_C0152 & !QC_BVSP_CleanUP_D0191 4621 5267 if(! pcTmpCU->getVSPIndex(uiIdx)) 4622 5268 #endif … … 4643 5289 pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true, false, true); 4644 5290 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) ) 4645 #if MERL_VSP_C0152 5291 #if MERL_VSP_C0152 & !QC_BVSP_CleanUP_D0191 4646 5292 if(! pcTmpCU->getVSPIndex(uiIdx)) 4647 5293 #endif … … 4667 5313 pcTmpCU = getPUBelowLeft(uiIdx, uiPartIdxLB, true, false); 4668 5314 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 4669 #if MERL_VSP_C0152 5315 #if MERL_VSP_C0152 & !QC_BVSP_CleanUP_D0191 4670 5316 if(! pcTmpCU->getVSPIndex(uiIdx)) 4671 5317 #endif … … 4694 5340 assert(uiPartIdxLT == (m_uiAbsIdxInLCU + uiPartAddr)); 4695 5341 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 4696 #if MERL_VSP_C0152 5342 #if MERL_VSP_C0152 & !QC_BVSP_CleanUP_D0191 4697 5343 if(! pcTmpCU->getVSPIndex(uiIdx)) 4698 5344 #endif … … 4902 5548 Int iPictureWidth = pcBaseViewDepthPicYuv->getWidth(); 4903 5549 Int iPictureHeight = pcBaseViewDepthPicYuv->getHeight(); 4904 5550 #if !QC_BVSP_CleanUP_D0191 5551 #if LGE_ROUND_OFFSET_D0135 5552 Int depthPosX = Clip3(0, iPictureWidth - iBlkWidth, iBlkX + ((mv->getHor()+2)>>2)); 5553 Int depthPosY = Clip3(0, iPictureHeight- iBlkHeight, iBlkY + ((mv->getVer()+2)>>2)); 5554 #else 4905 5555 Int depthPosX = Clip3(0, iPictureWidth - iBlkWidth, iBlkX + (mv->getHor()>>2)); 4906 5556 Int depthPosY = Clip3(0, iPictureHeight- iBlkHeight, iBlkY + (mv->getVer()>>2)); 5557 #endif 4907 5558 4908 5559 Pel *pDepthPel = pcBaseViewDepthPicYuv->getLumaAddr() + depthPosX + depthPosY * depStride; 5560 #endif 4909 5561 Pel maxDepthVal = 0; 4910 5562 4911 5563 if ( bSimpleDvpRefine ) 4912 5564 { 5565 #if LGE_ROUND_OFFSET_D0135 5566 Int depthStartPosX = Clip3(0, iPictureWidth - iBlkWidth, iBlkX + ((mv->getHor()+2)>>2)); 5567 Int depthStartPosY = Clip3(0, iPictureHeight- iBlkHeight, iBlkY + ((mv->getVer()+2)>>2)); 5568 Int depthEndPosX = Clip3(0, iPictureWidth - 1, iBlkX + iBlkWidth - 1 + ((mv->getHor()+2)>>2)); 5569 Int depthEndPosY = Clip3(0, iPictureHeight - 1, iBlkY + iBlkHeight - 1 + ((mv->getVer()+2)>>2)); 5570 #else 4913 5571 Int depthStartPosX = Clip3(0, iPictureWidth - iBlkWidth, iBlkX + (mv->getHor()>>2)); 4914 5572 Int depthStartPosY = Clip3(0, iPictureHeight- iBlkHeight, iBlkY + (mv->getVer()>>2)); 4915 5573 Int depthEndPosX = Clip3(0, iPictureWidth - 1, iBlkX + iBlkWidth - 1 + (mv->getHor()>>2)); 4916 5574 Int depthEndPosY = Clip3(0, iPictureHeight - 1, iBlkY + iBlkHeight - 1 + (mv->getVer()>>2)); 5575 #endif 5576 #if !MTK_DEPTH_TO_DISP_D0138 4917 5577 Int iCenterX = (depthStartPosX + depthEndPosX) >> 1; 4918 5578 Int iCenterY = (depthStartPosY + depthEndPosY) >> 1; 5579 #endif 4919 5580 4920 5581 Pel *depthTL = pcBaseViewDepthPicYuv->getLumaAddr(); … … 4924 5585 aiDepth[2] = depthTL[ (depthStartPosY) * depStride + depthEndPosX ]; // Right Top 4925 5586 aiDepth[3] = depthTL[ (depthEndPosY) * depStride + depthEndPosX ]; // Right Bottom 5587 #if MTK_DEPTH_TO_DISP_D0138 5588 for (Int i = 0; i < 4; i++) 5589 #else 4926 5590 aiDepth[4] = depthTL[ (iCenterY) * depStride + iCenterX ]; // Center 4927 5591 for (Int i = 0; i < 5; i++) 5592 #endif 4928 5593 { 4929 5594 if (maxDepthVal < aiDepth[i]) … … 4931 5596 } 4932 5597 } 5598 #if !QC_BVSP_CleanUP_D0191 4933 5599 else 4934 5600 { … … 4943 5609 } 4944 5610 } 5611 #endif 4945 5612 4946 5613 Int iDisp = aiShiftLUT[ maxDepthVal ] << iShiftPrec; … … 4948 5615 return iDisp; 4949 5616 } 4950 Void TComDataCU::estimateDVFromDM(UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred, Bool bSimpleDvpRefine) 5617 5618 Void TComDataCU::estimateDVFromDM( 5619 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5620 Int refViewIdx, 5621 #endif 5622 UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred, Bool bSimpleDvpRefine) 4951 5623 { 4952 5624 if (picDepth) … … 4962 5634 Int iShiftPrec; 4963 5635 4964 getSlice()->getBWVSPLUTParam(aiShiftLUT, iShiftPrec); 5636 getSlice()->getBWVSPLUTParam(aiShiftLUT, iShiftPrec 5637 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5638 , refViewIdx 5639 #endif 5640 ); 4965 5641 4966 5642 Pel iDisp = getMcpFromDM( pcBaseViewDepthPicYuv, cMvPred, iBlkX, iBlkY, iWidth, iHeight, aiShiftLUT, iShiftPrec, bSimpleDvpRefine ); … … 4991 5667 clipMv(cMvPred); 4992 5668 4993 TComPic* picDepth = getSlice()->getRefPicBaseDepth(); 4994 5669 TComPic* picDepth = NULL; 5670 #if MERL_General_Fix 5671 #if MERL_VSP_C0152 5672 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5673 Int refPOC = getSlice()->getRefPic(eRefPicList, refId)->getPOC(); 5674 picDepth = getSlice()->getDepthRefPic(refViewIdx, refPOC); 5675 assert(refPOC == getSlice()->getPOC()); 5676 assert(picDepth != NULL); 5677 #else 5678 picDepth = getSlice()->getRefPicBaseDepth(); 5679 #endif 5680 #endif 5681 #else 5682 picDepth = getSlice()->getRefPicBaseDepth(); 5683 #endif 5684 5685 #if QC_CU_NBDV_D0181 && MERL_VSP_C0152 5686 pNbDvInfo->m_acMvCandNoRef[pNbDvInfo->iN] = cMvPred; 5687 #endif 4995 5688 if (picDepth && bDepthRefine) 4996 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred, true); 4997 5689 estimateDVFromDM( 5690 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5691 refViewIdx, 5692 #endif 5693 uiPartIdx, picDepth, uiPartAddr, &cMvPred, true); 5694 5695 5696 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5697 pNbDvInfo->m_aListIdx[ pNbDvInfo->iN ] = eRefPicList; 5698 pNbDvInfo->m_aRefIdx [ pNbDvInfo->iN ] = -1-refId; 5699 assert(pNbDvInfo->m_aRefIdx [ pNbDvInfo->iN ] < 0); 5700 #endif 4998 5701 pNbDvInfo->m_acMvCand[ pNbDvInfo->iN ] = cMvPred; 4999 5702 pNbDvInfo->m_aVIdxCan[ pNbDvInfo->iN++ ] = refViewIdx; … … 5010 5713 } 5011 5714 } 5012 #if MERL_VSP_C0152 5715 #if MERL_VSP_C0152 & !QC_BVSP_CleanUP_D0191 5013 5716 else if (pcTmpCU->getVSPIndex(uiIdx) != 0) // is VSP 5014 5717 { 5015 TComPic* picDepth = pcTmpCU->getSlice()->getRefPicBaseDepth(); 5718 TComPic* picDepth = NULL; 5719 5720 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5721 RefPicList privateRefPicList = (RefPicList) pcTmpCU->getVSPDir( uiIdx ); 5722 assert(privateRefPicList == REF_PIC_LIST_0 || privateRefPicList == REF_PIC_LIST_1); 5723 Int refIdx = -1-pcTmpCU->getCUMvField( privateRefPicList )->getRefIdx( uiIdx ); // a trick when storing refIdx for temporal BVSP 5724 assert(refIdx >= 0); 5725 Int refViewIdx = getSlice()->getRefViewId(privateRefPicList, refIdx); 5726 Int refPOC = getSlice()->getRefPOC(privateRefPicList, refIdx); 5727 5728 picDepth = getSlice()->getDepthRefPic(refViewIdx, refPOC); 5729 assert(refPOC == getSlice()->getPOC()); 5730 assert(picDepth != NULL); 5731 #else 5732 picDepth = pcTmpCU->getSlice()->getRefPicBaseDepth(); 5733 #endif 5734 5735 #if QC_CU_NBDV_D0181 && MERL_VSP_C0152 5736 pNbDvInfo->m_acMvCandNoRef[pNbDvInfo->iN] = cMvPred; 5737 #endif 5016 5738 if (picDepth && bDepthRefine) 5017 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred); 5739 estimateDVFromDM( 5740 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5741 refViewIdx, 5742 #endif 5743 uiPartIdx, picDepth, uiPartAddr, &cMvPred); 5018 5744 5019 5745 cMvPred.setVer(0); 5020 5746 5747 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5748 pNbDvInfo->m_aRefIdx [ pNbDvInfo->iN ] = -1-refIdx; 5749 pNbDvInfo->m_aListIdx[ pNbDvInfo->iN ] = privateRefPicList; 5750 pNbDvInfo->m_acMvCand[ pNbDvInfo->iN ] = cMvPred; 5751 pNbDvInfo->m_aVIdxCan[ pNbDvInfo->iN ] = refViewIdx; 5752 assert(pNbDvInfo->m_aRefIdx [ pNbDvInfo->iN ] < 0); 5753 pNbDvInfo->iN++; 5754 #else 5021 5755 pNbDvInfo->m_acMvCand[ pNbDvInfo->iN] = cMvPred; 5022 5756 pNbDvInfo->m_aVIdxCan[ pNbDvInfo->iN++] = 0; // refViewIdx; 5757 #endif 5023 5758 return true; 5024 5759 } … … 5075 5810 } 5076 5811 5077 5812 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5813 Bool TComDataCU::getRefListAndRefFrmIdx(Int targetRefViewIdx, RefPicList& eRefPicList, Int& refFrmIdx) 5814 { 5815 Bool isFound = false; 5816 RefPicList privateRefPicList = REF_PIC_LIST_0; 5817 5818 refFrmIdx = 0; 5819 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1) && isFound == false; iList++) 5820 { 5821 privateRefPicList = RefPicList(iList); 5822 for (Int refIdx = 0; refIdx < getSlice()->getNumRefIdx(privateRefPicList); refIdx++) 5823 { 5824 Int refViewIdx = getSlice()->getRefViewId( privateRefPicList, refIdx); 5825 if ( refViewIdx == targetRefViewIdx) 5826 { 5827 refFrmIdx = refIdx; 5828 eRefPicList = privateRefPicList; 5829 isFound = true; 5830 break; 5831 } 5832 } 5833 } 5834 5835 return isFound; 5836 } 5837 #endif 5838 5839 #if QC_CU_NBDV_D0181 5840 Bool TComDataCU::getDisMvpCandNBDV( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo , Bool bParMerge 5841 #else 5078 5842 Void TComDataCU::getDisMvpCandNBDV( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo , Bool bParMerge 5843 #endif 5079 5844 #if MERL_VSP_C0152 5080 5845 , Bool bDepthRefine … … 5099 5864 } 5100 5865 5866 #if MTK_D0156 5867 if( !m_pcSlice->getSPS()->getUseDVPRefine() ) 5868 { 5869 bDepthRefine = false; 5870 } 5871 #endif 5872 5101 5873 // Get Positions 5102 5874 PartSize eCUMode = getPartitionSize( uiPartAddr ); 5875 #if QC_CU_NBDV_D0181 5876 assert(eCUMode == SIZE_2Nx2N); 5877 #endif 5103 5878 UInt uiPartIdxLT, uiPartIdxRT, uiPartIdxLB; 5104 5879 … … 5168 5943 { 5169 5944 clipMv(cColMv); 5170 TComPic* picDepth = getSlice()->getRefPicBaseDepth(); 5945 TComPic* picDepth = NULL; 5946 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5947 Int currPoc = getSlice()->getPOC(); 5948 picDepth = getSlice()->getDepthRefPic(iTargetViewIdx, currPoc); 5949 assert(picDepth != NULL); 5950 #else 5951 picDepth = getSlice()->getRefPicBaseDepth(); 5952 #endif 5953 #if QC_CU_NBDV_D0181 && MERL_VSP_C0152 5954 pDInfo->m_acMvCandNoRef[pDInfo->iN] = cColMv; 5955 #endif 5171 5956 if (picDepth && bDepthRefine) 5957 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5958 estimateDVFromDM(iTargetViewIdx, uiPartIdx, picDepth, uiPartAddr, &cColMv, true); 5959 #else 5172 5960 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv, true); 5173 5174 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv; 5961 #endif 5962 5963 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5964 Int refFrmIdx = 0; 5965 RefPicList privateRefPicList = REF_PIC_LIST_0; 5966 getRefListAndRefFrmIdx(iTargetViewIdx, privateRefPicList, refFrmIdx); 5967 5968 pDInfo->m_aListIdx[ pDInfo->iN ] = privateRefPicList; 5969 pDInfo->m_aRefIdx [ pDInfo->iN ] = -1-refFrmIdx; 5970 assert(pDInfo->m_aRefIdx [ pDInfo->iN ] < 0); 5971 #endif 5972 pDInfo->m_acMvCand[ pDInfo->iN ] = cColMv; 5175 5973 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx; 5974 #if QC_CU_NBDV_D0181 5975 return true; 5976 #else 5176 5977 return ; 5978 #endif 5177 5979 } 5178 5980 } // Loop positions … … 5203 6005 bCheckMcpDv = true; 5204 6006 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, uiPartIdx, uiPartAddr, pDInfo, bCheckMcpDv, &cMvpDvInfo, DVFROM_LEFT, bDepthRefine ) ) 6007 #if !QC_CU_NBDV_D0181 5205 6008 return; 5206 6009 #else 6010 return true; 6011 #endif 5207 6012 5208 6013 //// ******* Get disparity from above block ******* ///// … … 5225 6030 bCheckMcpDv = ( ( getAddr() - pcTmpCU->getAddr() ) == 0); 5226 6031 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, uiPartIdx, uiPartAddr, pDInfo, bCheckMcpDv, &cMvpDvInfo, DVFROM_ABOVE, bDepthRefine ) ) 6032 #if !QC_CU_NBDV_D0181 5227 6033 return; 6034 #else 6035 return true; 6036 #endif 5228 6037 } 5229 6038 … … 5243 6052 bCheckMcpDv = ( ( getAddr() - pcTmpCU->getAddr() ) == 0); 5244 6053 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, uiPartIdx, uiPartAddr, pDInfo, bCheckMcpDv, &cMvpDvInfo, DVFROM_ABOVERIGHT, bDepthRefine ) ) 6054 #if !QC_CU_NBDV_D0181 5245 6055 return; 6056 #else 6057 return true; 6058 #endif 5246 6059 } 5247 6060 … … 5262 6075 bCheckMcpDv = true; 5263 6076 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, uiPartIdx, uiPartAddr, pDInfo, bCheckMcpDv, &cMvpDvInfo, DVFROM_LEFTBELOW, bDepthRefine ) ) 6077 #if !QC_CU_NBDV_D0181 5264 6078 return; 6079 #else 6080 return true; 6081 #endif 5265 6082 } 5266 6083 … … 5282 6099 bCheckMcpDv = (( getAddr() - pcTmpCU->getAddr() ) <= 1); 5283 6100 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, uiPartIdx, uiPartAddr, pDInfo, bCheckMcpDv, &cMvpDvInfo, DVFROM_ABOVELEFT, bDepthRefine ) ) 6101 #if !QC_CU_NBDV_D0181 5284 6102 return; 6103 #else 6104 return true; 6105 #endif 5285 6106 } 5286 6107 … … 5297 6118 clipMv( cDispVec ); 5298 6119 5299 TComPic* picDepth = getSlice()->getRefPicBaseDepth(); 6120 TComPic* picDepth = NULL; 6121 #if MERL_VSP_NBDV_RefVId_Fix_D0166 6122 Int refPOC = getSlice()->getPOC(); 6123 picDepth = getSlice()->getDepthRefPic(0, refPOC); 6124 assert(picDepth!=NULL); 6125 #else 6126 picDepth = getSlice()->getRefPicBaseDepth(); 6127 #endif 6128 6129 #if QC_CU_NBDV_D0181 && MERL_VSP_C0152 6130 pDInfo->m_acMvCandNoRef[pDInfo->iN] = cDispVec; 6131 #endif 5300 6132 if (picDepth && bDepthRefine) 6133 #if MERL_VSP_NBDV_RefVId_Fix_D0166 6134 estimateDVFromDM(0, uiPartIdx, picDepth, uiPartAddr, &cDispVec, true); // from base view 6135 #else 5301 6136 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cDispVec, true); 5302 5303 pDInfo->m_acMvCand[ pDInfo->iN] = cDispVec; 6137 #endif 6138 6139 #if MERL_VSP_NBDV_RefVId_Fix_D0166 //if DVMCP is used, do a local reference frame list and idx search 6140 Int refFrmIdx = 0; 6141 RefPicList privateRefPicList = REF_PIC_LIST_0 ; 6142 getRefListAndRefFrmIdx(0, privateRefPicList, refFrmIdx); // find the reference picture from base view 6143 6144 pDInfo->m_aListIdx[ pDInfo->iN ] = privateRefPicList; 6145 pDInfo->m_aRefIdx [ pDInfo->iN ] = -1-refFrmIdx; 6146 assert(pDInfo->m_aRefIdx [ pDInfo->iN ] < 0); 6147 #endif 6148 6149 pDInfo->m_acMvCand[ pDInfo->iN ] = cDispVec; 5304 6150 pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; 6151 #if !QC_CU_NBDV_D0181 5305 6152 return; 6153 #else 6154 return true; 6155 #endif 5306 6156 } 5307 6157 } 5308 6158 } 5309 6159 } 6160 6161 #if SEC_DEFAULT_DV_D0112 6162 { 6163 TComPic* picDepth = NULL; 6164 TComMv defaultDV(0, 0); 6165 6166 #if MERL_VSP_NBDV_RefVId_Fix_D0166 6167 Int refPOC = getSlice()->getPOC(); 6168 picDepth = getSlice()->getDepthRefPic(0, refPOC); 6169 assert(picDepth!=NULL); 6170 #else 6171 picDepth = getSlice()->getRefPicBaseDepth(); 6172 #endif 6173 6174 #if MERL_General_Fix 6175 #if QC_CU_NBDV_D0181 && MERL_VSP_C0152 6176 pDInfo->m_acMvCandNoRef[pDInfo->iN] = defaultDV; 6177 #endif 6178 #endif 6179 6180 if (picDepth && bDepthRefine) 6181 { 6182 #if MERL_VSP_NBDV_RefVId_Fix_D0166 6183 estimateDVFromDM(0, uiPartIdx, picDepth, uiPartAddr, &defaultDV, true); // from base view 6184 #else 6185 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &defaultDV, true); 6186 #endif 6187 } 6188 6189 #if MERL_VSP_NBDV_RefVId_Fix_D0166 6190 Int refFrmIdx = 0; 6191 RefPicList privateRefPicList = REF_PIC_LIST_0 ; 6192 getRefListAndRefFrmIdx(0, privateRefPicList, refFrmIdx); // find the reference picture from base view 6193 6194 pDInfo->m_aListIdx[ pDInfo->iN ] = privateRefPicList; 6195 pDInfo->m_aRefIdx [ pDInfo->iN ] = -1-refFrmIdx; 6196 assert(pDInfo->m_aRefIdx [ pDInfo->iN ] < 0); 6197 #endif 6198 pDInfo->m_acMvCand[pDInfo->iN] = defaultDV; 6199 pDInfo->m_aVIdxCan[pDInfo->iN] = 0; 6200 #if MERL_VSP_NBDV_RefVId_Fix_D0166 // Bug fix for Samsung code. 6201 pDInfo->iN++; 6202 #endif 6203 } 6204 #endif 6205 6206 #if QC_CU_NBDV_D0181 6207 return false; 6208 #else 5310 6209 return; 6210 #endif 5311 6211 } 5312 6212 #endif … … 5322 6222 */ 5323 6223 #if H3D_IVMP 6224 #if SEC_TWO_CANDIDATES_FOR_AMVP_D0122 5324 6225 Void TComDataCU::fillMvpCand ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo, Int iMVPIdx) 5325 6226 { 6227 fillMvpCandBase(uiPartIdx, uiPartAddr, eRefPicList, iRefIdx, pInfo); 6228 } 6229 #else 6230 Void TComDataCU::fillMvpCand ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo, Int iMVPIdx) 6231 { 6232 5326 6233 if (!m_pcSlice->getSPS()->getViewId() || !m_pcSlice->getSPS()->getMultiviewMvPredMode()) 5327 6234 { … … 5350 6257 // Extension part 5351 6258 DisInfo cDisInfo; 6259 #if QC_CU_NBDV_D0181 6260 cDisInfo.iN = this->getDvInfo(0).iN; 6261 cDisInfo.m_acMvCand[0]=this->getDvInfo(0).m_acMvCand[0]; 6262 cDisInfo.m_aVIdxCan[0] = this->getDvInfo(0).m_aVIdxCan[0]; 6263 cDisInfo.bDV = this->getDvInfo(0).bDV; 6264 #else 5352 6265 cDisInfo.iN = 0; 5353 6266 #if FCO_DVP_REFINE_C0132_C0170 … … 5382 6295 cDisInfo.m_aVIdxCan[0] = 0; 5383 6296 } 6297 #endif 5384 6298 Int paiPdmRefIdx[4] = {-1, -1, -1, -1}; 5385 6299 Int iPdmDir[4] = {-1, -1, -1, -1}; … … 5402 6316 } 5403 6317 } 6318 #endif 5404 6319 5405 6320 … … 5700 6615 } 5701 6616 5702 #if MERL_VSP_C0152 6617 #if MERL_VSP_C0152&!QC_BVSP_CleanUP_D0191 5703 6618 if(pcTmpCU != NULL && pcTmpCU->getVSPIndex(uiIdx)) 5704 6619 { … … 5816 6731 } 5817 6732 5818 #if MERL_VSP_C0152 6733 #if MERL_VSP_C0152 &!QC_BVSP_CleanUP_D0191 5819 6734 if(pcTmpCU->getVSPIndex(uiIdx)) 5820 6735 { … … 5979 6894 TComDataCU *pColCU = pColPic->getCU( uiCUAddr ); 5980 6895 iColViewIdx = pColCU->getSlice()->getViewId(); 5981 #if MERL_VSP_C0152 6896 #if MERL_VSP_C0152 & !QC_BVSP_CleanUP_D0191 5982 6897 if( pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr) < 0) 5983 6898 { … … 7080 7995 memcpy( m_piVSPIndex + uiAbsPartIdxDst, pcCU->getVSPIndex() + uiAbsPartIdxSrc, sizeof( m_piVSPIndex[0] ) * uiNumPartition ); 7081 7996 #endif 7997 #if MERL_VSP_NBDV_RefVId_Fix_D0166 7998 memcpy( m_piVSPDir + uiAbsPartIdxDst, pcCU->getVSPDir () + uiAbsPartIdxSrc, sizeof( m_piVSPDir [0] ) * uiNumPartition ); 7999 #endif 7082 8000 7083 8001 #if !MTK_UNCONSTRAINED_MVI_B0083 … … 7158 8076 TComDataCU::getResidualSamples( UInt uiPartIdx, Bool bRecon, TComYuv* pcYuv ) 7159 8077 { 8078 #if !QC_ARP_D0177 7160 8079 TComResidualGenerator* pcResidualGenerator = m_pcSlice->getSPS()->getResidualGenerator(); 7161 8080 ROFRS( pcResidualGenerator, false ); 8081 #endif 8082 7162 8083 #if H3D_NBDV 7163 8084 DisInfo cDisInfo; 8085 #if !QC_CU_NBDV_D0181 7164 8086 cDisInfo.iN = 0; 8087 #else 8088 cDisInfo.bDV = false; 8089 #endif 7165 8090 PartSize m_peSaved = getPartitionSize( 0 ); 7166 8091 m_pePartSize[0] = SIZE_2Nx2N; … … 7182 8107 else 7183 8108 #endif 7184 8109 #if !QC_CU_NBDV_D0181 7185 8110 getDisMvpCandNBDV( 0, 0, &cDisInfo, false ); 7186 7187 8111 if( cDisInfo.iN == 0) 8112 #else 8113 cDisInfo.bDV = getDvInfo(0).bDV; 8114 #if MERL_VSP_C0152 8115 cDisInfo.m_acMvCand[0] = getDvInfo(0).m_acMvCandNoRef[0]; 8116 #else 8117 cDisInfo.m_acMvCand[0] = getDvInfo(0).m_acMvCand[0]; 8118 #endif 8119 cDisInfo.m_aVIdxCan[0] = 0; 8120 cDisInfo.iN = getDvInfo(0).iN; 8121 if( cDisInfo.bDV == false) 8122 #endif 7188 8123 { 7189 8124 m_pePartSize[0] = m_peSaved; … … 7191 8126 } 7192 8127 else 8128 #if QC_ARP_D0177 8129 if(m_pcSlice->getSPS()->getUseAdvRP()) 8130 { 8131 m_pePartSize[0] = m_peSaved; 8132 return true; 8133 } 8134 else 8135 return false; 8136 #else 7193 8137 { 7194 8138 Bool bAvailable = pcResidualGenerator->getResidualSamples( this, uiPartIdx, pcYuv, cDisInfo.m_acMvCand[0], bRecon ); … … 7196 8140 return bAvailable; 7197 8141 } 8142 #endif 7198 8143 #else 7199 8144 return pcResidualGenerator->getResidualSamples( this, uiPartIdx, pcYuv, bRecon ); … … 7201 8146 } 7202 8147 #endif 7203 8148 #if QC_ARP_D0177 8149 Void TComDataCU::setARPWSubParts ( UChar w, UInt uiAbsPartIdx, UInt uiDepth ) 8150 { 8151 assert( sizeof( *m_puhARPW) == 1 ); 8152 memset( m_puhARPW + uiAbsPartIdx, w, m_pcPic->getNumPartInCU() >> ( 2 * uiDepth ) ); 8153 } 8154 #endif 7204 8155 #if LGE_EDGE_INTRA_A0070 7205 8156 Void TComDataCU::reconPartition( UInt uiAbsPartIdx, UInt uiDepth, Bool bLeft, UChar ucStartPos, UChar ucNumEdge, UChar* pucEdgeCode, Bool* pbRegion ) -
trunk/source/Lib/TLibCommon/TComDataCU.h
r332 r443 195 195 ///< value 0: non-VSP, value 1: VSP 196 196 #endif 197 #if MERL_VSP_NBDV_RefVId_Fix_D0166 198 Char* m_piVSPDir; ///< 0: LIST0; 1: LIST1 199 #endif 197 200 #if AMP_MRG 198 201 Bool m_bIsMergeAMP; … … 214 217 Bool* m_pbResPredFlag; ///< array of residual prediction flags 215 218 #endif 216 219 #if QC_ARP_D0177 220 UChar* m_puhARPW; 221 #endif 217 222 #if LGE_EDGE_INTRA_A0070 218 223 UChar* m_pucEdgeCode; ///< array of edge code … … 268 273 Pel* m_apSegmentDCOffset[2]; 269 274 #endif 270 275 #if QC_CU_NBDV_D0181 276 DisInfo* m_pDvInfo; 277 #endif 271 278 protected: 272 279 … … 275 282 Bool xAddMVPCandOrder ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir ); 276 283 #if MERL_VSP_C0152 277 inline Bool xAddVspMergeCand ( UChar ucVspMergePos, Int vspIdx, Bool* bVspMvZeroDone, UInt uiDepth, Bool* abCandIsInter, Int& iCount, 278 UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, Int* iVSPIndexTrue, Int mrgCandIdx, DisInfo* pDisInfo ); 279 inline Void xInheritVspMode ( TComDataCU* pcCURef, UInt uiIdx, Bool* bVspMvZeroDone, Int iCount, Int* iVSPIndexTrue, TComMvField* pcMvFieldNeighbours, DisInfo* pDInfo ) ; 284 inline Bool xAddVspMergeCand ( 285 UChar ucVspMergePos, 286 #if !LGE_VSP_INHERIT_D0092 287 Int vspIdx, 288 Bool* bVspMvZeroDone, 289 #endif 290 UInt uiDepth, 291 Bool* abCandIsInter, 292 Int& iCount, 293 UChar* puhInterDirNeighbours, 294 TComMvField* pcMvFieldNeighbours, 295 Int* iVSPIndexTrue, 296 Int mrgCandIdx, 297 DisInfo* pDisInfo 298 #if MERL_VSP_NBDV_RefVId_Fix_D0166 299 , Int* iVspDirTrue = NULL 300 #endif 301 ); 302 inline Void xInheritVspMode ( TComDataCU* pcCURef, UInt uiIdx, Bool* bVspMvZeroDone, Int iCount, Int* iVSPIndexTrue, TComMvField* pcMvFieldNeighbours, DisInfo* pDInfo 303 #if QC_BVSP_CleanUP_D0191 304 ,UChar *puhInterDirNeighbours 305 #endif 306 #if MERL_VSP_NBDV_RefVId_Fix_D0166 307 , Int *iVSPDirTrue 308 #endif 309 ) ; 280 310 #endif 281 311 Void deriveRightBottomIdx ( PartSize eCUMode, UInt uiPartIdx, UInt& ruiPartIdxRB ); … … 299 329 300 330 /// compute scaling factor from POC difference 331 #if !QC_ARP_D0177 301 332 Int xGetDistScaleFactor ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC ); 302 333 #endif 303 334 Void xDeriveCenterIdx( PartSize eCUMode, UInt uiPartIdx, UInt& ruiPartIdxCenter ); 304 335 Bool xGetCenterCol( UInt uiPartIdx, RefPicList eRefPicList, int iRefIdx, TComMv *pcMv ); … … 314 345 // create / destroy / initialize / copy 315 346 // ------------------------------------------------------------------------------------------------------------------- 316 347 #if QC_ARP_D0177 348 Int xGetDistScaleFactor ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC ); 349 #endif 350 317 351 Void create ( UInt uiNumPartition, UInt uiWidth, UInt uiHeight, Bool bDecSubCu, Int unitSize 318 352 #if ADAPTIVE_QP_SELECTION … … 326 360 Void initSubCU ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth, Int qp ); 327 361 Void setOutsideCUPart ( UInt uiAbsPartIdx, UInt uiDepth ); 328 362 #if QC_CU_NBDV_D0181 363 Void copyDVInfoFrom (TComDataCU* pcCU, UInt uiAbsPartIdx); 364 #endif 329 365 Void copySubCU ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth ); 330 Void copyInterPredInfoFrom ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList ); 331 Void copyPartFrom ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth ); 366 Void copyInterPredInfoFrom ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList 367 #if QC_CU_NBDV_D0181 368 , Bool bNBDV = false 369 #endif 370 ); 371 Void copyPartFrom ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth 372 #if QC_ARP_D0177 373 , 374 Bool bRP = false 375 #endif 376 ); 332 377 333 378 Void copyToPic ( UChar uiDepth ); … … 458 503 Void setVSPIndex ( UInt uiIdx, Int n ) { m_piVSPIndex[uiIdx] = n; } 459 504 Void setVSPIndexSubParts( Char bVSPIndex, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 505 #endif 506 #if MERL_VSP_NBDV_RefVId_Fix_D0166 507 Char* getVSPDir () { return m_piVSPDir; } 508 Char getVSPDir ( UInt uiIdx ) { return m_piVSPDir[uiIdx]; } 509 Void setVSPDir ( UInt uiIdx, Int n ) { m_piVSPDir[uiIdx] = n; } 510 Void setVSPDirSubParts ( Char bVSPDir, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 511 Bool getRefListAndRefFrmIdx(Int targetRefViewIdx, RefPicList& eRefPicList, Int& refFrmIdx); 460 512 #endif 461 513 … … 474 526 #endif 475 527 #endif 528 #if QC_CU_NBDV_D0181 529 DisInfo* getDvInfo () { return m_pDvInfo; } 530 DisInfo getDvInfo (UInt uiIdx) { return m_pDvInfo[uiIdx]; } 531 Void setDvInfoSubParts( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiDepth ); 532 #endif 476 533 477 534 #if AMP_MRG … … 537 594 Bool getUnifiedMvPredCan ( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* iPdm, Bool bMerge ); 538 595 Void getDisMvpCand ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo ); 596 #if QC_CU_NBDV_D0181 597 Bool getDisMvpCandNBDV( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo , Bool bParMerg = false 598 #else 539 599 Void getDisMvpCandNBDV( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo , Bool bParMerg = false 600 #endif 540 601 #if MERL_VSP_C0152 541 602 , Bool bDepthRefine = false … … 548 609 #if MERL_VSP_C0152 549 610 Pel getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iWidth, Int iHeight, Int* aiShiftLUT, Int iShiftPrec, Bool bSimpleDvpRefine = false); 550 Void estimateDVFromDM(UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred, Bool bSimpleDvpRefine = false); 611 Void estimateDVFromDM( 612 #if MERL_VSP_NBDV_RefVId_Fix_D0166 613 Int refViewIdx, 614 #endif 615 UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred, Bool bSimpleDvpRefine = false); 551 616 #endif 552 617 Bool getIViewOrgDepthMvPred( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv ); … … 568 633 Bool getResidualSamples( UInt uiPartIdx, Bool bRecon, TComYuv* pcYuv = 0 ); 569 634 #endif 635 #if QC_ARP_D0177 636 UChar* getARPW () { return m_puhARPW; } 637 UChar getARPW ( UInt uiIdx ) { return m_puhARPW[uiIdx]; } 638 Void setARPW ( UInt uiIdx, UChar w ) { m_puhARPW[uiIdx] = w; } 639 Void setARPWSubParts ( UChar w, UInt uiAbsPartIdx, UInt uiDepth ); 640 Double getARPWFactor ( UInt uiIdx ); 641 #endif 570 642 // ------------------------------------------------------------------------------------------------------------------- 571 643 // member functions for accessing partition information … … 647 719 Bool hasEqualMotion ( UInt uiAbsPartIdx, TComDataCU* pcCandCU, UInt uiCandAbsPartIdx ); 648 720 #if MERL_VSP_C0152 649 Void getInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int* uiVSPIndexTrue, Int mrgCandIdx = -1 ); 721 Void getInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int* uiVSPIndexTrue, 722 #if MERL_VSP_NBDV_RefVId_Fix_D0166 723 Int* iVSPDir, 724 #endif 725 Int mrgCandIdx = -1 ); 650 726 #else 651 727 Void getInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx = -1 ); … … 688 764 UInt getCtxResPredFlag ( UInt uiAbsPartIdx ); 689 765 #endif 690 766 #if QC_ARP_D0177 767 UInt getCTXARPWFlag ( UInt uiAbsPartIdx ); 768 #endif 691 769 UInt getSliceStartCU ( UInt pos ) { return m_uiSliceStartCU[pos-m_uiAbsIdxInLCU]; } 692 770 UInt getEntropySliceStartCU ( UInt pos ) { return m_uiEntropySliceStartCU[pos-m_uiAbsIdxInLCU]; } … … 808 886 Void setSDCFlagSubParts ( Bool bSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 809 887 888 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 810 889 UInt getCtxSDCFlag ( UInt uiAbsPartIdx ); 890 #endif 811 891 812 892 Bool getSDCAvailable ( UInt uiAbsPartIdx ); -
trunk/source/Lib/TLibCommon/TComDepthMapGenerator.h
r332 r443 80 80 81 81 UInt getPdm () { if( m_aacActiveSPS[0][1] ) { return m_aacActiveSPS[0][1]->getPredDepthMapGeneration(); } return 0; } 82 #if H3D_IVRP 82 #if H3D_IVRP & !QC_ARP_D0177 83 83 UInt getResPrd () { if( m_aacActiveSPS[0][1] ) { return m_aacActiveSPS[0][1]->getMultiviewResPredMode (); } return 0; } 84 84 #endif -
trunk/source/Lib/TLibCommon/TComInterpolationFilter.cpp
r56 r443 72 72 { -2, 10, 58, -2 } 73 73 }; 74 74 #if QC_ARP_D0177 75 const Short TComInterpolationFilter::m_lumaFilterARP[4][NTAPS_LUMA_ARP] = 76 { 77 {64, 0}, 78 {48, 16}, 79 {32, 32}, 80 {16, 48} 81 }; 82 const Short TComInterpolationFilter::m_chromaFilterARP[8][NTAPS_CHROMA_ARP] = 83 { 84 {64, 0}, 85 {56, 8}, 86 {48, 16}, 87 {40, 24}, 88 {32, 32}, 89 {24, 40}, 90 {16, 48}, 91 {8, 56} 92 }; 93 #endif 75 94 // ==================================================================================================================== 76 95 // Private member functions … … 320 339 * \param isLast Flag indicating whether it is the last filtering operation 321 340 */ 322 Void TComInterpolationFilter::filterHorLuma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast ) 341 Void TComInterpolationFilter::filterHorLuma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast 342 #if QC_ARP_D0177 343 , 344 Bool filterType 345 #endif 346 ) 323 347 { 324 348 assert(frac >= 0 && frac < 4); … … 330 354 else 331 355 { 332 filterHor<NTAPS_LUMA>(src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilter[frac]); 356 #if QC_ARP_D0177 357 if(filterType) 358 filterHor<NTAPS_LUMA_ARP>(src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilterARP[frac]); 359 else 360 #endif 361 filterHor<NTAPS_LUMA>(src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilter[frac]); 333 362 } 334 363 } … … 347 376 * \param isLast Flag indicating whether it is the last filtering operation 348 377 */ 349 Void TComInterpolationFilter::filterVerLuma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast ) 378 Void TComInterpolationFilter::filterVerLuma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast 379 #if QC_ARP_D0177 380 , 381 Bool filterType 382 #endif 383 ) 350 384 { 351 385 assert(frac >= 0 && frac < 4); … … 357 391 else 358 392 { 359 filterVer<NTAPS_LUMA>(src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilter[frac]); 393 #if QC_ARP_D0177 394 if(filterType) 395 filterVer<NTAPS_LUMA_ARP>(src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilterARP[frac]); 396 else 397 #endif 398 filterVer<NTAPS_LUMA>(src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilter[frac]); 360 399 } 361 400 } … … 373 412 * \param isLast Flag indicating whether it is the last filtering operation 374 413 */ 375 Void TComInterpolationFilter::filterHorChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast ) 414 Void TComInterpolationFilter::filterHorChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast 415 #if QC_ARP_D0177 416 , 417 Bool filterType 418 #endif 419 ) 376 420 { 377 421 assert(frac >= 0 && frac < 8); … … 383 427 else 384 428 { 429 #if QC_ARP_D0177 430 if(filterType) 431 filterHor<NTAPS_CHROMA_ARP>(src, srcStride, dst, dstStride, width, height, isLast, m_chromaFilterARP[frac]); 432 else 433 #endif 385 434 filterHor<NTAPS_CHROMA>(src, srcStride, dst, dstStride, width, height, isLast, m_chromaFilter[frac]); 386 435 } … … 400 449 * \param isLast Flag indicating whether it is the last filtering operation 401 450 */ 402 Void TComInterpolationFilter::filterVerChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast ) 451 Void TComInterpolationFilter::filterVerChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast 452 #if QC_ARP_D0177 453 , 454 Bool filterType 455 #endif 456 ) 403 457 { 404 458 assert(frac >= 0 && frac < 8); … … 410 464 else 411 465 { 412 filterVer<NTAPS_CHROMA>(src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_chromaFilter[frac]); 466 #if QC_ARP_D0177 467 if(filterType) 468 filterVer<NTAPS_CHROMA_ARP>(src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_chromaFilterARP[frac]); 469 else 470 #endif 471 filterVer<NTAPS_CHROMA>(src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_chromaFilter[frac]); 413 472 } 414 473 } -
trunk/source/Lib/TLibCommon/TComInterpolationFilter.h
r56 r443 44 44 //! \ingroup TLibCommon 45 45 //! \{ 46 #if QC_ARP_D0177 47 #define NTAPS_LUMA_ARP 2 ///< Number of taps for luma 48 #define NTAPS_CHROMA_ARP 2 ///< Number of taps for chroma 49 #endif 46 50 47 51 #define NTAPS_LUMA 8 ///< Number of taps for luma … … 58 62 static const Short m_lumaFilter[4][NTAPS_LUMA]; ///< Luma filter taps 59 63 static const Short m_chromaFilter[8][NTAPS_CHROMA]; ///< Chroma filter taps 60 64 #if QC_ARP_D0177 65 static const Short m_lumaFilterARP [4][NTAPS_LUMA_ARP]; ///< Luma filter taps 66 static const Short m_chromaFilterARP[8][NTAPS_CHROMA_ARP]; ///< Chroma filter taps 67 #endif 68 61 69 static Void filterCopy(const Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Bool isFirst, Bool isLast); 62 70 … … 73 81 ~TComInterpolationFilter() {} 74 82 75 Void filterHorLuma (Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast ); 76 Void filterVerLuma (Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast ); 77 Void filterHorChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast ); 78 Void filterVerChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast ); 83 Void filterHorLuma (Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast 84 #if QC_ARP_D0177 85 , 86 Bool filterType = 0 87 #endif 88 ); 89 Void filterVerLuma (Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast 90 #if QC_ARP_D0177 91 , 92 Bool filterType = 0 93 #endif 94 ); 95 Void filterHorChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast 96 #if QC_ARP_D0177 97 , 98 Bool filterType = 0 99 #endif 100 ); 101 Void filterVerChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast 102 #if QC_ARP_D0177 103 , 104 Bool filterType = 0 105 #endif 106 ); 79 107 }; 80 108 -
trunk/source/Lib/TLibCommon/TComLoopFilter.cpp
r296 r443 428 428 //-- Set BS for Intra MB : BS = 4 or 3 429 429 if ( pcCUP->isIntra(uiPartP) || pcCUQ->isIntra(uiPartQ) 430 #if MERL_VSP_C0152 430 #if MERL_VSP_C0152 & !QC_BVSP_CleanUP_D0191 431 431 || pcCUP->getVSPIndex(uiPartP) || pcCUQ->getVSPIndex(uiPartQ) 432 432 #endif … … 438 438 //-- Set BS for not Intra MB : BS = 2 or 1 or 0 439 439 if ( !pcCUP->isIntra(uiPartP) && !pcCUQ->isIntra(uiPartQ) 440 #if MERL_VSP_C0152 440 #if MERL_VSP_C0152 & !QC_BVSP_CleanUP_D0191 441 441 && !pcCUP->getVSPIndex(uiPartP) && !pcCUQ->getVSPIndex(uiPartQ) 442 442 #endif … … 534 534 } // enf of "if( not Intra )" 535 535 536 #if MERL_VSP_C0152 536 #if MERL_VSP_C0152 & !QC_BVSP_CleanUP_D0191 537 537 if ( pcCUP->getVSPIndex(uiPartP) || pcCUQ->getVSPIndex(uiPartQ)) 538 538 { -
trunk/source/Lib/TLibCommon/TComMotionInfo.h
r332 r443 64 64 TComMv m_acMvCand[ DIS_CANS ]; ///< array of motion vector predictor candidates 65 65 Int m_aVIdxCan[ DIS_CANS ]; ///< array of motion vector predictor candidates 66 #if QC_CU_NBDV_D0181 67 Bool bDV; 68 #if MERL_VSP_C0152 69 TComMv m_acMvCandNoRef[ DIS_CANS ]; 70 #endif 71 #endif 66 72 Int iN; ///< number of motion vector predictor candidates 73 #if MERL_VSP_NBDV_RefVId_Fix_D0166 74 Int m_aListIdx[ DIS_CANS ]; ///< array of reference list of derived NBDV 75 Int m_aRefIdx [ DIS_CANS ]; ///< array of reference frame index corresponding to either RefList0/1 76 #endif 67 77 } DisInfo; 68 78 -
trunk/source/Lib/TLibCommon/TComPicYuv.cpp
r332 r443 488 488 } 489 489 } 490 490 #if QC_ARP_D0177 491 Void TComPicYuv::clearPic() 492 { 493 ::memset ( m_apiPicBufY, 0 , sizeof (Pel) * ( m_iPicWidth + (m_iLumaMarginX << 1)) * ( m_iPicHeight + (m_iLumaMarginY << 1)) ); 494 ::memset ( m_apiPicBufU, 0 , sizeof (Pel) * ((m_iPicWidth >> 1) + (m_iChromaMarginX << 1)) * ((m_iPicHeight >> 1) + (m_iChromaMarginY << 1)) ); 495 ::memset ( m_apiPicBufV, 0 , sizeof (Pel) * ((m_iPicWidth >> 1) + (m_iChromaMarginX << 1)) * ((m_iPicHeight >> 1) + (m_iChromaMarginY << 1)) ); 496 } 497 #endif 491 498 //! \} -
trunk/source/Lib/TLibCommon/TComPicYuv.h
r56 r443 183 183 Void setLumaTo ( Pel pVal ); 184 184 Void setChromaTo ( Pel pVal ); 185 185 #if QC_ARP_D0177 186 Void clearPic(); 187 #endif 186 188 };// END CLASS DEFINITION TComPicYuv 187 189 -
trunk/source/Lib/TLibCommon/TComPrediction.cpp
r332 r443 50 50 #endif 51 51 52 #if HHI_DELTADC_DLT_D0035 53 #define GetDepthValue2Idx(val) (pcCU->getSlice()->getSPS()->depthValue2idx(val)) 54 #define GetIdx2DepthValue(val) (pcCU->getSlice()->getSPS()->idx2DepthValue(val)) 55 #endif 56 57 #if MERL_General_Fix 58 #if MERL_VSP_C0152 59 #if MERL_CVSP_D0165 60 Int TComPrediction::m_iRangeLuma[12] = {14, 34, 21, 15, 36, 26, 21, 49, 41, 36, 80, 72}; 61 Int TComPrediction::m_iRangeChroma[12] = { 2, 8, 5, 4, 11, 9, 8, 19, 17, 15, 34, 32}; 62 #endif 63 #endif 64 #endif 65 52 66 TComPrediction::TComPrediction() 53 67 : m_pLumaRecBuffer(0) … … 78 92 79 93 m_cYuvPredTemp.destroy(); 80 94 #if QC_ARP_D0177 95 m_acYuvPredBase[0].destroy(); 96 m_acYuvPredBase[1].destroy(); 97 m_acYuvDiff[0].destroy(); 98 m_acYuvDiff[1].destroy(); 99 #endif 81 100 if( m_pLumaRecBuffer ) 82 101 { … … 119 138 120 139 m_cYuvPredTemp.create( g_uiMaxCUWidth, g_uiMaxCUHeight ); 140 #if QC_ARP_D0177 141 m_acYuvPredBase[0] .create( g_uiMaxCUWidth, g_uiMaxCUHeight ); 142 m_acYuvPredBase[1] .create( g_uiMaxCUWidth, g_uiMaxCUHeight ); 143 m_acYuvDiff [0] .create( g_uiMaxCUWidth, g_uiMaxCUHeight ); 144 m_acYuvDiff [1] .create( g_uiMaxCUWidth, g_uiMaxCUHeight ); 145 #endif 121 146 } 122 147 … … 535 560 // Do prediction 536 561 { 562 #if QC_DC_PREDICTOR_D0183 563 Int iMean0, iMean1; 564 getPredDCs( pbRegion, iWidth, pSrc+srcStride+1, srcStride, iMean0, iMean1 ); 565 #else 537 566 //UInt uiSum0 = 0, uiSum1 = 0; 538 567 Int iSum0 = 0, iSum1 = 0; … … 573 602 iMean0 = iSum0 / iCount0; // TODO : integer op. 574 603 iMean1 = iSum1 / iCount1; 604 #endif 575 605 #if LGE_EDGE_INTRA_DELTA_DC 576 606 if( bDelta ) … … 751 781 } 752 782 753 #if H3D_IVRP 783 #if H3D_IVRP & !QC_ARP_D0177 754 784 Void TComPrediction::residualPrediction(TComDataCU* pcCU, TComYuv* pcYuvPred, TComYuv* pcYuvResPred) 755 785 { … … 768 798 pcYuvPred->add(pcYuvResPred, iWidth, iHeight); 769 799 } 800 #endif 801 802 #if MERL_General_Fix 803 #if MERL_VSP_C0152 804 // Function to perform VSP block compensation 805 Void TComPrediction::xPredInterVSPBlk(TComDataCU* pcCU, UInt uiPartAddr, UInt uiAbsPartIdx, Int iWidth, Int iHeight, TComMv cMv, RefPicList eRefPicList, TComYuv*& rpcYuvPred 806 , Bool bi 807 #if !MERL_Bi_VSP_D0166 808 , Int vspIdx 809 #endif 810 ) 811 { 812 TComPic* pRefPicBaseTxt = NULL; 813 TComPicYuv* pcBaseViewTxtPicYuv = NULL; 814 TComPicYuv* pcBaseViewDepthPicYuv = NULL; 815 Int iBlkX = 0; 816 Int iBlkY = 0; 817 Int* pShiftLUT; 818 Int iShiftPrec; 819 820 #if !MERL_VSP_NBDV_RefVId_Fix_D0166 821 pRefPicBaseTxt = pcCU->getSlice()->getRefPicBaseTxt(); 822 pcBaseViewTxtPicYuv = pRefPicBaseTxt->getPicYuvRec(); 823 TComPic* pRefPicBaseDepth = pcCU->getSlice()->getRefPicBaseDepth(); 824 pcBaseViewDepthPicYuv = pRefPicBaseDepth->getPicYuvRec(); 825 826 Int iBlkX = ( pcCU->getAddr() % pRefPicBaseDepth->getFrameWidthInCU() ) * g_uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartIdx ] ]; 827 Int iBlkY = ( pcCU->getAddr() / pRefPicBaseDepth->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartIdx ] ]; 828 pcCU->getSlice()->getBWVSPLUTParam(pShiftLUT, iShiftPrec); 829 xPredInterLumaBlkFromDM ( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, iShiftPrec, &cMv, uiPartAddr, iBlkX, iBlkY, iWidth, iHeight, pcCU->getSlice()->getSPS()->isDepth(), rpcYuvPred ); 830 xPredInterChromaBlkFromDM( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, iShiftPrec, &cMv, uiPartAddr, iBlkX>>1, iBlkY>>1, iWidth>>1, iHeight>>1, pcCU->getSlice()->getSPS()->isDepth(), rpcYuvPred ); 831 832 #else // MERL_VSP_NBDV_RefVId_Fix_D0166 833 // Step 1: get depth reference 834 #if QC_BVSP_CleanUP_D0191 835 RefPicList privateRefPicList = REF_PIC_LIST_0; 836 Int refIdxList0 = pcCU->getCUMvField( REF_PIC_LIST_0 )->getRefIdx( uiPartAddr ); 837 Int refIdxList1 = pcCU->getCUMvField( REF_PIC_LIST_1 )->getRefIdx( uiPartAddr ); 838 privateRefPicList = refIdxList0 != NOT_VALID ? REF_PIC_LIST_0 : REF_PIC_LIST_1; 839 if(privateRefPicList == REF_PIC_LIST_1 && refIdxList1== NOT_VALID ) 840 { 841 assert(0); 842 } 843 Int privateRefIdx = privateRefPicList == REF_PIC_LIST_0 ? refIdxList0 : refIdxList1; 844 Int viewId = pcCU->getSlice()->getRefViewId(privateRefPicList, privateRefIdx); 845 Int refPoc = pcCU->getSlice()->getRefPOC(privateRefPicList, privateRefIdx); 846 #else 847 //recover VSP reference frame according to negative refIdx number 848 RefPicList privateRefPicList = (RefPicList) pcCU->getVSPDir( uiPartAddr ); 849 assert(privateRefPicList == REF_PIC_LIST_0 || privateRefPicList == REF_PIC_LIST_1); 850 Int refIdx = -1-pcCU->getCUMvField( privateRefPicList )->getRefIdx( uiPartAddr ); // texture ref index, a trick when storing refIdx 851 Int viewId = pcCU->getSlice()->getRefViewId(privateRefPicList, refIdx); // texture view id 852 Int refPoc = pcCU->getSlice()->getRefPOC(privateRefPicList, refIdx); // texture POC 853 #endif 854 TComPic* pRefPicBaseDepth = pcCU->getSlice()->getDepthRefPic(viewId, refPoc); 855 856 pcBaseViewDepthPicYuv = pRefPicBaseDepth->getPicYuvRec(); 857 assert(refPoc == pcCU->getSlice()->getPOC()); 858 assert(pRefPicBaseDepth != NULL); 859 assert(pcBaseViewDepthPicYuv != NULL); 860 861 iBlkX = ( pcCU->getAddr() % pRefPicBaseDepth->getFrameWidthInCU() ) * g_uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartIdx ] ]; 862 iBlkY = ( pcCU->getAddr() / pRefPicBaseDepth->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartIdx ] ]; 863 #if MERL_Bi_VSP_D0166 864 // Step 2: get texture reference 865 pRefPicBaseTxt = xGetVspRefTxt( pcCU, uiPartAddr, eRefPicList); 866 pcBaseViewTxtPicYuv = pRefPicBaseTxt->getPicYuvRec(); 867 assert(pcBaseViewTxtPicYuv != NULL); 868 869 // initialize the LUT according to the reference view idx 870 pcCU->getSlice()->getBWVSPLUTParam(pShiftLUT, iShiftPrec, pRefPicBaseTxt->getViewId()); 871 872 // Step 3: Do compensation 873 xPredInterLumaBlkFromDM ( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, iShiftPrec, &cMv, uiPartAddr, iBlkX, iBlkY, iWidth, iHeight, pcCU->getSlice()->getSPS()->isDepth(), rpcYuvPred, bi ); 874 xPredInterChromaBlkFromDM( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, iShiftPrec, &cMv, uiPartAddr, iBlkX>>1, iBlkY>>1, iWidth>>1, iHeight>>1, pcCU->getSlice()->getSPS()->isDepth(), rpcYuvPred, bi ); 875 #else 876 // Step 2: get texture reference 877 pRefPicBaseTxt = pcCU->getSlice()->getRefPic(privateRefPicList, refIdx); 878 pcBaseViewTxtPicYuv = pRefPicBaseTxt->getPicYuvRec(); 879 assert(pcBaseViewTxtPicYuv != NULL); 880 881 //initialize the LUT according to the reference view idx 882 pcCU->getSlice()->getBWVSPLUTParam(pShiftLUT, iShiftPrec, pRefPicBaseTxt->getViewId()); 883 884 // Step 3: Do compensation 885 xPredInterLumaBlkFromDM ( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, iShiftPrec, &cMv, uiPartAddr, iBlkX, iBlkY, iWidth, iHeight, pcCU->getSlice()->getSPS()->isDepth(), vspIdx, rpcYuvPred ); 886 xPredInterChromaBlkFromDM( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, iShiftPrec, &cMv, uiPartAddr, iBlkX>>1, iBlkY>>1, iWidth>>1, iHeight>>1, pcCU->getSlice()->getSPS()->isDepth(), vspIdx, rpcYuvPred ); 887 #endif 888 889 #endif 890 } 891 892 #endif 893 894 #if MERL_Bi_VSP_D0166 895 TComPic* TComPrediction::xGetVspRefTxt(TComDataCU* pcCU, UInt uiPartAddr, RefPicList eRefPicList) 896 { 897 #if QC_BVSP_CleanUP_D0191 898 RefPicList privateRefPicList = REF_PIC_LIST_0; 899 Int refIdxList0 = pcCU->getCUMvField( REF_PIC_LIST_0 )->getRefIdx( uiPartAddr ); 900 Int refIdxList1 = pcCU->getCUMvField( REF_PIC_LIST_1 )->getRefIdx( uiPartAddr ); 901 privateRefPicList = refIdxList0 != NOT_VALID ? REF_PIC_LIST_0 : REF_PIC_LIST_1; 902 if(privateRefPicList == REF_PIC_LIST_1 && refIdxList1==NOT_VALID ) 903 { 904 assert(0); 905 } 906 Int privateRefIdx = privateRefPicList == REF_PIC_LIST_0 ? refIdxList0 : refIdxList1; 907 Int viewId = pcCU->getSlice()->getRefViewId(privateRefPicList, privateRefIdx); 908 #else 909 RefPicList privateRefPicList = (RefPicList) pcCU->getVSPDir( uiPartAddr ); 910 Int refIdx = -1-pcCU->getCUMvField( privateRefPicList )->getRefIdx( uiPartAddr ); // texture ref index, a trick when storing refIdx 911 Int viewId = pcCU->getSlice()->getRefViewId(privateRefPicList, refIdx); // texture view id 912 #endif 913 TComPic* refPic = NULL; 914 915 assert(privateRefPicList == REF_PIC_LIST_0 || privateRefPicList == REF_PIC_LIST_1); 916 917 if (privateRefPicList == eRefPicList) 918 { 919 #if QC_BVSP_CleanUP_D0191 920 Int refIdxt = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr ); 921 #else 922 Int refIdxt = -1-pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr ); 923 #endif 924 assert(refIdxt>= 0); 925 refPic = pcCU->getSlice()->getRefPic(eRefPicList, refIdxt); 926 } 927 else 928 { 929 // Find the other interview reference in order to do VSP 930 RefPicList otherRefPicList = privateRefPicList == REF_PIC_LIST_0 ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 931 Bool isFound = false; 932 for (Int iRefIdx = 0; iRefIdx <pcCU->getSlice()->getNumRefIdx(otherRefPicList); iRefIdx ++ ) 933 { 934 Int refViewIdx = pcCU->getSlice()->getRefViewId( otherRefPicList, iRefIdx); 935 if ( (refViewIdx != pcCU->getSlice()->getViewId()) && (refViewIdx != viewId ) ) 936 { 937 refPic = pcCU->getSlice()->getRefPic(otherRefPicList, iRefIdx); 938 isFound = true; 939 break; 940 } 941 } 942 943 if (isFound == false) 944 { 945 #if QC_BVSP_CleanUP_D0191 946 Int refIdxTxt = pcCU->getCUMvField( privateRefPicList )->getRefIdx( uiPartAddr ); 947 #else 948 Int refIdxTxt = -1-pcCU->getCUMvField( privateRefPicList )->getRefIdx( uiPartAddr ); 949 #endif 950 assert(refIdxTxt >= 0); 951 refPic = pcCU->getSlice()->getRefPic(privateRefPicList, refIdxTxt); 952 } 953 assert(isFound); 954 } 955 assert(refPic != NULL); 956 return refPic; 957 } 958 #endif 770 959 #endif 771 960 … … 781 970 if (vspIdx != 0) 782 971 { 972 #if !QC_BVSP_CleanUP_D0191 783 973 if (iRefIdx >= 0) 784 974 { … … 786 976 } 787 977 assert (iRefIdx < 0); // assert (iRefIdx == NOT_VALID); 978 #endif 788 979 } 789 980 else … … 810 1001 } 811 1002 #endif 812 1003 #if QC_ARP_D0177 1004 if( 1005 #if MERL_General_Fix // TODO: Maybe logically redundant, but easier to read. Need verification before being removed 1006 #if MERL_VSP_C0152 1007 vspIdx == 0 && 1008 #endif 1009 #endif 1010 pcCU->getSlice()->getSPS()->isDepth() == false 1011 && pcCU->getSlice()->getSPS()->getViewId() > 0 1012 && pcCU->getSlice()->getSPS()->getUseAdvRP() > 0 1013 && pcCU->getARPW( uiPartAddr ) > 0 1014 && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()!= pcCU->getSlice()->getPOC() 1015 && (pcCU->getPartitionSize(uiPartAddr)==SIZE_2Nx2N || pcCU->isSkipped(uiPartAddr)) 1016 ) 1017 { 1018 xPredInterUniARP( pcCU , uiPartAddr , iWidth , iHeight , eRefPicList , rpcYuvPred , iPartIdx , bi ); 1019 } 1020 else 1021 { 1022 #endif 813 1023 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC 814 1024 if( pcCU->getSlice()->getSPS()->isDepth() ) … … 816 1026 #if MERL_VSP_C0152 817 1027 if (vspIdx != 0) 818 { // depth, vsp 1028 { // depth, vsp compensation 1029 #if !MERL_General_Fix 819 1030 // get depth estimator here 820 1031 TComPic* pRefPicBaseDepth = pcCU->getSlice()->getRefPicBaseDepth(); … … 833 1044 xPredInterLumaBlkFromDM ( pcBaseViewDepthPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, iShiftPrec, &cMv, uiPartAddr, iBlkX, iBlkY, iWidth, iHeight, pcCU->getSlice()->getSPS()->isDepth(), vspIdx, rpcYuvPred ); 834 1045 xPredInterChromaBlkFromDM( pcBaseViewDepthPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, iShiftPrec, &cMv, uiPartAddr, iBlkX>>1, iBlkY>>1, iWidth>>1, iHeight>>1, pcCU->getSlice()->getSPS()->isDepth(), vspIdx, rpcYuvPred ); 1046 #else 1047 #if MERL_Bi_VSP_D0166 1048 xPredInterVSPBlk(pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, cMv, eRefPicList, rpcYuvPred, bi ); 1049 #else 1050 xPredInterVSPBlk(pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, cMv, eRefPicList, rpcYuvPred, bi, vspIdx ); 1051 #endif 1052 #endif 835 1053 } 836 1054 else … … 855 1073 #endif// MERL_VSP_C0152 //else 856 1074 } 857 else 1075 else // texture 858 1076 { 859 1077 #endif 860 1078 #if MERL_VSP_C0152 861 1079 if ( vspIdx != 0 ) 862 { // texture, vsp 1080 { // texture, vsp compensation 1081 #if !MERL_General_Fix 863 1082 TComPic* pRefPicBaseTxt = pcCU->getSlice()->getRefPicBaseTxt(); 864 1083 TComPicYuv* pcBaseViewTxtPicYuv = pRefPicBaseTxt->getPicYuvRec(); … … 879 1098 xPredInterLumaBlkFromDM ( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, iShiftPrec, &cMv, uiPartAddr, iBlkX, iBlkY, iWidth, iHeight, pcCU->getSlice()->getSPS()->isDepth(), vspIdx, rpcYuvPred ); 880 1099 xPredInterChromaBlkFromDM( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, iShiftPrec, &cMv, uiPartAddr, iBlkX>>1, iBlkY>>1, iWidth>>1, iHeight>>1, pcCU->getSlice()->getSPS()->isDepth(), vspIdx, rpcYuvPred ); 1100 #else 1101 #if MERL_Bi_VSP_D0166 1102 xPredInterVSPBlk(pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, cMv, eRefPicList, rpcYuvPred, bi ); 1103 #else 1104 xPredInterVSPBlk(pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, cMv, eRefPicList, rpcYuvPred, bi, vspIdx ); 1105 #endif 1106 #endif 881 1107 } 882 1108 else//texture not VSP … … 911 1137 } 912 1138 #endif 913 } 914 1139 #if QC_ARP_D0177 1140 } 1141 #endif 1142 } 1143 1144 #if QC_ARP_D0177 1145 Void TComPrediction::xPredInterUniARP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bi, TComMvField * pNewMvFiled ) 1146 { 1147 Int iRefIdx = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr ); 1148 TComMv cMv = pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr ); 1149 Bool bTobeScaled = false; 1150 UChar dW = pcCU->getARPW ( uiPartAddr ); 1151 TComPic* pcPicYuvBaseCol = NULL; 1152 TComPic* pcPicYuvBaseRef = NULL; 1153 DisInfo cDistparity; 1154 1155 if( pNewMvFiled ) 1156 { 1157 iRefIdx = pNewMvFiled->getRefIdx(); 1158 cMv = pNewMvFiled->getMv(); 1159 } 1160 1161 #if QC_CU_NBDV_D0181 1162 cDistparity.bDV = pcCU->getDvInfo(uiPartAddr).bDV; 1163 if( cDistparity.bDV ) 1164 { 1165 #if MERL_VSP_C0152 1166 cDistparity.m_acMvCand[0] = pcCU->getDvInfo(0).m_acMvCandNoRef[0]; 1167 #else 1168 cDistparity.m_acMvCand[0] = pcCU->getDvInfo(0).m_acMvCand[0]; 1169 #endif 1170 assert(pcCU->getDvInfo(uiPartAddr).bDV == pcCU->getDvInfo(0).bDV); 1171 cDistparity.m_aVIdxCan[0] = pcCU->getDvInfo(uiPartAddr).m_aVIdxCan[0]; 1172 cDistparity.iN = pcCU->getDvInfo(uiPartAddr).iN; 1173 } 1174 else 1175 cDistparity.iN = 0; 1176 #else 1177 pcCU->getDisMvpCandNBDV( iPartIdx, uiPartAddr, &cDistparity, false ); 1178 #endif 1179 1180 dW = !cDistparity.iN ? 0: dW; 1181 if( cDistparity.iN ) 1182 { 1183 if(dW > 0 && pcCU->getSlice()->getRefPic( eRefPicList, 0 )->getPOC()!= pcCU->getSlice()->getPOC()) 1184 bTobeScaled = true; 1185 pcPicYuvBaseCol = pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getPOC(), cDistparity.m_aVIdxCan[0] ); 1186 pcPicYuvBaseRef = pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getRefPic( eRefPicList, 0 )->getPOC(), cDistparity.m_aVIdxCan[0] ); 1187 if( (!pcPicYuvBaseCol || pcPicYuvBaseCol->getPOC() != pcCU->getSlice()->getPOC()) || (!pcPicYuvBaseRef || pcPicYuvBaseRef->getPOC() != pcCU->getSlice()->getRefPic( eRefPicList, 0 )->getPOC() )) 1188 { 1189 dW = 0; 1190 bTobeScaled = false; 1191 } 1192 else 1193 assert( pcPicYuvBaseCol->getPOC() == pcCU->getSlice()->getPOC() && pcPicYuvBaseRef->getPOC() == pcCU->getSlice()->getRefPic( eRefPicList, 0 )->getPOC() ); 1194 if(bTobeScaled) 1195 { 1196 Int iCurrPOC = pcCU->getSlice()->getPOC(); 1197 Int iColRefPOC = pcCU->getSlice()->getRefPOC( eRefPicList, iRefIdx ); 1198 Int iCurrRefPOC = pcCU->getSlice()->getRefPOC( eRefPicList, 0); 1199 Int iScale = pcCU-> xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iCurrPOC, iColRefPOC); 1200 if ( iScale != 4096 ) 1201 cMv = cMv.scaleMv( iScale ); 1202 iRefIdx = 0; 1203 } 1204 } 1205 pcCU->clipMv(cMv); 1206 TComPicYuv* pcPicYuvRef = pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(); 1207 xPredInterLumaBlk ( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi 1208 #if LGE_ILLUCOMP_B0045 1209 , false 1210 #endif 1211 , true 1212 ); 1213 xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi 1214 #if LGE_ILLUCOMP_B0045 1215 , false 1216 #endif 1217 , true 1218 ); 1219 if( dW > 0 ) 1220 { 1221 TComYuv * pYuvmB0 = &m_acYuvPredBase[0]; 1222 TComYuv * pYuvB1 = &m_acYuvPredBase[1]; 1223 assert ( cDistparity.iN == 1 ); 1224 pcPicYuvRef = pcPicYuvBaseCol->getPicYuvRec(); 1225 xPredInterLumaBlk ( pcCU, pcPicYuvRef, uiPartAddr, &cDistparity.m_acMvCand[0], iWidth, iHeight, pYuvB1, bi 1226 #if LGE_ILLUCOMP_B0045 1227 , false 1228 #endif 1229 , true 1230 ); 1231 xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cDistparity.m_acMvCand[0], iWidth, iHeight, pYuvB1, bi 1232 #if LGE_ILLUCOMP_B0045 1233 , false 1234 #endif 1235 , true 1236 ); 1237 pcPicYuvRef = pcPicYuvBaseRef->getPicYuvRec(); 1238 TComMv cMVwithDisparity = cMv + cDistparity.m_acMvCand[0]; 1239 pcCU->clipMv(cMVwithDisparity); 1240 xPredInterLumaBlk ( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvmB0, bi 1241 #if LGE_ILLUCOMP_B0045 1242 , false 1243 #endif 1244 , true 1245 ); 1246 xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvmB0, bi 1247 #if LGE_ILLUCOMP_B0045 1248 , false 1249 #endif 1250 , true 1251 ); 1252 pYuvB1->subtractARP( pYuvB1 , pYuvmB0 , uiPartAddr , iWidth , iHeight ); 1253 if(dW == 2) 1254 pYuvB1->multiplyARP( uiPartAddr , iWidth , iHeight , dW ); 1255 rpcYuvPred->addARP( rpcYuvPred , pYuvB1 , uiPartAddr , iWidth , iHeight , !bi ); 1256 } 1257 } 1258 #endif 915 1259 916 1260 #if MERL_VSP_C0152 … … 923 1267 Int iRefIdx[2] = {-1, -1}; 924 1268 1269 #if MERL_Bi_VSP_D0166 1270 Bool biDecision = 0; 1271 Int predDirVSP = 0; 1272 #if QC_BVSP_CleanUP_D0191 1273 RefPicList privateRefPicList = REF_PIC_LIST_0; 1274 #endif 1275 if (pcCU->getVSPIndex(uiPartAddr) != 0) // is VSP 1276 { 1277 Int biVSPAvail = 0; 1278 //test whether VSP is Bi or Uni 1279 //Step1. Get derived DV view id 1280 #if QC_BVSP_CleanUP_D0191 1281 RefPicList otherRefPicList = REF_PIC_LIST_1; 1282 Int refIdxList0 = pcCU->getCUMvField( REF_PIC_LIST_0 )->getRefIdx( uiPartAddr ); 1283 Int refIdxList1 = pcCU->getCUMvField( REF_PIC_LIST_1 )->getRefIdx( uiPartAddr ); 1284 privateRefPicList = refIdxList0 != NOT_VALID ? REF_PIC_LIST_0 : REF_PIC_LIST_1; 1285 if(privateRefPicList == REF_PIC_LIST_1 && refIdxList1==NOT_VALID ) 1286 { 1287 assert(0); 1288 } 1289 Int privateRefIdx = privateRefPicList == REF_PIC_LIST_0 ? refIdxList0 : refIdxList1; 1290 Int viewId = pcCU->getSlice()->getRefViewId(privateRefPicList, privateRefIdx); 1291 Int refPoc = pcCU->getSlice()->getRefPOC(privateRefPicList, privateRefIdx); 1292 #else 1293 Int refIdx = pcCU->getCUMvField( privateRefPicList )->getRefIdx( uiPartAddr ); 1294 RefPicList privateRefPicList = (RefPicList) pcCU->getVSPDir( uiPartAddr ); 1295 RefPicList otherRefPicList = privateRefPicList == REF_PIC_LIST_0 ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 1296 assert(privateRefPicList == REF_PIC_LIST_0 || privateRefPicList == REF_PIC_LIST_1); 1297 Int refIdx = -1-pcCU->getCUMvField( privateRefPicList )->getRefIdx( uiPartAddr ); 1298 assert(refIdx >= 0); 1299 Int viewId = pcCU->getSlice()->getRefViewId(privateRefPicList, refIdx); 1300 Int refPoc = pcCU->getSlice()->getRefPOC(privateRefPicList, refIdx); 1301 #endif 1302 assert(refPoc == pcCU->getSlice()->getPOC()); 1303 // if(refPoc != pcCU->getSlice()->getPOC() ) 1304 // { 1305 // printf("refPOC= %d, and current POC=%d\n", refPoc, pcCU->getSlice()->getPOC() ); 1306 // } 1307 //Step 2. Get initial prediction direction value according to reference picture list availability 1308 Int iInterDir = ((pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_0) > 0 && pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_1) > 0) ? 3 : 1309 (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_0) > 0 ? 1 : 2)); 1310 //Step 3. Check the availability of Bi VSP by checking the interview reference availability in the other reference list 1311 if(iInterDir == 3) 1312 { 1313 for (Int jRefIdx = 0; jRefIdx <pcCU->getSlice()->getNumRefIdx(otherRefPicList); jRefIdx++ ) 1314 { 1315 Int refViewIdx = pcCU->getSlice()->getRefViewId( otherRefPicList, jRefIdx); 1316 if ( (refViewIdx != pcCU->getSlice()->getViewId()) && (refViewIdx != viewId ) ) 1317 { 1318 biVSPAvail = 1; 1319 break; 1320 } 1321 } 1322 } 1323 //Step 4. Update the Bi VSP prediction direction 1324 if ( iInterDir == 3 && biVSPAvail == 1) 1325 { 1326 biDecision = 1; 1327 predDirVSP = 3; 1328 } 1329 else 1330 { 1331 biDecision = 0; 1332 if ( privateRefPicList == REF_PIC_LIST_0 ) 1333 predDirVSP = 1; 1334 else 1335 predDirVSP = 2; 1336 } 1337 } 1338 else 1339 {//not VSP 1340 if( ( pcCU->getCUMvField( REF_PIC_LIST_0 )->getRefIdx( uiPartAddr ) >= 0 && pcCU->getCUMvField( REF_PIC_LIST_1 )->getRefIdx( uiPartAddr ) >= 0 ) ) 1341 biDecision = 1; 1342 else 1343 biDecision = 0; 1344 } 1345 #endif 1346 925 1347 for ( Int iRefList = 0; iRefList < 2; iRefList++ ) 926 1348 { … … 938 1360 else 939 1361 { 940 if ( iRefList== REF_PIC_LIST_1 && iRefIdx[iRefList] < 0 ) // iRefIdx[iRefList] ==NOT_VALID 1362 1363 #if !MERL_Bi_VSP_D0166 //both lists should go 1364 if ( iRefList == REF_PIC_LIST_1 && iRefIdx[iRefList] < 0 ) // iRefIdx[iRefList] ==NOT_VALID 941 1365 { 942 1366 continue; 943 1367 } 1368 #else 1369 //Reference list loop termination 1370 #if QC_BVSP_CleanUP_D0191 1371 RefPicList privateVSPRefPicList = privateRefPicList; 1372 #else 1373 RefPicList privateVSPRefPicList = (RefPicList) pcCU->getVSPDir( uiPartAddr ); 1374 #endif 1375 if( (pcCU->getVSPIndex(uiPartAddr)!=0) && iRefList != privateVSPRefPicList && !biDecision ) 1376 {//when VSP mode, if it is uni prediction, the other reference list should skip 1377 continue; 1378 } 1379 #endif 1380 944 1381 } 945 1382 #else … … 953 1390 954 1391 pcMbYuv = &m_acYuvPred[iRefList]; 1392 1393 #if MERL_Bi_VSP_D0166 1394 if(biDecision == 1) 1395 #else 955 1396 if( pcCU->getCUMvField( REF_PIC_LIST_0 )->getRefIdx( uiPartAddr ) >= 0 && pcCU->getCUMvField( REF_PIC_LIST_1 )->getRefIdx( uiPartAddr ) >= 0 ) 1397 #endif 956 1398 { 957 1399 #if MERL_VSP_C0152 … … 993 1435 { 994 1436 #if MERL_VSP_C0152 1437 #if !MERL_Bi_VSP_D0166 995 1438 if(pcCU->getVSPIndex(uiPartAddr)) 996 1439 m_acYuvPred[0].copyPartToPartYuv( rpcYuvPred, uiPartAddr, iWidth, iHeight ); 997 1440 else 998 1441 #endif 1442 #endif 999 1443 xWeightedPredictionBi( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred ); 1000 1444 } … … 1004 1448 { 1005 1449 #if MERL_VSP_C0152 1450 #if !MERL_Bi_VSP_D0166 1006 1451 if(pcCU->getVSPIndex(uiPartAddr)) 1007 1452 m_acYuvPred[0].copyPartToPartYuv( rpcYuvPred, uiPartAddr, iWidth, iHeight ); 1008 1453 else 1009 1454 #endif 1455 #endif 1010 1456 xWeightedPredictionUni( pcCU, &m_acYuvPred[0], uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, rpcYuvPred, iPartIdx ); 1011 1457 } … … 1020 1466 { 1021 1467 #if MERL_VSP_C0152 1468 #if !MERL_Bi_VSP_D0166 1022 1469 if(pcCU->getVSPIndex(uiPartAddr)) 1023 1470 m_acYuvPred[0].copyPartToPartYuv( rpcYuvPred, uiPartAddr, iWidth, iHeight ); 1024 1471 else 1025 #endif 1472 xWeightedAverage( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred ); 1473 #else 1474 xWeightedAverage( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred, predDirVSP ); 1475 #endif 1476 #else 1026 1477 xWeightedAverage( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred ); 1478 #endif 1027 1479 } 1028 1480 } … … 1108 1560 */ 1109 1561 #if LGE_ILLUCOMP_B0045 1110 Void TComPrediction::xPredInterLumaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi, Bool bICFlag) 1111 #else 1112 Void TComPrediction::xPredInterLumaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi ) 1562 Void TComPrediction::xPredInterLumaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi, Bool bICFlag 1563 #if QC_ARP_D0177 1564 , 1565 Int filterType 1566 #endif 1567 ) 1568 #else 1569 Void TComPrediction::xPredInterLumaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi 1570 #if QC_ARP_D0177 1571 , 1572 Int filterType 1573 #endif 1574 ) 1113 1575 #endif 1114 1576 { … … 1129 1591 if ( yFrac == 0 ) 1130 1592 { 1131 m_if.filterHorLuma( ref, refStride, dst, dstStride, width, height, xFrac, !bi ); 1593 m_if.filterHorLuma( ref, refStride, dst, dstStride, width, height, xFrac, !bi 1594 #if QC_ARP_D0177 1595 , 1596 filterType 1597 #endif 1598 ); 1132 1599 } 1133 1600 else if ( xFrac == 0 ) 1134 1601 { 1135 m_if.filterVerLuma( ref, refStride, dst, dstStride, width, height, yFrac, true, !bi ); 1602 m_if.filterVerLuma( ref, refStride, dst, dstStride, width, height, yFrac, true, !bi 1603 #if QC_ARP_D0177 1604 , 1605 filterType 1606 #endif 1607 ); 1136 1608 } 1137 1609 else … … 1143 1615 Int halfFilterSize = ( filterSize >> 1 ); 1144 1616 1145 m_if.filterHorLuma(ref - (halfFilterSize-1)*refStride, refStride, tmp, tmpStride, width, height+filterSize-1, xFrac, false ); 1146 m_if.filterVerLuma(tmp + (halfFilterSize-1)*tmpStride, tmpStride, dst, dstStride, width, height, yFrac, false, !bi); 1617 m_if.filterHorLuma(ref - (halfFilterSize-1)*refStride, refStride, tmp, tmpStride, width, height+filterSize-1, xFrac, false 1618 #if QC_ARP_D0177 1619 , 1620 filterType 1621 #endif 1622 ); 1623 m_if.filterVerLuma(tmp + (halfFilterSize-1)*tmpStride, tmpStride, dst, dstStride, width, height, yFrac, false, !bi 1624 #if QC_ARP_D0177 1625 , 1626 filterType 1627 #endif 1628 ); 1147 1629 } 1148 1630 … … 1185 1667 */ 1186 1668 #if LGE_ILLUCOMP_B0045 1187 Void TComPrediction::xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi, Bool bICFlag ) 1188 #else 1189 Void TComPrediction::xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi ) 1669 Void TComPrediction::xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi, Bool bICFlag 1670 #if QC_ARP_D0177 1671 , 1672 Int filterType 1673 #endif 1674 ) 1675 #else 1676 Void TComPrediction::xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi 1677 #if QC_ARP_D0177 1678 , Int filterType 1679 #endif 1680 ) 1190 1681 #endif 1191 1682 { … … 1215 1706 if ( yFrac == 0 ) 1216 1707 { 1217 m_if.filterHorChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, xFrac, !bi); 1218 m_if.filterHorChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, xFrac, !bi); 1708 m_if.filterHorChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, xFrac, !bi 1709 #if QC_ARP_D0177 1710 , 1711 filterType 1712 #endif 1713 ); 1714 m_if.filterHorChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, xFrac, !bi 1715 #if QC_ARP_D0177 1716 , 1717 filterType 1718 #endif 1719 ); 1219 1720 } 1220 1721 else if ( xFrac == 0 ) 1221 1722 { 1222 m_if.filterVerChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, yFrac, true, !bi); 1223 m_if.filterVerChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, yFrac, true, !bi); 1723 m_if.filterVerChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, yFrac, true, !bi 1724 #if QC_ARP_D0177 1725 , 1726 filterType 1727 #endif 1728 ); 1729 m_if.filterVerChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, yFrac, true, !bi 1730 #if QC_ARP_D0177 1731 , 1732 filterType 1733 #endif 1734 ); 1224 1735 } 1225 1736 else 1226 1737 { 1227 m_if.filterHorChroma(refCb - (halfFilterSize-1)*refStride, refStride, extY, extStride, cxWidth, cxHeight+filterSize-1, xFrac, false); 1228 m_if.filterVerChroma(extY + (halfFilterSize-1)*extStride, extStride, dstCb, dstStride, cxWidth, cxHeight , yFrac, false, !bi); 1738 m_if.filterHorChroma(refCb - (halfFilterSize-1)*refStride, refStride, extY, extStride, cxWidth, cxHeight+filterSize-1, xFrac, false 1739 #if QC_ARP_D0177 1740 , 1741 filterType 1742 #endif 1743 ); 1744 m_if.filterVerChroma(extY + (halfFilterSize-1)*extStride, extStride, dstCb, dstStride, cxWidth, cxHeight , yFrac, false, !bi 1745 #if QC_ARP_D0177 1746 , 1747 filterType 1748 #endif 1749 ); 1229 1750 1230 m_if.filterHorChroma(refCr - (halfFilterSize-1)*refStride, refStride, extY, extStride, cxWidth, cxHeight+filterSize-1, xFrac, false); 1231 m_if.filterVerChroma(extY + (halfFilterSize-1)*extStride, extStride, dstCr, dstStride, cxWidth, cxHeight , yFrac, false, !bi); 1751 m_if.filterHorChroma(refCr - (halfFilterSize-1)*refStride, refStride, extY, extStride, cxWidth, cxHeight+filterSize-1, xFrac, false 1752 #if QC_ARP_D0177 1753 , 1754 filterType 1755 #endif 1756 ); 1757 m_if.filterVerChroma(extY + (halfFilterSize-1)*extStride, extStride, dstCr, dstStride, cxWidth, cxHeight , yFrac, false, !bi 1758 #if QC_ARP_D0177 1759 , 1760 filterType 1761 #endif 1762 ); 1232 1763 } 1233 1764 #if LGE_ILLUCOMP_B0045 … … 1274 1805 // refPic: Ref picture. Full picture, with padding 1275 1806 // posX, posY: PU position, texture 1276 // size _x, size_y: PU size1807 // sizeX, sizeY: PU size 1277 1808 // partAddr: z-order index 1278 1809 // mv: disparity vector. derived from neighboring blocks 1279 1810 // 1280 1811 // Output: dstPic, PU predictor 64x64 1281 Void TComPrediction::xPredInterLumaBlkFromDM( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv* mv, UInt partAddr,Int posX, Int posY, Int size_x, Int size_y, Bool isDepth, Int vspIdx 1282 , TComYuv *&dstPic ) 1812 Void TComPrediction::xPredInterLumaBlkFromDM( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv* mv, UInt partAddr,Int posX, Int posY, Int sizeX, Int sizeY, Bool isDepth 1813 #if !MERL_Bi_VSP_D0166 1814 , Int vspIdx 1815 #endif 1816 , TComYuv *&dstPic 1817 #if MERL_Bi_VSP_D0166 1818 , Bool bi 1819 #endif 1820 ) 1283 1821 { 1284 1822 Int widthLuma; … … 1301 1839 #endif 1302 1840 1841 #if MERL_CVSP_D0165 1842 Int widthDepth = pPicBaseDepth->getWidth(); 1843 Int heightDepth = pPicBaseDepth->getHeight(); 1844 #endif 1845 1303 1846 Int nTxtPerDepthX = widthLuma / ( pPicBaseDepth->getWidth() ); // texture pixel # per depth pixel 1304 1847 Int nTxtPerDepthY = heightLuma / ( pPicBaseDepth->getHeight() ); … … 1307 1850 Int dstStride = dstPic->getStride(); 1308 1851 Int depStride = pPicBaseDepth->getStride(); 1309 Int depthPosX = Clip3(0, widthLuma - size_x, (posX/nTxtPerDepthX) + (mv->getHor()>>2)); 1310 Int depthPosY = Clip3(0, heightLuma- size_y, (posY/nTxtPerDepthY) + (mv->getVer()>>2)); 1852 #if LGE_ROUND_OFFSET_D0135 1853 Int depthPosX = Clip3(0, widthLuma - sizeX, (posX/nTxtPerDepthX) + ((mv->getHor()+2)>>2)); 1854 Int depthPosY = Clip3(0, heightLuma- sizeY, (posY/nTxtPerDepthY) + ((mv->getVer()+2)>>2)); 1855 #else 1856 Int depthPosX = Clip3(0, widthLuma - sizeX, (posX/nTxtPerDepthX) + (mv->getHor()>>2)); 1857 Int depthPosY = Clip3(0, heightLuma- sizeY, (posY/nTxtPerDepthY) + (mv->getVer()>>2)); 1858 #endif 1311 1859 Pel *ref = refPic->getLumaAddr() + posX + posY * refStride; 1312 1860 Pel *dst = dstPic->getLumaAddr(partAddr); … … 1315 1863 #if MERL_VSP_BLOCKSIZE_C0152 != 1 1316 1864 #if MERL_VSP_BLOCKSIZE_C0152 == 2 1317 Int dW = size _x>>1;1318 Int dH = size _y>>1;1865 Int dW = sizeX>>1; 1866 Int dH = sizeY>>1; 1319 1867 #endif 1320 1868 #if MERL_VSP_BLOCKSIZE_C0152 == 4 1321 Int dW = size _x>>2;1322 Int dH = size _y>>2;1869 Int dW = sizeX>>2; 1870 Int dH = sizeY>>2; 1323 1871 #endif 1324 1872 { … … 1342 1890 #endif 1343 1891 Int maxV = 0; 1892 #if MTK_DEPTH_TO_DISP_D0138 1893 for (Int blockj = 0; blockj < MERL_VSP_BLOCKSIZE_C0152; blockj+=(MERL_VSP_BLOCKSIZE_C0152-1)) 1894 #else 1344 1895 for (Int blockj = 0; blockj < MERL_VSP_BLOCKSIZE_C0152; blockj++) 1896 #endif 1345 1897 { 1346 1898 Int iX = 0; 1899 #if MTK_DEPTH_TO_DISP_D0138 1900 for (Int blocki = 0; blocki < MERL_VSP_BLOCKSIZE_C0152; blocki+=(MERL_VSP_BLOCKSIZE_C0152-1)) 1901 #else 1347 1902 for (Int blocki = 0; blocki < MERL_VSP_BLOCKSIZE_C0152; blocki++) 1903 #endif 1348 1904 { 1349 1905 if (maxV < depthTmp[iX]) … … 1381 1937 #endif 1382 1938 1939 #if MERL_General_Fix 1940 #if MERL_VSP_BLOCKSIZE_C0152 == 1 1941 #if MERL_CVSP_D0165 1942 //get LUT based horizontal reference range 1943 Int range = 0; 1944 if( sizeX == 4 && sizeY == 8 ) 1945 range = m_iRangeLuma[0]; 1946 else if( sizeX == 8 && sizeY == 4 ) 1947 range = m_iRangeLuma[1]; 1948 else if( sizeX == 8 && sizeY == 8 ) 1949 range = m_iRangeLuma[2]; 1950 else if( sizeX == 8 && sizeY == 16 ) 1951 range = m_iRangeLuma[3]; 1952 else if( sizeX == 16 && sizeY == 8 ) 1953 range = m_iRangeLuma[4]; 1954 else if( sizeX == 16 && sizeY == 16 ) 1955 range = m_iRangeLuma[5]; 1956 else if( sizeX == 16 && sizeY == 32 ) 1957 range = m_iRangeLuma[6]; 1958 else if( sizeX == 32 && sizeY == 16 ) 1959 range = m_iRangeLuma[7]; 1960 else if( sizeX == 32 && sizeY == 32 ) 1961 range = m_iRangeLuma[8]; 1962 else if( sizeX == 32 && sizeY == 64 ) 1963 range = m_iRangeLuma[9]; 1964 else if( sizeX == 64 && sizeY == 32 ) 1965 range = m_iRangeLuma[10]; 1966 else if( sizeX == 64 && sizeY == 64 ) 1967 range = m_iRangeLuma[11]; 1968 else 1969 assert(0); 1970 1971 // The minimum depth value 1972 Int minRelativePos = 5000; 1973 Int maxRelativePos = -5000; 1974 1975 Pel* depthTemp, *depthInitial=depth; 1976 for (Int yTxt =0; yTxt<sizeY; yTxt++) 1977 { 1978 for (Int xTxt =0; xTxt<sizeX; xTxt++) 1979 { 1980 if (depthPosX+xTxt < widthDepth) 1981 depthTemp = depthInitial + xTxt; 1982 else 1983 depthTemp = depthInitial + (widthDepth - depthPosX - 1); 1984 1985 Int disparity = pShiftLUT[ *depthTemp ] << iShiftPrec; 1986 Int disparityInt = disparity >> 2; 1987 1988 if( disparity <= 0) 1989 { 1990 if (minRelativePos > disparityInt+xTxt) 1991 minRelativePos = disparityInt+xTxt; 1992 } 1993 else 1994 { 1995 if (maxRelativePos < disparityInt+xTxt) 1996 maxRelativePos = disparityInt+xTxt; 1997 } 1998 } 1999 if (depthPosY+yTxt < heightDepth) 2000 depthInitial = depthInitial + depStride; 2001 } 2002 2003 Int disparity_tmp = pShiftLUT[ *depth ] << iShiftPrec; 2004 if (disparity_tmp <= 0) 2005 maxRelativePos = minRelativePos + range -1 ; 2006 else 2007 minRelativePos = maxRelativePos - range +1 ; 2008 #endif 2009 #endif 2010 #endif 2011 1383 2012 #if MERL_VSP_BLOCKSIZE_C0152 != 1 1384 2013 Int yDepth = 0; 1385 2014 #endif 1386 for ( Int yTxt = 0; yTxt < size _y; yTxt += nTxtPerDepthY )1387 { 1388 for ( Int xTxt = 0, xDepth = 0; xTxt < size _x; xTxt += nTxtPerDepthX, xDepth++ )1389 { 1390 Pel rep _depth = 0; // to store the depth value used for warping2015 for ( Int yTxt = 0; yTxt < sizeY; yTxt += nTxtPerDepthY ) 2016 { 2017 for ( Int xTxt = 0, xDepth = 0; xTxt < sizeX; xTxt += nTxtPerDepthX, xDepth++ ) 2018 { 2019 Pel repDepth = 0; // to store the depth value used for warping 1391 2020 #if MERL_VSP_BLOCKSIZE_C0152 == 1 1392 rep _depth = depth[xDepth];2021 repDepth = depth[xDepth]; 1393 2022 #endif 1394 2023 #if MERL_VSP_BLOCKSIZE_C0152 == 2 1395 rep _depth = m_pDepth[(xTxt>>1) + (yTxt>>1)*dW];2024 repDepth = m_pDepth[(xTxt>>1) + (yTxt>>1)*dW]; 1396 2025 #endif 1397 2026 #if MERL_VSP_BLOCKSIZE_C0152 == 4 1398 rep _depth = m_pDepth[(xTxt>>2) + (yTxt>>2)*dW];1399 #endif 1400 1401 assert( rep _depth >= 0 && rep_depth <= 255 );1402 Int disparity = pShiftLUT[ rep _depth ] << iShiftPrec;2027 repDepth = m_pDepth[(xTxt>>2) + (yTxt>>2)*dW]; 2028 #endif 2029 2030 assert( repDepth >= 0 && repDepth <= 255 ); 2031 Int disparity = pShiftLUT[ repDepth ] << iShiftPrec; 1403 2032 Int refOffset = xTxt + (disparity >> 2); 1404 2033 Int xFrac = disparity & 0x3; 2034 #if MERL_CVSP_D0165 2035 if(refOffset<minRelativePos || refOffset>maxRelativePos) 2036 xFrac = 0; 2037 refOffset = Clip3(minRelativePos, maxRelativePos, refOffset); 2038 #endif 1405 2039 Int absX = posX + refOffset; 1406 2040 … … 1413 2047 1414 2048 assert( ref[refOffset] >= 0 && ref[refOffset]<= 255 ); 2049 #if MERL_Bi_VSP_D0166 2050 m_if.filterHorLuma( &ref[refOffset], refStride, &dst[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !bi ); 2051 #else 1415 2052 m_if.filterHorLuma( &ref[refOffset], refStride, &dst[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, true ); 2053 #endif 2054 1416 2055 } 1417 2056 ref += refStride*nTxtPerDepthY; … … 1421 2060 yDepth++; 1422 2061 #endif 1423 } 1424 } 1425 1426 Void TComPrediction::xPredInterChromaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv*mv, UInt partAddr, Int posX, Int posY, Int size_x, Int size_y, Bool isDepth, Int vspIdx 1427 , TComYuv *&dstPic ) 2062 2063 } 2064 } 2065 2066 Void TComPrediction::xPredInterChromaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv*mv, UInt partAddr, Int posX, Int posY, Int sizeX, Int sizeY, Bool isDepth 2067 #if !MERL_Bi_VSP_D0166 2068 , Int vspIdx 2069 #endif 2070 , TComYuv *&dstPic 2071 #if MERL_Bi_VSP_D0166 2072 , Bool bi 2073 #endif 2074 ) 1428 2075 { 1429 2076 Int refStride = refPic->getCStride(); … … 1458 2105 nTxtPerDepthX = widthChroma / widthDepth; 1459 2106 nDepthPerTxtX = 1; 2107 #if LGE_ROUND_OFFSET_D0135 2108 depthPosX = posX / nTxtPerDepthX + ((mv->getHor()+2)>>2); //mv denotes the disparity for VSP 2109 #else 1460 2110 depthPosX = posX / nTxtPerDepthX + (mv->getHor()>>2); //mv denotes the disparity for VSP 2111 #endif 1461 2112 } 1462 2113 else … … 1464 2115 nTxtPerDepthX = 1; 1465 2116 nDepthPerTxtX = widthDepth / widthChroma; 2117 #if LGE_ROUND_OFFSET_D0135 2118 depthPosX = posX * nDepthPerTxtX + ((mv->getHor()+2)>>2); //mv denotes the disparity for VSP 2119 #else 1466 2120 depthPosX = posX * nDepthPerTxtX + (mv->getHor()>>2); //mv denotes the disparity for VSP 1467 } 1468 depthPosX = Clip3(0, widthDepth - (size_x<<1), depthPosX); 2121 #endif 2122 } 2123 depthPosX = Clip3(0, widthDepth - (sizeX<<1), depthPosX); 1469 2124 if ( heightChroma > heightDepth ) 1470 2125 { 1471 2126 nTxtPerDepthY = heightChroma / heightDepth; 1472 2127 nDepthPerTxtY = 1; 2128 #if LGE_ROUND_OFFSET_D0135 2129 depthPosY = posY / nTxtPerDepthY + ((mv->getVer()+2)>>2); //mv denotes the disparity for VSP 2130 #else 1473 2131 depthPosY = posY / nTxtPerDepthY + (mv->getVer()>>2); //mv denotes the disparity for VSP 2132 #endif 1474 2133 } 1475 2134 else … … 1477 2136 nTxtPerDepthY = 1; 1478 2137 nDepthPerTxtY = heightDepth / heightChroma; 2138 #if LGE_ROUND_OFFSET_D0135 2139 depthPosY = posY * nDepthPerTxtY + ((mv->getVer()+2)>>2); //mv denotes the disparity for VSP 2140 #else 1479 2141 depthPosY = posY * nDepthPerTxtY + (mv->getVer()>>2); //mv denotes the disparity for VSP 1480 } 1481 depthPosY = Clip3(0, heightDepth - (size_y<<1), depthPosY); 2142 #endif 2143 } 2144 depthPosY = Clip3(0, heightDepth - (sizeY<<1), depthPosY); 1482 2145 1483 2146 Pel *refCb = refPic->getCbAddr() + posX + posY * refStride; … … 1491 2154 Int depStrideBlock = depStride * nDepthPerTxtY; 1492 2155 2156 #if !MERL_Bi_VSP_D0166 1493 2157 if (isDepth) 1494 2158 { 1495 2159 // DT: Since the call for this function is redundant, .. 1496 for (Int y = 0; y < size _y; y++)2160 for (Int y = 0; y < sizeY; y++) 1497 2161 { 1498 for (Int x = 0; x < size _x; x++)2162 for (Int x = 0; x < sizeX; x++) 1499 2163 { 1500 2164 dstCb[x] = 128; … … 1506 2170 return; 1507 2171 } 1508 2172 #endif 2173 1509 2174 if ( widthChroma > widthDepth ) // We assume 1510 2175 { … … 1516 2181 { 1517 2182 #if MERL_VSP_BLOCKSIZE_C0152 == 1 1518 Int dW = size _x;1519 Int dH = size _y;2183 Int dW = sizeX; 2184 Int dH = sizeY; 1520 2185 Int sW = 2; // search window size 1521 2186 Int sH = 2; 1522 2187 #endif 1523 2188 #if MERL_VSP_BLOCKSIZE_C0152 == 2 1524 Int dW = size _x;1525 Int dH = size _y;2189 Int dW = sizeX; 2190 Int dH = sizeY; 1526 2191 Int sW = 2; // search window size 1527 2192 Int sH = 2; 1528 2193 #endif 1529 2194 #if MERL_VSP_BLOCKSIZE_C0152 == 4 1530 Int dW = size _x>>1;1531 Int dH = size _y>>1;2195 Int dW = sizeX>>1; 2196 Int dH = sizeY>>1; 1532 2197 Int sW = 4; // search window size 1533 2198 Int sH = 4; … … 1594 2259 1595 2260 1596 // (size_x, size_y) is Chroma block size 1597 for ( Int yTxt = 0, yDepth = 0; yTxt < size_y; yTxt += nTxtPerDepthY, yDepth += nDepthPerTxtY ) 1598 { 1599 for ( Int xTxt = 0, xDepth = 0; xTxt < size_x; xTxt += nTxtPerDepthX, xDepth += nDepthPerTxtX ) 1600 { 1601 Pel rep_depth = 0; // to store the depth value used for warping 2261 #if MERL_General_Fix 1602 2262 #if MERL_VSP_BLOCKSIZE_C0152 == 1 1603 rep_depth = m_pDepth[(xTxt) + (yTxt)*dW]; 2263 #if MERL_CVSP_D0165 2264 //get LUT based horizontal reference range 2265 Int range=0; 2266 if( sizeX == 2 && sizeY == 4 ) 2267 range = m_iRangeChroma[0]; 2268 else if( sizeX == 4 && sizeY == 2 ) 2269 range = m_iRangeChroma[1]; 2270 else if( sizeX == 4 && sizeY == 4 ) 2271 range = m_iRangeChroma[2]; 2272 else if( sizeX == 4 && sizeY == 8 ) 2273 range = m_iRangeChroma[3]; 2274 else if( sizeX == 8 && sizeY == 4 ) 2275 range = m_iRangeChroma[4]; 2276 else if( sizeX == 8 && sizeY == 8 ) 2277 range = m_iRangeChroma[5]; 2278 else if( sizeX == 8 && sizeY == 16 ) 2279 range = m_iRangeChroma[6]; 2280 else if( sizeX == 16 && sizeY == 8 ) 2281 range = m_iRangeChroma[7]; 2282 else if( sizeX == 16 && sizeY == 16 ) 2283 range = m_iRangeChroma[8]; 2284 else if( sizeX == 16 && sizeY == 32 ) 2285 range = m_iRangeChroma[9]; 2286 else if( sizeX == 32 && sizeY == 16 ) 2287 range = m_iRangeChroma[10]; 2288 else if( sizeX == 32 && sizeY == 32 ) 2289 range = m_iRangeChroma[11]; 2290 else 2291 assert(0); 2292 2293 // The minimum depth value 2294 Int minRelativePos = 5000; 2295 Int maxRelativePos = -5000; 2296 2297 Int depthTmp; 2298 for (Int yTxt=0; yTxt<sizeY; yTxt++) 2299 { 2300 for (Int xTxt=0; xTxt<sizeX; xTxt++) 2301 { 2302 depthTmp = m_pDepth[xTxt+yTxt*dW]; 2303 Int disparity = pShiftLUT[ depthTmp ] << iShiftPrec; 2304 Int disparityInt = disparity >> 3;//in chroma resolution 2305 2306 if (disparityInt < 0) 2307 { 2308 if (minRelativePos > disparityInt+xTxt) 2309 minRelativePos = disparityInt+xTxt; 2310 } 2311 else 2312 { 2313 if (maxRelativePos < disparityInt+xTxt) 2314 maxRelativePos = disparityInt+xTxt; 2315 } 2316 } 2317 } 2318 2319 depthTmp = m_pDepth[0]; 2320 Int disparity_tmp = pShiftLUT[ depthTmp ] << iShiftPrec; 2321 if ( disparity_tmp < 0 ) 2322 maxRelativePos = minRelativePos + range - 1; 2323 else 2324 minRelativePos = maxRelativePos - range + 1; 2325 2326 #endif 2327 #endif 2328 #endif 2329 2330 // (sizeX, sizeY) is Chroma block size 2331 for ( Int yTxt = 0, yDepth = 0; yTxt < sizeY; yTxt += nTxtPerDepthY, yDepth += nDepthPerTxtY ) 2332 { 2333 for ( Int xTxt = 0, xDepth = 0; xTxt < sizeX; xTxt += nTxtPerDepthX, xDepth += nDepthPerTxtX ) 2334 { 2335 Pel repDepth = 0; // to store the depth value used for warping 2336 #if MERL_VSP_BLOCKSIZE_C0152 == 1 2337 repDepth = m_pDepth[(xTxt) + (yTxt)*dW]; 1604 2338 #endif 1605 2339 #if MERL_VSP_BLOCKSIZE_C0152 == 2 1606 rep _depth = m_pDepth[(xTxt) + (yTxt)*dW];2340 repDepth = m_pDepth[(xTxt) + (yTxt)*dW]; 1607 2341 #endif 1608 2342 #if MERL_VSP_BLOCKSIZE_C0152 == 4 1609 rep _depth = m_pDepth[(xTxt>>1) + (yTxt>>1)*dW];2343 repDepth = m_pDepth[(xTxt>>1) + (yTxt>>1)*dW]; 1610 2344 #endif 1611 2345 1612 2346 // calculate the offset in the reference picture 1613 Int disparity = pShiftLUT[ rep _depth ] << iShiftPrec;2347 Int disparity = pShiftLUT[ repDepth ] << iShiftPrec; 1614 2348 Int refOffset = xTxt + (disparity >> 3); // in integer pixel in chroma image 1615 2349 Int xFrac = disparity & 0x7; 2350 #if MERL_CVSP_D0165 2351 if(refOffset < minRelativePos || refOffset > maxRelativePos) 2352 xFrac = 0; 2353 refOffset = Clip3(minRelativePos, maxRelativePos, refOffset); 2354 #endif 1616 2355 Int absX = posX + refOffset; 1617 2356 … … 1625 2364 assert( refCb[refOffset] >= 0 && refCb[refOffset]<= 255 ); 1626 2365 assert( refCr[refOffset] >= 0 && refCr[refOffset]<= 255 ); 2366 #if MERL_Bi_VSP_D0166 2367 m_if.filterHorChroma(&refCb[refOffset], refStride, &dstCb[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !bi); 2368 m_if.filterHorChroma(&refCr[refOffset], refStride, &dstCr[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !bi); 2369 #else 1627 2370 m_if.filterHorChroma(&refCb[refOffset], refStride, &dstCb[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, true); 1628 2371 m_if.filterHorChroma(&refCr[refOffset], refStride, &dstCr[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, true); 2372 #endif 2373 1629 2374 } 1630 2375 refCb += refStrideBlock; … … 1635 2380 } 1636 2381 } 2382 1637 2383 } 1638 2384 … … 1642 2388 Void TComPrediction::xWeightedAveragePdm( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartIdx, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst, UInt uiSubSampExpX, UInt uiSubSampExpY ) 1643 2389 { 2390 1644 2391 if( iRefIdx0 >= 0 && iRefIdx1 >= 0 ) 1645 2392 { … … 1661 2408 #endif 1662 2409 1663 Void TComPrediction::xWeightedAverage( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartIdx, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst ) 1664 { 2410 Void TComPrediction::xWeightedAverage( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartIdx, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst 2411 #if MERL_Bi_VSP_D0166 2412 , Int predDirVSP 2413 #endif 2414 ) 2415 { 2416 #if MERL_Bi_VSP_D0166 2417 Bool isVSP = 0; 2418 if (pcCU->getVSPIndex(uiPartIdx)!=0)//is VSP 2419 { 2420 isVSP = 1; 2421 } 2422 2423 if(( !isVSP && iRefIdx0 >= 0 && iRefIdx1 >= 0 ) || ( isVSP && predDirVSP == 3 )) 2424 #else 1665 2425 if( iRefIdx0 >= 0 && iRefIdx1 >= 0 ) 2426 #endif 1666 2427 { 1667 2428 rpcYuvDst->addAvg( pcYuvSrc0, pcYuvSrc1, uiPartIdx, iWidth, iHeight ); 1668 2429 } 2430 #if MERL_Bi_VSP_D0166 2431 else if ( ( !isVSP && iRefIdx0 >= 0 && iRefIdx1 < 0 ) || ( isVSP && predDirVSP == 1)) 2432 #else 1669 2433 else if ( iRefIdx0 >= 0 && iRefIdx1 < 0 ) 2434 #endif 1670 2435 { 1671 2436 pcYuvSrc0->copyPartToPartYuv( rpcYuvDst, uiPartIdx, iWidth, iHeight ); 1672 2437 } 2438 #if MERL_Bi_VSP_D0166 2439 else if (( !isVSP && iRefIdx0 < 0 && iRefIdx1 >= 0 ) || ( isVSP && predDirVSP == 2)) 2440 #else 1673 2441 else if ( iRefIdx0 < 0 && iRefIdx1 >= 0 ) 2442 #endif 1674 2443 { 1675 2444 pcYuvSrc1->copyPartToPartYuv( rpcYuvDst, uiPartIdx, iWidth, iHeight ); 1676 2445 } 2446 #if MERL_Bi_VSP_D0166 2447 else 2448 {//for debug test only 2449 assert(0); 2450 } 2451 #endif 1677 2452 } 1678 2453 … … 2076 2851 iCUPelX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]]; 2077 2852 iCUPelY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]]; 2853 #if LGE_ROUND_OFFSET_D0135 2854 iRefX = iCUPelX + ((pMv->getHor()+2) >> 2); 2855 iRefY = iCUPelY + ((pMv->getVer()+2) >> 2); 2856 #else 2078 2857 iRefX = iCUPelX + (pMv->getHor() >> 2); 2079 2858 iRefY = iCUPelY + (pMv->getVer() >> 2); 2859 #endif 2080 2860 uiWidth = pcCU->getWidth(0); 2081 2861 uiHeight = pcCU->getHeight(0); … … 2089 2869 if(pcCU->getPUAbove(uiTmpPartIdx, pcCU->getZorderIdxInCU()) && iCUPelY > 0 && iRefY > 0) 2090 2870 { 2871 #if LGE_ROUND_OFFSET_D0135 2872 iRefOffset = ( (pMv->getHor()+2) >> 2 ) + ( (pMv->getVer()+2) >> 2 ) * iRefStride - iRefStride; 2873 #else 2091 2874 iRefOffset = ( pMv->getHor() >> 2 ) + ( pMv->getVer() >> 2 ) * iRefStride - iRefStride; 2875 #endif 2092 2876 pRef = pRefPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 2093 2877 pRec = pRecPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - iRecStride; … … 2106 2890 if(pcCU->getPULeft(uiTmpPartIdx, pcCU->getZorderIdxInCU()) && iCUPelX > 0 && iRefX > 0) 2107 2891 { 2892 #if LGE_ROUND_OFFSET_D0135 2893 iRefOffset = ( (pMv->getHor()+2) >> 2 ) + ( (pMv->getVer()+2) >> 2 ) * iRefStride - 1; 2894 #else 2108 2895 iRefOffset = ( pMv->getHor() >> 2 ) + ( pMv->getVer() >> 2 ) * iRefStride - 1; 2896 #endif 2109 2897 pRef = pRefPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 2110 2898 pRec = pRecPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - 1; … … 2224 3012 iCUPelX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]]; 2225 3013 iCUPelY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]]; 3014 #if LGE_ROUND_OFFSET_D0135 3015 iRefX = iCUPelX + ((pMv->getHor()+2) >> 2); 3016 iRefY = iCUPelY + ((pMv->getVer()+2) >> 2); 3017 #else 2226 3018 iRefX = iCUPelX + (pMv->getHor() >> 2); 2227 3019 iRefY = iCUPelY + (pMv->getVer() >> 2); 3020 #endif 2228 3021 uiWidth = pcCU->getWidth(0) >> 1; 2229 3022 uiHeight = pcCU->getHeight(0) >> 1; … … 2237 3030 if(pcCU->getPUAbove(uiTmpPartIdx, pcCU->getZorderIdxInCU()) && iCUPelY > 0 && iRefY > 0) 2238 3031 { 3032 #if LGE_ROUND_OFFSET_D0135 3033 iRefOffset = ( (pMv->getHor()+4) >> 3 ) + ( (pMv->getVer()+4) >> 3 ) * iRefStride - iRefStride; 3034 #else 2239 3035 iRefOffset = ( pMv->getHor() >> 3 ) + ( pMv->getVer() >> 3 ) * iRefStride - iRefStride; 3036 #endif 2240 3037 if (iChromaId == 0) // Cb 2241 3038 { … … 2262 3059 if(pcCU->getPULeft(uiTmpPartIdx, pcCU->getZorderIdxInCU()) && iCUPelX > 0 && iRefX > 0) 2263 3060 { 3061 #if LGE_ROUND_OFFSET_D0135 3062 iRefOffset = ( (pMv->getHor()+4) >> 3 ) + ( (pMv->getVer()+4) >> 3 ) * iRefStride - 1; 3063 #else 2264 3064 iRefOffset = ( pMv->getHor() >> 3 ) + ( pMv->getVer() >> 3 ) * iRefStride - 1; 3065 #endif 2265 3066 if (iChromaId == 0) // Cb 2266 3067 { … … 2426 3227 } 2427 3228 3229 #if QC_DC_PREDICTOR_D0183 3230 Void TComPrediction::getPredDCs( Bool* pbPattern, Int iStride, Int* piMask, Int iMaskStride, Int& riPredDC1, Int& riPredDC2 ) 3231 { 3232 Int iDC1, iDC2; 3233 const Int iTR = ( iStride - 1 ) - iMaskStride; 3234 const Int iTM = ( ( iStride - 1 ) >> 1 ) - iMaskStride; 3235 const Int iLB = ( iStride - 1 ) * iMaskStride - 1; 3236 const Int iLM = ( ( iStride - 1 ) >> 1 ) * iMaskStride - 1; 3237 const UInt uiBitDepth = g_uiBitDepth + g_uiBitIncrement; 3238 3239 Bool bL = ( pbPattern[0] != pbPattern[(iStride-1)*iStride] ); 3240 Bool bT = ( pbPattern[0] != pbPattern[(iStride-1)] ); 3241 3242 if( bL == bT ) 3243 { 3244 iDC1 = bL ? ( piMask[iTR] + piMask[iLB] )>>1 : 1<<( uiBitDepth - 1 ); 3245 iDC2 = ( piMask[ -1] + piMask[-iMaskStride] )>>1; 3246 } 3247 else 3248 { 3249 iDC1 = bL ? piMask[iLB] : piMask[iTR]; 3250 iDC2 = bL ? piMask[iTM] : piMask[iLM]; 3251 } 3252 3253 riPredDC1 = pbPattern[0] ? iDC1 : iDC2; 3254 riPredDC2 = pbPattern[0] ? iDC2 : iDC1; 3255 } 3256 #else 2428 3257 Void TComPrediction::getWedgePredDCs( TComWedgelet* pcWedgelet, Int* piMask, Int iMaskStride, Int& riPredDC1, Int& riPredDC2, Bool bAbove, Bool bLeft ) 2429 3258 { … … 2503 3332 } 2504 3333 } 3334 #endif 2505 3335 2506 3336 Void TComPrediction::calcWedgeDCs( TComWedgelet* pcWedgelet, Pel* piOrig, UInt uiStride, Int& riDC1, Int& riDC2 ) … … 2870 3700 Int iMaskStride = ( iWidth<<1 ) + 1; 2871 3701 piMask += iMaskStride+1; 3702 #if QC_DC_PREDICTOR_D0183 3703 getPredDCs( pcWedgelet->getPattern(), pcWedgelet->getStride(), piMask, iMaskStride, iPredDC1, iPredDC2 ); 3704 #else 2872 3705 getWedgePredDCs( pcWedgelet, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft ); 3706 #endif 2873 3707 2874 3708 // assign wedge pred DCs to prediction 2875 if( bDelta ) { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, Clip ( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); } 2876 else { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, iPredDC1, iPredDC2 ); } 3709 if( bDelta ) 3710 { 3711 #if HHI_DELTADC_DLT_D0035 3712 assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, GetIdx2DepthValue( GetDepthValue2Idx(iPredDC1) + iDeltaDC1 ), GetIdx2DepthValue( GetDepthValue2Idx(iPredDC2) + iDeltaDC2 ) ); 3713 #else 3714 assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, Clip( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); 3715 #endif 3716 } 3717 else 3718 { 3719 assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, iPredDC1, iPredDC2 ); 3720 } 2877 3721 } 2878 3722 … … 2889 3733 Int iMaskStride = ( iWidth<<1 ) + 1; 2890 3734 piMask += iMaskStride+1; 3735 #if QC_DC_PREDICTOR_D0183 3736 getPredDCs( pcContourWedge->getPattern(), pcContourWedge->getStride(), piMask, iMaskStride, iPredDC1, iPredDC2 ); 3737 #else 2891 3738 getWedgePredDCs( pcContourWedge, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft ); 3739 #endif 2892 3740 2893 3741 // assign wedge pred DCs to prediction 2894 if( bDelta ) { assignWedgeDCs2Pred( pcContourWedge, piPred, uiStride, Clip ( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); } 2895 else { assignWedgeDCs2Pred( pcContourWedge, piPred, uiStride, iPredDC1, iPredDC2 ); } 3742 if( bDelta ) 3743 { 3744 #if HHI_DELTADC_DLT_D0035 3745 assignWedgeDCs2Pred( pcContourWedge, piPred, uiStride, GetIdx2DepthValue( GetDepthValue2Idx(iPredDC1) + iDeltaDC1 ), GetIdx2DepthValue( GetDepthValue2Idx(iPredDC2) + iDeltaDC2 ) ); 3746 #else 3747 assignWedgeDCs2Pred( pcContourWedge, piPred, uiStride, Clip( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); 3748 #endif 3749 } 3750 else 3751 { 3752 assignWedgeDCs2Pred( pcContourWedge, piPred, uiStride, iPredDC1, iPredDC2 ); 3753 } 2896 3754 2897 3755 pcContourWedge->destroy(); … … 3064 3922 Int iMaskStride = ( iWidth<<1 ) + 1; 3065 3923 piMask += iMaskStride+1; 3924 #if QC_DC_PREDICTOR_D0183 3925 getPredDCs( pcWedgelet->getPattern(), pcWedgelet->getStride(), piMask, iMaskStride, iPredDC1, iPredDC2 ); 3926 #else 3066 3927 getWedgePredDCs( pcWedgelet, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft ); 3928 #endif 3067 3929 3068 3930 // assign wedge pred DCs to prediction 3069 if( bDelta ) { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, Clip( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); } 3070 else { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, iPredDC1, iPredDC2 ); } 3931 if( bDelta ) 3932 { 3933 #if HHI_DELTADC_DLT_D0035 3934 assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, GetIdx2DepthValue( GetDepthValue2Idx(iPredDC1) + iDeltaDC1 ), GetIdx2DepthValue( GetDepthValue2Idx(iPredDC2) + iDeltaDC2 ) ); 3935 #else 3936 assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, Clip( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); 3937 #endif 3938 } 3939 else 3940 { 3941 assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, iPredDC1, iPredDC2 ); 3942 } 3071 3943 } 3072 3944 … … 3099 3971 Int iMaskStride = ( iWidth<<1 ) + 1; 3100 3972 piMask += iMaskStride+1; 3973 #if QC_DC_PREDICTOR_D0183 3974 getPredDCs( pcWedgelet->getPattern(), pcWedgelet->getStride(), piMask, iMaskStride, iPredDC1, iPredDC2 ); 3975 #else 3101 3976 getWedgePredDCs( pcWedgelet, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft ); 3977 #endif 3102 3978 3103 3979 // assign wedge pred DCs to prediction 3104 if( bDelta ) { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, Clip( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); } 3105 else { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, iPredDC1, iPredDC2 ); } 3980 if( bDelta ) 3981 { 3982 #if HHI_DELTADC_DLT_D0035 3983 assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, GetIdx2DepthValue( GetDepthValue2Idx(iPredDC1) + iDeltaDC1 ), GetIdx2DepthValue( GetDepthValue2Idx(iPredDC2) + iDeltaDC2 ) ); 3984 #else 3985 assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, Clip( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); 3986 #endif 3987 } 3988 else 3989 { 3990 assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, iPredDC1, iPredDC2 ); 3991 } 3106 3992 } 3107 3993 -
trunk/source/Lib/TLibCommon/TComPrediction.h
r332 r443 69 69 TComYuv m_acYuvPred[2]; 70 70 TComYuv m_cYuvPredTemp; 71 #if QC_ARP_D0177 72 TComYuv m_acYuvPredBase[2]; 73 TComYuv m_acYuvDiff[2]; 74 #endif 71 75 TComYuv m_filteredBlock[4][4]; 72 76 TComYuv m_filteredBlockTmp[4]; … … 80 84 #if MERL_VSP_C0152 81 85 Int* m_pDepth; ///< Local variable, to store a depth block, just to prevent allocate memory every time 86 87 #if MERL_CVSP_D0165 88 static Int m_iRangeLuma[12]; 89 static Int m_iRangeChroma[12]; 90 #endif 82 91 #endif 83 92 … … 86 95 87 96 // motion compensation functions 97 #if QC_ARP_D0177 98 Void xPredInterUniARP ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bi=false, TComMvField * pNewMvFiled = NULL ); 99 #endif 88 100 #if MERL_VSP_C0152 89 101 Void xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, UInt uiAbsPartIdx, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX = 0, UInt uiSubSampExpY = 0, Bool bi=false ); … … 103 115 ); 104 116 117 #if !MERL_General_Fix 105 118 #if MERL_VSP_C0152 106 119 Void xPredInterUniBWVSP ( TComDataCU* pcCU, UInt uiPartAddr, UInt uiAbsPartIdx, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX, UInt uiSubSampExpY, Bool bi=false ); 107 120 Void xPredInterBiBWVSP ( TComDataCU* pcCU, UInt uiPartAddr, UInt uiAbsPartIdx, Int iWidth, Int iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap ); 108 121 #endif 122 #endif 109 123 110 124 #if DEPTH_MAP_GENERATION … … 113 127 114 128 #if LGE_ILLUCOMP_B0045 115 Void xPredInterLumaBlk ( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi, Bool bICFlag = false ); 116 Void xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi, Bool bICFlag = false ); 117 #else 118 Void xPredInterLumaBlk ( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi ); 119 Void xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi ); 120 #endif 129 Void xPredInterLumaBlk ( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi, Bool bICFlag = false 130 #if QC_ARP_D0177 131 , 132 Int filterType = 0 133 #endif 134 ); 135 Void xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi, Bool bICFlag = false 136 #if QC_ARP_D0177 137 , 138 Int filterType = 0 139 #endif 140 ); 141 #else 142 Void xPredInterLumaBlk ( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi 143 #if QC_ARP_D0177 144 , 145 Int filterType = 0 146 #endif 147 ); 148 Void xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi 149 #if QC_ARP_D0177 150 , 151 Int filterType = 0 152 #endif 153 ); 154 #endif 155 156 #if MERL_Bi_VSP_D0166 157 Void xWeightedAverage ( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst, Int predDir); 158 #else 121 159 Void xWeightedAverage ( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst ); 122 123 #if MERL_VSP_C0152 124 Void xPredInterLumaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv *mv, UInt partAddr,Int posX, Int posY, Int size_x, Int size_y, Bool isDepth, Int vspIdx 160 #endif 161 162 #if MERL_VSP_C0152 163 #if !MERL_Bi_VSP_D0166 164 Void xPredInterLumaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv *mv, UInt partAddr,Int posX, Int posY, Int sizeX, Int sizeY, Bool isDepth, Int vspIdx 125 165 , TComYuv *&dstPic ); 126 Void xPredInterChromaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv *mv, UInt partAddr,Int posX, Int posY, Int size _x, Int size_y, Bool isDepth, Int vspIdx166 Void xPredInterChromaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv *mv, UInt partAddr,Int posX, Int posY, Int sizeX, Int sizeY, Bool isDepth, Int vspIdx 127 167 , TComYuv *&dstPic ); 128 #endif 168 #else 169 TComPic* xGetVspRefTxt(TComDataCU* pcCU, UInt uiPartAddr, RefPicList eRefPicList); 170 Void xPredInterLumaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv *mv, UInt partAddr,Int posX, Int posY, Int sizeX, Int sizeY, Bool isDepth, 171 TComYuv *&dstPic, Bool bi); 172 Void xPredInterChromaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv *mv, UInt partAddr,Int posX, Int posY, Int sizeX, Int sizeY, Bool isDepth, 173 TComYuv *&dstPic, Bool bi); 174 #endif 175 #endif 176 129 177 Void xGetLLSPrediction ( TComPattern* pcPattern, Int* pSrc0, Int iSrcStride, Pel* pDst0, Int iDstStride, UInt uiWidth, UInt uiHeight, UInt uiExt0 ); 130 178 #if LGE_ILLUCOMP_B0045 … … 134 182 Void xDCPredFiltering( Int* pSrc, Int iSrcStride, Pel*& rpDst, Int iDstStride, Int iWidth, Int iHeight ); 135 183 Bool xCheckIdenticalMotion ( TComDataCU* pcCU, UInt PartAddr); 184 185 #if MERL_General_Fix 186 #if MERL_VSP_C0152 187 Void xPredInterVSPBlk(TComDataCU* pcCU, UInt uiPartAddr, UInt uiAbsPartIdx, Int iWidth, Int iHeight, TComMv cMv, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi 188 #if !MERL_Bi_VSP_D0166 189 , Int vspIdx 190 #endif 191 ); 192 #endif 193 #endif 136 194 137 195 #if HHI_DMM_WEDGE_INTRA … … 169 227 #endif 170 228 171 #if H3D_IVRP 229 #if H3D_IVRP & !QC_ARP_D0177 172 230 Void residualPrediction (TComDataCU* pcCU, TComYuv* pcYuvPred, TComYuv* pcYuvResPred); 173 231 #endif … … 191 249 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 192 250 Void predIntraLumaDMM ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bAbove, Bool bLeft, Bool bEncoder ); 193 251 #if QC_DC_PREDICTOR_D0183 252 Void getPredDCs ( Bool* pbPattern, Int iPatternStride, Int* piMask, Int iMaskStride, Int& riPredDC1, Int& riPredDC2 ); 253 #else 194 254 Void getWedgePredDCs ( TComWedgelet* pcWedgelet, Int* piMask, Int iMaskStride, Int& riPredDC1, Int& riPredDC2, Bool bAbove, Bool bLeft ); 255 #endif 195 256 Void calcWedgeDCs ( TComWedgelet* pcWedgelet, Pel* piOrig, UInt uiStride, Int& riDC1, Int& riDC2 ); 196 257 Void assignWedgeDCs2Pred ( TComWedgelet* pcWedgelet, Pel* piPred, UInt uiStride, Int iDC1, Int iDC2 ); -
trunk/source/Lib/TLibCommon/TComResidualGenerator.cpp
r332 r443 44 44 45 45 46 #if H3D_IVRP 46 #if H3D_IVRP & !QC_ARP_D0177 47 47 48 48 … … 225 225 } 226 226 } 227 227 #endif 228 229 #if !QC_ARP_D0177 228 230 #if H3D_NBDV 229 231 Bool … … 249 251 } 250 252 251 #if H3D_NBDV 253 #if H3D_NBDV 252 254 Bool 253 255 TComResidualGenerator::getResidualSamples( TComPic* pcPic, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv, TComMv iDisp, Bool bRecon) … … 263 265 } 264 266 UInt uiXPosInRefView = uiXPos , uiYPosInRefView = uiYPos; 267 #if QC_ARP_D0177 268 if(pcPic->getSPS()->getMultiviewResPredMode()) 269 { 270 #endif 265 271 #if H3D_NBDV 266 272 xSetPredResidualBlock( pcPic, uiBaseViewId, uiXPos, uiYPos, uiBlkWidth, uiBlkHeight, pcYuv, iDisp, &uiXPosInRefView , &uiYPosInRefView , bRecon ); … … 269 275 #endif 270 276 return true; 277 #if QC_ARP_D0177 278 } 279 else 280 return true; 281 #endif 271 282 } 272 283 … … 345 356 UInt uiCUAddr = pcCU->getAddr(); 346 357 pcSubCU->copySubCU( pcCU, uiAbsPartIdx, uiDepth ); 347 358 #if QC_CU_NBDV_D0181 359 pcSubCU->copyDVInfoFrom( pcCU, uiAbsPartIdx); 360 #endif 348 361 //--- set residual --- 349 362 switch( pcSubCU->getPredictionMode( 0 ) ) -
trunk/source/Lib/TLibCommon/TComResidualGenerator.h
r332 r443 50 50 51 51 52 #if H3D_IVRP 52 #if H3D_IVRP & !QC_ARP_D0177 53 53 54 54 class TComResidualGenerator -
trunk/source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp
r296 r443 62 62 TComSampleAdaptiveOffset::TComSampleAdaptiveOffset() 63 63 { 64 #if !LGE_SAO_MIGRATION_D0091 64 65 m_pcPic = NULL; 66 #endif 65 67 m_iOffsetBo = NULL; 66 68 m_pClipTable = NULL; … … 71 73 m_iUpBufft = NULL; 72 74 ipSwap = NULL; 75 #if !LGE_SAO_MIGRATION_D0091 73 76 m_pcYuvTmp = NULL; 77 #endif 74 78 75 79 m_pTmpU1 = NULL; … … 85 89 } 86 90 91 #if !LGE_SAO_MIGRATION_D0091 87 92 const Int TComSampleAdaptiveOffset::m_aiNumPartsInRow[5] = 88 93 { … … 102 107 256 //level 4 103 108 }; 109 #endif 104 110 105 111 const Int TComSampleAdaptiveOffset::m_aiNumCulPartsLevel[5] = … … 124 130 0 125 131 }; 126 132 #if !LGE_SAO_MIGRATION_D0091 127 133 const UInt TComSampleAdaptiveOffset::m_iWeightSao[MAX_NUM_SAO_TYPE] = 128 134 { … … 146 152 6 147 153 }; 154 #endif 148 155 149 156 Int TComSampleAdaptiveOffset::m_iNumClass[MAX_NUM_SAO_TYPE] = … … 187 194 return idx; 188 195 } 196 #if !LGE_SAO_MIGRATION_D0091 189 197 /** convert quadtree Idx to Level, Row, and Col 190 198 * \param idx, *level, *row, *col … … 223 231 } 224 232 } 233 #endif 225 234 /** create SampleAdaptiveOffset memory. 226 235 * \param … … 317 326 } 318 327 319 328 #if LGE_SAO_MIGRATION_D0091 329 if (m_iUpBuff1) 330 { 331 m_iUpBuff1--; 332 delete [] m_iUpBuff1; m_iUpBuff1 = NULL; 333 } 334 if (m_iUpBuff2) 335 { 336 m_iUpBuff2--; 337 delete [] m_iUpBuff2; m_iUpBuff2 = NULL; 338 } 339 if (m_iUpBufft) 340 { 341 m_iUpBufft--; 342 delete [] m_iUpBufft; m_iUpBufft = NULL; 343 } 344 #else 320 345 m_iUpBuff1--; 321 346 m_iUpBuff2--; … … 334 359 delete [] m_iUpBufft; m_iUpBufft = NULL; 335 360 } 361 #endif 336 362 if (m_pTmpL1) 337 363 { … … 368 394 initSAOParam(pcSaoParam, 0, 0, 0, -1, 0, m_iNumCuInWidth-1, 0, m_iNumCuInHeight-1,1); 369 395 initSAOParam(pcSaoParam, 0, 0, 0, -1, 0, m_iNumCuInWidth-1, 0, m_iNumCuInHeight-1,2); 396 #if !LGE_SAO_MIGRATION_D0091 370 397 for(Int j=0;j<MAX_NUM_SAO_TYPE;j++) 371 398 { 372 399 pcSaoParam->iNumClass[j] = m_iNumClass[j]; 373 400 } 401 #endif 374 402 pcSaoParam->numCuInWidth = m_iNumCuInWidth; 375 403 pcSaoParam->numCuInHeight = m_iNumCuInHeight; … … 405 433 pSaoPart->iLength = 0; 406 434 435 #if LGE_SAO_MIGRATION_D0091 436 pSaoPart->subTypeIdx = 0; 437 #else 407 438 pSaoPart->bandPosition = 0; 439 #endif 408 440 409 441 for (j=0;j<MAX_NUM_SAO_OFFSETS;j++) … … 514 546 for(Int c=0; c<iNumComponet; c++) 515 547 { 548 #if LGE_SAO_MIGRATION_D0091 549 if (c<2) 550 { 516 551 pcSaoParam->bSaoFlag[c] = 0; 552 } 553 #else 554 pcSaoParam->bSaoFlag[c] = 0; 555 #endif 517 556 for(Int i=0; i< m_aiNumCulPartsLevel[m_uiMaxSplitLevel]; i++) 518 557 { … … 524 563 pcSaoParam->psSaoPart[c][i].iMinDist = MAX_INT; 525 564 pcSaoParam->psSaoPart[c][i].iMinRate = MAX_INT; 565 #if LGE_SAO_MIGRATION_D0091 566 pcSaoParam->psSaoPart[c][i].subTypeIdx = 0; 567 #else 526 568 pcSaoParam->psSaoPart[c][i].bandPosition = 0; 569 #endif 527 570 for (Int j=0;j<MAX_NUM_SAO_OFFSETS;j++) 528 571 { … … 557 600 m_pcPic = pcPic; 558 601 m_uiNumSlicesInPic = numSlicesInPic; 602 #if LGE_SAO_MIGRATION_D0091 603 m_iSGDepth = 0; 604 #else 559 605 m_iSGDepth = pcPic->getSliceGranularityForNDBFilter(); 606 #endif 560 607 m_bUseNIF = ( pcPic->getIndependentSliceBoundaryForNDBFilter() || pcPic->getIndependentTileBoundaryForNDBFilter() ); 561 608 if(m_bUseNIF) … … 958 1005 uiEdgeType = iSignDown + m_iUpBuff1[x] + 2; 959 1006 m_iUpBuff1[x]= -iSignDown; 960 961 1007 pRec[x] = m_pClipTable[pRec[x] + m_iOffsetEo[uiEdgeType]]; 962 1008 } … … 1065 1111 Void TComSampleAdaptiveOffset::SAOProcess(TComPic* pcPic, SAOParam* pcSaoParam) 1066 1112 { 1113 #if LGE_SAO_MIGRATION_D0091 1114 if (pcSaoParam->bSaoFlag[0] || pcSaoParam->bSaoFlag[1]) 1115 #else 1067 1116 if (pcSaoParam->bSaoFlag[0]) 1117 #endif 1068 1118 { 1069 1119 #if FULL_NBIT … … 1077 1127 m_pcPic->getPicYuvRec()->copyToPic(m_pcYuvTmp); 1078 1128 } 1079 1129 #if LGE_SAO_MIGRATION_D0091 1130 if (m_saoLcuBasedOptimization) 1131 #else 1080 1132 if (m_saoInterleavingFlag) 1133 #endif 1081 1134 { 1082 1135 pcSaoParam->oneUnitFlag[0] = 0; … … 1085 1138 } 1086 1139 Int iY = 0; 1140 #if LGE_SAO_MIGRATION_D0091 1141 if (pcSaoParam->bSaoFlag[0]) 1142 { 1143 processSaoUnitAll( pcSaoParam->saoLcuParam[iY], pcSaoParam->oneUnitFlag[iY], iY); 1144 } 1145 if(pcSaoParam->bSaoFlag[1]) 1146 { 1147 processSaoUnitAll( pcSaoParam->saoLcuParam[1], pcSaoParam->oneUnitFlag[1], 1);//Cb 1148 processSaoUnitAll( pcSaoParam->saoLcuParam[2], pcSaoParam->oneUnitFlag[2], 2);//Cr 1149 } 1150 #else 1087 1151 processSaoUnitAll( pcSaoParam->saoLcuParam[iY], pcSaoParam->oneUnitFlag[iY], iY); 1088 1152 … … 1097 1161 processSaoUnitAll( pcSaoParam->saoLcuParam[iCr], pcSaoParam->oneUnitFlag[iCr], iCr); 1098 1162 } 1099 1100 1163 #endif 1101 1164 m_pcPic = NULL; 1102 1165 } … … 1154 1217 Int typeIdx; 1155 1218 1219 #if LGE_SAO_MIGRATION_D0091 1220 Int offset[LUMA_GROUP_NUM+1]; 1221 #else 1156 1222 static Int offset[LUMA_GROUP_NUM+1]; 1223 #endif 1157 1224 Int idxX; 1158 1225 Int idxY; … … 1164 1231 Int isChroma = (yCbCr == 0) ? 0:1; 1165 1232 Bool mergeLeftFlag; 1166 1167 1233 #if LGE_SAO_MIGRATION_D0091 1234 offset[0] = 0; 1235 #endif 1168 1236 for (idxY = 0; idxY< frameHeightInCU; idxY++) 1169 1237 { … … 1201 1269 { 1202 1270 addr = idxY * frameWidthInCU + idxX; 1203 1204 1271 if (oneUnitFlag) 1205 1272 { … … 1225 1292 for (i=0; i<saoLcuParam[addr].length; i++) 1226 1293 { 1294 #if LGE_SAO_MIGRATION_D0091 1295 offset[ (saoLcuParam[addr].subTypeIdx +i)%SAO_MAX_BO_CLASSES +1] = saoLcuParam[addr].offset[i] << m_uiSaoBitIncrease; 1296 #else 1227 1297 offset[ (saoLcuParam[addr].bandPosition +i)%SAO_MAX_BO_CLASSES +1] = saoLcuParam[addr].offset[i] << m_uiSaoBitIncrease; 1298 #endif 1228 1299 } 1229 1300 … … 1304 1375 saoLcuParam[i].offset[j] = 0; 1305 1376 } 1377 #if LGE_SAO_MIGRATION_D0091 1378 saoLcuParam[i].subTypeIdx = 0; 1379 #else 1306 1380 saoLcuParam[i].bandPosition = 0; 1381 #endif 1307 1382 } 1308 1383 } … … 1353 1428 saoLcuParam[addr].partIdxTmp = (Int)partIdx; 1354 1429 saoLcuParam[addr].typeIdx = saoQTPart[partIdx].iBestType; 1430 #if LGE_SAO_MIGRATION_D0091 1431 saoLcuParam[addr].subTypeIdx = saoQTPart[partIdx].subTypeIdx; 1432 #else 1355 1433 saoLcuParam[addr].bandPosition = saoQTPart[partIdx].bandPosition; 1434 #endif 1356 1435 if (saoLcuParam[addr].typeIdx!=-1) 1357 1436 { … … 1365 1444 { 1366 1445 saoLcuParam[addr].length = 0; 1446 #if LGE_SAO_MIGRATION_D0091 1447 saoLcuParam[addr].subTypeIdx = saoQTPart[partIdx].subTypeIdx; 1448 #else 1367 1449 saoLcuParam[addr].bandPosition = saoQTPart[partIdx].bandPosition; 1450 #endif 1368 1451 for (j=0;j<MAX_NUM_SAO_OFFSETS;j++) 1369 1452 { … … 1375 1458 } 1376 1459 1377 1378 1460 #if LGE_SAO_MIGRATION_D0091 1461 Void TComSampleAdaptiveOffset::resetSaoUnit(SaoLcuParam* saoUnit) 1462 { 1463 saoUnit->partIdx = 0; 1464 saoUnit->partIdxTmp = 0; 1465 saoUnit->mergeLeftFlag = 0; 1466 saoUnit->mergeUpFlag = 0; 1467 saoUnit->typeIdx = -1; 1468 saoUnit->length = 0; 1469 saoUnit->subTypeIdx = 0; 1470 1471 for (Int i=0;i<4;i++) 1472 { 1473 saoUnit->offset[i] = 0; 1474 } 1475 } 1476 1477 Void TComSampleAdaptiveOffset::copySaoUnit(SaoLcuParam* saoUnitDst, SaoLcuParam* saoUnitSrc ) 1478 { 1479 saoUnitDst->mergeLeftFlag = saoUnitSrc->mergeLeftFlag; 1480 saoUnitDst->mergeUpFlag = saoUnitSrc->mergeUpFlag; 1481 saoUnitDst->typeIdx = saoUnitSrc->typeIdx; 1482 saoUnitDst->length = saoUnitSrc->length; 1483 1484 saoUnitDst->subTypeIdx = saoUnitSrc->subTypeIdx; 1485 for (Int i=0;i<4;i++) 1486 { 1487 saoUnitDst->offset[i] = saoUnitSrc->offset[i]; 1488 } 1489 } 1490 1491 /** PCM LF disable process. 1492 * \param pcPic picture (TComPic) pointer 1493 * \returns Void 1494 * 1495 * \note Replace filtered sample values of PCM mode blocks with the transmitted and reconstructed ones. 1496 */ 1497 Void TComSampleAdaptiveOffset::PCMLFDisableProcess (TComPic* pcPic) 1498 { 1499 xPCMRestoration(pcPic); 1500 } 1501 1502 /** Picture-level PCM restoration. 1503 * \param pcPic picture (TComPic) pointer 1504 * \returns Void 1505 */ 1506 Void TComSampleAdaptiveOffset::xPCMRestoration(TComPic* pcPic) 1507 { 1508 Bool bPCMFilter = (pcPic->getSlice(0)->getSPS()->getUsePCM() && pcPic->getSlice(0)->getSPS()->getPCMFilterDisableFlag())? true : false; 1509 #if LOSSLESS_CODING 1510 if(bPCMFilter || pcPic->getSlice(0)->getSPS()->getUseLossless()) 1511 #else 1512 if(bPCMFilter) 1513 #endif 1514 { 1515 for( UInt uiCUAddr = 0; uiCUAddr < pcPic->getNumCUsInFrame() ; uiCUAddr++ ) 1516 { 1517 TComDataCU* pcCU = pcPic->getCU(uiCUAddr); 1518 xPCMCURestoration(pcCU, 0, 0); 1519 } 1520 } 1521 } 1522 1523 /** PCM CU restoration. 1524 * \param pcCU pointer to current CU 1525 * \param uiAbsPartIdx part index 1526 * \param uiDepth CU depth 1527 * \returns Void 1528 */ 1529 Void TComSampleAdaptiveOffset::xPCMCURestoration ( TComDataCU* pcCU, UInt uiAbsZorderIdx, UInt uiDepth ) 1530 { 1531 TComPic* pcPic = pcCU->getPic(); 1532 UInt uiCurNumParts = pcPic->getNumPartInCU() >> (uiDepth<<1); 1533 UInt uiQNumParts = uiCurNumParts>>2; 1534 1535 // go to sub-CU 1536 if( pcCU->getDepth(uiAbsZorderIdx) > uiDepth ) 1537 { 1538 for ( UInt uiPartIdx = 0; uiPartIdx < 4; uiPartIdx++, uiAbsZorderIdx+=uiQNumParts ) 1539 { 1540 UInt uiLPelX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsZorderIdx] ]; 1541 UInt uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsZorderIdx] ]; 1542 if( ( uiLPelX < pcCU->getSlice()->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples() ) ) 1543 xPCMCURestoration( pcCU, uiAbsZorderIdx, uiDepth+1 ); 1544 } 1545 return; 1546 } 1547 1548 // restore PCM samples 1549 if ((pcCU->getIPCMFlag(uiAbsZorderIdx)&& pcPic->getSlice(0)->getSPS()->getPCMFilterDisableFlag()) || pcCU->isLosslessCoded( uiAbsZorderIdx)) 1550 { 1551 xPCMSampleRestoration (pcCU, uiAbsZorderIdx, uiDepth, TEXT_LUMA ); 1552 xPCMSampleRestoration (pcCU, uiAbsZorderIdx, uiDepth, TEXT_CHROMA_U); 1553 xPCMSampleRestoration (pcCU, uiAbsZorderIdx, uiDepth, TEXT_CHROMA_V); 1554 } 1555 } 1556 1557 /** PCM sample restoration. 1558 * \param pcCU pointer to current CU 1559 * \param uiAbsPartIdx part index 1560 * \param uiDepth CU depth 1561 * \param ttText texture component type 1562 * \returns Void 1563 */ 1564 Void TComSampleAdaptiveOffset::xPCMSampleRestoration (TComDataCU* pcCU, UInt uiAbsZorderIdx, UInt uiDepth, TextType ttText) 1565 { 1566 TComPicYuv* pcPicYuvRec = pcCU->getPic()->getPicYuvRec(); 1567 Pel* piSrc; 1568 Pel* piPcm; 1569 UInt uiStride; 1570 UInt uiWidth; 1571 UInt uiHeight; 1572 UInt uiPcmLeftShiftBit; 1573 UInt uiX, uiY; 1574 UInt uiMinCoeffSize = pcCU->getPic()->getMinCUWidth()*pcCU->getPic()->getMinCUHeight(); 1575 UInt uiLumaOffset = uiMinCoeffSize*uiAbsZorderIdx; 1576 UInt uiChromaOffset = uiLumaOffset>>2; 1577 1578 if( ttText == TEXT_LUMA ) 1579 { 1580 piSrc = pcPicYuvRec->getLumaAddr( pcCU->getAddr(), uiAbsZorderIdx); 1581 piPcm = pcCU->getPCMSampleY() + uiLumaOffset; 1582 uiStride = pcPicYuvRec->getStride(); 1583 uiWidth = (g_uiMaxCUWidth >> uiDepth); 1584 uiHeight = (g_uiMaxCUHeight >> uiDepth); 1585 if ( pcCU->isLosslessCoded(uiAbsZorderIdx) ) 1586 { 1587 uiPcmLeftShiftBit = 0; 1588 } 1589 else 1590 { 1591 uiPcmLeftShiftBit = g_uiBitDepth + g_uiBitIncrement - pcCU->getSlice()->getSPS()->getPCMBitDepthLuma(); 1592 } 1593 } 1594 else 1595 { 1596 if( ttText == TEXT_CHROMA_U ) 1597 { 1598 piSrc = pcPicYuvRec->getCbAddr( pcCU->getAddr(), uiAbsZorderIdx ); 1599 piPcm = pcCU->getPCMSampleCb() + uiChromaOffset; 1600 } 1601 else 1602 { 1603 piSrc = pcPicYuvRec->getCrAddr( pcCU->getAddr(), uiAbsZorderIdx ); 1604 piPcm = pcCU->getPCMSampleCr() + uiChromaOffset; 1605 } 1606 1607 uiStride = pcPicYuvRec->getCStride(); 1608 uiWidth = ((g_uiMaxCUWidth >> uiDepth)/2); 1609 uiHeight = ((g_uiMaxCUWidth >> uiDepth)/2); 1610 if ( pcCU->isLosslessCoded(uiAbsZorderIdx) ) 1611 { 1612 uiPcmLeftShiftBit = 0; 1613 } 1614 else 1615 { 1616 uiPcmLeftShiftBit = g_uiBitDepth + g_uiBitIncrement - pcCU->getSlice()->getSPS()->getPCMBitDepthChroma(); 1617 } 1618 } 1619 1620 for( uiY = 0; uiY < uiHeight; uiY++ ) 1621 { 1622 for( uiX = 0; uiX < uiWidth; uiX++ ) 1623 { 1624 piSrc[uiX] = (piPcm[uiX] << uiPcmLeftShiftBit); 1625 } 1626 piPcm += uiWidth; 1627 piSrc += uiStride; 1628 } 1629 } 1630 #endif 1379 1631 //! \} -
trunk/source/Lib/TLibCommon/TComSampleAdaptiveOffset.h
r296 r443 65 65 66 66 static UInt m_uiMaxDepth; 67 #if !LGE_SAO_MIGRATION_D0091 67 68 static const Int m_aiNumPartsInRow[5]; 68 69 static const Int m_aiNumPartsLevel[5]; 70 #endif 69 71 static const Int m_aiNumCulPartsLevel[5]; 70 72 static const UInt m_auiEoTable[9]; 73 #if !LGE_SAO_MIGRATION_D0091 71 74 static const UInt m_auiEoTable2D[9]; 72 75 static const UInt m_iWeightSao[MAX_NUM_SAO_TYPE]; 76 #endif 73 77 Int *m_iOffsetBo; 74 78 Int m_iOffsetEo[LUMA_GROUP_NUM]; … … 107 111 Int* m_iLcuPartIdx; 108 112 Int m_maxNumOffsetsPerPic; 113 #if LGE_SAO_MIGRATION_D0091 114 Bool m_saoLcuBoundary; 115 Bool m_saoLcuBasedOptimization; 116 117 Void xPCMRestoration (TComPic* pcPic); 118 Void xPCMCURestoration (TComDataCU* pcCU, UInt uiAbsZorderIdx, UInt uiDepth); 119 Void xPCMSampleRestoration (TComDataCU* pcCU, UInt uiAbsZorderIdx, UInt uiDepth, TextType ttText); 120 #else 109 121 Bool m_saoInterleavingFlag; 122 #endif 110 123 public: 111 124 TComSampleAdaptiveOffset (); … … 116 129 117 130 Int convertLevelRowCol2Idx(int level, int row, int col); 131 #if !LGE_SAO_MIGRATION_D0091 118 132 void convertIdx2LevelRowCol(int idx, int *level, int *row, int *col); 133 #endif 119 134 120 135 Void initSAOParam (SAOParam *pcSaoParam, Int iPartLevel, Int iPartRow, Int iPartCol, Int iParentPartIdx, Int StartCUX, Int EndCUX, Int StartCUY, Int EndCUY, Int iYCbCr); 121 136 Void allocSaoParam (SAOParam* pcSaoParam); 122 137 Void resetSAOParam (SAOParam *pcSaoParam); 138 #if LGE_SAO_MIGRATION_D0091 139 static Void freeSaoParam (SAOParam *pcSaoParam); 140 #else 123 141 Void freeSaoParam (SAOParam *pcSaoParam); 142 #endif 143 124 144 125 145 Void SAOProcess(TComPic* pcPic, SAOParam* pcSaoParam); 126 146 Void processSaoCu(Int iAddr, Int iSaoType, Int iYCbCr); 147 #if !LGE_SAO_MIGRATION_D0091 127 148 Void processSaoOnePart(SAOQTPart *psQTPart, UInt uiPartIdx, Int iYCbCr); 128 149 Void processSaoQuadTree(SAOQTPart *psQTPart, UInt uiPartIdx, Int iYCbCr); 150 #endif 129 151 Pel* getPicYuvAddr(TComPicYuv* pcPicYuv, Int iYCbCr,Int iAddr = 0); 130 152 … … 138 160 Void convertOnePart2SaoUnit(SAOParam *saoParam, UInt partIdx, Int yCbCr); 139 161 Void processSaoUnitAll(SaoLcuParam* saoLcuParam, Bool oneUnitFlag, Int yCbCr); 162 #if LGE_SAO_MIGRATION_D0091 163 Void setSaoLcuBoundary (Bool bVal) {m_saoLcuBoundary = bVal;} 164 Bool getSaoLcuBoundary () {return m_saoLcuBoundary;} 165 Void setSaoLcuBasedOptimization (Bool bVal) {m_saoLcuBasedOptimization = bVal;} 166 Bool getSaoLcuBasedOptimization () {return m_saoLcuBasedOptimization;} 167 Void resetSaoUnit(SaoLcuParam* saoUnit); 168 Void copySaoUnit(SaoLcuParam* saoUnitDst, SaoLcuParam* saoUnitSrc ); 169 Void PCMLFDisableProcess ( TComPic* pcPic); ///< interface function for ALF process 170 #else 140 171 Void setSaoInterleavingFlag (Bool bVal) {m_saoInterleavingFlag = bVal;} 141 172 Bool getSaoInterleavingFlag () {return m_saoInterleavingFlag;} 173 #endif 142 174 }; 143 175 -
trunk/source/Lib/TLibCommon/TComSlice.cpp
r332 r443 113 113 #if LGE_ILLUCOMP_B0045 114 114 , m_bApplyIC ( false ) 115 #if SHARP_ILLUCOMP_PARSE_D0060 116 , m_icSkipParseFlag ( false ) 117 #endif 115 118 #endif 116 119 #if INTER_VIEW_VECTOR_SCALING_C0115 … … 119 122 #endif 120 123 { 124 #if MERL_VSP_NBDV_RefVId_Fix_D0166 125 for(Int iNumCount = 0; iNumCount < MAX_VIEW_NUM; iNumCount++) 126 m_pcListDepthPic[iNumCount] =NULL; 127 #endif 121 128 m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = m_aiNumRefIdx[2] = 0; 122 129 … … 818 825 819 826 m_saoEnabledFlag = pSrc->m_saoEnabledFlag; 827 #if LGE_SAO_MIGRATION_D0091 828 m_saoEnabledFlagChroma = pSrc->m_saoEnabledFlagChroma; 829 #else 820 830 m_saoInterleavingFlag = pSrc->m_saoInterleavingFlag; 821 831 m_saoEnabledFlagCb = pSrc->m_saoEnabledFlagCb; 822 832 m_saoEnabledFlagCr = pSrc->m_saoEnabledFlagCr; 833 #endif 823 834 #if CABAC_INIT_FLAG 824 835 m_cabacInitFlag = pSrc->m_cabacInitFlag; … … 827 838 828 839 m_bLMvdL1Zero = pSrc->m_bLMvdL1Zero; 840 #if SHARP_ILLUCOMP_PARSE_D0060 841 m_bApplyIC = pSrc->m_bApplyIC; 842 m_icSkipParseFlag = pSrc->m_icSkipParseFlag; 843 #endif 829 844 } 830 845 … … 1387 1402 #endif 1388 1403 1404 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1405 TComPic* TComSlice::getDepthRefPic(Int viewId, Int poc) 1406 { 1407 TComPic* pPic = NULL; 1408 1409 if (m_pcListDepthPic[viewId] == NULL) 1410 return NULL; 1411 1412 for( TComList<TComPic*>::iterator it = m_pcListDepthPic[viewId]->begin(); it != m_pcListDepthPic[viewId]->end(); it++ ) 1413 { 1414 TComPic* currPic = *it; 1415 TComSlice* currSlice = currPic->getCurrSlice(); 1416 Bool isDepth = currSlice->getIsDepth(); 1417 //assert(isDepth); 1418 if( isDepth && currPic->getPOC() == poc && currPic->getViewId() == viewId ) // (*it)->getSPS()->isDepth() 1419 { 1420 pPic = *it; 1421 break; 1422 } 1423 } 1424 1425 return pPic; 1426 } 1427 #endif 1428 1429 1430 #if QC_ARP_D0177 1431 Void TComSlice::setARPStepNum() 1432 { 1433 Bool bAllIvRef = false; 1434 if(!getSPS()->getUseAdvRP()) 1435 m_nARPStepNum = 0; 1436 else 1437 { 1438 for( Int iRefListId = 0; iRefListId < 2; iRefListId++ ) 1439 { 1440 RefPicList eRefPicList = RefPicList( iRefListId ); 1441 Int iNumRefIdx = getNumRefIdx(eRefPicList); 1442 if( iNumRefIdx <= 0 ) 1443 continue; 1444 for (Int i = 0; i < iNumRefIdx; i++) 1445 { 1446 if(getRefPic( REF_PIC_LIST_0, i)->getPOC() != getPOC()) 1447 { 1448 bAllIvRef = true; 1449 break; 1450 } 1451 } 1452 if( bAllIvRef == true ) 1453 break; 1454 } 1455 if(bAllIvRef== true) 1456 m_nARPStepNum = getSPS()->getARPStepNum(); 1457 else 1458 m_nARPStepNum = 0; 1459 } 1460 } 1461 #endif 1389 1462 // ------------------------------------------------------------------------------------------------ 1390 1463 // Video parameter set (VPS) … … 1576 1649 m_uiMultiviewMvPredMode = 0; 1577 1650 #endif 1578 1651 #if QC_ARP_D0177 1652 m_nUseAdvResPred = 0; 1653 m_nARPStepNum = 1; 1654 #endif 1579 1655 ::memset( m_aiUsableInterViewRefs, 0, sizeof( m_aiUsableInterViewRefs ) ); 1580 1656 … … 2044 2120 m_scalingList = src.m_scalingList; 2045 2121 m_scalingListEnabled = src.m_scalingListEnabled; 2122 #if !LGE_SAO_MIGRATION_D0091 2046 2123 m_saoInterleavingFlag = src.m_saoInterleavingFlag; 2124 #endif 2047 2125 2048 2126 return *this; -
trunk/source/Lib/TLibCommon/TComSlice.h
r332 r443 54 54 class TComDepthMapGenerator; 55 55 #endif 56 #if H3D_IVRP 56 #if H3D_IVRP & !QC_ARP_D0177 57 57 class TComResidualGenerator; 58 58 #endif … … 180 180 Bool m_bIVScalingFlag; 181 181 #endif 182 183 #if MTK_D0156 184 #if MERL_VSP_COMPENSATION_C0152 185 Bool m_abUseVSPCompensation[ MAX_TLAYER ]; 186 #endif 187 Bool m_abUseDVPRefine[ MAX_TLAYER ]; 188 #endif 189 182 190 public: 183 191 TComVPS(); … … 245 253 246 254 #endif 255 256 #if MTK_D0156 257 #if MERL_VSP_COMPENSATION_C0152 258 Bool getUseVSPCompensation( UInt tLayer ){ return m_abUseVSPCompensation[ tLayer ];} 259 Void setUseVSPCompensation( Bool bValue, UInt tLayer ){ m_abUseVSPCompensation[ tLayer ] = bValue;} 260 #endif 261 Bool getUseDVPRefine( UInt tLayer ){ return m_abUseDVPRefine[ tLayer ];} 262 Void setUseDVPRefine( Bool bValue, UInt tLayer ){ m_abUseDVPRefine[ tLayer ] = bValue;} 263 #endif 247 264 }; 248 265 … … 390 407 #endif 391 408 #if H3D_IVRP 409 #if QC_ARP_D0177 410 UInt m_nUseAdvResPred; 411 UInt m_nARPStepNum; 412 #else 392 413 UInt m_uiMultiviewResPredMode; 414 #endif 393 415 #endif 394 416 … … 396 418 TComDepthMapGenerator* m_pcDepthMapGenerator; 397 419 #endif 398 #if H3D_IVRP 420 #if H3D_IVRP & !QC_ARP_D0177 399 421 TComResidualGenerator* m_pcResidualGenerator; 422 #endif 423 424 #if MTK_D0156 425 #if MERL_VSP_COMPENSATION_C0152 426 Bool m_bUseVSPCompensation; 427 #endif 428 Bool m_bUseDVPRefine; 400 429 #endif 401 430 … … 643 672 Void setPredDepthMapGeneration( UInt uiViewId, Bool bIsDepth, UInt uiPdmGenMode = 0, UInt uiPdmMvPredMode = 0, UInt uiPdmPrec = 0, Int** aaiPdmScaleNomDelta = 0, Int** aaiPdmOffset = 0 ); 644 673 #endif 645 #if H3D_IVRP 674 #if H3D_IVRP & !QC_ARP_D0177 646 675 Void setMultiviewResPredMode ( UInt uiResPrdMode ) { m_uiMultiviewResPredMode = uiResPrdMode; } 647 676 #endif … … 658 687 #endif 659 688 #if H3D_IVRP 689 #if QC_ARP_D0177 690 UInt getUseAdvRP() { return m_nUseAdvResPred; } 691 Void setUseAdvRP(UInt n) { m_nUseAdvResPred = n; } 692 UInt getARPStepNum() { return m_nARPStepNum; } 693 Void setARPStepNum(UInt n) { m_nARPStepNum = n; } 694 #else 660 695 UInt getMultiviewResPredMode () { return m_uiMultiviewResPredMode; } 696 #endif 661 697 #endif 662 698 … … 665 701 TComDepthMapGenerator* getDepthMapGenerator() { return m_pcDepthMapGenerator; } 666 702 #endif 667 #if H3D_IVRP 703 #if H3D_IVRP & !QC_ARP_D0177 668 704 Void setResidualGenerator( TComResidualGenerator* pcResidualGenerator ) { m_pcResidualGenerator = pcResidualGenerator; } 669 705 TComResidualGenerator* getResidualGenerator() { return m_pcResidualGenerator; } 706 #endif 707 708 #if MTK_D0156 709 710 #if MERL_VSP_COMPENSATION_C0152 711 Bool getUseVSPCompensation( ){ return m_bUseVSPCompensation;} 712 Void setUseVSPCompensation( Bool bValue ){ m_bUseVSPCompensation = bValue;} 713 #endif 714 715 Bool getUseDVPRefine( ){ return m_bUseDVPRefine;} 716 Void setUseDVPRefine( Bool bValue ){ m_bUseDVPRefine = bValue;} 717 670 718 #endif 671 719 }; … … 928 976 Bool getScalingListEnabled () { return m_scalingListEnabled; } //!< get ScalingList enabled/disabled in APS 929 977 TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in APS 978 #if !LGE_SAO_MIGRATION_D0091 930 979 Bool getSaoInterleavingFlag() {return m_saoInterleavingFlag;} //!< get SAO interleaving flag in APS 931 980 Void setSaoInterleavingFlag(Bool bVal) {m_saoInterleavingFlag = bVal;} //!< set SAO interleaving flag in APS 981 #endif 932 982 933 983 private: … … 943 993 Bool m_scalingListEnabled; //!< ScalingList enabled/disabled in APS (true for enabled) 944 994 TComScalingList* m_scalingList; //!< ScalingList class pointer 995 #if !LGE_SAO_MIGRATION_D0091 945 996 Bool m_saoInterleavingFlag; //!< SAO interleaving flag 997 #endif 946 998 947 999 public: … … 975 1027 bool m_alfEnabledFlag; 976 1028 bool m_saoEnabledFlag; 1029 #if LGE_SAO_MIGRATION_D0091 1030 bool m_saoEnabledFlagChroma; ///< SAO Cb&Cr enabled flag 1031 #else 977 1032 bool m_saoInterleavingFlag; ///< SAO interleaving flag 978 1033 bool m_saoEnabledFlagCb; ///< SAO Cb enabled flag 979 1034 bool m_saoEnabledFlagCr; ///< SAO Cr enabled flag 1035 #endif 980 1036 Int m_iPPSId; ///< picture parameter set ID 981 1037 Bool m_PicOutputFlag; ///< pic_output_flag … … 1106 1162 #if LGE_ILLUCOMP_B0045 1107 1163 Bool m_bApplyIC; 1164 #if SHARP_ILLUCOMP_PARSE_D0060 1165 Bool m_icSkipParseFlag; 1166 #endif 1167 #endif 1168 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1169 TComList<TComPic*>* m_pcListDepthPic[MAX_VIEW_NUM]; // For encoder, the list may also include texture pictures. Three views with ViewIdx = 0, 1, 2 1170 #endif 1171 #if QC_ARP_D0177 1172 TComList<TComPic*> * m_pBaseViewRefPicList[MAX_VIEW_NUM]; 1173 UInt m_nARPStepNum; 1108 1174 #endif 1109 1175 #if INTER_VIEW_VECTOR_SCALING_C0115|QC_MVHEVC_B0046 … … 1115 1181 TComPic* m_apcRefPicBaseTxt; 1116 1182 TComPic* m_apcRefPicBaseDepth; 1183 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1184 Int* m_aiShiftLUT[2]; // For reference views 1185 #else 1117 1186 Int* m_aiShiftLUT; 1187 #endif 1118 1188 Int m_iShiftPrec; 1119 1189 #endif … … 1158 1228 Void setSaoEnabledFlag(Bool s) {m_saoEnabledFlag =s; } 1159 1229 Bool getSaoEnabledFlag() { return m_saoEnabledFlag; } 1230 #if LGE_SAO_MIGRATION_D0091 1231 Void setSaoEnabledFlagChroma(Bool s) {m_saoEnabledFlagChroma =s; } //!< set SAO Cb&Cr enabled flag 1232 Bool getSaoEnabledFlagChroma() { return m_saoEnabledFlagChroma; } //!< get SAO Cb&Cr enabled flag 1233 #else 1160 1234 Void setSaoInterleavingFlag(Bool s) {m_saoInterleavingFlag =s; } //!< set SAO interleaving flag 1161 1235 Bool getSaoInterleavingFlag() { return m_saoInterleavingFlag; } //!< get SAO interleaving flag … … 1164 1238 Void setSaoEnabledFlagCr(Bool s) {m_saoEnabledFlagCr =s; } //!< set SAO Cr enabled flag 1165 1239 Bool getSaoEnabledFlagCr() { return m_saoEnabledFlagCr; } //!< get SAO Cr enabled flag 1240 #endif 1166 1241 Void setRPS ( TComReferencePictureSet *pcRPS ) { m_pcRPS = pcRPS; } 1167 1242 TComReferencePictureSet* getRPS () { return m_pcRPS; } … … 1253 1328 Void setRefPicListMvc ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& rapcInterViewRefPics ); 1254 1329 Void setRefPOCnViewListsMvc(); 1255 1330 #if QC_ARP_D0177 1331 Void setBaseViewRefPicList( TComList<TComPic*> *pListPic, Int iViewIdx ) { m_pBaseViewRefPicList[iViewIdx] = pListPic; } 1332 TComPic* getBaseViewRefPic ( UInt uiPOC , Int iViewIdx ) { return xGetRefPic( *m_pBaseViewRefPicList[iViewIdx], uiPOC ); } 1333 Void setARPStepNum(); 1334 UInt getARPStepNum( ) { return m_nARPStepNum; } 1335 #endif 1256 1336 Void setColDir ( UInt uiDir ) { m_uiColDir = uiDir; } 1257 1337 #if COLLOCATED_REF_IDX … … 1401 1481 Bool getApplyIC () { return m_bApplyIC; } 1402 1482 Void xSetApplyIC (); 1483 #if SHARP_ILLUCOMP_PARSE_D0060 1484 Void setIcSkipParseFlag( Bool b ) { m_icSkipParseFlag = b; } 1485 Bool getIcSkipParseFlag() { return m_icSkipParseFlag; } 1486 #endif 1403 1487 #endif 1404 1488 #if QC_TMVP_MRG_REFIDX_C0047 … … 1418 1502 TComPic* getRefPicBaseDepth () { return m_apcRefPicBaseDepth; } 1419 1503 Void setRefPicBaseDepth ( TComPic* RefPic) { m_apcRefPicBaseDepth = RefPic; } 1420 1504 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1505 Void setBWVSPLUTParam( Int *pShiftLUT, Int iLoG2LUTPrec, Int iNeighborViewId) { m_aiShiftLUT[iNeighborViewId] = pShiftLUT; m_iShiftPrec = iLoG2LUTPrec; } 1506 Void getBWVSPLUTParam( Int*&pShiftLUT, Int&iLoG2LUTPrec, Int iNeighborViewId) { pShiftLUT = m_aiShiftLUT[iNeighborViewId]; iLoG2LUTPrec = m_iShiftPrec; } 1507 #else 1421 1508 Void setBWVSPLUTParam( Int *pShiftLUT, Int iLoG2LUTPrec) { m_aiShiftLUT = pShiftLUT; m_iShiftPrec = iLoG2LUTPrec; } 1422 1509 Void getBWVSPLUTParam( Int*&pShiftLUT, Int&iLoG2LUTPrec) { pShiftLUT = m_aiShiftLUT; iLoG2LUTPrec = m_iShiftPrec; } 1510 #endif 1511 #endif 1512 1513 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1514 Void setListDepthPic( TComList<TComPic*>* pListDepthPic, Int viewId) { m_pcListDepthPic[viewId] = pListDepthPic; } 1515 TComList<TComPic*>* getListDepthPic(Int viewId) { return m_pcListDepthPic[viewId]; } 1516 TComPic* getDepthRefPic(Int viewId, Int poc); 1517 TComPic* getDepthRefPic(Int refIdx); 1423 1518 #endif 1424 1519 -
trunk/source/Lib/TLibCommon/TComWedgelet.cpp
r296 r443 783 783 Int deltax = x1 - x0; 784 784 Int deltay = abs(y1 - y0); 785 #if FIX_WEDGE_NOFLOAT_D0036 786 Int error = 0; 787 Int deltaerr = (deltay<<1); 788 #else 785 789 double error = 0.0; 786 790 double deltaerr = (double)deltay / (double)deltax; 791 #endif 787 792 788 793 Int ystep; … … 797 802 798 803 error += deltaerr; 804 #if FIX_WEDGE_NOFLOAT_D0036 805 if( error >= deltax ) 806 #else 799 807 if( error >= 0.5) 808 #endif 800 809 { 801 810 y += ystep; 811 #if FIX_WEDGE_NOFLOAT_D0036 812 error = error - (deltax<<1); 813 #else 802 814 error = error - 1.0; 815 #endif 803 816 } 804 817 } -
trunk/source/Lib/TLibCommon/TComYuv.cpp
r332 r443 741 741 } 742 742 } 743 #if QC_ARP_D0177 744 Void TComYuv::addARP(TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip ) 745 { 746 addARPLuma ( pcYuvSrc0, pcYuvSrc1, uiAbsPartIdx, uiWidth , uiHeight , bClip ); 747 addARPChroma ( pcYuvSrc0, pcYuvSrc1, uiAbsPartIdx, uiWidth>>1, uiHeight>>1 , bClip ); 748 } 749 750 Void TComYuv::addARPLuma(TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip ) 751 { 752 Int x, y; 753 754 Pel* pSrc0 = pcYuvSrc0->getLumaAddr( uiAbsPartIdx ); 755 Pel* pSrc1 = pcYuvSrc1->getLumaAddr( uiAbsPartIdx ); 756 Pel* pDst = getLumaAddr( uiAbsPartIdx ); 757 758 UInt iSrc0Stride = pcYuvSrc0->getStride(); 759 UInt iSrc1Stride = pcYuvSrc1->getStride(); 760 UInt iDstStride = getStride(); 761 for ( y = uiHeight-1; y >= 0; y-- ) 762 { 763 for ( x = uiWidth-1; x >= 0; x-- ) 764 { 765 pDst[x] = pSrc0[x] + pSrc1[x]; 766 if( bClip ) 767 pDst[x] = Clip( pDst[x] ); 768 } 769 pSrc0 += iSrc0Stride; 770 pSrc1 += iSrc1Stride; 771 pDst += iDstStride; 772 } 773 } 774 775 Void TComYuv::addARPChroma(TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip ) 776 { 777 Int x, y; 778 779 Pel* pSrcU0 = pcYuvSrc0->getCbAddr( uiAbsPartIdx ); 780 Pel* pSrcU1 = pcYuvSrc1->getCbAddr( uiAbsPartIdx ); 781 Pel* pSrcV0 = pcYuvSrc0->getCrAddr( uiAbsPartIdx ); 782 Pel* pSrcV1 = pcYuvSrc1->getCrAddr( uiAbsPartIdx ); 783 Pel* pDstU = getCbAddr( uiAbsPartIdx ); 784 Pel* pDstV = getCrAddr( uiAbsPartIdx ); 785 786 UInt iSrc0Stride = pcYuvSrc0->getCStride(); 787 UInt iSrc1Stride = pcYuvSrc1->getCStride(); 788 UInt iDstStride = getCStride(); 789 for ( y = uiHeight-1; y >= 0; y-- ) 790 { 791 for ( x = uiWidth-1; x >= 0; x-- ) 792 { 793 pDstU[x] = pSrcU0[x] + pSrcU1[x]; 794 pDstV[x] = pSrcV0[x] + pSrcV1[x]; 795 if( bClip ) 796 { 797 pDstU[x] = Clip( pDstU[x] ); 798 pDstV[x] = Clip( pDstV[x] ); 799 } 800 } 801 802 pSrcU0 += iSrc0Stride; 803 pSrcU1 += iSrc1Stride; 804 pSrcV0 += iSrc0Stride; 805 pSrcV1 += iSrc1Stride; 806 pDstU += iDstStride; 807 pDstV += iDstStride; 808 } 809 } 810 811 Void TComYuv::subtractARP(TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight) 812 { 813 subtractARPLuma ( pcYuvSrc0, pcYuvSrc1, uiAbsPartIdx, uiWidth , uiHeight ); 814 subtractARPChroma( pcYuvSrc0, pcYuvSrc1, uiAbsPartIdx, uiWidth>>1 , uiHeight>>1 ); 815 } 816 817 Void TComYuv::subtractARPLuma(TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight) 818 { 819 Int x, y; 820 821 Pel* pSrc0 = pcYuvSrc0->getLumaAddr( uiAbsPartIdx ); 822 Pel* pSrc1 = pcYuvSrc1->getLumaAddr( uiAbsPartIdx ); 823 Pel* pDst = getLumaAddr( uiAbsPartIdx ); 824 825 Int iSrc0Stride = pcYuvSrc0->getStride(); 826 Int iSrc1Stride = pcYuvSrc1->getStride(); 827 Int iDstStride = getStride(); 828 for ( y = uiHeight-1; y >= 0; y-- ) 829 { 830 for ( x = uiWidth-1; x >= 0; x-- ) 831 { 832 pDst[x] = pSrc0[x] - pSrc1[x]; 833 } 834 pSrc0 += iSrc0Stride; 835 pSrc1 += iSrc1Stride; 836 pDst += iDstStride; 837 } 838 } 839 840 Void TComYuv::subtractARPChroma(TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight) 841 { 842 Int x, y; 843 844 Pel* pSrcU0 = pcYuvSrc0->getCbAddr( uiAbsPartIdx ); 845 Pel* pSrcU1 = pcYuvSrc1->getCbAddr( uiAbsPartIdx ); 846 Pel* pSrcV0 = pcYuvSrc0->getCrAddr( uiAbsPartIdx ); 847 Pel* pSrcV1 = pcYuvSrc1->getCrAddr( uiAbsPartIdx ); 848 Pel* pDstU = getCbAddr( uiAbsPartIdx ); 849 Pel* pDstV = getCrAddr( uiAbsPartIdx ); 850 851 Int iSrc0Stride = pcYuvSrc0->getCStride(); 852 Int iSrc1Stride = pcYuvSrc1->getCStride(); 853 Int iDstStride = getCStride(); 854 for ( y = uiHeight-1; y >= 0; y-- ) 855 { 856 for ( x = uiWidth-1; x >= 0; x-- ) 857 { 858 pDstU[x] = pSrcU0[x] - pSrcU1[x]; 859 pDstV[x] = pSrcV0[x] - pSrcV1[x]; 860 } 861 pSrcU0 += iSrc0Stride; 862 pSrcU1 += iSrc1Stride; 863 pSrcV0 += iSrc0Stride; 864 pSrcV1 += iSrc1Stride; 865 pDstU += iDstStride; 866 pDstV += iDstStride; 867 } 868 } 869 870 Void TComYuv::multiplyARP( UInt uiAbsPartIdx , UInt uiWidth , UInt uiHeight , UChar dW ) 871 { 872 multiplyARPLuma( uiAbsPartIdx , uiWidth , uiHeight , dW ); 873 multiplyARPChroma( uiAbsPartIdx , uiWidth >> 1 , uiHeight >> 1 , dW ); 874 } 875 876 Void TComYuv::xxMultiplyLine( Pel * pSrcDst , UInt uiWidth , UChar dW ) 877 { 878 assert( dW == 2 ); 879 for( UInt x = 0 ; x < uiWidth ; x++ ) 880 pSrcDst[x] = pSrcDst[x] >> 1; 881 } 882 883 Void TComYuv::multiplyARPLuma( UInt uiAbsPartIdx , UInt uiWidth , UInt uiHeight , UChar dW ) 884 { 885 Pel* pDst = getLumaAddr( uiAbsPartIdx ); 886 Int iDstStride = getStride(); 887 for ( Int y = uiHeight-1; y >= 0; y-- ) 888 { 889 xxMultiplyLine( pDst , uiWidth , dW ); 890 pDst += iDstStride; 891 } 892 } 893 894 Void TComYuv::multiplyARPChroma( UInt uiAbsPartIdx , UInt uiWidth , UInt uiHeight , UChar dW ) 895 { 896 Pel* pDstU = getCbAddr( uiAbsPartIdx ); 897 Pel* pDstV = getCrAddr( uiAbsPartIdx ); 898 899 Int iDstStride = getCStride(); 900 for ( Int y = uiHeight-1; y >= 0; y-- ) 901 { 902 xxMultiplyLine( pDstU , uiWidth , dW ); 903 xxMultiplyLine( pDstV , uiWidth , dW ); 904 pDstU += iDstStride; 905 pDstV += iDstStride; 906 } 907 } 908 #endif 743 909 //! \} -
trunk/source/Lib/TLibCommon/TComYuv.h
r332 r443 199 199 200 200 __inline Pel xClip (Pel x ) { return ( (x < 0) ? 0 : (x > (Pel)g_uiIBDI_MAX) ? (Pel)g_uiIBDI_MAX : x ); } 201 #if QC_ARP_D0177 202 Void addARP ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip ); 203 Void addARPLuma ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip ); 204 Void addARPChroma ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip ); 205 Void subtractARP ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight ); 206 Void subtractARPLuma ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight ); 207 Void subtractARPChroma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight ); 208 Void multiplyARP ( UInt uiAbsPartIdx , UInt uiWidth , UInt uiHeight , UChar dW ); 209 Void multiplyARPLuma ( UInt uiAbsPartIdx , UInt uiWidth , UInt uiHeight , UChar dW ); 210 Void multiplyARPChroma( UInt uiAbsPartIdx , UInt uiWidth , UInt uiHeight , UChar dW ); 211 private: 212 Void xxMultiplyLine( Pel * pSrcDst , UInt uiWidth , UChar dW ); 213 #endif 201 214 };// END CLASS DEFINITION TComYuv 202 215 -
trunk/source/Lib/TLibCommon/TypeDef.h
r332 r443 59 59 // HHI_DMM_DELTADC_Q1_C0034 JCT3V-C0034: no quantization and fast encoder search for DMM delta DC values 60 60 // FIX_DMM_CTX_INIT_C0034 JCT3V-C0034 fix for wrong init type of DMM contexts (UChar instead of Short) 61 #define FIX_WEDGE_NOFLOAT_D0036 1 // JCT3V-D0036: Fix for aligning SW and spec (Wedgelet segmentation line generation without float) 61 62 62 63 #define LGE_EDGE_INTRA_A0070 1 // JCT3V-A0070 63 64 #define LGE_DMM3_SIMP_C0044 1 65 66 #define QC_DC_PREDICTOR_D0183 1 // JCT3V-D0183: Simplified DC predictor for depth intra modes 64 67 65 68 ///// ***** SDC ********* … … 67 70 // SAIT_SDC_C0096 JCT3V-C0096: Improved Simple Depth Coding(removal of DMM2 among four SDC modes(DC, Planar, DMM1 and DMM2)) 68 71 // FIX_SDC_ENC_C0143, JCT3V-C0143 fix for unnecessary encoder checks in case of SDC 69 72 #if RWTH_SDC_DLT_B0036 73 #define HHI_DELTADC_DLT_D0035 1 // JCT3V-D0035: DLT for DMM deltaDC coding 74 #define INTEL_SDC64_D0193 1 // JCT3V-D0193: SDC binary clean up (use a 1 bit binary code to signal sdc_pred_mode when CU size is 64x64) 75 #define RWTH_SDC_CTX_SIMPL_D0032 1 // JCT3V-D0032: CABAC Context Reduction for Simplified Depth Coding 76 #define LGE_CONCATENATE_D0141 1 // JCT3V-D0141: concatenate binarization for residual index coding 77 #endif 78 #define FIX_SDC_ENC_RD_WVSO_D0163 1 // JCT3V-D0163: fix for SDC encoder rd-cost (VSO -> WVSO) 79 80 #define PKU_QC_DEPTH_INTRA_UNI_D0195 1 // JCT3V-D0195: unified syntax table for depth intra coding tools 81 #define MTK_SAMPLE_BASED_SDC_D0110 1 // JCT3V-D0110: sample based SDC 70 82 ///// ***** TMVP/AMVP ********* 71 83 #define TMVP_DEPTH_SWITCH 1 // JCT3V-B0092 additional encoder option only … … 84 96 // QC_C0051_FIXED_BY_MTK 1 // Bug fix for C0051 implementation 85 97 // QC_AMVP_MRG_UNIFY_IVCAN_C0051 1 98 #define SEC_TWO_CANDIDATES_FOR_AMVP_D0122 1 // SEC_TWO_CANDIDATES_FOR_AMVP_D0122, fixing # of AMVP candidates 3 to 2 86 99 87 100 … … 95 108 // FIX_LG_RESTRICTEDRESPRED_M24766 1 96 109 110 #define QC_ARP_D0177 1 ////< advanced residual prediction 111 #if QC_ARP_D0177 112 #define QC_ARP_WFNR 3 113 #define QC_ARP_WARNING_FIX 1 // Fix warning message for ARP 114 #endif 97 115 ///// ***** DISPARITY VECTOR DERIVATION ********* 98 116 #define H3D_NBDV 1 // Neighboring block disparity derivation … … 111 129 // MTK_SIMPLIFY_DVTC_C0135 112 130 // FIX_CHROMA_RESIDUAL_C0129 131 #define QC_CU_NBDV_D0181 1 132 133 #define SEC_DEFAULT_DV_D0112 1 113 134 114 135 ///// ***** MOTION PARAMETER INHERITANCE ********* … … 143 164 #endif 144 165 166 #define SHARP_ILLUCOMP_PARSE_D0060 1 // JCT3V-D0060 Removal of IC's parsing dependency 167 145 168 ///// ***** INTERVIEW SKIP ********* 146 169 #define HHI_INTERVIEW_SKIP 1 … … 159 182 #define FIX_APPENCTOP_T_ONLY 1 // For Texture-only coding 160 183 184 #define LGE_ROUND_OFFSET_D0135 1 // JCT3V-D0135 Rounding offset 185 #define LGE_SAO_MIGRATION_D0091 1 186 #if LGE_SAO_MIGRATION_D0091 187 #define SAO_SKIP_RIGHT 1 ///< H1101: disallow using unavailable pixel during RDO 188 #define SAO_ENCODING_CHOICE 1 ///< I0184: picture early termination 189 #if SAO_ENCODING_CHOICE 190 #define SAO_ENCODING_RATE 0.75 191 #define SAO_ENCODING_CHOICE_CHROMA 1 ///< J0044: picture early termination Luma and Chroma are handled separatenly 192 #if SAO_ENCODING_CHOICE_CHROMA 193 #define SAO_ENCODING_RATE_CHROMA 0.5 194 #define SAO_ENCODING_CHOICE_CHROMA_BF 1 /// K0156: Bug fix for SAO selection consistency 195 #endif 196 #endif 197 #endif 198 161 199 ///// ***** FCO ********* 162 200 #define FLEX_CODING_ORDER_M23723 1 … … 174 212 175 213 ///// ***** VSP ********* 176 #define MERL_VSP_C0152 1 // JCT3V-C0152: 1: enable VSP-related tools; 0: disable VSP-related tools177 // LGE_SIMP_DVP_REFINE_C0112178 // MERL_MTK_VSP_DVP_REFINE_C0152_C0131214 #define MERL_VSP_C0152 1 // JCT3V-C0152: 1: enable VSP-related tools; 0: disable VSP-related tools 215 // LGE_SIMP_DVP_REFINE_C0112 216 // MERL_MTK_VSP_DVP_REFINE_C0152_C0131 179 217 #if MERL_VSP_C0152 180 #define MERL_VSP_C0152_BugFix_ForNoDepthCase 1// MERL bugfix for test condition of no depth 181 /* 182 * Two macros are used to configure combinations of JCT3V-C0152 and JCT3V-C0131 183 * 184 * a) (full) A full JCT3V-C0152 implementation, including JCT3V-C0131 185 * #define MERL_VSP_COMPENSATION_C0152 1 186 * #define MERL_MTK_VSP_DVP_REFINE_C0152_C0131 1 187 * 188 * b) (mvp2off) For partial JCT3V-C0152 excluding overlaps from JCT3V-C0131 189 * #define MERL_VSP_COMPENSATION_C0152 1 190 * #define MERL_MTK_VSP_DVP_REFINE_C0152_C0131 0 191 * 192 * c) (nocand) For JCT3V-C0131 only 193 * #define MERL_VSP_COMPENSATION_C0152 0 194 * #define MERL_MTK_VSP_DVP_REFINE_C0152_C0131 1 195 */ 196 197 #define MERL_VSP_COMPENSATION_C0152 1 // JCT3V-C0152: 1: add VSP merge candidate to merging candidate list; 0: not to add (nocand). 198 218 219 220 #define FIX_MERGE_D 1 // Fix to compile merged version 221 222 223 #define MERL_General_Fix 1// General fix by MERL 224 #define MERL_VSP_C0152_BugFix_ForNoDepthCase 1 // MERL bugfix for test condition of no depth 225 #define QC_BVSP_CleanUP_D0191 1 226 227 #define MTK_D0156 1 228 #define LGE_VSP_INHERIT_D0092 1 229 230 #define MERL_VSP_COMPENSATION_C0152 1 // JCT3V-C0152: 1: add VSP merge candidate to merging candidate list; 0: not to add (nocand). 199 231 200 232 #define MERL_VSP_BLOCKSIZE_C0152 4 // JCT3V-C0152: VSP block size, supported values: 1, 2 and 4. 233 #if MERL_VSP_BLOCKSIZE_C0152 == 1 234 #define MERL_CVSP_D0165 1 // JCT3V-D0165: 1: enable CVSP; 0: disable CVSP. 235 #else 236 #define MERL_CVSP_D0165 0 // JCT3V-D0165: 1: enable CVSP; 0: disable CVSP. 237 #endif 238 #if LGE_VSP_INHERIT_D0092 239 #define VSP_MERGE_POS 3 // JCT3V-C0152: fixed position of VSP candidate in merge list, supported values: 3. 240 #else 201 241 #define VSP_MERGE_POS 5 // JCT3V-C0152: fixed position of VSP candidate in merge list, supported values: 5. 202 //MTK_DVPREFINE_BVSP_BUG_FIX 1 242 #endif // MTK_DVPREFINE_BVSP_BUG_FIX 1 243 #define MTK_DEPTH_TO_DISP_D0138 1 // JCT3V-D0138: Use max among four corners for DoNBDV and BVSP 244 245 #if MERL_General_Fix 246 #define MTK_LGE_VSP_DEPTH_OFF_D0105_D0139 1 // JCT3V-D0105/JCT3V-D0139: disable VSP for depth map 247 #define MTK_VSP_USING_NBDV_D0105 1 // JCT3V-D0105: use NBDV instead of DoNBDV for BVSP 248 #endif 249 250 #if MERL_General_Fix 251 #define MERL_VSP_NBDV_RefVId_Fix_D0166 1 // JCT3V-D0166: 1: fix the NBDV with ref view selectioin; 0: always use base view with refViewIdx=0 252 #else 253 #define MERL_VSP_NBDV_RefVId_Fix_D0166 0 254 #endif 255 256 #if MERL_VSP_NBDV_RefVId_Fix_D0166 257 #define MERL_Bi_VSP_D0166 1 // JCT3V-D0166: 1: add supporting for Bi-VSP, the code under the macro can also handle uni-direction VSP 258 #else 259 #define MERL_Bi_VSP_D0166 0 260 #endif 203 261 204 262 #else // !MERL_VSP_C0152 205 263 #define MERL_VSP_COMPENSATION_C0152 0 // JCT3V-C0152: 1: add VSP merge candidate to merging candidate list; 0: not to add 206 264 #define MERL_VSP_BLOCKSIZE_C0152 4 // JCT3V-C0152: VSP block size, supported values: 1, 2 and 4. 207 #endif 208 265 #define MERL_VSP_C0152_BugFix_ForNoDepthCase 0 // MERL bugfix for test condition of no depth 266 #define MERL_CVSP_D0165 0 // JCT3V-D0165: 1: enable CVSP; 0: disable CVSP. 267 #define MERL_VSP_NBDV_RefVId_Fix_D0166 0 // JCT3V-D0166: 1: fix the NBDV with ref view selectioin; 0: always use base view with refViewIdx=0 268 #define MERL_Bi_VSP_D0166 0 // JCT3V-D0166: 1: add supporting for Bi-VSP, the code under the macro can also handle uni-direction VSP 269 #define MTK_VSP_USING_NBDV_D0105 0 270 #define MERL_General_Fix 0 271 #endif 272 273 #if !MERL_General_Fix 274 #define MTK_LGE_VSP_DEPTH_OFF_D0105_D0139 1 // JCT3V-D0105/JCT3V-D0139: disable VSP for depth map 275 #define MTK_VSP_USING_NBDV_D0105 1 // JCT3V-D0105: use NBDV instead of DoNBDV for BVSP 276 #endif 209 277 210 278 ///// ***** DERIVED PARAMETERS ********* … … 342 410 #define C2FLAG_NUMBER 1 // maximum number of largerThan2 flag coded in one chunk: 16 in HM5 343 411 412 #if !LGE_SAO_MIGRATION_D0091 344 413 #define REMOVE_SAO_LCU_ENC_CONSTRAINTS_1 0 ///< disable the encoder constraint that does not test SAO/BO mode for chroma in interleaved mode 345 414 #define REMOVE_SAO_LCU_ENC_CONSTRAINTS_2 0 ///< disable the encoder constraint that reduce the range of SAO/EO for chroma in interleaved mode 415 #endif 346 416 #define REMOVE_SAO_LCU_ENC_CONSTRAINTS_3 0 ///< disable the encoder constraint that conditionally disable SAO for chroma for entire slice in interleaved mode 347 417 #define COLLOCATED_REF_IDX 1 ///< H0442: signal collocated reference index … … 616 686 Int iBestType; 617 687 Int iLength; 688 #if LGE_SAO_MIGRATION_D0091 689 Int subTypeIdx ; ///< indicates EO class or BO band position 690 #else 618 691 Int bandPosition ; 692 #endif 619 693 Int iOffset[4]; 620 694 Int StartCUX; … … 646 720 Bool mergeLeftFlag; 647 721 Int typeIdx; 722 #if LGE_SAO_MIGRATION_D0091 723 Int subTypeIdx; 724 #else 648 725 Int bandPosition; 726 #endif 649 727 Int offset[4]; 728 #if !LGE_SAO_MIGRATION_D0091 650 729 Int runDiff; 651 730 Int run; 731 #endif 652 732 Int partIdx; 653 733 Int partIdxTmp;
Note: See TracChangeset for help on using the changeset viewer.