Changeset 1289 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibEncoder
- Timestamp:
- 18 Jul 2015, 00:52:46 (10 years ago)
- Location:
- branches/SHM-dev/source/Lib/TLibEncoder
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h
r1287 r1289 145 145 146 146 Int m_maxTempLayer; ///< Max temporal layer 147 Bool m_useAMP; 147 Bool m_useAMP; 148 UInt m_maxCUWidth; 149 UInt m_maxCUHeight; 148 150 //======= Transform ============= 149 151 UInt m_uiQuadtreeTULog2MaxSize; … … 511 513 Int getMaxTempLayer () { return m_maxTempLayer; } 512 514 Void setMaxTempLayer ( Int maxTempLayer ) { m_maxTempLayer = maxTempLayer; } 515 Void setMaxCUWidth ( UInt u ) { m_maxCUWidth = u; } 516 Void setMaxCUHeight ( UInt u ) { m_maxCUHeight = u; } 517 513 518 //======== Transform ============= 514 519 Void setQuadtreeTULog2MaxSize ( UInt u ) { m_uiQuadtreeTULog2MaxSize = u; } … … 970 975 Void setTMVPConstraintsSEIEnabled(Int b) { m_TMVPConstraintsSEIEnabled = b; } 971 976 Int getTMVPConstraintsSEIEnabled() { return m_TMVPConstraintsSEIEnabled; } 972 973 977 #endif 974 978 #if P0123_ALPHA_CHANNEL_SEI -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCu.cpp
r1287 r1289 372 372 TComPic* pcPic = rpcBestCU->getPic(); 373 373 DEBUG_STRING_NEW(sDebug) 374 const TComPPS &pps=*(rpcTempCU->getSlice()->getPPS()); 375 const TComSPS &sps=*(rpcTempCU->getSlice()->getSPS()); 376 const UInt maxCUWidth = sps.getMaxCUWidth(); 374 377 375 378 // get Original YUV data from picture … … 396 399 const UInt numberValidComponents = rpcBestCU->getPic()->getNumberValidComponents(); 397 400 398 if( ( g_uiMaxCUWidth>>uiDepth) >= (g_uiMaxCUWidth >> ( rpcTempCU->getSlice()->getPPS()->getMaxCuDQPDepth())) )401 if( (maxCUWidth>>uiDepth) >= (maxCUWidth >> ( pps.getMaxCuDQPDepth())) ) // TODO: tidy expression 399 402 { 400 403 Int idQP = m_pcEncCfg->getMaxDeltaQP(); … … 403 406 iMaxQP = Clip3( -rpcTempCU->getSlice()->getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, iBaseQP+idQP ); 404 407 #else 405 iMinQP = Clip3( - rpcTempCU->getSlice()->getSPS()->getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, iBaseQP-idQP );406 iMaxQP = Clip3( - rpcTempCU->getSlice()->getSPS()->getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, iBaseQP+idQP );408 iMinQP = Clip3( -sps.getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, iBaseQP-idQP ); 409 iMaxQP = Clip3( -sps.getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, iBaseQP+idQP ); 407 410 #endif 408 411 } … … 423 426 const Int lowestQP = iMinQP; // For TQB, use this QP which is the lowest non TQB QP tested (rather than QP'=0) - that way delta QPs are smaller, and TQB can be tested at all CU levels. 424 427 425 if ( ( rpcTempCU->getSlice()->getPPS()->getTransquantBypassEnableFlag()) )428 if ( (pps.getTransquantBypassEnableFlag()) ) 426 429 { 427 430 isAddLowestQP = true; // mark that the first iteration is to cost TQB mode. … … 439 442 ( uiBPelY < rpcBestCU->getSlice()->getPicHeightInLumaSamples() ) ) 440 443 #else 441 if ( ( uiRPelX < rpcBestCU->getSlice()->getSPS()->getPicWidthInLumaSamples() ) &&442 ( uiBPelY < rpcBestCU->getSlice()->getSPS()->getPicHeightInLumaSamples() ) )444 if ( ( uiRPelX < sps.getPicWidthInLumaSamples() ) && 445 ( uiBPelY < sps.getPicHeightInLumaSamples() ) ) 443 446 #endif 444 447 { … … 492 495 * block position 493 496 */ 494 Int lgMinCuSize = pcSlice->getSPS()->getLog2MinCodingBlockSize() +495 std::max<Int>(0, pcSlice->getSPS()->getLog2DiffMaxMinCodingBlockSize()-Int(pcSlice->getPPS()->getMaxCuChromaQpAdjDepth()));496 m_ChromaQpAdjIdc = ((uiLPelX >> lgMinCuSize) + (uiTPelY >> lgMinCuSize)) % (p cSlice->getPPS()->getChromaQpAdjTableSize() + 1);497 Int lgMinCuSize = sps.getLog2MinCodingBlockSize() + 498 std::max<Int>(0, sps.getLog2DiffMaxMinCodingBlockSize()-Int(pps.getMaxCuChromaQpAdjDepth())); 499 m_ChromaQpAdjIdc = ((uiLPelX >> lgMinCuSize) + (uiTPelY >> lgMinCuSize)) % (pps.getChromaQpAdjTableSize() + 1); 497 500 } 498 501 … … 591 594 592 595 //! Try AMP (SIZE_2NxnU, SIZE_2NxnD, SIZE_nLx2N, SIZE_nRx2N) 593 if( pcSlice->getSPS()->getUseAMP() && uiDepth < g_uiMaxCUDepth-g_uiAddCUDepth )596 if(sps.getUseAMP() && uiDepth < g_uiMaxCUDepth-g_uiAddCUDepth ) 594 597 { 595 598 #if AMP_ENC_SPEEDUP … … 720 723 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth ) 721 724 { 722 if( rpcTempCU->getWidth(0) > ( 1 << rpcTempCU->getSlice()->getSPS()->getQuadtreeTULog2MinSize() ) )725 if( rpcTempCU->getWidth(0) > ( 1 << sps.getQuadtreeTULog2MinSize() ) ) 723 726 { 724 727 Double tmpIntraCost; … … 731 734 732 735 // test PCM 733 if( pcPic->getSlice(0)->getSPS()->getUsePCM()734 && rpcTempCU->getWidth(0) <= (1<< pcPic->getSlice(0)->getSPS()->getPCMLog2MaxSize())735 && rpcTempCU->getWidth(0) >= (1<< pcPic->getSlice(0)->getSPS()->getPCMLog2MinSize()) )736 if(sps.getUsePCM() 737 && rpcTempCU->getWidth(0) <= (1<<sps.getPCMLog2MaxSize()) 738 && rpcTempCU->getWidth(0) >= (1<<sps.getPCMLog2MinSize()) ) 736 739 { 737 740 #if SVC_EXTENSION 738 741 UInt uiRawBits = getTotalBits(rpcBestCU->getWidth(0), rpcBestCU->getHeight(0), rpcBestCU->getPic()->getChromaFormat(), pcPic->getSlice(0)->getBitDepths().recon); 739 742 #else 740 UInt uiRawBits = getTotalBits(rpcBestCU->getWidth(0), rpcBestCU->getHeight(0), rpcBestCU->getPic()->getChromaFormat(), pcPic->getSlice(0)->getSPS()->getBitDepths().recon);743 UInt uiRawBits = getTotalBits(rpcBestCU->getWidth(0), rpcBestCU->getHeight(0), rpcBestCU->getPic()->getChromaFormat(), sps.getBitDepths().recon); 741 744 #endif 742 745 UInt uiBestBits = rpcBestCU->getTotalBits(); … … 799 802 } 800 803 801 if( ( g_uiMaxCUWidth>>uiDepth) == (g_uiMaxCUWidth >> ( rpcTempCU->getSlice()->getPPS()->getMaxCuDQPDepth())) )804 if( (maxCUWidth>>uiDepth) == (maxCUWidth >> ( pps.getMaxCuDQPDepth())) ) // TODO: tidy expression 802 805 { 803 806 Int idQP = m_pcEncCfg->getMaxDeltaQP(); … … 806 809 iMaxQP = Clip3( -rpcTempCU->getSlice()->getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, iBaseQP+idQP ); 807 810 #else 808 iMinQP = Clip3( - rpcTempCU->getSlice()->getSPS()->getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, iBaseQP-idQP );809 iMaxQP = Clip3( - rpcTempCU->getSlice()->getSPS()->getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, iBaseQP+idQP );811 iMinQP = Clip3( -sps.getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, iBaseQP-idQP ); 812 iMaxQP = Clip3( -sps.getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, iBaseQP+idQP ); 810 813 #endif 811 814 } 812 else if( ( g_uiMaxCUWidth>>uiDepth) > (g_uiMaxCUWidth >> ( rpcTempCU->getSlice()->getPPS()->getMaxCuDQPDepth())) )815 else if( (maxCUWidth>>uiDepth) > (maxCUWidth >> ( pps.getMaxCuDQPDepth())) ) // TODO: tidy expression 813 816 { 814 817 iMinQP = iBaseQP; … … 855 858 if( ( pcSubBestPartCU->getCUPelX() < pcSlice->getPicWidthInLumaSamples() ) && ( pcSubBestPartCU->getCUPelY() < pcSlice->getPicHeightInLumaSamples() ) ) 856 859 #else 857 if( ( pcSubBestPartCU->getCUPelX() < pcSlice->getSPS()->getPicWidthInLumaSamples() ) && ( pcSubBestPartCU->getCUPelY() < pcSlice->getSPS()->getPicHeightInLumaSamples() ) )860 if( ( pcSubBestPartCU->getCUPelX() < sps.getPicWidthInLumaSamples() ) && ( pcSubBestPartCU->getCUPelY() < sps.getPicHeightInLumaSamples() ) ) 858 861 #endif 859 862 { … … 903 906 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 904 907 905 if( ( g_uiMaxCUWidth>>uiDepth) == (g_uiMaxCUWidth >> ( rpcTempCU->getSlice()->getPPS()->getMaxCuDQPDepth())) && rpcTempCU->getSlice()->getPPS()->getUseDQP())908 if( (maxCUWidth>>uiDepth) == (maxCUWidth >> ( pps.getMaxCuDQPDepth())) && pps.getUseDQP()) // TODO: tidy expression 906 909 { 907 910 Bool hasResidual = false; … … 1045 1048 Void TEncCu::xEncodeCU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 1046 1049 { 1047 TComPic* pcPic = pcCU->getPic(); 1048 1049 Bool bBoundary = false; 1050 UInt uiLPelX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ]; 1051 UInt uiRPelX = uiLPelX + (g_uiMaxCUWidth>>uiDepth) - 1; 1052 UInt uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ]; 1053 UInt uiBPelY = uiTPelY + (g_uiMaxCUHeight>>uiDepth) - 1; 1054 1055 TComSlice * pcSlice = pcCU->getPic()->getSlice(pcCU->getPic()->getCurrSliceIdx()); 1050 TComPic *const pcPic = pcCU->getPic(); 1051 TComSlice *const pcSlice = pcCU->getSlice(); 1052 const TComSPS &sps =*(pcSlice->getSPS()); 1053 const TComPPS &pps =*(pcSlice->getPPS()); 1054 1055 const UInt maxCUWidth = sps.getMaxCUWidth(); 1056 const UInt maxCUHeight = sps.getMaxCUHeight(); 1057 1058 Bool bBoundary = false; 1059 UInt uiLPelX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ]; 1060 const UInt uiRPelX = uiLPelX + (maxCUWidth>>uiDepth) - 1; 1061 UInt uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ]; 1062 const UInt uiBPelY = uiTPelY + (maxCUHeight>>uiDepth) - 1; 1063 1056 1064 #if HIGHER_LAYER_IRAP_SKIP_FLAG 1057 1065 if (m_pcEncCfg->getSkipPictureAtArcSwitch() && m_pcEncCfg->getAdaptiveResolutionChange() > 0 && pcSlice->getLayerId() == 1 && pcSlice->getPOC() == m_pcEncCfg->getAdaptiveResolutionChange()) … … 1064 1072 if( ( uiRPelX < pcSlice->getPicWidthInLumaSamples() ) && ( uiBPelY < pcSlice->getPicHeightInLumaSamples() ) ) 1065 1073 #else 1066 if( ( uiRPelX < pcSlice->getSPS()->getPicWidthInLumaSamples() ) && ( uiBPelY < pcSlice->getSPS()->getPicHeightInLumaSamples() ) )1074 if( ( uiRPelX < sps.getPicWidthInLumaSamples() ) && ( uiBPelY < sps.getPicHeightInLumaSamples() ) ) 1067 1075 #endif 1068 1076 { … … 1077 1085 { 1078 1086 UInt uiQNumParts = ( pcPic->getNumPartitionsInCtu() >> (uiDepth<<1) )>>2; 1079 if( ( g_uiMaxCUWidth>>uiDepth) == (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuDQPDepth())) && pcCU->getSlice()->getPPS()->getUseDQP())1087 if( (maxCUWidth>>uiDepth) == (maxCUWidth >> ( pps.getMaxCuDQPDepth())) && pps.getUseDQP()) // TODO: tidy expression 1080 1088 { 1081 1089 setdQPFlag(true); 1082 1090 } 1083 1091 1084 if( ( g_uiMaxCUWidth>>uiDepth) == (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuChromaQpAdjDepth())) && pcCU->getSlice()->getUseChromaQpAdj())1092 if( (maxCUWidth>>uiDepth) == (maxCUWidth >> ( pps.getMaxCuChromaQpAdjDepth())) && pcSlice->getUseChromaQpAdj()) // TODO: tidy expression 1085 1093 { 1086 1094 setCodeChromaQpAdjFlag(true); … … 1095 1103 if( ( uiLPelX < pcSlice->getPicWidthInLumaSamples() ) && ( uiTPelY < pcSlice->getPicHeightInLumaSamples() ) ) 1096 1104 #else 1097 if( ( uiLPelX < pcSlice->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcSlice->getSPS()->getPicHeightInLumaSamples() ) )1105 if( ( uiLPelX < sps.getPicWidthInLumaSamples() ) && ( uiTPelY < sps.getPicHeightInLumaSamples() ) ) 1098 1106 #endif 1099 1107 { … … 1104 1112 } 1105 1113 1106 if( ( g_uiMaxCUWidth>>uiDepth) >= (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuDQPDepth())) && pcCU->getSlice()->getPPS()->getUseDQP())1114 if( (maxCUWidth>>uiDepth) >= (maxCUWidth >> ( pps.getMaxCuDQPDepth())) && pps.getUseDQP()) // TODO: tidy expression 1107 1115 { 1108 1116 setdQPFlag(true); 1109 1117 } 1110 1118 1111 if( ( g_uiMaxCUWidth>>uiDepth) >= (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuChromaQpAdjDepth())) && pcCU->getSlice()->getUseChromaQpAdj())1119 if( (maxCUWidth>>uiDepth) >= (maxCUWidth >> ( pps.getMaxCuChromaQpAdjDepth())) && pcSlice->getUseChromaQpAdj()) // TODO: tidy expression 1112 1120 { 1113 1121 setCodeChromaQpAdjFlag(true); 1114 1122 } 1115 1123 1116 if (p cCU->getSlice()->getPPS()->getTransquantBypassEnableFlag())1124 if (pps.getTransquantBypassEnableFlag()) 1117 1125 { 1118 1126 m_pcEntropyCoder->encodeCUTransquantBypassFlag( pcCU, uiAbsPartIdx ); 1119 1127 } 1120 1128 1121 if( !pc CU->getSlice()->isIntra() )1129 if( !pcSlice->isIntra() ) 1122 1130 { 1123 1131 m_pcEntropyCoder->encodeSkipFlag( pcCU, uiAbsPartIdx ); … … 1639 1647 UInt uiDepth = pcCU->getDepth( 0 ); 1640 1648 1641 if( pcCU->getSlice()->getPPS()->getUseDQP() && (g_uiMaxCUWidth>>uiDepth) >= (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuDQPDepth())) ) 1649 const TComPPS &pps = *(pcCU->getSlice()->getPPS()); 1650 const TComSPS &sps = *(pcCU->getSlice()->getSPS()); 1651 if ( pps.getUseDQP() && (sps.getMaxCUWidth()>>uiDepth) >= (sps.getMaxCUWidth() >> ( pps.getMaxCuDQPDepth())) ) // TODO: tidy expression 1642 1652 { 1643 1653 if ( pcCU->getQtRootCbf( 0) ) … … 1755 1765 TCoeff* pCoeffY = pCtu->getCoeff(COMPONENT_Y); 1756 1766 TCoeff* pArlCoeffY = pCtu->getArlCoeff(COMPONENT_Y); 1757 1758 UInt uiMinCUWidth = g_uiMaxCUWidth >> g_uiMaxCUDepth; 1767 const TComSPS &sps = *(pCtu->getSlice()->getSPS()); 1768 1769 const UInt uiMinCUWidth = sps.getMaxCUWidth() >> g_uiMaxCUDepth; 1759 1770 UInt uiMinNumCoeffInCU = 1 << uiMinCUWidth; 1760 1771 -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r1287 r1289 210 210 m_Enc3DAsymLUTPicUpdate.create( m_pcCfg->getCGSMaxOctantDepth() , prevBitDepthLuma, prevBitDepthChroma, bitDepthLuma, bitDepthChroma , m_pcCfg->getCGSMaxYPartNumLog2() ); 211 211 m_Enc3DAsymLUTPPS.create( m_pcCfg->getCGSMaxOctantDepth(), prevBitDepthLuma, prevBitDepthChroma, bitDepthLuma, prevBitDepthChroma , m_pcCfg->getCGSMaxYPartNumLog2() ); 212 212 213 if(!m_pColorMappedPic) 213 214 { 214 215 m_pColorMappedPic = new TComPicYuv; 215 m_pColorMappedPic->create( m_ppcTEncTop[0]->getSourceWidth(), m_ppcTEncTop[0]->getSourceHeight(), m_ppcTEncTop[0]->getChromaFormatIDC(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, NULL );216 m_pColorMappedPic->create( m_ppcTEncTop[0]->getSourceWidth(), m_ppcTEncTop[0]->getSourceHeight(), m_ppcTEncTop[0]->getChromaFormatIDC(), pcTEncTop->getSPS()->getMaxCUWidth(), pcTEncTop->getSPS()->getMaxCUHeight(), g_uiMaxCUDepth, true, NULL ); 216 217 } 217 218 } … … 3162 3163 if (conversion!=IPCOLOURSPACE_UNCHANGED) 3163 3164 { 3164 cscd.create(pcPicD->getWidth(COMPONENT_Y), pcPicD->getHeight(COMPONENT_Y), pcPicD->getChromaFormat(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth);3165 cscd.create(pcPicD->getWidth(COMPONENT_Y), pcPicD->getHeight(COMPONENT_Y), pcPicD->getChromaFormat(), pcPicD->getWidth(COMPONENT_Y), pcPicD->getHeight(COMPONENT_Y), 0, false); 3165 3166 #if SVC_EXTENSION 3166 3167 TVideoIOYuv::ColourSpaceConvert(*pcPicD, cscd, conversion, pcPic->getSlice(0)->getBitDepths().recon, false); … … 3385 3386 { 3386 3387 TComPicYuv &reconField=*(apcPicRecFields[fieldNum]); 3387 cscd[fieldNum].create(reconField.getWidth(COMPONENT_Y), reconField.getHeight(COMPONENT_Y), reconField.getChromaFormat(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth);3388 cscd[fieldNum].create(reconField.getWidth(COMPONENT_Y), reconField.getHeight(COMPONENT_Y), reconField.getChromaFormat(), reconField.getWidth(COMPONENT_Y), reconField.getHeight(COMPONENT_Y), 0, false); 3388 3389 #if SVC_EXTENSION 3389 3390 TVideoIOYuv::ColourSpaceConvert(reconField, cscd[fieldNum], conversion, pcPicOrgFirstField->getSlice(0)->getBitDepths().recon, false); -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.h
r1287 r1289 194 194 195 195 #if !SVC_EXTENSION 196 Void printOutSummary ( UInt uiNumAllPicCoded, Bool isField, const Bool printMSEBasedSNR, const Bool printSequenceMSE );196 Void printOutSummary ( UInt uiNumAllPicCoded, Bool isField, const Bool printMSEBasedSNR, const Bool printSequenceMSE, const BitDepths &bitDepths ); 197 197 #endif 198 198 Void preLoopFilterPicAll ( TComPic* pcPic, UInt64& ruiDist ); -
branches/SHM-dev/source/Lib/TLibEncoder/TEncPic.cpp
r1260 r1289 128 128 #if SVC_EXTENSION 129 129 // * \param vps reference to used VPS 130 Void TEncPic::create( const TComVPS& vps, const TComSPS &sps, const TComPPS &pps, UInt uiMax Width, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual, const UInt layerId )130 Void TEncPic::create( const TComVPS& vps, const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual, const UInt layerId ) 131 131 { 132 TComPic::create( vps, sps, pps, uiMax Width, uiMaxHeight, uiMaxDepth, bIsVirtual, layerId );132 TComPic::create( vps, sps, pps, uiMaxDepth, bIsVirtual, layerId ); 133 133 134 134 const Int iWidth = vps.getPicWidthInLumaSamples(&sps, layerId); 135 135 const Int iHeight = vps.getPicHeightInLumaSamples(&sps, layerId); 136 136 #else 137 Void TEncPic::create( const TComSPS &sps, const TComPPS &pps, UInt uiMax Width, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual )137 Void TEncPic::create( const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual ) 138 138 { 139 TComPic::create( sps, pps, uiMax Width, uiMaxHeight, uiMaxDepth, bIsVirtual );140 const Int iWidth= sps.getPicWidthInLumaSamples();141 const Int iHeight= sps.getPicHeightInLumaSamples();139 TComPic::create( sps, pps, uiMaxDepth, bIsVirtual ); 140 const Int iWidth = sps.getPicWidthInLumaSamples(); 141 const Int iHeight = sps.getPicHeightInLumaSamples(); 142 142 #endif 143 144 const UInt uiMaxWidth = sps.getMaxCUWidth(); 145 const UInt uiMaxHeight = sps.getMaxCUHeight(); 143 146 m_uiMaxAQDepth = uiMaxAQDepth; 144 147 if ( uiMaxAQDepth > 0 ) -
branches/SHM-dev/source/Lib/TLibEncoder/TEncPic.h
r1259 r1289 106 106 107 107 #if SVC_EXTENSION 108 Void create( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, UInt uiMax Width, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual /* = false*/, const UInt layerId );108 Void create( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual /* = false*/, const UInt layerId ); 109 109 #else //SVC_EXTENSION 110 Void create( const TComSPS &sps, const TComPPS &pps, UInt uiMax Width, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual /* = false*/ );110 Void create( const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual /* = false*/ ); 111 111 #endif //SVC_EXTENSION 112 112 -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.cpp
r1287 r1289 204 204 Int bipredSearchRange, 205 205 Int iFastSearch, 206 const UInt maxCUWidth, 207 const UInt maxCUHeight, 206 208 TEncEntropy* pcEntropyCoder, 207 209 TComRdCost* pcRdCost, … … 250 252 initTempBuff(cform); 251 253 252 m_pTempPel = new Pel[ g_uiMaxCUWidth*g_uiMaxCUHeight];254 m_pTempPel = new Pel[maxCUWidth*maxCUHeight]; 253 255 254 256 const UInt uiNumLayersToAllocate = pcEncCfg->getQuadtreeTULog2MaxSize()-pcEncCfg->getQuadtreeTULog2MinSize()+1; … … 259 261 const UInt csy=::getComponentScaleY(ComponentID(ch), cform); 260 262 m_ppcQTTempCoeff[ch] = new TCoeff* [uiNumLayersToAllocate]; 261 m_pcQTTempCoeff[ch] = new TCoeff [( g_uiMaxCUWidth*g_uiMaxCUHeight)>>(csx+csy) ];263 m_pcQTTempCoeff[ch] = new TCoeff [(maxCUWidth*maxCUHeight)>>(csx+csy) ]; 262 264 #if ADAPTIVE_QP_SELECTION 263 265 m_ppcQTTempArlCoeff[ch] = new TCoeff*[uiNumLayersToAllocate]; 264 m_pcQTTempArlCoeff[ch] = new TCoeff [( g_uiMaxCUWidth*g_uiMaxCUHeight)>>(csx+csy) ];266 m_pcQTTempArlCoeff[ch] = new TCoeff [(maxCUWidth*maxCUHeight)>>(csx+csy) ]; 265 267 #endif 266 268 m_puhQTTempCbf[ch] = new UChar [uiNumPartitions]; … … 268 270 for (UInt layer = 0; layer < uiNumLayersToAllocate; layer++) 269 271 { 270 m_ppcQTTempCoeff[ch][layer] = new TCoeff[( g_uiMaxCUWidth*g_uiMaxCUHeight)>>(csx+csy)];272 m_ppcQTTempCoeff[ch][layer] = new TCoeff[(maxCUWidth*maxCUHeight)>>(csx+csy)]; 271 273 #if ADAPTIVE_QP_SELECTION 272 m_ppcQTTempArlCoeff[ch][layer] = new TCoeff[( g_uiMaxCUWidth*g_uiMaxCUHeight)>>(csx+csy) ];274 m_ppcQTTempArlCoeff[ch][layer] = new TCoeff[(maxCUWidth*maxCUHeight)>>(csx+csy) ]; 273 275 #endif 274 276 } … … 286 288 for( UInt ui = 0; ui < uiNumLayersToAllocate; ++ui ) 287 289 { 288 m_pcQTTempTComYuv[ui].create( g_uiMaxCUWidth, g_uiMaxCUHeight, pcEncCfg->getChromaFormatIdc() );289 } 290 m_pcQTTempTransformSkipTComYuv.create( g_uiMaxCUWidth, g_uiMaxCUHeight, pcEncCfg->getChromaFormatIdc() );290 m_pcQTTempTComYuv[ui].create( maxCUWidth, maxCUHeight, pcEncCfg->getChromaFormatIdc() ); 291 } 292 m_pcQTTempTransformSkipTComYuv.create( maxCUWidth, maxCUHeight, pcEncCfg->getChromaFormatIdc() ); 291 293 m_tmpYuvPred.create(MAX_CU_SIZE, MAX_CU_SIZE, pcEncCfg->getChromaFormatIdc()); 292 294 } -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.h
r1259 r1289 138 138 Int bipredSearchRange, 139 139 Int iFastSearch, 140 const UInt maxCUWidth, 141 const UInt maxCUHeight, 140 142 TEncEntropy* pcEntropyCoder, 141 143 TComRdCost* pcRdCost, -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSlice.cpp
r1288 r1289 68 68 { 69 69 m_apcPicYuvPred = new TComPicYuv; 70 m_apcPicYuvPred->create( iWidth, iHeight, chromaFormat, iMaxCUWidth, iMaxCUHeight, uhTotalDepth );70 m_apcPicYuvPred->create( iWidth, iHeight, chromaFormat, iMaxCUWidth, iMaxCUHeight, uhTotalDepth, true ); 71 71 } 72 72 … … 75 75 { 76 76 m_apcPicYuvResi = new TComPicYuv; 77 m_apcPicYuvResi->create( iWidth, iHeight, chromaFormat, iMaxCUWidth, iMaxCUHeight, uhTotalDepth );77 m_apcPicYuvResi->create( iWidth, iHeight, chromaFormat, iMaxCUWidth, iMaxCUHeight, uhTotalDepth, true ); 78 78 } 79 79 } -
branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp
r1288 r1289 117 117 m_cGOPEncoder. create( ); 118 118 #endif 119 m_cSliceEncoder. create( getSourceWidth(), getSourceHeight(), m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth );120 m_cCuEncoder. create( g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, m_chromaFormatIDC );119 m_cSliceEncoder. create( getSourceWidth(), getSourceHeight(), m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, g_uiMaxCUDepth ); 120 m_cCuEncoder. create( g_uiMaxCUDepth, m_maxCUWidth, m_maxCUHeight, m_chromaFormatIDC ); 121 121 if (m_bUseSAO) 122 122 { 123 m_cEncSAO.create( getSourceWidth(), getSourceHeight(), m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_saoOffsetBitShift[CHANNEL_TYPE_LUMA], m_saoOffsetBitShift[CHANNEL_TYPE_CHROMA] );123 m_cEncSAO.create( getSourceWidth(), getSourceHeight(), m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, g_uiMaxCUDepth, m_saoOffsetBitShift[CHANNEL_TYPE_LUMA], m_saoOffsetBitShift[CHANNEL_TYPE_CHROMA] ); 124 124 #if SAO_ENCODE_ALLOW_USE_PREDEBLOCK 125 125 m_cEncSAO.createEncData(getSaoCtuBoundary()); … … 140 140 { 141 141 m_cRateCtrl.init( m_framesToBeEncoded, m_RCTargetBitrate, m_iFrameRate, m_iGOPSize, m_iSourceWidth, m_iSourceHeight, 142 g_uiMaxCUWidth, g_uiMaxCUHeight, m_RCKeepHierarchicalBit, m_RCUseLCUSeparateModel, m_GOPList );142 m_maxCUWidth, m_maxCUHeight, m_RCKeepHierarchicalBit, m_RCUseLCUSeparateModel, m_GOPList ); 143 143 } 144 144 … … 258 258 259 259 // initialize encoder search class 260 m_cSearch.init( this, &m_cTrQuant, m_iSearchRange, m_bipredSearchRange, m_iFastSearch, &m_cEntropyCoder, &m_cRdCost, getRDSbacCoder(), getRDGoOnSbacCoder() );260 m_cSearch.init( this, &m_cTrQuant, m_iSearchRange, m_bipredSearchRange, m_iFastSearch, m_maxCUWidth, m_maxCUHeight, &m_cEntropyCoder, &m_cRdCost, getRDSbacCoder(), getRDGoOnSbacCoder() ); 261 261 262 262 m_iMaxRefPicNum = 0; … … 579 579 { 580 580 rpcPicYuvRec = new TComPicYuv; 581 rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth);581 rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, g_uiMaxCUDepth, true); 582 582 } 583 583 rcListPicYuvRecOut.pushBack( rpcPicYuvRec ); … … 620 620 { 621 621 rpcPicYuvRec = new TComPicYuv; 622 rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth);622 rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, g_uiMaxCUDepth, true); 623 623 } 624 624 rcListPicYuvRecOut.pushBack( rpcPicYuvRec ); … … 750 750 } 751 751 752 pcEPic->create( m_cVPS, m_cSPS, m_cPPS, g_uiMaxCU Width, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1, false, m_layerId);752 pcEPic->create( m_cVPS, m_cSPS, m_cPPS, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1, false, m_layerId); 753 753 #else //SVC_EXTENSION 754 pcEPic->create( m_cSPS, m_cPPS, g_uiMaxCU Width, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1, false);754 pcEPic->create( m_cSPS, m_cPPS, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1, false); 755 755 #endif //SVC_EXTENSION 756 756 rpcPic = pcEPic; … … 800 800 } 801 801 802 rpcPic->create( m_cVPS, m_cSPS, m_cPPS, g_uiMaxCU Width, g_uiMaxCUHeight, g_uiMaxCUDepth, false, m_layerId );802 rpcPic->create( m_cVPS, m_cSPS, m_cPPS, g_uiMaxCUDepth, false, m_layerId ); 803 803 #else //SVC_EXTENSION 804 rpcPic->create( m_cSPS, m_cPPS, g_uiMaxCU Width, g_uiMaxCUHeight, g_uiMaxCUDepth, false );804 rpcPic->create( m_cSPS, m_cPPS, g_uiMaxCUDepth, false ); 805 805 #endif //SVC_EXTENSION 806 806 } … … 887 887 m_cSPS.setPicHeightInLumaSamples ( m_iSourceHeight ); 888 888 m_cSPS.setConformanceWindow ( m_conformanceWindow ); 889 m_cSPS.setMaxCUWidth ( g_uiMaxCUWidth );890 m_cSPS.setMaxCUHeight ( g_uiMaxCUHeight );889 m_cSPS.setMaxCUWidth ( m_maxCUWidth ); 890 m_cSPS.setMaxCUHeight ( m_maxCUHeight ); 891 891 m_cSPS.setMaxCUDepth ( g_uiMaxCUDepth ); 892 892 m_cSPS.setChromaFormatIdc( m_chromaFormatIDC); … … 1430 1430 Void TEncCfg::xCheckGSParameters() 1431 1431 { 1432 Int iWidthInCU = ( m_iSourceWidth% g_uiMaxCUWidth ) ? m_iSourceWidth/g_uiMaxCUWidth + 1 : m_iSourceWidth/g_uiMaxCUWidth;1433 Int iHeightInCU = ( m_iSourceHeight% g_uiMaxCUHeight ) ? m_iSourceHeight/g_uiMaxCUHeight + 1 : m_iSourceHeight/g_uiMaxCUHeight;1432 Int iWidthInCU = ( m_iSourceWidth%m_maxCUWidth ) ? m_iSourceWidth/m_maxCUWidth + 1 : m_iSourceWidth/m_maxCUWidth; 1433 Int iHeightInCU = ( m_iSourceHeight%m_maxCUHeight ) ? m_iSourceHeight/m_maxCUHeight + 1 : m_iSourceHeight/m_maxCUHeight; 1434 1434 UInt uiCummulativeColumnWidth = 0; 1435 1435 UInt uiCummulativeRowHeight = 0; … … 1505 1505 if( m_layerId > 0 ) 1506 1506 { 1507 g_uiMaxCUWidth = m_cSPS.getMaxCUWidth();1508 g_uiMaxCUHeight = m_cSPS.getMaxCUHeight();1509 1507 g_uiMaxCUDepth = m_cSPS.getMaxCUDepth(); 1510 1508 g_uiAddCUDepth = max (0, m_cSPS.getLog2MinCodingBlockSize() - (Int)m_cSPS.getQuadtreeTULog2MinSize() ); … … 1515 1513 { 1516 1514 m_cIlpPic[j] = new TComPic; 1517 m_cIlpPic[j]->create(m_cVPS, m_cSPS, m_cPPS, g_uiMaxCU Width, g_uiMaxCUHeight, g_uiMaxCUDepth, true, m_layerId);1515 m_cIlpPic[j]->create(m_cVPS, m_cSPS, m_cPPS, g_uiMaxCUDepth, true, m_layerId); 1518 1516 for (Int i=0; i<m_cIlpPic[j]->getPicSym()->getNumberOfCtusInFrame(); i++) 1519 1517 {
Note: See TracChangeset for help on using the changeset viewer.