Changeset 504 in 3DVCSoftware for branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder
- Timestamp:
- 28 Jun 2013, 03:51:50 (11 years ago)
- Location:
- branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCavlc.cpp
r486 r504 752 752 WRITE_FLAG( pcVPS->getIvMvPredFlag (layer) ? 1 : 0 , "iv_mv_pred_flag[i]"); 753 753 #endif 754 #if H_3D_ARP 755 WRITE_FLAG( pcVPS->getUseAdvRP (layer) ? 1 : 0, "advanced_residual_pred_flag" ); 756 #endif 754 757 #if H_3D_NBDV_REF 755 758 WRITE_FLAG( pcVPS->getDepthRefinementFlag (layer) ? 1 : 0 , "depth_refinement_flag[i]"); … … 1093 1096 xCodePredWeightTable( pcSlice ); 1094 1097 } 1098 #if H_3D_IC 1099 else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE ) ) 1100 { 1101 WRITE_FLAG( pcSlice->getApplyIC() ? 1 : 0, "slice_ic_enable_flag" ); 1102 if( pcSlice->getApplyIC() ) 1103 { 1104 WRITE_FLAG( pcSlice->getIcSkipParseFlag() ? 1 : 0, "ic_skip_mergeidx0" ); 1105 } 1106 } 1107 #endif 1108 1095 1109 #if H_3D_IV_MERGE 1096 1110 assert(pcSlice->getMaxNumMergeCand()<=MRG_MAX_NUM_CANDS_MEM); … … 1380 1394 } 1381 1395 1396 #if H_3D_ARP 1397 Void TEncCavlc::codeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx ) 1398 { 1399 assert(0); 1400 } 1401 #endif 1402 1403 #if H_3D_IC 1404 Void TEncCavlc::codeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) 1405 { 1406 assert(0); 1407 } 1408 #endif 1409 1382 1410 Void TEncCavlc::codeInterModeFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiEncMode ) 1383 1411 { -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCavlc.h
r446 r504 114 114 Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 115 115 116 #if H_3D_ARP 117 Void codeARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 118 #endif 119 #if H_3D_IC 120 Void codeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 121 #endif 122 116 123 Void codeInterModeFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiEncMode ); 117 124 Void codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCfg.h
r479 r504 394 394 Bool m_bUseEstimatedVSD; 395 395 Double m_dDispCoeff; 396 397 #if H_3D_ARP 398 UInt m_uiUseAdvResPred; 399 UInt m_uiARPStepNum; 400 #endif 401 402 #if H_3D_IC 403 Bool m_bUseIC; 404 #endif 396 405 #endif 397 406 … … 467 476 Bool getMaxTempLayer () { return m_maxTempLayer; } 468 477 Void setMaxTempLayer ( Int maxTempLayer ) { m_maxTempLayer = maxTempLayer; } 478 479 #if H_3D_ARP 480 UInt getUseAdvRP ( ) { return m_uiUseAdvResPred; } 481 Void setUseAdvRP ( UInt u ) { m_uiUseAdvResPred = u; } 482 483 UInt getARPStepNum () { return m_uiARPStepNum; } 484 Void setARPStepNum ( UInt u ) { m_uiARPStepNum = u; } 485 #endif 486 487 #if H_3D_IC 488 Void setUseIC ( Bool bVal ) { m_bUseIC = bVal; } 489 Bool getUseIC () { return m_bUseIC; } 490 #endif 469 491 //======== Transform ============= 470 492 Void setQuadtreeTULog2MaxSize ( UInt u ) { m_uiQuadtreeTULog2MaxSize = u; } -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCu.cpp
r486 r504 65 65 m_ppcTempCU = new TComDataCU*[m_uhTotalDepth-1]; 66 66 67 #if H_3D_ARP 68 m_ppcWeightedTempCU = new TComDataCU*[m_uhTotalDepth-1]; 69 #endif 70 67 71 m_ppcPredYuvBest = new TComYuv*[m_uhTotalDepth-1]; 68 72 m_ppcResiYuvBest = new TComYuv*[m_uhTotalDepth-1]; … … 83 87 m_ppcTempCU[i] = new TComDataCU; m_ppcTempCU[i]->create( uiNumPartitions, uiWidth, uiHeight, false, uiMaxWidth >> (m_uhTotalDepth - 1) ); 84 88 89 #if H_3D_ARP 90 m_ppcWeightedTempCU[i] = new TComDataCU; m_ppcWeightedTempCU[i]->create( uiNumPartitions, uiWidth, uiHeight, false, uiMaxWidth >> (m_uhTotalDepth - 1) ); 91 #endif 92 85 93 m_ppcPredYuvBest[i] = new TComYuv; m_ppcPredYuvBest[i]->create(uiWidth, uiHeight); 86 94 m_ppcResiYuvBest[i] = new TComYuv; m_ppcResiYuvBest[i]->create(uiWidth, uiHeight); … … 124 132 m_ppcTempCU[i]->destroy(); delete m_ppcTempCU[i]; m_ppcTempCU[i] = NULL; 125 133 } 134 #if H_3D_ARP 135 if(m_ppcWeightedTempCU[i]) 136 { 137 m_ppcWeightedTempCU[i]->destroy(); delete m_ppcWeightedTempCU[i]; m_ppcWeightedTempCU[i] = NULL; 138 } 139 #endif 126 140 if(m_ppcPredYuvBest[i]) 127 141 { … … 163 177 m_ppcTempCU = NULL; 164 178 } 165 179 180 #if H_3D_ARP 181 if(m_ppcWeightedTempCU) 182 { 183 delete [] m_ppcWeightedTempCU; 184 m_ppcWeightedTempCU = NULL; 185 } 186 #endif 166 187 if(m_ppcPredYuvBest) 167 188 { … … 436 457 } 437 458 #endif 438 459 #if H_3D_IC 460 Bool bICEnabled = rpcTempCU->getSlice()->getViewIndex() && ( rpcTempCU->getSlice()->getSliceType() == P_SLICE || rpcTempCU->getSlice()->getSliceType() == B_SLICE ); 461 bICEnabled = bICEnabled && rpcTempCU->getSlice()->getApplyIC(); 462 #endif 439 463 // If slice start or slice end is within this cu... 440 464 TComSlice * pcSlice = rpcTempCU->getPic()->getSlice(rpcTempCU->getPic()->getCurrSliceIdx()); … … 468 492 if( rpcTempCU->getSlice()->getSliceType() != I_SLICE ) 469 493 { 470 if(rpcTempCU->getSlice()->getViewIndex() && !rpcTempCU->getSlice()->getIsDepth()) //Notes from QC: this condition shall be changed once the configuration is completed, e.g. in pcSlice->getSPS()->getMultiviewMvPredMode() || ARP in prev. HTM. Remove this comment once it is done. Remove this comment once it is done. 494 #if H_3D_ARP && H_3D_IV_MERGE 495 if( rpcTempCU->getSlice()->getVPS()->getUseAdvRP(rpcTempCU->getSlice()->getLayerId()) || rpcTempCU->getSlice()->getVPS()->getIvMvPredFlag(rpcTempCU->getSlice()->getLayerId()) ) 496 #else 497 #if H_3D_ARP 498 if( rpcTempCU->getSlice()->getVPS()->getUseAdvRP(rpcTempCU->getSlice()->getLayerId()) ) 499 #else 500 #if H_3D_IV_MERGE 501 if( rpcTempCU->getSlice()->getVPS()->getIvMvPredFlag(rpcTempCU->getSlice()->getLayerId()) ) 502 #else 503 if (0) 504 #endif 505 #endif 506 #endif 471 507 { 472 508 PartSize ePartTemp = rpcTempCU->getPartitionSize(0); … … 488 524 if( rpcBestCU->getSlice()->getSliceType() != I_SLICE ) 489 525 { 526 #if H_3D_IC 527 for( UInt uiICId = 0; uiICId < ( bICEnabled ? 2 : 1 ); uiICId++ ) 528 { 529 Bool bICFlag = uiICId ? true : false; 530 #endif 490 531 // 2Nx2N 491 532 if(m_pcEncCfg->getUseEarlySkipDetection()) 492 533 { 534 #if H_3D_IC 535 rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth); 536 #endif 493 537 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); rpcTempCU->initEstData( uiDepth, iQP );//by Competition for inter_2Nx2N 494 538 } 495 539 // SKIP 540 #if H_3D_IC 541 rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth); 542 #endif 496 543 xCheckRDCostMerge2Nx2N( rpcBestCU, rpcTempCU, &earlyDetectionSkipMode );//by Merge for inter_2Nx2N 497 544 rpcTempCU->initEstData( uiDepth, iQP ); … … 513 560 if ( !bEarlySkip ) 514 561 { 562 #if H_3D_IC 563 rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth); 564 #endif 515 565 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); rpcTempCU->initEstData( uiDepth, iQP ); 516 566 if(m_pcEncCfg->getUseCbfFastMode()) … … 520 570 } 521 571 } 572 #if H_3D_IC 573 } 574 #endif 522 575 } 523 576 … … 1220 1273 { 1221 1274 m_pcEntropyCoder->encodeMergeIndex( pcCU, uiAbsPartIdx ); 1275 #if H_3D_IC 1276 m_pcEntropyCoder->encodeICFlag ( pcCU, uiAbsPartIdx ); 1277 #endif 1278 #if H_3D_ARP 1279 m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx ); 1280 #endif 1222 1281 finishCU(pcCU,uiAbsPartIdx,uiDepth); 1223 1282 return; … … 1241 1300 // prediction Info ( Intra : direction mode, Inter : Mv, reference idx ) 1242 1301 m_pcEntropyCoder->encodePredInfo( pcCU, uiAbsPartIdx ); 1243 1302 #if H_3D_IC 1303 m_pcEntropyCoder->encodeICFlag ( pcCU, uiAbsPartIdx ); 1304 #endif 1305 #if H_3D_ARP 1306 m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx ); 1307 #endif 1308 1244 1309 // Encode Coefficients 1245 1310 Bool bCodeDQP = getdQPFlag(); … … 1273 1338 } 1274 1339 UChar uhDepth = rpcTempCU->getDepth( 0 ); 1275 1340 #if H_3D_IC 1341 Bool bICFlag = rpcTempCU->getICFlag( 0 ); 1342 #endif 1276 1343 #if H_3D_VSO // M1 //nececcary here? 1277 1344 if( m_pcRdCost->getUseRenModel() ) … … 1311 1378 } 1312 1379 1380 #if H_3D_ARP 1381 Int nARPWMax = rpcTempCU->getSlice()->getARPStepNum() - 1; 1382 if( nARPWMax < 0 || !rpcTempCU->getDvInfo(0).bDV ) 1383 { 1384 nARPWMax = 0; 1385 } 1386 for( Int nARPW=nARPWMax; nARPW >= 0 ; nARPW-- ) 1387 { 1388 memset( mergeCandBuffer, 0, MRG_MAX_NUM_CANDS*sizeof(Int) ); 1389 #endif 1313 1390 for( UInt uiNoResidual = 0; uiNoResidual < iteration; ++uiNoResidual ) 1314 1391 { … … 1316 1393 { 1317 1394 { 1395 #if H_3D_IC 1396 if( rpcTempCU->getSlice()->getApplyIC() && rpcTempCU->getSlice()->getIcSkipParseFlag() ) 1397 { 1398 if( bICFlag && uiMergeCand == 0 ) 1399 { 1400 continue; 1401 } 1402 } 1403 #endif 1318 1404 if(!(uiNoResidual==1 && mergeCandBuffer[uiMergeCand]==1)) 1319 1405 { … … 1325 1411 rpcTempCU->setCUTransquantBypassSubParts( m_pcEncCfg->getCUTransquantBypassFlagValue(), 0, uhDepth ); 1326 1412 rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); // interprets depth relative to LCU level 1413 #if H_3D_IC 1414 rpcTempCU->setICFlagSubParts( bICFlag, 0, 0, uhDepth ); 1415 #endif 1416 #if H_3D_ARP 1417 rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth ); 1418 #endif 1327 1419 rpcTempCU->setMergeFlagSubParts( true, 0, 0, uhDepth ); // interprets depth relative to LCU level 1328 1420 rpcTempCU->setMergeIndexSubParts( uiMergeCand, 0, 0, uhDepth ); // interprets depth relative to LCU level … … 1331 1423 rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level 1332 1424 1425 #if H_3D_ARP 1426 if( nARPW ) 1427 { 1428 Bool bSignalflag[2] = { true, true }; 1429 for( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx ++ ) 1430 { 1431 Int iRefIdx = cMvFieldNeighbours[uiRefListIdx + 2*uiMergeCand].getRefIdx(); 1432 RefPicList eRefList = uiRefListIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 1433 if( iRefIdx < 0 || rpcTempCU->getSlice()->getPOC() == rpcTempCU->getSlice()->getRefPOC(eRefList, iRefIdx) ) 1434 { 1435 bSignalflag[uiRefListIdx] = false; 1436 } 1437 } 1438 if( !bSignalflag[0] && !bSignalflag[1] ) 1439 { 1440 rpcTempCU->setARPWSubParts( 0 , 0 , uhDepth ); 1441 } 1442 } 1443 #endif 1333 1444 // do MC 1334 1445 m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] ); … … 1410 1521 } 1411 1522 } 1523 #if H_3D_ARP 1524 } 1525 #endif 1412 1526 } 1413 1527 … … 1420 1534 { 1421 1535 UChar uhDepth = rpcTempCU->getDepth( 0 ); 1536 #if H_3D_ARP 1537 Int iLayerId = rpcTempCU->getSlice()->getLayerId(); 1538 Bool bFirstTime = true; 1539 Int nARPWMax = rpcTempCU->getSlice()->getARPStepNum() - 1; 1540 1541 if( nARPWMax < 0 || ePartSize != SIZE_2Nx2N || !rpcTempCU->getDvInfo(0).bDV ) 1542 { 1543 nARPWMax = 0; 1544 } 1545 1546 for( Int nARPW = 0; nARPW <= nARPWMax; nARPW++ ) 1547 { 1548 if( bFirstTime == false && rpcTempCU->getSlice()->getVPS()->getUseAdvRP( iLayerId ) ) 1549 { 1550 rpcTempCU->initEstData( rpcTempCU->getDepth(0), rpcTempCU->getQP(0) ); 1551 } 1552 #endif 1422 1553 #if H_3D_VSO // M3 1423 1554 if( m_pcRdCost->getUseRenModel() ) … … 1439 1570 rpcTempCU->setCUTransquantBypassSubParts ( m_pcEncCfg->getCUTransquantBypassFlagValue(), 0, uhDepth ); 1440 1571 1572 #if H_3D_ARP 1573 rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth ); 1574 #endif 1575 1576 #if H_3D_ARP 1577 if( bFirstTime == false && nARPWMax ) 1578 { 1579 rpcTempCU->copyPartFrom( m_ppcWeightedTempCU[uhDepth] , 0 , uhDepth ); 1580 rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth ); 1581 1582 m_pcPredSearch->motionCompensation( rpcTempCU , m_ppcPredYuvTemp[uhDepth] ); 1583 1584 if(rpcTempCU->getPartitionSize(0)==SIZE_2Nx2N) 1585 { 1586 Bool bSignalflag[2] = { true, true }; 1587 for(UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx ++ ) 1588 { 1589 RefPicList eRefList = uiRefListIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 1590 Int iRefIdx = rpcTempCU->getCUMvField(eRefList)->getRefIdx(0); 1591 if( iRefIdx < 0 || rpcTempCU->getSlice()->getPOC() == rpcTempCU->getSlice()->getRefPOC(eRefList, iRefIdx) ) 1592 { 1593 bSignalflag[uiRefListIdx] = false; 1594 } 1595 } 1596 if( !bSignalflag[0] && !bSignalflag[1] ) 1597 { 1598 rpcTempCU->setARPWSubParts( 0 , 0 , uhDepth ); 1599 } 1600 } 1601 } 1602 else 1603 { 1604 bFirstTime = false; 1605 #endif 1441 1606 #if AMP_MRG 1442 1607 rpcTempCU->setMergeAMP (true); … … 1445 1610 m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth] ); 1446 1611 #endif 1612 #if H_3D_ARP 1613 if( nARPWMax ) 1614 { 1615 m_ppcWeightedTempCU[uhDepth]->copyPartFrom( rpcTempCU , 0 , uhDepth ); 1616 1617 Bool bSignalflag[2] = { true, true }; 1618 for(UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx ++ ) 1619 { 1620 RefPicList eRefList = uiRefListIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 1621 Int iRefIdx = rpcTempCU->getCUMvField(eRefList)->getRefIdx(0); 1622 if( iRefIdx < 0 || rpcTempCU->getSlice()->getPOC() == rpcTempCU->getSlice()->getRefPOC(eRefList, iRefIdx) ) 1623 { 1624 bSignalflag[uiRefListIdx] = false; 1625 } 1626 } 1627 if( !bSignalflag[0] && !bSignalflag[1]) 1628 { 1629 rpcTempCU->setARPWSubParts( 0 , 0 , uhDepth ); 1630 } 1631 } 1632 } 1633 #endif 1447 1634 1448 1635 #if AMP_MRG 1449 1636 if ( !rpcTempCU->getMergeAMP() ) 1450 1637 { 1638 #if H_3D_ARP 1639 if( nARPWMax ) 1640 { 1641 continue; 1642 } 1643 else 1644 #endif 1451 1645 return; 1452 1646 } … … 1475 1669 xCheckDQP( rpcTempCU ); 1476 1670 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 1671 #if H_3D_ARP 1672 } 1673 #endif 1477 1674 } 1478 1675 -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCu.h
r324 r504 69 69 TComDataCU** m_ppcBestCU; ///< Best CUs in each depth 70 70 TComDataCU** m_ppcTempCU; ///< Temporary CUs in each depth 71 #if H_3D_ARP 72 TComDataCU** m_ppcWeightedTempCU; 73 #endif 71 74 UChar m_uhTotalDepth; 72 75 -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncEntropy.cpp
r446 r504 157 157 } 158 158 159 #if H_3D_IC 160 Void TEncEntropy::encodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 161 { 162 if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) ) 163 { 164 return; 165 } 166 167 if( !pcCU->getSlice()->getApplyIC() ) 168 return; 169 170 if( bRD ) 171 { 172 uiAbsPartIdx = 0; 173 } 174 175 if( pcCU->isICFlagRequired( uiAbsPartIdx ) ) 176 m_pcEntropyCoderIf->codeICFlag( pcCU, uiAbsPartIdx ); 177 } 178 #endif 179 180 #if H_3D_ARP 181 Void TEncEntropy::encodeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx ) 182 { 183 if( !pcCU->getSlice()->getARPStepNum() || pcCU->isIntra( uiAbsPartIdx ) ) 184 { 185 return; 186 } 187 188 if ( pcCU->getPartitionSize(uiAbsPartIdx)!=SIZE_2Nx2N ) 189 { 190 assert(pcCU->getARPW (uiAbsPartIdx) == 0); 191 } 192 else 193 { 194 m_pcEntropyCoderIf->codeARPW( pcCU, uiAbsPartIdx ); 195 } 196 } 197 #endif 198 159 199 /** encode prediction mode 160 200 * \param pcCU -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncEntropy.h
r446 r504 88 88 virtual Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 89 89 virtual Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 90 #if H_3D_ARP 91 virtual Void codeARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 92 #endif 93 #if H_3D_IC 94 virtual Void codeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 95 #endif 90 96 virtual Void codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 91 97 … … 169 175 Void encodeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 170 176 Void encodeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 177 #if H_3D_ARP 178 Void encodeARPW ( TComDataCU* pcCU, UInt uiAbspartIdx ); 179 #endif 180 #if H_3D_IC 181 Void encodeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 182 #endif 171 183 Void encodePredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 172 184 Void encodePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool bRD = false ); -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncGOP.cpp
r499 r504 678 678 #if H_MV 679 679 pcSlice->setRefPicList( rcListPic, m_refPicSetInterLayer ); 680 #if H_3D_ARP 681 pcSlice->setARPStepNum(); 682 if(pcSlice->getARPStepNum() > 1) 683 { 684 for(Int iLayerId = 0; iLayerId < getLayerId(); iLayerId ++ ) 685 { 686 Int iViewIdx = pcSlice->getVPS()->getViewIndex(iLayerId); 687 Bool bIsDepth = ( pcSlice->getVPS()->getDepthId ( iLayerId ) == 1 ); 688 if( iViewIdx<getViewIndex() && !bIsDepth ) 689 { 690 pcSlice->setBaseViewRefPicList( m_ivPicLists->getPicList( iLayerId ), iViewIdx ); 691 } 692 } 693 } 694 #endif 680 695 #else 681 696 pcSlice->setRefPicList ( rcListPic ); -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSbac.cpp
r446 r504 60 60 , m_cCUMergeFlagExtSCModel ( 1, 1, NUM_MERGE_FLAG_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels) 61 61 , m_cCUMergeIdxExtSCModel ( 1, 1, NUM_MERGE_IDX_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels) 62 #if H_3D_ARP 63 , m_cCUPUARPWSCModel ( 1, 1, NUM_ARPW_CTX , m_contextModels + m_numContextModels, m_numContextModels) 64 #endif 65 #if H_3D_IC 66 , m_cCUICFlagSCModel ( 1, 1, NUM_IC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 67 #endif 62 68 , m_cCUPartSizeSCModel ( 1, 1, NUM_PART_SIZE_CTX , m_contextModels + m_numContextModels, m_numContextModels) 63 69 , m_cCUPredModeSCModel ( 1, 1, NUM_PRED_MODE_CTX , m_contextModels + m_numContextModels, m_numContextModels) … … 111 117 m_cCUMergeFlagExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT); 112 118 m_cCUMergeIdxExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT); 119 #if H_3D_ARP 120 m_cCUPUARPWSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ARPW ); 121 #endif 122 #if H_3D_IC 123 m_cCUICFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_IC_FLAG ); 124 #endif 113 125 m_cCUPartSizeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_PART_SIZE ); 114 126 m_cCUAMPSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_CU_AMP_POS ); … … 165 177 curCost += m_cCUMergeFlagExtSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_MERGE_FLAG_EXT); 166 178 curCost += m_cCUMergeIdxExtSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_MERGE_IDX_EXT); 179 #if H_3D_ARP 180 curCost += m_cCUPUARPWSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_ARPW ); 181 #endif 182 #if H_3D_IC 183 curCost += m_cCUICFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_IC_FLAG ); 184 #endif 167 185 curCost += m_cCUPartSizeSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_PART_SIZE ); 168 186 curCost += m_cCUAMPSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_CU_AMP_POS ); … … 214 232 m_cCUMergeFlagExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT); 215 233 m_cCUMergeIdxExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT); 234 #if H_3D_ARP 235 m_cCUPUARPWSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ARPW ); 236 #endif 237 #if H_3D_IC 238 m_cCUICFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_IC_FLAG ); 239 #endif 216 240 m_cCUPartSizeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_PART_SIZE ); 217 241 m_cCUAMPSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_CU_AMP_POS ); … … 589 613 DTRACE_CABAC_T( "\n" ); 590 614 } 615 616 #if H_3D_ARP 617 Void TEncSbac::codeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx ) 618 { 619 Int iW = (Int)pcCU->getARPW( uiAbsPartIdx ); 620 Int iMaxW = pcCU->getSlice()->getARPStepNum() - 1; 621 assert( iMaxW > 0); 622 623 Int nOffset = pcCU->getCTXARPWFlag(uiAbsPartIdx); 624 Int nBinNum = iW + ( iW != iMaxW ); 625 m_pcBinIf->encodeBin( iW ? 1 : 0 , m_cCUPUARPWSCModel.get( 0, 0, 0 + nOffset ) ); 626 if( nBinNum > 1 ) 627 { 628 m_pcBinIf->encodeBin( ( iW == iMaxW ) ? 1 : 0, m_cCUPUARPWSCModel.get( 0, 0, 3 ) ); 629 } 630 } 631 #endif 632 633 #if H_3D_IC 634 /** code Illumination Compensation flag 635 * \param pcCU 636 * \param uiAbsPartIdx 637 * \returns Void 638 */ 639 Void TEncSbac::codeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) 640 { 641 // get context function is here 642 UInt uiSymbol = pcCU->getICFlag( uiAbsPartIdx ) ? 1 : 0; 643 UInt uiCtxIC = pcCU->getCtxICFlag( uiAbsPartIdx ) ; 644 m_pcBinIf->encodeBin( uiSymbol, m_cCUICFlagSCModel.get( 0, 0, uiCtxIC ) ); 645 DTRACE_CABAC_VL( g_nSymbolCounter++ ); 646 DTRACE_CABAC_T( "\tICFlag" ); 647 DTRACE_CABAC_T( "\tuiCtxIC: "); 648 DTRACE_CABAC_V( uiCtxIC ); 649 DTRACE_CABAC_T( "\tuiSymbol: "); 650 DTRACE_CABAC_V( uiSymbol ); 651 DTRACE_CABAC_T( "\n"); 652 } 653 #endif 654 591 655 592 656 Void TEncSbac::codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSbac.h
r446 r504 134 134 Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 135 135 Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 136 #if H_3D_ARP 137 Void codeARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 138 #endif 139 #if H_3D_IC 140 Void codeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 141 #endif 136 142 Void codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 137 143 Void codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList ); … … 181 187 ContextModel3DBuffer m_cCUMergeFlagExtSCModel; 182 188 ContextModel3DBuffer m_cCUMergeIdxExtSCModel; 189 #if H_3D_ARP 190 ContextModel3DBuffer m_cCUPUARPWSCModel; 191 #endif 192 #if H_3D_IC 193 ContextModel3DBuffer m_cCUICFlagSCModel; 194 #endif 183 195 ContextModel3DBuffer m_cCUPartSizeSCModel; 184 196 ContextModel3DBuffer m_cCUPredModeSCModel; -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSearch.cpp
r476 r504 317 317 318 318 piRefSrch = rcStruct.piRefY + iSearchY * rcStruct.iYStride + iSearchX; 319 319 #if H_3D_IC 320 m_cDistParam.bUseIC = pcPatternKey->getICFlag(); 321 #endif 320 322 //-- jclee for using the SAD function pointer 321 323 m_pcRdCost->setDistParam( pcPatternKey, piRefSrch, rcStruct.iYStride, m_cDistParam ); … … 744 746 745 747 setDistParamComp(0); // Y component 746 748 #if H_3D_IC 749 m_cDistParam.bUseIC = pcPatternKey->getICFlag(); 750 #endif 747 751 m_cDistParam.pCur = piRefPos; 748 752 m_cDistParam.bitDepth = g_bitDepthY; … … 3147 3151 #else 3148 3152 iWidth, iHeight, m_pcEncCfg->getUseHADME() ); 3153 #endif 3154 #if H_3D_IC 3155 cDistParam.bUseIC = false; 3149 3156 #endif 3150 3157 ruiErr = cDistParam.DistFunc( &cDistParam ); … … 4240 4247 pcCU->clipMv( cMvCand ); 4241 4248 4249 #if H_3D_IC 4250 Bool bICFlag = pcCU->getICFlag( uiPartAddr ) && ( pcCU->getSlice()->getViewIndex() != pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getViewIndex() ); 4251 #endif 4252 4242 4253 // prediction pattern 4243 4254 if ( pcCU->getSlice()->getPPS()->getUseWP() && pcCU->getSlice()->getSliceType()==P_SLICE ) … … 4247 4258 else 4248 4259 { 4249 xPredInterLumaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMvCand, iSizeX, iSizeY, pcTemplateCand, false ); 4260 xPredInterLumaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMvCand, iSizeX, iSizeY, pcTemplateCand, false 4261 #if H_3D_ARP 4262 , false 4263 #endif 4264 #if H_3D_IC 4265 , bICFlag 4266 #endif 4267 ); 4250 4268 } 4251 4269 … … 4300 4318 pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iRoiWidth, iRoiHeight ); 4301 4319 4320 #if H_3D_IC 4321 Bool bICFlag = pcCU->getICFlag( uiPartAddr ) && ( pcCU->getSlice()->getViewIndex() != pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxPred )->getViewIndex() ); 4322 pcPatternKey->setICFlag( bICFlag ); 4323 #endif 4324 4302 4325 if ( bBi ) 4303 4326 { … … 4332 4355 4333 4356 m_pcRdCost->setPredictor ( *pcMvPred ); 4357 #if H_3D_IC 4358 if( pcCU->getSlice()->getIsDepth() ) 4359 m_pcRdCost->setCostScale ( 0 ); 4360 else 4361 #endif 4334 4362 m_pcRdCost->setCostScale ( 2 ); 4335 4363 … … 4347 4375 4348 4376 m_pcRdCost->getMotionCost( 1, 0 ); 4377 #if H_3D_IC 4378 if( ! pcCU->getSlice()->getIsDepth() ) 4379 { 4380 #endif 4349 4381 m_pcRdCost->setCostScale ( 1 ); 4350 4382 … … 4361 4393 rcMv += (cMvHalf <<= 1); 4362 4394 rcMv += cMvQter; 4395 #if H_3D_IC 4396 } 4397 #endif 4363 4398 4364 4399 UInt uiMvBits = m_pcRdCost->getBits( rcMv.getHor(), rcMv.getVer() ); 4365 4400 #if H_3D_IC 4401 if( pcCU->getSlice()->getIsDepth() ) 4402 ruiCost += m_pcRdCost->getCost( uiMvBits ); 4403 #endif 4366 4404 ruiBits += uiMvBits; 4367 4405 ruiCost = (UInt)( floor( fWeight * ( (Double)ruiCost - (Double)m_pcRdCost->getCost( uiMvBits ) ) ) + (Double)m_pcRdCost->getCost( ruiBits ) ); … … 4372 4410 { 4373 4411 Int iMvShift = 2; 4412 #if H_3D_IC 4413 if( pcCU->getSlice()->getIsDepth() ) 4414 iMvShift = 0; 4415 #endif 4374 4416 TComMv cTmpMvPred = cMvPred; 4375 4417 pcCU->clipMv( cTmpMvPred ); … … 4423 4465 4424 4466 setDistParamComp(0); 4425 4467 #if H_3D_IC 4468 m_cDistParam.bUseIC = pcPatternKey->getICFlag(); 4469 #endif 4426 4470 m_cDistParam.bitDepth = g_bitDepthY; 4427 4471 uiSad = m_cDistParam.DistFunc( &m_cDistParam ); … … 4474 4518 UInt uiSearchRange = m_iSearchRange; 4475 4519 pcCU->clipMv( rcMv ); 4520 #if H_3D_IC 4521 if( ! pcCU->getSlice()->getIsDepth() ) 4522 #endif 4476 4523 rcMv >>= 2; 4477 4524 // init TZSearchStruct … … 4491 4538 TComMv cMv = m_acMvPredictors[index]; 4492 4539 pcCU->clipMv( cMv ); 4540 #if H_3D_IC 4541 if( ! pcCU->getSlice()->getIsDepth() ) 4542 #endif 4493 4543 cMv >>= 2; 4494 4544 xTZSearchHelp( pcPatternKey, cStruct, cMv.getHor(), cMv.getVer(), 0, 0 ); … … 4746 4796 m_pcEntropyCoder->encodeSkipFlag(pcCU, 0, true); 4747 4797 m_pcEntropyCoder->encodeMergeIndex( pcCU, 0, true ); 4748 4798 #if H_3D_IC 4799 m_pcEntropyCoder->encodeICFlag( pcCU, 0, true ); 4800 #endif 4801 #if H_3D_ARP 4802 m_pcEntropyCoder->encodeARPW( pcCU, 0 ); 4803 #endif 4749 4804 uiBits = m_pcEntropyCoder->getNumberOfWrittenBits(); 4750 4805 pcCU->getTotalBits() = uiBits; … … 6155 6210 m_pcEntropyCoder->encodeSkipFlag(pcCU, 0, true); 6156 6211 m_pcEntropyCoder->encodeMergeIndex(pcCU, 0, true); 6212 #if H_3D_IC 6213 m_pcEntropyCoder->encodeICFlag( pcCU, 0, true ); 6214 #endif 6215 #if H_3D_ARP 6216 m_pcEntropyCoder->encodeARPW( pcCU, 0 ); 6217 #endif 6157 6218 ruiBits += m_pcEntropyCoder->getNumberOfWrittenBits(); 6158 6219 } … … 6168 6229 m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth(0), true ); 6169 6230 m_pcEntropyCoder->encodePredInfo( pcCU, 0, true ); 6231 #if H_3D_IC 6232 m_pcEntropyCoder->encodeICFlag( pcCU, 0, true ); 6233 #endif 6234 #if H_3D_ARP 6235 m_pcEntropyCoder->encodeARPW( pcCU , 0 ); 6236 #endif 6170 6237 Bool bDummy = false; 6171 6238 m_pcEntropyCoder->encodeCoeff ( pcCU, 0, pcCU->getDepth(0), pcCU->getWidth(0), pcCU->getHeight(0), bDummy ); -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSlice.cpp
r486 r504 203 203 rpcSlice->setPicOutputFlag( true ); 204 204 rpcSlice->setPOC( pocCurr ); 205 205 #if H_3D_IC 206 rpcSlice->setApplyIC( false ); 207 #endif 206 208 // depth computation based on GOP size 207 209 Int depth; … … 951 953 Int iNumSubstreams = 1; 952 954 UInt uiTilesAcross = 0; 953 955 #if H_3D_IC 956 if ( pcEncTop->getViewIndex() && pcEncTop->getUseIC() && 957 !( ( pcSlice->getSliceType() == P_SLICE && pcSlice->getPPS()->getUseWP() ) || ( pcSlice->getSliceType() == B_SLICE && pcSlice->getPPS()->getWPBiPred() ) ) 958 ) 959 { 960 pcSlice ->xSetApplyIC(); 961 if ( pcSlice->getApplyIC() ) 962 { 963 pcSlice->setIcSkipParseFlag( pcSlice->getPOC() % m_pcCfg->getIntraPeriod() != 0 ); 964 } 965 } 966 #endif 954 967 if( m_pcCfg->getUseSBACRD() ) 955 968 {
Note: See TracChangeset for help on using the changeset viewer.