Changeset 716 in 3DVCSoftware
- Timestamp:
- 28 Nov 2013, 10:04:37 (11 years ago)
- Location:
- branches/HTM-8.2-dev0-MediaTek/source
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-8.2-dev0-MediaTek/source/App/TAppEncoder/TAppEncCfg.cpp
r712 r716 510 510 ("AdvMultiviewResPred", m_uiUseAdvResPred, (UInt)1, "Usage of Advanced Residual Prediction" ) 511 511 #endif 512 #if MTK_SPIVMP_F0110 513 ("SubPULog2Size", m_iSubPULog2Size, (Int)3, "Sub-PU size index: 2^n") 514 #endif 515 512 516 #if H_3D_IC 513 517 #if SEC_ONLY_TEXTURE_IC_F0151 … … 1486 1490 #if H_3D_ARP 1487 1491 xConfirmPara( ( 0 != m_uiUseAdvResPred ) && ( 1 != m_uiUseAdvResPred ), "UseAdvResPred must be 0 or 1." ); 1492 #endif 1493 #if MTK_SPIVMP_F0110 1494 xConfirmPara( m_iSubPULog2Size < 2, "SubPULog2Size must be 2 or greater."); 1495 xConfirmPara( m_iSubPULog2Size > 6, "SubPULog2Size must be 6 or smaller."); 1496 xConfirmPara( (1<<m_iSubPULog2Size) > m_uiMaxCUWidth, "SubPULog2Size must be log2(maxCUSize) or smaller."); 1488 1497 #endif 1489 1498 #if ADAPTIVE_QP_SELECTION … … 2432 2441 printf("IvMvPred:%d ", m_ivMvPredFlag ); 2433 2442 #endif 2443 #if MTK_SPIVMP_F0110 2444 printf(" SubPULog2Size:%d " , m_iSubPULog2Size ); 2445 #endif 2434 2446 #endif 2435 2447 #if H_3D_ARP -
branches/HTM-8.2-dev0-MediaTek/source/App/TAppEncoder/TAppEncCfg.h
r712 r716 119 119 #else 120 120 Bool m_ivMvPredFlag; ///< Interview motion vector prediction 121 #endif 122 #if MTK_SPIVMP_F0110 123 Int m_iSubPULog2Size; 121 124 #endif 122 125 #endif -
branches/HTM-8.2-dev0-MediaTek/source/App/TAppEncoder/TAppEncTop.cpp
r712 r716 182 182 m_cTEncTop.setUseAdvRP ( ( isDepth || 0==layerIdInVps ) ? 0 : m_uiUseAdvResPred ); 183 183 m_cTEncTop.setARPStepNum ( ( isDepth || 0==layerIdInVps ) ? 1 : H_3D_ARP_WFNR ); 184 #endif 185 #if MTK_SPIVMP_F0110 186 m_cTEncTop.setSubPULog2Size (( isDepth || 0==layerIdInVps ) ? 0 : m_iSubPULog2Size ); 184 187 #endif 185 188 #if H_3D_IC … … 1655 1658 vps.setARPStepNum ( layer, ( isDepth || isLayerZero ) ? 1 : H_3D_ARP_WFNR ); 1656 1659 #endif 1660 #if MTK_SPIVMP_F0110 1661 if( isDepth ) 1662 { 1663 vps.setSubPULog2Size ( layer, (layer != 1) ? m_iSubPULog2Size: 0 ); 1664 } 1665 else 1666 { 1667 vps.setSubPULog2Size ( layer, (!isLayerZero) ? m_iSubPULog2Size: 0 ); 1668 } 1669 #endif 1657 1670 1658 1671 #if H_3D_DIM -
branches/HTM-8.2-dev0-MediaTek/source/Lib/TLibCommon/TComDataCU.cpp
r712 r716 146 146 m_piVSPFlag = NULL; 147 147 #endif 148 #if MTK_SPIVMP_F0110 149 m_pbSPIVMPFlag = NULL; 150 #endif 148 151 #if H_3D_ARP 149 152 m_puhARPW = NULL; … … 196 199 #if H_3D_VSP 197 200 m_piVSPFlag = (Char* )xMalloc(Char, uiNumPartition); 201 #endif 202 #if MTK_SPIVMP_F0110 203 m_pbSPIVMPFlag = (Bool* )xMalloc(Bool, uiNumPartition); 198 204 #endif 199 205 m_puhLumaIntraDir = (UChar* )xMalloc(UChar, uiNumPartition); … … 356 362 if ( m_piVSPFlag ) { xFree(m_piVSPFlag); m_piVSPFlag = NULL; } 357 363 #endif 364 #if MTK_SPIVMP_F0110 365 if ( m_pbSPIVMPFlag ) { xFree(m_pbSPIVMPFlag); m_pbSPIVMPFlag = NULL; } 366 #endif 358 367 if ( m_puhLumaIntraDir ) { xFree(m_puhLumaIntraDir); m_puhLumaIntraDir = NULL; } 359 368 if ( m_puhChromaIntraDir ) { xFree(m_puhChromaIntraDir); m_puhChromaIntraDir = NULL; } … … 561 570 #if H_3D_VSP 562 571 m_piVSPFlag[ui] = pcFrom->m_piVSPFlag[ui]; 572 #endif 573 #if MTK_SPIVMP_F0110 574 m_pbSPIVMPFlag[ui] = pcFrom->m_pbSPIVMPFlag[ui]; 563 575 #endif 564 576 m_puhLumaIntraDir[ui]=pcFrom->m_puhLumaIntraDir[ui]; … … 603 615 #if H_3D_VSP 604 616 memset( m_piVSPFlag + firstElement, 0, numElements * sizeof( *m_piVSPFlag ) ); 617 #endif 618 #if MTK_SPIVMP_F0110 619 memset( m_pbSPIVMPFlag + firstElement, 0, numElements * sizeof( *m_pbSPIVMPFlag ) ); 605 620 #endif 606 621 memset( m_puhLumaIntraDir + firstElement, DC_IDX, numElements * sizeof( *m_puhLumaIntraDir ) ); … … 784 799 m_piVSPFlag[ui] = 0; 785 800 #endif 801 #if MTK_SPIVMP_F0110 802 m_pbSPIVMPFlag[ui] = 0; 803 #endif 786 804 m_puhLumaIntraDir[ui] = DC_IDX; 787 805 m_puhChromaIntraDir[ui] = 0; … … 883 901 #if H_3D_VSP 884 902 memset( m_piVSPFlag, 0, sizeof( Char ) * m_uiNumPartition ); 903 #endif 904 #if MTK_SPIVMP_F0110 905 memset( m_pbSPIVMPFlag, 0, sizeof( Bool ) * m_uiNumPartition ); 885 906 #endif 886 907 memset( m_puhLumaIntraDir, DC_IDX, iSizeInUchar ); … … 980 1001 m_pDvInfo[ ui ] = pcCU->m_pDvInfo[uiPartOffset+ui]; 981 1002 #endif 1003 #if MTK_SPIVMP_F0110 1004 m_pbSPIVMPFlag[ui]=pcCU->m_pbSPIVMPFlag[uiPartOffset+ui]; 1005 #endif 982 1006 m_puhLumaIntraDir[ui]=pcCU->m_puhLumaIntraDir[uiPartOffset+ui]; 983 1007 m_puhChromaIntraDir[ui]=pcCU->m_puhChromaIntraDir[uiPartOffset+ui]; … … 1130 1154 m_piVSPFlag = pcCU->getVSPFlag() + uiPart; 1131 1155 #endif 1156 #if MTK_SPIVMP_F0110 1157 m_pbSPIVMPFlag = pcCU->getSPIVMPFlag() + uiPart; 1158 #endif 1132 1159 1133 1160 #if H_3D_ARP … … 1285 1312 m_piVSPFlag = pcCU->getVSPFlag() + uiAbsPartIdx; 1286 1313 m_pDvInfo = pcCU->getDvInfo() + uiAbsPartIdx; 1314 #endif 1315 #if MTK_SPIVMP_F0110 1316 m_pbSPIVMPFlag = pcCU->getSPIVMPFlag() + uiAbsPartIdx; 1287 1317 #endif 1288 1318 … … 1335 1365 1336 1366 #endif 1367 #if MTK_SPIVMP_F0110 1368 memcpy( m_pbSPIVMPFlag + uiOffset, pcCU->getSPIVMPFlag(), sizeof( Bool ) * uiNumPartition ); 1369 #endif 1337 1370 memcpy( m_puhLumaIntraDir + uiOffset, pcCU->getLumaIntraDir(), iSizeInUchar ); 1338 1371 memcpy( m_puhChromaIntraDir + uiOffset, pcCU->getChromaIntraDir(), iSizeInUchar ); … … 1464 1497 memcpy( rpcCU->getDvInfo() + m_uiAbsIdxInLCU, m_pDvInfo, sizeof( *m_pDvInfo ) * m_uiNumPartition ); 1465 1498 #endif 1499 #if MTK_SPIVMP_F0110 1500 memcpy( rpcCU->getSPIVMPFlag() + m_uiAbsIdxInLCU, m_pbSPIVMPFlag, sizeof( Bool ) * m_uiNumPartition ); 1501 #endif 1466 1502 memcpy( rpcCU->getLumaIntraDir() + m_uiAbsIdxInLCU, m_puhLumaIntraDir, iSizeInUchar ); 1467 1503 memcpy( rpcCU->getChromaIntraDir() + m_uiAbsIdxInLCU, m_puhChromaIntraDir, iSizeInUchar ); … … 1579 1615 #if H_3D_VSP 1580 1616 memcpy( rpcCU->getVSPFlag() + uiPartOffset, m_piVSPFlag, sizeof(Char) * uiQNumPart ); 1617 #endif 1618 #if MTK_SPIVMP_F0110 1619 memcpy( rpcCU->getSPIVMPFlag() + uiPartOffset, m_pbSPIVMPFlag, sizeof(Bool) * uiQNumPart ); 1581 1620 #endif 1582 1621 memcpy( rpcCU->getLumaIntraDir() + uiPartOffset, m_puhLumaIntraDir, iSizeInUchar ); … … 2705 2744 setSubPart<UChar>( uiMergeIndex, m_puhMergeIndex, uiAbsPartIdx, uiDepth, uiPartIdx ); 2706 2745 } 2746 2747 #if MTK_SPIVMP_F0110 2748 Void TComDataCU::setSPIVMPFlagSubParts( Bool bSPIVMPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 2749 { 2750 setSubPart<Bool>( bSPIVMPFlag, m_pbSPIVMPFlag, uiAbsPartIdx, uiDepth, uiPartIdx ); 2751 } 2752 #endif 2707 2753 2708 2754 #if H_3D_VSP … … 3962 4008 , InheritedVSPDisInfo* inheritedVSPDisInfo 3963 4009 #endif 4010 #if MTK_SPIVMP_F0110 4011 , Bool* pbSPIVMPFlag, TComMvField* pcMvFieldSP, UChar* puhInterDirSP 4012 #endif 3964 4013 , Int& numValidMergeCand, Int mrgCandIdx 3965 4014 ) … … 4030 4079 #if QC_DEPTH_IV_MRG_F0125 4031 4080 Bool bIsDepth = getSlice()->getIsDepth(); 4081 #if !BUGFIX_F0093 4032 4082 Bool bDepthIPMCAvai = false; 4083 #endif 4033 4084 #endif 4034 4085 … … 4433 4484 , bIsDepth 4434 4485 #endif 4486 #if MTK_SPIVMP_F0110 4487 , pcMvFieldSP, puhInterDirSP 4488 #endif 4435 4489 ); 4436 4490 } … … 4459 4513 Int iCnloop=0; 4460 4514 4461 for(Int i = 0; i < 2; i ++) 4462 { 4463 iCnloop = iPosLeftAbove[i]; 4464 if ( iCnloop == -1 ) 4465 { 4466 continue; 4467 } 4468 if(ivCandDir[0] == puhInterDirNeighbours[iCnloop] && tmpMV[0]==pcMvFieldNeighbours[(iCnloop<<1)] && tmpMV[1]==pcMvFieldNeighbours[(iCnloop<<1)+1]) 4469 { 4470 bRemoveSpa = true; 4471 break; 4472 } 4473 } 4515 #if BUGFIX_F0093 4516 if (!bIsDepth) 4517 { 4518 #endif 4519 for(Int i = 0; i < 2; i ++) 4520 { 4521 iCnloop = iPosLeftAbove[i]; 4522 if ( iCnloop == -1 ) 4523 { 4524 continue; 4525 } 4526 if(ivCandDir[0] == puhInterDirNeighbours[iCnloop] && tmpMV[0]==pcMvFieldNeighbours[(iCnloop<<1)] && tmpMV[1]==pcMvFieldNeighbours[(iCnloop<<1)+1]) 4527 { 4528 bRemoveSpa = true; 4529 break; 4530 } 4531 } 4532 #if BUGFIX_F0093 4533 } 4534 #endif 4474 4535 #if QC_DEPTH_IV_MRG_F0125 4536 #if BUGFIX_F0093 4537 if (bIsDepth) 4538 #else 4475 4539 if ( bIsDepth && !bRemoveSpa) 4540 #endif 4476 4541 { 4477 4542 iCnloop = iCount-1; 4478 4543 for(; iCnloop >= 0; iCnloop --) 4479 4544 { 4545 #if BUGFIX_F0093 4546 if(ivCandDir[0] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==tmpMV[0] && pcMvFieldNeighbours[(iCnloop<<1)+1]==tmpMV[1]) // F0125 compatible with F0093 4547 #else 4480 4548 if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1]) 4549 #endif 4481 4550 { 4482 4551 bRemoveSpa = true; … … 4484 4553 } 4485 4554 } 4555 #if !BUGFIX_F0093 4486 4556 if(!bRemoveSpa) 4487 4557 { 4488 4558 bDepthIPMCAvai = true; 4489 4559 } 4560 #endif 4490 4561 } 4491 4562 #endif … … 4545 4616 if (bIvMC) 4546 4617 { 4618 #if MTK_SPIVMP_F0110 4619 pbSPIVMPFlag[iCount] = true; 4620 #endif 4547 4621 if( ( ivCandDir[0] & 1 ) == 1 ) 4548 4622 { … … 4556 4630 puhInterDirNeighbours[ iCount ] = ivCandDir[0]; 4557 4631 4632 #if !BUGFIX_F0093 4558 4633 #if QC_DEPTH_IV_MRG_F0125 4559 4634 if ( bDepthIPMCAvai || !bIsDepth ) 4560 4635 { 4561 4636 #endif 4562 if ( mrgCandIdx == iCount ) 4563 { 4564 return; 4565 } 4566 iCount ++; 4637 #endif 4638 if ( mrgCandIdx == iCount ) 4639 { 4640 return; 4641 } 4642 iCount ++; 4643 #if !BUGFIX_F0093 4567 4644 #if QC_DEPTH_IV_MRG_F0125 4568 4645 } 4646 #endif 4569 4647 #endif 4570 4648 } … … 8112 8190 } 8113 8191 #endif 8192 8193 #if MTK_SPIVMP_F0110 8194 Void TComDataCU::getSPPara(Int iPUWidth, Int iPUHeight, Int& iNumSP, Int& iNumSPInOneLine, Int& iSPWidth, Int& iSPHeight) 8195 { 8196 Int iSubPUSize = 1<<getSlice()->getVPS()->getSubPULog2Size(getSlice()->getLayerId()); 8197 iNumSPInOneLine = iPUWidth/iSubPUSize; 8198 iNumSPInOneLine = iNumSPInOneLine < 1 ? 1: iNumSPInOneLine; 8199 Int iNumSPInOneColumn = iPUHeight/iSubPUSize; 8200 iNumSPInOneColumn = iNumSPInOneColumn < 1 ? 1: iNumSPInOneColumn; 8201 iNumSP = iNumSPInOneLine * iNumSPInOneColumn; 8202 8203 iSPWidth = iNumSPInOneLine == 1 ? iPUWidth: iSubPUSize; 8204 iSPHeight = iNumSPInOneColumn == 1 ? iPUHeight: iSubPUSize; 8205 } 8206 8207 Void TComDataCU::getSPAbsPartIdx(UInt uiBaseAbsPartIdx, Int iWidth, Int iHeight, Int iPartIdx, Int iNumPartLine, UInt& ruiPartAddr ) 8208 { 8209 uiBaseAbsPartIdx += m_uiAbsIdxInLCU; 8210 Int iBasePelX = g_auiRasterToPelX[g_auiZscanToRaster[uiBaseAbsPartIdx]]; 8211 Int iBasePelY = g_auiRasterToPelY[g_auiZscanToRaster[uiBaseAbsPartIdx]]; 8212 Int iCurrPelX = iBasePelX + iPartIdx%iNumPartLine * iWidth; 8213 Int iCurrPelY = iBasePelY + iPartIdx/iNumPartLine * iHeight; 8214 Int iCurrRaster = iCurrPelY / getPic()->getMinCUHeight() * getPic()->getNumPartInWidth() + iCurrPelX/getPic()->getMinCUWidth(); 8215 ruiPartAddr = g_auiRasterToZscan[iCurrRaster]; 8216 ruiPartAddr -= m_uiAbsIdxInLCU; 8217 } 8218 8219 Void TComDataCU::setInterDirSP( UInt uiDir, UInt uiAbsPartIdx, Int iWidth, Int iHeight ) 8220 { 8221 uiAbsPartIdx += getZorderIdxInCU(); 8222 Int iStartPelX = g_auiRasterToPelX[g_auiZscanToRaster[uiAbsPartIdx]]; 8223 Int iStartPelY = g_auiRasterToPelY[g_auiZscanToRaster[uiAbsPartIdx]]; 8224 Int iEndPelX = iStartPelX + iWidth; 8225 Int iEndPelY = iStartPelY + iHeight; 8226 8227 Int iCurrRaster, uiPartAddr; 8228 8229 for (Int i=iStartPelY; i<iEndPelY; i+=getPic()->getMinCUHeight()) 8230 { 8231 for (Int j=iStartPelX; j < iEndPelX; j += getPic()->getMinCUWidth()) 8232 { 8233 iCurrRaster = i / getPic()->getMinCUHeight() * getPic()->getNumPartInWidth() + j/getPic()->getMinCUWidth(); 8234 uiPartAddr = g_auiRasterToZscan[iCurrRaster]; 8235 uiPartAddr -= getZorderIdxInCU(); 8236 8237 m_puhInterDir[uiPartAddr] = uiDir; 8238 } 8239 } 8240 } 8241 #endif 8242 8114 8243 #if H_3D_IV_MERGE 8115 8244 Bool … … 8118 8247 , Bool bIsDepth 8119 8248 #endif 8249 #if MTK_SPIVMP_F0110 8250 , TComMvField* pcMvFieldSP, UChar* puhInterDirSP 8251 #endif 8120 8252 ) 8121 8253 { … … 8139 8271 pcBaseRec->getTopLeftSamplePos( getAddr(), getZorderIdxInCU() + uiPartAddr, iCurrPosX, iCurrPosY ); 8140 8272 8273 #if !MTK_SPIVMP_F0110 8141 8274 #if QC_DEPTH_IV_MRG_F0125 8142 8275 iCurrPosX += ( iWidth >> 1 ); … … 8146 8279 iCurrPosY += ( ( iHeight - 1 ) >> 1 ); 8147 8280 #endif 8281 #endif 8148 8282 8149 8283 Bool depthRefineFlag = false; … … 8162 8296 #endif 8163 8297 8298 #if MTK_SPIVMP_F0110 8299 //////////////////////////////// 8300 //////////sub-PU IvMC/////////// 8301 //////////////////////////////// 8302 8303 Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight; 8304 getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight); 8305 8306 for (Int i=0; i<iNumSP; i++) 8307 { 8308 puhInterDirSP[i] = 0; 8309 pcMvFieldSP[2*i].getMv().set(0, 0); 8310 pcMvFieldSP[2*i+1].getMv().set(0,0); 8311 pcMvFieldSP[2*i].setRefIdx(-1); 8312 pcMvFieldSP[2*i+1].setRefIdx(-1); 8313 } 8314 8315 Int iBaseCUAddr; 8316 Int iBaseAbsPartIdx; 8317 TComDataCU* pcBaseCU; 8318 Int iPartition = 0; 8319 Int iInterDirLast = 0; 8320 TComMvField cMvFieldLast[2]; 8321 8322 Int iDelX = iSPWidth/2; 8323 Int iDelY = iSPHeight/2; 8324 8325 Int iBasePosX, iBasePosY; 8326 for (Int i=iCurrPosY; i < iCurrPosY + iHeight; i += iSPHeight) 8327 { 8328 for (Int j = iCurrPosX; j < iCurrPosX + iWidth; j += iSPWidth) 8329 { 8330 iBasePosX = Clip3( 0, pcBaseRec->getWidth () - 1, j + iDelX + ( (cDv.getHor() + 2 ) >> 2 )); 8331 iBasePosY = Clip3( 0, pcBaseRec->getHeight() - 1, i + iDelY + ( (cDv.getVer() + 2 ) >> 2 )); 8332 8333 pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY, iBaseCUAddr, iBaseAbsPartIdx ); 8334 pcBaseCU = pcBasePic->getCU( iBaseCUAddr ); 8335 if(!( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTRA )) 8336 { 8337 for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ ) 8338 { 8339 RefPicList eCurrRefPicList = RefPicList( uiCurrRefListId ); 8340 Bool bLoop_stop = false; 8341 for(Int iLoop = 0; iLoop < 2 && !bLoop_stop; ++iLoop) 8342 { 8343 RefPicList eBaseRefPicList = (iLoop ==1)? RefPicList( 1 - uiCurrRefListId ) : RefPicList( uiCurrRefListId ); 8344 TComMvField cBaseMvField; 8345 pcBaseCU->getMvField( pcBaseCU, iBaseAbsPartIdx, eBaseRefPicList, cBaseMvField ); 8346 Int iBaseRefIdx = cBaseMvField.getRefIdx(); 8347 if (iBaseRefIdx >= 0) 8348 { 8349 Int iBaseRefPOC = pcBaseCU->getSlice()->getRefPOC(eBaseRefPicList, iBaseRefIdx); 8350 if (iBaseRefPOC != pcSlice->getPOC()) 8351 { 8352 for (Int iPdmRefIdx = 0; iPdmRefIdx < pcSlice->getNumRefIdx( eCurrRefPicList ); iPdmRefIdx++) 8353 { 8354 if (iBaseRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx)) 8355 { 8356 abPdmAvailable[ uiCurrRefListId ] = true; 8357 TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer()); 8358 8359 if( !bIsDepth ) 8360 { 8361 cMv.setIDVFlag (true); 8362 cMv.setIDVHor (cDv.getHor()); 8363 cMv.setIDVVer (cDv.getVer()); 8364 cMv.setIDVVId (iViewIndex); 8365 } 8366 8367 clipMv( cMv ); 8368 bLoop_stop = true; 8369 8370 pcMvFieldSP[2*iPartition + uiCurrRefListId].setMvField(cMv, iPdmRefIdx); 8371 break; 8372 } 8373 } 8374 } 8375 } 8376 } 8377 } 8378 } 8379 8380 puhInterDirSP[iPartition] = (pcMvFieldSP[2*iPartition].getRefIdx()!=-1 ? 1: 0) + (pcMvFieldSP[2*iPartition+1].getRefIdx()!=-1 ? 2: 0); 8381 if (puhInterDirSP[iPartition] == 0) 8382 { 8383 if (iInterDirLast != 0) 8384 { 8385 puhInterDirSP[iPartition] = iInterDirLast; 8386 pcMvFieldSP[2*iPartition] = cMvFieldLast[0]; 8387 pcMvFieldSP[2*iPartition + 1] = cMvFieldLast[1]; 8388 } 8389 } 8390 else 8391 { 8392 if (iInterDirLast ==0) 8393 { 8394 availableMcDc[0] = puhInterDirSP[iPartition]; 8395 paiPdmRefIdx [ 0 ] = pcMvFieldSP[2*iPartition].getRefIdx(); 8396 pacPdmMv [ 0 ] = pcMvFieldSP[2*iPartition].getMv(); 8397 paiPdmRefIdx [ 1 ] = pcMvFieldSP[2*iPartition+1].getRefIdx(); 8398 pacPdmMv [ 1 ] = pcMvFieldSP[2*iPartition+1].getMv(); 8399 8400 if (iPartition != 0) 8401 { 8402 for (Int iPart = iPartition-1; iPart >= 0; iPart--) 8403 { 8404 puhInterDirSP[iPart] = puhInterDirSP[iPartition]; 8405 pcMvFieldSP[2*iPart] = pcMvFieldSP[2*iPartition]; 8406 pcMvFieldSP[2*iPart + 1] = pcMvFieldSP[2*iPartition + 1]; 8407 } 8408 } 8409 } 8410 iInterDirLast = puhInterDirSP[iPartition]; 8411 cMvFieldLast[0] = pcMvFieldSP[2*iPartition]; 8412 cMvFieldLast[1] = pcMvFieldSP[2*iPartition + 1]; 8413 } 8414 8415 iPartition ++; 8416 8417 } 8418 } 8419 8420 iCurrPosX += ( iWidth >> 1 ); 8421 iCurrPosY += ( iHeight >> 1 ); 8422 #endif 8423 8164 8424 //////////////////////////////// 8165 8425 /////// IvMC + IvMCShift /////// 8166 8426 //////////////////////////////// 8167 8427 8168 for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++) 8428 #if MTK_SPIVMP_F0110 8429 for(Int iLoopCan = 1; iLoopCan < 2; iLoopCan ++) 8430 #else 8431 for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++) 8432 #endif 8169 8433 { 8170 8434 // iLoopCan == 0 --> IvMC … … 8234 8498 } 8235 8499 } 8500 #if MTK_SPIVMP_F0110 8501 for(Int iLoopCan = 1; iLoopCan < 2; iLoopCan ++) 8502 #else 8236 8503 for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++) 8504 #endif 8237 8505 { 8238 8506 availableMcDc[(iLoopCan << 1)] = ( abPdmAvailable[(iLoopCan<<2)] ? 1 : 0 ) + ( abPdmAvailable[1 + (iLoopCan<<2)] ? 2 : 0); -
branches/HTM-8.2-dev0-MediaTek/source/Lib/TLibCommon/TComDataCU.h
r712 r716 198 198 ///< 0: non-VSP; 1: VSP 199 199 #endif 200 #if MTK_SPIVMP_F0110 201 Bool* m_pbSPIVMPFlag; ///< array of sub-PU IVMP flags to indicate whehter a block uses sub-PU IVMP 202 ///< 0: non-SPIVMP; 1: SPIVMP 203 #endif 200 204 #if H_3D_ARP 201 205 UChar* m_puhARPW; … … 531 535 Void getIVNStatus ( UInt uiPartIdx, DisInfo* pDInfo, Bool& bIVFMerge, Int& iIVFMaxD); 532 536 #endif 537 #if MTK_SPIVMP_F0110 538 Void getSPPara(Int iPUWidth, Int iPUHeight, Int& iNumSP, Int& iNumSPInOneLine, Int& iSPWidth, Int& iSPHeight); 539 Void getSPAbsPartIdx(UInt uiBaseAbsPartIdx, Int iWidth, Int iHeight, Int iPartIdx, Int iNumPartLine, UInt& ruiPartAddr ); 540 Void setInterDirSP( UInt uiDir, UInt uiAbsPartIdx, Int iWidth, Int iHeight ); 541 #endif 533 542 #if H_3D_IV_MERGE 534 543 Bool getInterViewMergeCands ( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* availableMcDc 535 544 #if QC_DEPTH_IV_MRG_F0125 536 545 , Bool bIsDepth 546 #endif 547 #if MTK_SPIVMP_F0110 548 , TComMvField* pcMFieldSP, UChar* puhInterDirSP 537 549 #endif 538 550 ); … … 708 720 , InheritedVSPDisInfo* inheritedVSPDisInfo 709 721 #endif 710 , Int& numValidMergeCand, Int mrgCandIdx = -1 ); 722 #if MTK_SPIVMP_F0110 723 , Bool* pbSPIVMPFlag, TComMvField* pcMvFieldSP, UChar* puhInterDirSP 724 #endif 725 , Int& numValidMergeCand, Int mrgCandIdx = -1 726 ); 711 727 712 728 #if H_3D_VSP 713 729 inline Void xInheritVSPDisInfo(TComDataCU* pcCURef, UInt uiAbsPartIdx, Int iCount, InheritedVSPDisInfo* inheritedVSPDisInfo); 730 731 #if MTK_SPIVMP_F0110 732 Bool* getSPIVMPFlag () { return m_pbSPIVMPFlag; } 733 Bool getSPIVMPFlag ( UInt uiIdx ) { return m_pbSPIVMPFlag[uiIdx]; } 734 Void setSPIVMPFlag ( UInt uiIdx, Bool n ) { m_pbSPIVMPFlag[uiIdx] = n; } 735 Void setSPIVMPFlagSubParts( Bool bSPIVMPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 736 #endif 714 737 715 738 Char* getVSPFlag () { return m_piVSPFlag; } -
branches/HTM-8.2-dev0-MediaTek/source/Lib/TLibCommon/TComMotionInfo.cpp
r608 r716 40 40 #include "assert.h" 41 41 #include <stdlib.h> 42 #if MTK_SPIVMP_F0110 43 #include "TComDataCU.h" 44 #include "TComPic.h" 45 #endif 42 46 43 47 //! \ingroup TLibCommon … … 323 327 setAllRefIdx( mvField.getRefIdx(), eCUMode, iPartAddr, uiDepth, iPartIdx ); 324 328 } 329 330 #if MTK_SPIVMP_F0110 331 Void TComCUMvField::setMvFieldSP( TComDataCU* pcCU, UInt uiAbsPartIdx, TComMvField cMvField, Int iWidth, Int iHeight ) 332 { 333 uiAbsPartIdx += pcCU->getZorderIdxInCU(); 334 Int iStartPelX = g_auiRasterToPelX[g_auiZscanToRaster[uiAbsPartIdx]]; 335 Int iStartPelY = g_auiRasterToPelY[g_auiZscanToRaster[uiAbsPartIdx]]; 336 Int iEndPelX = iStartPelX + iWidth; 337 Int iEndPelY = iStartPelY + iHeight; 338 339 Int iCurrRaster, uiPartAddr; 340 341 for (Int i=iStartPelY; i<iEndPelY; i+=pcCU->getPic()->getMinCUHeight()) 342 { 343 for (Int j=iStartPelX; j < iEndPelX; j += pcCU->getPic()->getMinCUWidth()) 344 { 345 iCurrRaster = i / pcCU->getPic()->getMinCUHeight() * pcCU->getPic()->getNumPartInWidth() + j/pcCU->getPic()->getMinCUWidth(); 346 uiPartAddr = g_auiRasterToZscan[iCurrRaster]; 347 uiPartAddr -= pcCU->getZorderIdxInCU(); 348 349 m_pcMv[uiPartAddr] = cMvField.getMv(); 350 m_piRefIdx[uiPartAddr] = cMvField.getRefIdx(); 351 } 352 } 353 } 354 #endif 325 355 326 356 /**Subsampling of the stored prediction mode, reference index and motion vector -
branches/HTM-8.2-dev0-MediaTek/source/Lib/TLibCommon/TComMotionInfo.h
r622 r716 43 43 #include "CommonDef.h" 44 44 #include "TComMv.h" 45 46 45 //! \ingroup TLibCommon 47 46 //! \{ … … 51 50 // ==================================================================================================================== 52 51 52 #if MTK_SPIVMP_F0110 53 class TComDataCU; 54 #endif 53 55 /// parameters for AMVP 54 56 typedef struct _AMVPInfo … … 171 173 Void setAllRefIdx ( Int iRefIdx, PartSize eMbMode, Int iPartAddr, UInt uiDepth, Int iPartIdx=0 ); 172 174 Void setAllMvField( TComMvField const & mvField, PartSize eMbMode, Int iPartAddr, UInt uiDepth, Int iPartIdx=0 ); 175 #if MTK_SPIVMP_F0110 176 Void setMvFieldSP ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComMvField cMvField, Int iWidth, Int iHeight ); 177 #endif 173 178 174 179 Void setNumPartition( Int iNumPart ) -
branches/HTM-8.2-dev0-MediaTek/source/Lib/TLibCommon/TComPrediction.cpp
r712 r716 561 561 } 562 562 563 #if MTK_SPIVMP_F0110 564 Void TComPrediction::xGetSubPUAddrAndMerge(TComDataCU* pcCU, UInt uiPartAddr, Int iSPWidth, Int iSPHeight, Int iNumSPInOneLine, Int iNumSP, UInt* uiMergedSPW, UInt* uiMergedSPH, UInt* uiSPAddr ) 565 { 566 for (Int i = 0; i < iNumSP; i++) 567 { 568 uiMergedSPW[i] = iSPWidth; 569 uiMergedSPH[i] = iSPHeight; 570 pcCU->getSPAbsPartIdx(uiPartAddr, iSPWidth, iSPHeight, i, iNumSPInOneLine, uiSPAddr[i]); 571 } 572 // horizontal sub-PU merge 573 for (Int i=0; i<iNumSP; i++) 574 { 575 if (i % iNumSPInOneLine == iNumSPInOneLine - 1 || uiMergedSPW[i]==0 || uiMergedSPH[i]==0) 576 { 577 continue; 578 } 579 for (Int j=i+1; j<i+iNumSPInOneLine-i%iNumSPInOneLine; j++) 580 { 581 if (xCheckTwoSPMotion(pcCU, uiSPAddr[i], uiSPAddr[j])) 582 { 583 uiMergedSPW[i] += iSPWidth; 584 uiMergedSPW[j] = uiMergedSPH[j] = 0; 585 } 586 else 587 { 588 break; 589 } 590 } 591 } 592 //vertical sub-PU merge 593 for (Int i=0; i<iNumSP-iNumSPInOneLine; i++) 594 { 595 if (uiMergedSPW[i]==0 || uiMergedSPH[i]==0) 596 { 597 continue; 598 } 599 for (Int j=i+iNumSPInOneLine; j<iNumSP; j+=iNumSPInOneLine) 600 { 601 if (xCheckTwoSPMotion(pcCU, uiSPAddr[i], uiSPAddr[j]) && uiMergedSPW[i]==uiMergedSPW[j]) 602 { 603 uiMergedSPH[i] += iSPHeight; 604 uiMergedSPH[j] = uiMergedSPW[j] = 0; 605 } 606 else 607 { 608 break; 609 } 610 } 611 } 612 } 613 614 Bool TComPrediction::xCheckTwoSPMotion ( TComDataCU* pcCU, UInt PartAddr0, UInt PartAddr1 ) 615 { 616 if( pcCU->getCUMvField(REF_PIC_LIST_0)->getRefIdx(PartAddr0) != pcCU->getCUMvField(REF_PIC_LIST_0)->getRefIdx(PartAddr1)) 617 { 618 return false; 619 } 620 if( pcCU->getCUMvField(REF_PIC_LIST_1)->getRefIdx(PartAddr0) != pcCU->getCUMvField(REF_PIC_LIST_1)->getRefIdx(PartAddr1)) 621 { 622 return false; 623 } 624 625 if (pcCU->getCUMvField(REF_PIC_LIST_0)->getRefIdx(PartAddr0) >= 0) 626 { 627 if (pcCU->getCUMvField(REF_PIC_LIST_0)->getMv(PartAddr0) != pcCU->getCUMvField(REF_PIC_LIST_0)->getMv(PartAddr1)) 628 { 629 return false; 630 } 631 } 632 633 if (pcCU->getCUMvField(REF_PIC_LIST_1)->getRefIdx(PartAddr0) >= 0) 634 { 635 if (pcCU->getCUMvField(REF_PIC_LIST_1)->getMv(PartAddr0) != pcCU->getCUMvField(REF_PIC_LIST_1)->getMv(PartAddr1)) 636 { 637 return false; 638 } 639 } 640 return true; 641 } 642 #endif 563 643 564 644 Void TComPrediction::motionCompensation ( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList, Int iPartIdx ) … … 592 672 else 593 673 { 594 if ( xCheckIdenticalMotion( pcCU, uiPartAddr ) ) 595 { 596 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred ); 674 #if MTK_SPIVMP_F0110 675 if ( pcCU->getSPIVMPFlag(uiPartAddr)!=0) 676 { 677 Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight; 678 679 pcCU->getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight); 680 681 UInt uiW[256], uiH[256]; 682 UInt uiSPAddr[256]; 683 684 xGetSubPUAddrAndMerge(pcCU, uiPartAddr, iSPWidth, iSPHeight, iNumSPInOneLine, iNumSP, uiW, uiH, uiSPAddr); 685 686 //MC 687 for (Int i = 0; i < iNumSP; i++) 688 { 689 if (uiW[i]==0 || uiH[i]==0) 690 { 691 continue; 692 } 693 if( xCheckIdenticalMotion( pcCU, uiSPAddr[i] )) 694 { 695 xPredInterUni (pcCU, uiSPAddr[i], uiW[i], uiH[i], REF_PIC_LIST_0, pcYuvPred ); 696 } 697 else 698 { 699 xPredInterBi (pcCU, uiSPAddr[i], uiW[i], uiH[i], pcYuvPred); 700 } 701 } 597 702 } 598 703 else 599 704 { 600 xPredInterBi (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred ); 601 } 705 #endif 706 if ( xCheckIdenticalMotion( pcCU, uiPartAddr ) ) 707 { 708 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred ); 709 } 710 else 711 { 712 xPredInterBi (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred ); 713 } 714 #if MTK_SPIVMP_F0110 715 } 716 #endif 602 717 } 603 718 #if H_3D_VSP … … 643 758 else 644 759 { 760 #if MTK_SPIVMP_F0110 761 if (pcCU->getSPIVMPFlag(uiPartAddr)!=0) 762 { 763 Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight; 764 765 pcCU->getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight); 766 767 UInt uiW[256], uiH[256]; 768 UInt uiSPAddr[256]; 769 770 xGetSubPUAddrAndMerge(pcCU, uiPartAddr, iSPWidth, iSPHeight, iNumSPInOneLine, iNumSP, uiW, uiH, uiSPAddr); 771 //MC 772 for (Int i = 0; i < iNumSP; i++) 773 { 774 if (uiW[i]==0 || uiH[i]==0) 775 { 776 continue; 777 } 778 if( xCheckIdenticalMotion( pcCU, uiSPAddr[i] )) 779 { 780 xPredInterUni (pcCU, uiSPAddr[i], uiW[i], uiH[i], REF_PIC_LIST_0, pcYuvPred ); 781 } 782 else 783 { 784 xPredInterBi (pcCU, uiSPAddr[i], uiW[i], uiH[i], pcYuvPred); 785 } 786 } 787 } 788 else 789 { 790 #endif 645 791 if ( xCheckIdenticalMotion( pcCU, uiPartAddr ) ) 646 792 { … … 651 797 xPredInterBi (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred ); 652 798 } 799 #if MTK_SPIVMP_F0110 800 } 801 #endif 653 802 } 654 803 #if H_3D_VSP -
branches/HTM-8.2-dev0-MediaTek/source/Lib/TLibCommon/TComPrediction.h
r711 r716 142 142 Void xDCPredFiltering( Int* pSrc, Int iSrcStride, Pel*& rpDst, Int iDstStride, Int iWidth, Int iHeight ); 143 143 Bool xCheckIdenticalMotion ( TComDataCU* pcCU, UInt PartAddr); 144 144 #if MTK_SPIVMP_F0110 145 Bool xCheckTwoSPMotion ( TComDataCU* pcCU, UInt PartAddr0, UInt PartAddr1 ); 146 Void xGetSubPUAddrAndMerge(TComDataCU* pcCU, UInt uiPartAddr, Int iSPWidth, Int iSPHeight, Int iNumSPInOneLine, Int iNumSP, UInt* uiMergedSPW, UInt* uiMergedSPH, UInt* uiSPAddr ); 147 #endif 145 148 #if H_3D_DIM 146 149 // depth intra functions -
branches/HTM-8.2-dev0-MediaTek/source/Lib/TLibCommon/TComSlice.cpp
r710 r716 1838 1838 #if H_3D_IV_MERGE 1839 1839 m_ivMvPredFlag [ i ] = false; 1840 #if MTK_SPIVMP_F0110 1841 m_iSubPULog2Size [ i ] = 0; 1842 #endif 1840 1843 #endif 1841 1844 #if H_3D_VSP -
branches/HTM-8.2-dev0-MediaTek/source/Lib/TLibCommon/TComSlice.h
r710 r716 597 597 #if H_3D_IV_MERGE 598 598 Bool m_ivMvPredFlag [ MAX_NUM_LAYERS ]; 599 #if MTK_SPIVMP_F0110 600 Int m_iSubPULog2Size [MAX_NUM_LAYERS ]; 601 #endif 599 602 #endif 600 603 #if H_3D_VSP … … 829 832 Void setIvMvPredFlag ( Int layerIdInVps, Bool val ) { m_ivMvPredFlag[ layerIdInVps ] = val; } 830 833 Bool getIvMvPredFlag ( Int layerIdInVps ) { return m_ivMvPredFlag[ layerIdInVps ]; }; 834 #if MTK_SPIVMP_F0110 835 Int getSubPULog2Size(Int layerIdInVps) { return m_iSubPULog2Size[layerIdInVps]; } 836 Void setSubPULog2Size(Int layerIdInVps, Int u) { m_iSubPULog2Size[layerIdInVps] = u;} 837 #endif 831 838 #endif 832 839 #if H_3D_VSP -
branches/HTM-8.2-dev0-MediaTek/source/Lib/TLibCommon/TypeDef.h
r713 r716 262 262 #if H_3D_IV_MERGE 263 263 #define QC_DEPTH_IV_MRG_F0125 1 // JCT3V-F0125: Depth oriented Inter-view MV candidate 264 #define MTK_SPIVMP_F0110 0 // JCT3V-F0110: Sub-PU level inter-view motion prediction 265 #define BUGFIX_F0093 1 // bug fix for F0093 for depth IvMC pruning 264 266 #endif 265 267 -
branches/HTM-8.2-dev0-MediaTek/source/Lib/TLibDecoder/TDecCAVLC.cpp
r712 r716 1245 1245 pcVPS->setARPStepNum( i, 1 ); 1246 1246 #endif 1247 #if MTK_SPIVMP_F0110 1248 pcVPS->setSubPULog2Size(i, 0); 1249 #endif 1247 1250 if ( i != 0 ) 1248 1251 { … … 1251 1254 #if H_3D_IV_MERGE 1252 1255 READ_FLAG( uiCode, "iv_mv_pred_flag[i]"); pcVPS->setIvMvPredFlag ( i, uiCode == 1 ? true : false ); 1256 #if MTK_SPIVMP_F0110 1257 READ_UVLC (uiCode, "log2_sub_PU_size_minus2"); pcVPS->setSubPULog2Size(i, uiCode+2); 1258 #endif 1253 1259 #endif 1254 1260 #if H_3D_ARP … … 1269 1275 { 1270 1276 READ_FLAG( uiCode, "iv_mv_pred_flag[i]"); pcVPS->setIvMvPredFlag ( i, uiCode == 1 ? true : false ); 1277 } 1278 #endif 1279 #if MTK_SPIVMP_F0110 1280 if (i!=1) 1281 { 1282 READ_UVLC (uiCode, "log2_sub_PU_size_minus2"); pcVPS->setSubPULog2Size(i, uiCode+2); 1271 1283 } 1272 1284 #endif -
branches/HTM-8.2-dev0-MediaTek/source/Lib/TLibDecoder/TDecCu.cpp
r712 r716 403 403 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 404 404 InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM]; 405 405 #if MTK_SPIVMP_F0110 406 Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM]; 407 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); 408 TComMvField* pcMvFieldSP; 409 UChar* puhInterDirSP; 410 pcMvFieldSP = new TComMvField[pcCU->getPic()->getPicSym()->getNumPartition()*2]; 411 puhInterDirSP = new UChar[pcCU->getPic()->getPicSym()->getNumPartition()]; 412 #endif 406 413 #if ETRIKHU_MERGE_REUSE_F0093 407 414 m_ppcCU[uiDepth]->initAvailableFlags(); 408 415 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 409 m_ppcCU[uiDepth]->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand, uiMergeIndex ); 416 m_ppcCU[uiDepth]->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo 417 #if MTK_SPIVMP_F0110 418 , bSPIVMPFlag, pcMvFieldSP, puhInterDirSP 419 #endif 420 , numValidMergeCand, uiMergeIndex ); 410 421 #else 411 422 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand, uiMergeIndex ); … … 457 468 } 458 469 } 470 #if MTK_SPIVMP_F0110 471 pcCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMergeIndex], uiAbsPartIdx, 0, uiDepth ); 472 if (bSPIVMPFlag[uiMergeIndex]) 473 { 474 UInt uiSPAddr; 475 Int iWidth = pcCU->getWidth(uiAbsPartIdx); 476 Int iHeight = pcCU->getHeight(uiAbsPartIdx); 477 478 Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight; 479 480 pcCU->getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight); 481 482 for (Int iPartitionIdx = 0; iPartitionIdx < iNumSP; iPartitionIdx++) 483 { 484 pcCU->getSPAbsPartIdx(uiAbsPartIdx, iSPWidth, iSPHeight, iPartitionIdx, iNumSPInOneLine, uiSPAddr); 485 pcCU->setInterDirSP(puhInterDirSP[iPartitionIdx], uiSPAddr, iSPWidth, iSPHeight); 486 pcCU->getCUMvField( REF_PIC_LIST_0 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx], iSPWidth, iSPHeight); 487 pcCU->getCUMvField( REF_PIC_LIST_1 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx + 1], iSPWidth, iSPHeight); 488 } 489 } 490 delete pcMvFieldSP; 491 delete puhInterDirSP; 492 #endif 459 493 #if !LGE_SHARP_VSP_INHERIT_F0104 460 494 #if H_3D_IC -
branches/HTM-8.2-dev0-MediaTek/source/Lib/TLibDecoder/TDecEntropy.cpp
r712 r716 213 213 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS]; 214 214 #endif 215 215 #if MTK_SPIVMP_F0110 216 Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM]; 217 TComMvField* pcMvFieldSP; 218 UChar* puhInterDirSP; 219 pcMvFieldSP = new TComMvField[pcCU->getPic()->getPicSym()->getNumPartition()*2]; 220 puhInterDirSP = new UChar[pcCU->getPic()->getPicSym()->getNumPartition()]; 221 #endif 216 222 for ( UInt ui = 0; ui < pcCU->getSlice()->getMaxNumMergeCand(); ui++ ) 217 223 { … … 256 262 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 257 263 InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM]; 264 #if MTK_SPIVMP_F0110 265 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); 266 #endif 258 267 #if ETRIKHU_MERGE_REUSE_F0093 259 268 pcSubCU->initAvailableFlags(); 260 269 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand); 261 pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand ); 270 pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo 271 #if MTK_SPIVMP_F0110 272 , bSPIVMPFlag, pcMvFieldSP, puhInterDirSP 273 #endif 274 , numValidMergeCand ); 262 275 #else 263 276 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand ); … … 290 303 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 291 304 InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM]; 305 #if MTK_SPIVMP_F0110 306 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); 307 #endif 292 308 #if ETRIKHU_MERGE_REUSE_F0093 293 309 pcSubCU->initAvailableFlags(); 294 310 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 295 pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo,numValidMergeCand, uiMergeIndex ); 311 pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo 312 #if MTK_SPIVMP_F0110 313 , bSPIVMPFlag, pcMvFieldSP, puhInterDirSP 314 #endif 315 ,numValidMergeCand, uiMergeIndex ); 296 316 #else 297 317 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo,numValidMergeCand, uiMergeIndex ); … … 325 345 } 326 346 } 347 #if MTK_SPIVMP_F0110 348 pcCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 349 if (bSPIVMPFlag[uiMergeIndex] != 0) 350 { 351 Int iWidth, iHeight; 352 UInt uiIdx; 353 pcCU->getPartIndexAndSize( uiPartIdx, uiIdx, iWidth, iHeight, uiSubPartIdx, true ); 354 355 UInt uiSPAddr; 356 357 Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight; 358 359 pcCU->getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight); 360 361 for (Int iPartitionIdx = 0; iPartitionIdx < iNumSP; iPartitionIdx++) 362 { 363 pcCU->getSPAbsPartIdx(uiSubPartIdx, iSPWidth, iSPHeight, iPartitionIdx, iNumSPInOneLine, uiSPAddr); 364 pcCU->setInterDirSP(puhInterDirSP[iPartitionIdx], uiSPAddr, iSPWidth, iSPHeight); 365 pcCU->getCUMvField( REF_PIC_LIST_0 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx], iSPWidth, iSPHeight); 366 pcCU->getCUMvField( REF_PIC_LIST_1 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx + 1], iSPWidth, iSPHeight); 367 } 368 } 369 #endif 327 370 } 328 371 else … … 358 401 } 359 402 } 403 #if MTK_SPIVMP_F0110 404 delete pcMvFieldSP; 405 delete puhInterDirSP; 406 #endif 360 407 return; 361 408 } -
branches/HTM-8.2-dev0-MediaTek/source/Lib/TLibEncoder/TEncCavlc.cpp
r712 r716 1006 1006 #if H_3D_IV_MERGE 1007 1007 WRITE_FLAG( pcVPS->getIvMvPredFlag ( i ) ? 1 : 0 , "iv_mv_pred_flag[i]"); 1008 #if MTK_SPIVMP_F0110 1009 WRITE_UVLC( pcVPS->getSubPULog2Size(i)-2, "log2_sub_PU_size_minus2[i]"); 1010 #endif 1008 1011 #endif 1009 1012 #if H_3D_ARP … … 1023 1026 { 1024 1027 WRITE_FLAG( pcVPS->getIvMvPredFlag ( i ) ? 1 : 0 , "iv_mv_pred_flag[i]"); 1028 } 1029 #endif 1030 #if MTK_SPIVMP_F0110 1031 if (i!=1) 1032 { 1033 WRITE_UVLC( pcVPS->getSubPULog2Size(i)-2, "log2_sub_PU_size_minus2[i]"); 1025 1034 } 1026 1035 #endif -
branches/HTM-8.2-dev0-MediaTek/source/Lib/TLibEncoder/TEncCfg.h
r712 r716 403 403 UInt m_uiARPStepNum; 404 404 #endif 405 #if MTK_SPIVMP_F0110 406 Int m_iSubPULog2Size; 407 #endif 405 408 #if H_3D_IC 406 409 Bool m_bUseIC; … … 505 508 UInt getARPStepNum () { return m_uiARPStepNum; } 506 509 Void setARPStepNum ( UInt u ) { m_uiARPStepNum = u; } 510 #endif 511 #if MTK_SPIVMP_F0110 512 Int getSubPULog2Size () { return m_iSubPULog2Size;} 513 Void setSubPULog2Size (Int u) { m_iSubPULog2Size = u; } 507 514 #endif 508 515 -
branches/HTM-8.2-dev0-MediaTek/source/Lib/TLibEncoder/TEncCu.cpp
r712 r716 1868 1868 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 1869 1869 InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM]; 1870 #if MTK_SPIVMP_F0110 1871 Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM]; 1872 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); 1873 TComMvField* pcMvFieldSP; 1874 UChar* puhInterDirSP; 1875 pcMvFieldSP = new TComMvField[rpcTempCU->getPic()->getPicSym()->getNumPartition()*2]; 1876 puhInterDirSP = new UChar[rpcTempCU->getPic()->getPicSym()->getNumPartition()]; 1877 #endif 1870 1878 #if ETRIKHU_MERGE_REUSE_F0093 1871 1879 rpcTempCU->initAvailableFlags(); 1872 1880 rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); 1873 rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag,inheritedVSPDisInfo, numValidMergeCand ); 1881 rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag,inheritedVSPDisInfo 1882 #if MTK_SPIVMP_F0110 1883 , bSPIVMPFlag, pcMvFieldSP, puhInterDirSP 1884 #endif 1885 , numValidMergeCand 1886 ); 1874 1887 #else 1875 1888 rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand ); … … 1910 1923 rpcTempCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, 0, 0, uhDepth ); 1911 1924 #endif 1912 rpcTempCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeCand], 0, 0, uhDepth ); // interprets depth relative to LCU level 1913 rpcTempCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level 1914 rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level 1925 #if MTK_SPIVMP_F0110 1926 rpcTempCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMergeCand], 0, 0, uhDepth); 1927 if (bSPIVMPFlag[uiMergeCand]) 1928 { 1929 UInt uiSPAddr; 1930 Int iWidth = rpcTempCU->getWidth(0); 1931 Int iHeight = rpcTempCU->getHeight(0); 1932 1933 Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight; 1934 1935 rpcTempCU->getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight); 1936 1937 for (Int iPartitionIdx = 0; iPartitionIdx < iNumSP; iPartitionIdx++) 1938 { 1939 rpcTempCU->getSPAbsPartIdx(0, iSPWidth, iSPHeight, iPartitionIdx, iNumSPInOneLine, uiSPAddr); 1940 rpcTempCU->setInterDirSP(puhInterDirSP[iPartitionIdx], uiSPAddr, iSPWidth, iSPHeight); 1941 rpcTempCU->getCUMvField( REF_PIC_LIST_0 )->setMvFieldSP(rpcTempCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx], iSPWidth, iSPHeight); 1942 rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setMvFieldSP(rpcTempCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx + 1], iSPWidth, iSPHeight); 1943 } 1944 } 1945 else 1946 { 1947 #endif 1948 rpcTempCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeCand], 0, 0, uhDepth ); // interprets depth relative to LCU level 1949 rpcTempCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level 1950 rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level 1951 #if MTK_SPIVMP_F0110 1952 } 1953 #endif 1915 1954 #if H_3D_ARP && !QC_MTK_INTERVIEW_ARP_F0123_F0108 1916 1955 if( nARPW ) … … 2054 2093 } 2055 2094 } 2095 #if MTK_SPIVMP_F0110 2096 delete pcMvFieldSP; 2097 delete puhInterDirSP; 2098 #endif 2056 2099 #if H_3D_ARP 2057 2100 } -
branches/HTM-8.2-dev0-MediaTek/source/Lib/TLibEncoder/TEncSearch.cpp
r712 r716 3616 3616 , InheritedVSPDisInfo* inheritedVSPDisInfo 3617 3617 #endif 3618 #if MTK_SPIVMP_F0110 3619 , Bool* pbSPIVMPFlag, TComMvField* pcMvFieldSP, UChar* puhInterDirSP 3620 #endif 3618 3621 , Int& numValidMergeCand 3619 3622 ) … … 3639 3642 , inheritedVSPDisInfo 3640 3643 #endif 3644 #if MTK_SPIVMP_F0110 3645 , pbSPIVMPFlag, pcMvFieldSP, puhInterDirSP 3646 #endif 3641 3647 , numValidMergeCand 3642 3648 ); … … 3663 3669 , inheritedVSPDisInfo 3664 3670 #endif 3671 #if MTK_SPIVMP_F0110 3672 , pbSPIVMPFlag, pcMvFieldSP, puhInterDirSP 3673 #endif 3665 3674 , numValidMergeCand 3666 3675 ); … … 3691 3700 PartSize ePartSize = pcCU->getPartitionSize( 0 ); 3692 3701 3693 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx ); 3694 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx ); 3702 #if MTK_SPIVMP_F0110 3703 pcCU->setSPIVMPFlagSubParts( pbSPIVMPFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx )); 3704 if (pbSPIVMPFlag[uiMergeCand]) 3705 { 3706 UInt uiSPAddr; 3707 3708 Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight; 3709 3710 pcCU->getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight); 3711 3712 for (Int iPartitionIdx = 0; iPartitionIdx < iNumSP; iPartitionIdx++) 3713 { 3714 pcCU->getSPAbsPartIdx(uiAbsPartIdx, iSPWidth, iSPHeight, iPartitionIdx, iNumSPInOneLine, uiSPAddr); 3715 pcCU->getCUMvField( REF_PIC_LIST_0 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx], iSPWidth, iSPHeight); 3716 pcCU->getCUMvField( REF_PIC_LIST_1 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx + 1], iSPWidth, iSPHeight); 3717 } 3718 } 3719 else 3720 { 3721 #endif 3722 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx ); 3723 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx ); 3724 #if MTK_SPIVMP_F0110 3725 } 3726 #endif 3695 3727 3696 3728 #if H_3D_VSP … … 4369 4401 DisInfo OriginalDvInfo = pcCU->getDvInfo(uiAbsPartIdx); 4370 4402 #endif 4371 4403 #if MTK_SPIVMP_F0110 4404 Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM]; 4405 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); 4406 TComMvField* pcMvFieldSP; 4407 UChar* puhInterDirSP; 4408 pcMvFieldSP = new TComMvField[pcCU->getPic()->getPicSym()->getNumPartition()*2]; 4409 puhInterDirSP = new UChar[pcCU->getPic()->getPicSym()->getNumPartition()]; 4410 #endif 4372 4411 xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost, cMvFieldNeighbours, uhInterDirNeighbours 4373 4412 #if H_3D_VSP … … 4375 4414 , inheritedVSPDisInfo 4376 4415 #endif 4416 #if MTK_SPIVMP_F0110 4417 , bSPIVMPFlag, pcMvFieldSP, puhInterDirSP 4418 #endif 4377 4419 , numValidMergeCand 4378 4420 ); … … 4386 4428 pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMRGIndex].m_acDvInfo, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 4387 4429 #endif 4388 pcCU->setInterDirSubParts ( uiMRGInterDir, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 4389 { 4390 pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMRGMvField[0], ePartSize, uiPartAddr, 0, iPartIdx ); 4391 pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMRGMvField[1], ePartSize, uiPartAddr, 0, iPartIdx ); 4392 } 4430 #if MTK_SPIVMP_F0110 4431 pcCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMRGIndex], uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 4432 if (bSPIVMPFlag[uiMRGIndex]!=0) 4433 { 4434 UInt uiSPAddr; 4435 4436 Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight; 4437 4438 pcCU->getSPPara(iRoiWidth, iRoiHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight); 4439 4440 for (Int iPartitionIdx = 0; iPartitionIdx < iNumSP; iPartitionIdx++) 4441 { 4442 pcCU->getSPAbsPartIdx(uiPartAddr, iSPWidth, iSPHeight, iPartitionIdx, iNumSPInOneLine, uiSPAddr); 4443 pcCU->setInterDirSP(puhInterDirSP[iPartitionIdx], uiSPAddr, iSPWidth, iSPHeight); 4444 pcCU->getCUMvField( REF_PIC_LIST_0 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx], iSPWidth, iSPHeight); 4445 pcCU->getCUMvField( REF_PIC_LIST_1 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx + 1], iSPWidth, iSPHeight); 4446 } 4447 4448 if ( pcCU->getInterDir(uiPartAddr) == 3 && pcCU->isBipredRestriction(iPartIdx) ) 4449 { 4450 pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMv( TComMv(0,0), ePartSize, uiPartAddr, 0, iPartIdx); 4451 pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllRefIdx( -1, ePartSize, uiPartAddr, 0, iPartIdx); 4452 pcCU->setInterDirSubParts( 1, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr )); 4453 } 4454 4455 } 4456 else 4457 { 4458 #endif 4459 pcCU->setInterDirSubParts ( uiMRGInterDir, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 4460 { 4461 pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMRGMvField[0], ePartSize, uiPartAddr, 0, iPartIdx ); 4462 pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMRGMvField[1], ePartSize, uiPartAddr, 0, iPartIdx ); 4463 } 4464 #if MTK_SPIVMP_F0110 4465 } 4466 #endif 4393 4467 4394 4468 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvd ( cMvZero, ePartSize, uiPartAddr, 0, iPartIdx ); … … 4402 4476 else 4403 4477 { 4478 #if MTK_SPIVMP_F0110 4479 pcCU->setSPIVMPFlagSubParts(0, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 4480 #endif 4404 4481 // set ME result 4405 4482 pcCU->setMergeFlagSubParts( false, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); … … 4414 4491 } 4415 4492 } 4493 #if MTK_SPIVMP_F0110 4494 delete pcMvFieldSP; 4495 delete puhInterDirSP; 4496 #endif 4416 4497 } 4417 4498 … … 5326 5407 dZeroCost = dCost + 1; 5327 5408 } 5409 #if MTK_SPIVMP_F0110 5410 if ( dZeroCost < dCost || pcCU->getQtRootCbf(0)==0) 5411 #else 5328 5412 if ( dZeroCost < dCost ) 5413 #endif 5329 5414 { 5330 5415 dCost = dZeroCost; -
branches/HTM-8.2-dev0-MediaTek/source/Lib/TLibEncoder/TEncSearch.h
r712 r716 427 427 , InheritedVSPDisInfo* inheritedVSPDisInfo 428 428 #endif 429 #if MTK_SPIVMP_F0110 430 , Bool* pbSPIVMPFlag, TComMvField* pcMvFieldSP, UChar* puhInterDirSP 431 #endif 429 432 , Int& numValidMergeCand 430 433 );
Note: See TracChangeset for help on using the changeset viewer.