Changeset 1287 in 3DVCSoftware for branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder
- Timestamp:
- 20 Jul 2015, 14:13:33 (10 years ago)
- Location:
- branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncCfg.h
r1279 r1287 257 257 Int* m_aidQP; 258 258 UInt m_uiDeltaQpRD; 259 Bool m_bFastDeltaQP; 259 260 260 261 Bool m_bUseConstrainedIntraPred; … … 710 711 Void setdQPs ( Int* p ) { m_aidQP = p; } 711 712 Void setDeltaQpRD ( UInt u ) {m_uiDeltaQpRD = u; } 713 Void setFastDeltaQp ( Bool b ) {m_bFastDeltaQP = b; } 712 714 Bool getUseASR () { return m_bUseASR; } 713 715 Bool getUseHADME () { return m_bUseHADME; } … … 758 760 Void setIntraSmoothingDisabledFlag (Bool bValue) { m_intraSmoothingDisabledFlag=bValue; } 759 761 760 Int* getdQPs () { return m_aidQP; } 761 UInt getDeltaQpRD () { return m_uiDeltaQpRD; } 762 Int* getdQPs () { return m_aidQP; } 763 UInt getDeltaQpRD () const { return m_uiDeltaQpRD; } 764 Bool getFastDeltaQp () const { return m_bFastDeltaQP; } 762 765 763 766 //====== Slice ======== -
branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncCu.cpp
r1285 r1287 122 122 m_stillToCodeChromaQpOffsetFlag = false; 123 123 m_cuChromaQpOffsetIdxPlus1 = 0; 124 m_bFastDeltaQP = false; 124 125 125 126 // initialize partition order. … … 406 407 */ 407 408 #if AMP_ENC_SPEEDUP 408 Void TEncCu::xCompressCU( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, UInt uiDepth DEBUG_STRING_FN_DECLARE(sDebug_), PartSize eParentPartSize )409 #else 410 Void TEncCu::xCompressCU( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, UInt uiDepth )409 Void TEncCu::xCompressCU( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, const UInt uiDepth DEBUG_STRING_FN_DECLARE(sDebug_), PartSize eParentPartSize ) 410 #else 411 Void TEncCu::xCompressCU( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, const UInt uiDepth ) 411 412 #endif 412 413 { … … 415 416 const TComPPS &pps=*(rpcTempCU->getSlice()->getPPS()); 416 417 const TComSPS &sps=*(rpcTempCU->getSlice()->getSPS()); 418 419 // These are only used if getFastDeltaQp() is true 420 const UInt fastDeltaQPCuMaxSize = Clip3(sps.getMaxCUHeight()>>sps.getLog2DiffMaxMinCodingBlockSize(), sps.getMaxCUHeight(), 32u); 417 421 418 422 … … 437 441 Bool bTrySplitDQP = true; 438 442 #endif 439 440 // variable for Early CU determination441 Bool bSubBranch = true;442 443 443 // variable for Cbf fast mode PU decision 444 444 Bool doNotBlockPu = true; … … 453 453 #endif 454 454 #endif 455 Bool bBoundary = false;456 UInt uiLPelX = rpcBestCU->getCUPelX();457 UInt uiRPelX = uiLPelX + rpcBestCU->getWidth(0) - 1;458 UInt uiTPelY = rpcBestCU->getCUPelY();459 UInt uiBPelY = uiTPelY + rpcBestCU->getHeight(0) - 1;455 const UInt uiLPelX = rpcBestCU->getCUPelX(); 456 const UInt uiRPelX = uiLPelX + rpcBestCU->getWidth(0) - 1; 457 const UInt uiTPelY = rpcBestCU->getCUPelY(); 458 const UInt uiBPelY = uiTPelY + rpcBestCU->getHeight(0) - 1; 459 const UInt uiWidth = rpcBestCU->getWidth(0); 460 460 461 461 #if H_MV_ENC_DEC_TRAC … … 515 515 516 516 TComSlice * pcSlice = rpcTempCU->getPic()->getSlice(rpcTempCU->getPic()->getCurrSliceIdx()); 517 // We need to split, so don't try these modes. 518 if ( ( uiRPelX < sps.getPicWidthInLumaSamples() ) && 519 ( uiBPelY < sps.getPicHeightInLumaSamples() ) ) 517 518 const Bool bBoundary = !( uiRPelX < sps.getPicWidthInLumaSamples() && uiBPelY < sps.getPicHeightInLumaSamples() ); 519 520 if ( !bBoundary ) 520 521 { 521 522 #if H_3D_FAST_TEXTURE_ENCODING … … 1187 1188 } 1188 1189 1189 m_pcRDGoOnSbacCoder->load(m_pppcRDSbacCoder[uiDepth][CI_NEXT_BEST]); 1190 m_pcEntropyCoder->resetBits(); 1191 m_pcEntropyCoder->encodeSplitFlag( rpcBestCU, 0, uiDepth, true ); 1192 rpcBestCU->getTotalBits() += m_pcEntropyCoder->getNumberOfWrittenBits(); // split bits 1193 rpcBestCU->getTotalBins() += ((TEncBinCABAC *)((TEncSbac*)m_pcEntropyCoder->m_pcEntropyCoderIf)->getEncBinIf())->getBinsCoded(); 1190 if( rpcBestCU->getTotalCost()!=MAX_DOUBLE ) 1191 { 1192 m_pcRDGoOnSbacCoder->load(m_pppcRDSbacCoder[uiDepth][CI_NEXT_BEST]); 1193 m_pcEntropyCoder->resetBits(); 1194 m_pcEntropyCoder->encodeSplitFlag( rpcBestCU, 0, uiDepth, true ); 1195 rpcBestCU->getTotalBits() += m_pcEntropyCoder->getNumberOfWrittenBits(); // split bits 1196 rpcBestCU->getTotalBins() += ((TEncBinCABAC *)((TEncSbac*)m_pcEntropyCoder->m_pcEntropyCoderIf)->getEncBinIf())->getBinsCoded(); 1194 1197 #if NH_3D_VSO // M8 1195 1198 if ( m_pcRdCost->getUseVSO() ) … … 1200 1203 #endif 1201 1204 rpcBestCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcBestCU->getTotalBits(), rpcBestCU->getTotalDistortion() ); 1202 m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_NEXT_BEST]); 1203 1204 // Early CU determination 1205 if( m_pcEncCfg->getUseEarlyCU() && rpcBestCU->isSkipped(0) ) 1206 { 1207 bSubBranch = false; 1208 } 1209 else 1210 { 1211 bSubBranch = true; 1205 m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_NEXT_BEST]); 1212 1206 } 1213 1207 #if H_3D_FAST_TEXTURE_ENCODING … … 1218 1212 #endif 1219 1213 } 1220 else 1221 { 1222 bBoundary = true; 1223 } 1224 1225 // copy orginal YUV samples to PCM buffer 1226 if( rpcBestCU->isLosslessCoded(0) && (rpcBestCU->getIPCMFlag(0) == false)) 1214 1215 // copy original YUV samples to PCM buffer 1216 if( rpcBestCU->getTotalCost()!=MAX_DOUBLE && rpcBestCU->isLosslessCoded(0) && (rpcBestCU->getIPCMFlag(0) == false)) 1227 1217 { 1228 1218 xFillPCMBuffer(rpcBestCU, m_ppcOrigYuv[uiDepth]); … … 1258 1248 } 1259 1249 1260 for (Int iQP=iMinQP; iQP<=iMaxQP; iQP++) 1261 { 1262 const Bool bIsLosslessMode = false; // False at this level. Next level down may set it to true. 1263 1264 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 1265 1250 const Bool bSubBranch = bBoundary || !( m_pcEncCfg->getUseEarlyCU() && rpcBestCU->getTotalCost()!=MAX_DOUBLE && rpcBestCU->isSkipped(0) ); 1251 #if NH_3D_QTLPC 1252 if( bSubBranch && uiDepth < sps.getLog2DiffMaxMinCodingBlockSize() && (!getFastDeltaQp() || uiWidth > fastDeltaQPCuMaxSize || bBoundary) && bTrySplitDQP ) 1253 #else 1254 if( bSubBranch && uiDepth < sps.getLog2DiffMaxMinCodingBlockSize() && (!getFastDeltaQp() || uiWidth > fastDeltaQPCuMaxSize || bBoundary)) 1255 #endif 1256 { 1266 1257 // further split 1267 #if NH_3D_QTLPC 1268 1269 if( bSubBranch && bTrySplitDQP && uiDepth < sps.getLog2DiffMaxMinCodingBlockSize() ) 1270 #else 1271 if( bSubBranch && uiDepth < sps.getLog2DiffMaxMinCodingBlockSize() ) 1272 #endif 1273 { 1258 for (Int iQP=iMinQP; iQP<=iMaxQP; iQP++) 1259 { 1260 const Bool bIsLosslessMode = false; // False at this level. Next level down may set it to true. 1261 1262 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 1263 1274 1264 #if NH_3D_VSO // M9 1275 1265 // reset Model … … 1310 1300 #if AMP_ENC_SPEEDUP 1311 1301 DEBUG_STRING_NEW(sChild) 1312 if ( ! rpcBestCU->isInter(0) )1302 if ( !(rpcBestCU->getTotalCost()!=MAX_DOUBLE && rpcBestCU->isInter(0)) ) 1313 1303 { 1314 1304 xCompressCU( pcSubBestPartCU, pcSubTempPartCU, uhNextDepth DEBUG_STRING_PASS_INTO(sChild), NUMBER_OF_PART_SIZES ); … … 1366 1356 } 1367 1357 1368 UInt uiTargetPartIdx = 0;1369 1358 if ( hasResidual ) 1370 1359 { 1371 1360 m_pcEntropyCoder->resetBits(); 1372 m_pcEntropyCoder->encodeQP( rpcTempCU, uiTargetPartIdx, false );1361 m_pcEntropyCoder->encodeQP( rpcTempCU, 0, false ); 1373 1362 rpcTempCU->getTotalBits() += m_pcEntropyCoder->getNumberOfWrittenBits(); // dQP bits 1374 1363 rpcTempCU->getTotalBins() += ((TEncBinCABAC *)((TEncSbac*)m_pcEntropyCoder->m_pcEntropyCoderIf)->getEncBinIf())->getBinsCoded(); … … 1383 1372 1384 1373 Bool foundNonZeroCbf = false; 1385 rpcTempCU->setQPSubCUs( rpcTempCU->getRefQP( uiTargetPartIdx), 0, uiDepth, foundNonZeroCbf );1374 rpcTempCU->setQPSubCUs( rpcTempCU->getRefQP( 0 ), 0, uiDepth, foundNonZeroCbf ); 1386 1375 assert( foundNonZeroCbf ); 1387 1376 } 1388 1377 else 1389 1378 { 1390 rpcTempCU->setQPSubParts( rpcTempCU->getRefQP( uiTargetPartIdx), 0, uiDepth ); // set QP to default QP1379 rpcTempCU->setQPSubParts( rpcTempCU->getRefQP( 0 ), 0, uiDepth ); // set QP to default QP 1391 1380 } 1392 1381 } … … 1399 1388 // This can be achieved by forcing the decision to be that of the rpcTempCU. 1400 1389 // The exception is each slice / slice-segment must have at least one CTU. 1401 const Bool isEndOfSlice = pcSlice->getSliceMode()==FIXED_NUMBER_OF_BYTES 1402 && ((pcSlice->getSliceBits()+rpcBestCU->getTotalBits())>pcSlice->getSliceArgument()<<3) 1403 && rpcBestCU->getCtuRsAddr() != pcPic->getPicSym()->getCtuTsToRsAddrMap(pcSlice->getSliceCurStartCtuTsAddr()) 1404 && rpcBestCU->getCtuRsAddr() != pcPic->getPicSym()->getCtuTsToRsAddrMap(pcSlice->getSliceSegmentCurStartCtuTsAddr()); 1405 const Bool isEndOfSliceSegment = pcSlice->getSliceSegmentMode()==FIXED_NUMBER_OF_BYTES 1406 && ((pcSlice->getSliceSegmentBits()+rpcBestCU->getTotalBits()) > pcSlice->getSliceSegmentArgument()<<3) 1407 && rpcBestCU->getCtuRsAddr() != pcPic->getPicSym()->getCtuTsToRsAddrMap(pcSlice->getSliceSegmentCurStartCtuTsAddr()); 1408 // Do not need to check slice condition for slice-segment since a slice-segment is a subset of a slice. 1409 if(isEndOfSlice||isEndOfSliceSegment) 1390 if (rpcBestCU->getTotalCost()!=MAX_DOUBLE) 1410 1391 { 1411 rpcBestCU->getTotalCost()=MAX_DOUBLE; 1392 const Bool isEndOfSlice = pcSlice->getSliceMode()==FIXED_NUMBER_OF_BYTES 1393 && ((pcSlice->getSliceBits()+rpcBestCU->getTotalBits())>pcSlice->getSliceArgument()<<3) 1394 && rpcBestCU->getCtuRsAddr() != pcPic->getPicSym()->getCtuTsToRsAddrMap(pcSlice->getSliceCurStartCtuTsAddr()) 1395 && rpcBestCU->getCtuRsAddr() != pcPic->getPicSym()->getCtuTsToRsAddrMap(pcSlice->getSliceSegmentCurStartCtuTsAddr()); 1396 const Bool isEndOfSliceSegment = pcSlice->getSliceSegmentMode()==FIXED_NUMBER_OF_BYTES 1397 && ((pcSlice->getSliceSegmentBits()+rpcBestCU->getTotalBits()) > pcSlice->getSliceSegmentArgument()<<3) 1398 && rpcBestCU->getCtuRsAddr() != pcPic->getPicSym()->getCtuTsToRsAddrMap(pcSlice->getSliceSegmentCurStartCtuTsAddr()); 1399 // Do not need to check slice condition for slice-segment since a slice-segment is a subset of a slice. 1400 if(isEndOfSlice||isEndOfSliceSegment) 1401 { 1402 rpcBestCU->getTotalCost()=MAX_DOUBLE; 1403 } 1412 1404 } 1413 1405 1414 1406 xCheckBestMode( rpcBestCU, rpcTempCU, uiDepth DEBUG_STRING_PASS_INTO(sDebug) DEBUG_STRING_PASS_INTO(sTempDebug) DEBUG_STRING_PASS_INTO(false) ); // RD compare current larger prediction 1415 // with sub partitioned prediction.1407 // with sub partitioned prediction. 1416 1408 } 1417 1409 } … … 1785 1777 { 1786 1778 assert( rpcTempCU->getSlice()->getSliceType() != I_SLICE ); 1779 if(getFastDeltaQp()) 1780 { 1781 return; // never check merge in fast deltaqp mode 1782 } 1787 1783 #if NH_3D_MLC 1788 1784 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists … … 2247 2243 DEBUG_STRING_NEW(sTest) 2248 2244 2245 if(getFastDeltaQp()) 2246 { 2247 const TComSPS &sps=*(rpcTempCU->getSlice()->getSPS()); 2248 const UInt fastDeltaQPCuMaxSize = Clip3(sps.getMaxCUHeight()>>(sps.getLog2DiffMaxMinCodingBlockSize()), sps.getMaxCUHeight(), 32u); 2249 if(ePartSize != SIZE_2Nx2N || rpcTempCU->getWidth( 0 ) > fastDeltaQPCuMaxSize) 2250 { 2251 return; // only check necessary 2Nx2N Inter in fast deltaqp mode 2252 } 2253 } 2254 2249 2255 // prior to this, rpcTempCU will have just been reset using rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 2250 2256 #if H_3D || NH_3D_ARP … … 2740 2746 DEBUG_STRING_NEW(sTest) 2741 2747 2748 if(getFastDeltaQp()) 2749 { 2750 const TComSPS &sps=*(rpcTempCU->getSlice()->getSPS()); 2751 const UInt fastDeltaQPCuMaxSize = Clip3(sps.getMaxCUHeight()>>(sps.getLog2DiffMaxMinCodingBlockSize()), sps.getMaxCUHeight(), 32u); 2752 if(rpcTempCU->getWidth( 0 ) > fastDeltaQPCuMaxSize) 2753 { 2754 return; // only check necessary 2Nx2N Intra in fast deltaqp mode 2755 } 2756 } 2757 2742 2758 UInt uiDepth = rpcTempCU->getDepth( 0 ); 2743 2759 #if NH_3D_VSO // M5 … … 2844 2860 Void TEncCu::xCheckIntraPCM( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU ) 2845 2861 { 2862 if(getFastDeltaQp()) 2863 { 2864 const TComSPS &sps=*(rpcTempCU->getSlice()->getSPS()); 2865 const UInt fastDeltaQPCuMaxPCMSize = Clip3((UInt)1<<sps.getPCMLog2MinSize(), (UInt)1<<sps.getPCMLog2MaxSize(), 32u); 2866 if (rpcTempCU->getWidth( 0 ) > fastDeltaQPCuMaxPCMSize) 2867 { 2868 return; // only check necessary PCM in fast deltaqp mode 2869 } 2870 } 2871 2846 2872 UInt uiDepth = rpcTempCU->getDepth( 0 ); 2847 2873 -
branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncCu.h
r1282 r1287 88 88 // Data : encoder control 89 89 Bool m_bEncodeDQP; 90 Bool m_bFastDeltaQP; 90 91 Bool m_stillToCodeChromaQpOffsetFlag; //indicates whether chroma QP offset flag needs to coded at this particular CU granularity. 91 92 Int m_cuChromaQpOffsetIdxPlus1; // if 0, then cu_chroma_qp_offset_flag will be 0, otherwise cu_chroma_qp_offset_flag will be 1. … … 132 133 #endif 133 134 135 Void setFastDeltaQp ( Bool b) { m_bFastDeltaQP = b; } 136 134 137 protected: 135 138 Void finishCU ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 136 139 #if AMP_ENC_SPEEDUP 137 Void xCompressCU ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, UInt uiDepth DEBUG_STRING_FN_DECLARE(sDebug), PartSize eParentPartSize = NUMBER_OF_PART_SIZES );138 #else 139 Void xCompressCU ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, UInt uiDepth );140 Void xCompressCU ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, const UInt uiDepth DEBUG_STRING_FN_DECLARE(sDebug), PartSize eParentPartSize = NUMBER_OF_PART_SIZES ); 141 #else 142 Void xCompressCU ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, const UInt uiDepth ); 140 143 #endif 141 144 Void xEncodeCU ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); … … 181 184 Void setdQPFlag ( Bool b ) { m_bEncodeDQP = b; } 182 185 186 Bool getFastDeltaQp () const { return m_bFastDeltaQP; } 187 183 188 Bool getCodeChromaQpAdjFlag() { return m_stillToCodeChromaQpOffsetFlag; } 184 189 Void setCodeChromaQpAdjFlag( Bool b ) { m_stillToCodeChromaQpOffsetFlag = b; } -
branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncGOP.cpp
r1279 r1287 1264 1264 pcSlice->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, rcListPic, m_pcCfg->getEfficientFieldIRAPEnabled()); 1265 1265 m_pcEncTop->selectReferencePictureSet(pcSlice, pocCurr, iGOPid); 1266 pcSlice->getRPS()->setNumberOfLongtermPictures(0);1267 1266 if (!m_pcCfg->getEfficientFieldIRAPEnabled()) 1268 1267 { … … 1757 1756 { 1758 1757 m_pcSliceEncoder->precompressSlice( pcPic ); 1759 m_pcSliceEncoder->compressSlice ( pcPic, false );1758 m_pcSliceEncoder->compressSlice ( pcPic, false, false ); 1760 1759 1761 1760 const UInt curSliceSegmentEnd = pcSlice->getSliceSegmentCurEndCtuTsAddr(); … … 2741 2740 Void TEncGOP::arrangeLongtermPicturesInRPS(TComSlice *pcSlice, TComList<TComPic*>& rcListPic) 2742 2741 { 2743 TComReferencePictureSet *rps = pcSlice->getRPS(); 2744 if(!rps->getNumberOfLongtermPictures()) 2742 if(pcSlice->getRPS()->getNumberOfLongtermPictures() == 0) 2745 2743 { 2746 2744 return; 2747 2745 } 2746 // we can only modify the local RPS! 2747 assert (pcSlice->getRPSidx()==-1); 2748 TComReferencePictureSet *rps = pcSlice->getLocalRPS(); 2748 2749 2749 2750 // Arrange long-term reference pictures in the correct order of LSB and MSB, -
branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncSearch.cpp
r1283 r1287 116 116 117 117 TEncSearch::TEncSearch() 118 : m_puhQTTempTrIdx(NULL) 119 , m_pcQTTempTComYuv(NULL) 120 , m_pcEncCfg (NULL) 121 , m_pcTrQuant (NULL) 122 , m_pcRdCost (NULL) 123 , m_pcEntropyCoder (NULL) 124 , m_iSearchRange (0) 125 , m_bipredSearchRange (0) 126 , m_iFastSearch (0) 127 , m_pppcRDSbacCoder (NULL) 128 , m_pcRDGoOnSbacCoder (NULL) 129 , m_pTempPel (NULL) 130 , m_puiDFilter (NULL) 131 , m_isInitialized (false) 118 132 { 119 133 for (UInt ch=0; ch<MAX_NUM_COMPONENT; ch++) … … 134 148 m_puhQTTempTransformSkipFlag[ch] = NULL; 135 149 } 136 m_puhQTTempTrIdx = NULL; 137 m_pcQTTempTComYuv = NULL; 138 m_pcEncCfg = NULL; 139 m_pcEntropyCoder = NULL; 140 m_pTempPel = NULL; 150 151 for (Int i=0; i<MAX_NUM_REF_LIST_ADAPT_SR; i++) 152 { 153 memset (m_aaiAdaptSR[i], 0, MAX_IDX_ADAPT_SR * sizeof (Int)); 154 } 155 for (Int i=0; i<AMVP_MAX_NUM_CANDS+1; i++) 156 { 157 memset (m_auiMVPIdxCost[i], 0, (AMVP_MAX_NUM_CANDS+1) * sizeof (UInt) ); 158 } 159 141 160 setWpScalingDistParam( NULL, -1, REF_PIC_LIST_X ); 142 161 } 143 162 144 163 145 146 147 TEncSearch::~TEncSearch() 164 Void TEncSearch::destroy() 148 165 { 166 assert (m_isInitialized); 149 167 if ( m_pTempPel ) 150 168 { … … 197 215 198 216 m_tmpYuvPred.destroy(); 217 m_isInitialized = false; 218 } 219 220 TEncSearch::~TEncSearch() 221 { 222 if (m_isInitialized) 223 { 224 destroy(); 225 } 199 226 } 200 227 … … 216 243 ) 217 244 { 245 assert (!m_isInitialized); 218 246 m_pcEncCfg = pcEncCfg; 219 247 m_pcTrQuant = pcTrQuant; … … 296 324 m_pcQTTempTransformSkipTComYuv.create( maxCUWidth, maxCUHeight, pcEncCfg->getChromaFormatIdc() ); 297 325 m_tmpYuvPred.create(MAX_CU_SIZE, MAX_CU_SIZE, pcEncCfg->getChromaFormatIdc()); 326 m_isInitialized = true; 298 327 } 299 328 … … 1224 1253 1225 1254 //===== init availability pattern ===== 1226 Bool bAboveAvail = false;1227 Bool bLeftAvail = false;1228 1229 1255 DEBUG_STRING_NEW(sTemp) 1230 1256 … … 1235 1261 const Bool bUseFilteredPredictions=TComPrediction::filteringIntraReferenceSamples(compID, uiChFinalMode, uiWidth, uiHeight, chFmt, sps.getSpsRangeExtension().getIntraSmoothingDisabledFlag()); 1236 1262 1237 initIntraPatternChType( rTu, bAboveAvail, bLeftAvail,compID, bUseFilteredPredictions DEBUG_STRING_PASS_INTO(sDebug) );1263 initIntraPatternChType( rTu, compID, bUseFilteredPredictions DEBUG_STRING_PASS_INTO(sDebug) ); 1238 1264 1239 1265 //===== get prediction signal ===== … … 1246 1272 { 1247 1273 #endif 1248 predIntraAng( compID, uiChFinalMode, piOrg, uiStride, piPred, uiStride, rTu, b AboveAvail, bLeftAvail, bUseFilteredPredictions );1274 predIntraAng( compID, uiChFinalMode, piOrg, uiStride, piPred, uiStride, rTu, bUseFilteredPredictions ); 1249 1275 #if NH_3D_DMM 1250 1276 } … … 1575 1601 checkTransformSkip &= (!pcCU->getCUTransquantBypass(0)); 1576 1602 1603 assert (rTu.ProcessComponentSection(COMPONENT_Y)); 1604 const UInt totalAdjustedDepthChan = rTu.GetTransformDepthTotalAdj(COMPONENT_Y); 1605 1577 1606 if ( m_pcEncCfg->getUseTransformSkipFast() ) 1578 1607 { … … 1609 1638 } 1610 1639 1611 if (rTu.ProcessComponentSection(COMPONENT_Y)) 1612 { 1613 const UInt totalAdjustedDepthChan = rTu.GetTransformDepthTotalAdj(COMPONENT_Y); 1614 pcCU->setTransformSkipSubParts ( modeId, COMPONENT_Y, uiAbsPartIdx, totalAdjustedDepthChan ); 1615 1616 xIntraCodingTUBlock( pcOrgYuv, pcPredYuv, pcResiYuv, resiLumaSingle, false, singleDistTmpLuma, COMPONENT_Y, rTu DEBUG_STRING_PASS_INTO(sModeString), default0Save1Load2 ); 1617 } 1640 1641 pcCU->setTransformSkipSubParts ( modeId, COMPONENT_Y, uiAbsPartIdx, totalAdjustedDepthChan ); 1642 xIntraCodingTUBlock( pcOrgYuv, pcPredYuv, pcResiYuv, resiLumaSingle, false, singleDistTmpLuma, COMPONENT_Y, rTu DEBUG_STRING_PASS_INTO(sModeString), default0Save1Load2 ); 1643 1618 1644 singleCbfTmpLuma = pcCU->getCbf( uiAbsPartIdx, COMPONENT_Y, uiTrDepth ); 1619 1645 … … 1669 1695 } 1670 1696 1671 if (rTu.ProcessComponentSection(COMPONENT_Y)) 1672 { 1673 const UInt totalAdjustedDepthChan = rTu.GetTransformDepthTotalAdj(COMPONENT_Y); 1674 pcCU ->setTransformSkipSubParts ( bestModeId[COMPONENT_Y], COMPONENT_Y, uiAbsPartIdx, totalAdjustedDepthChan ); 1675 } 1697 pcCU ->setTransformSkipSubParts ( bestModeId[COMPONENT_Y], COMPONENT_Y, uiAbsPartIdx, totalAdjustedDepthChan ); 1676 1698 1677 1699 if(bestModeId[COMPONENT_Y] == firstCheckId) 1678 1700 { 1679 1701 xLoadIntraResultQT(COMPONENT_Y, rTu ); 1680 if (rTu.ProcessComponentSection(COMPONENT_Y)) 1681 { 1682 pcCU->setCbfSubParts ( uiSingleCbfLuma << uiTrDepth, COMPONENT_Y, uiAbsPartIdx, rTu.GetTransformDepthTotalAdj(COMPONENT_Y) ); 1683 } 1702 pcCU->setCbfSubParts ( uiSingleCbfLuma << uiTrDepth, COMPONENT_Y, uiAbsPartIdx, rTu.GetTransformDepthTotalAdj(COMPONENT_Y) ); 1684 1703 1685 1704 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiFullDepth ][ CI_TEMP_BEST ] ); … … 1695 1714 //----- code luma/chroma block with given intra prediction mode and store Cbf----- 1696 1715 dSingleCost = 0.0; 1697 1698 if (rTu.ProcessComponentSection(COMPONENT_Y))1699 {1700 const UInt totalAdjustedDepthChan = rTu.GetTransformDepthTotalAdj(COMPONENT_Y);1701 pcCU ->setTransformSkipSubParts ( 0, COMPONENT_Y, uiAbsPartIdx, totalAdjustedDepthChan );1702 }1703 1716 #if NH_3D_ENC_DEPTH 1704 1717 xIntraCodingTUBlock( pcOrgYuv, pcPredYuv, pcResiYuv, resiLumaSingle, false, uiSingleDistLuma, COMPONENT_Y, rTu DEBUG_STRING_PASS_INTO(sDebug), zeroResiFlag ); 1705 1718 #else 1719 pcCU ->setTransformSkipSubParts ( 0, COMPONENT_Y, uiAbsPartIdx, totalAdjustedDepthChan ); 1706 1720 xIntraCodingTUBlock( pcOrgYuv, pcPredYuv, pcResiYuv, resiLumaSingle, false, uiSingleDistLuma, COMPONENT_Y, rTu DEBUG_STRING_PASS_INTO(sDebug)); 1707 1721 #endif … … 1835 1849 pcCU->setTrIdxSubParts( uiTrDepth, uiAbsPartIdx, uiFullDepth ); 1836 1850 const TComRectangle &tuRect=rTu.getRect(COMPONENT_Y); 1837 const UInt totalAdjustedDepthChan = rTu.GetTransformDepthTotalAdj(COMPONENT_Y);1838 1851 pcCU->setCbfSubParts ( uiSingleCbfLuma << uiTrDepth, COMPONENT_Y, uiAbsPartIdx, totalAdjustedDepthChan ); 1839 1852 pcCU ->setTransformSkipSubParts ( bestModeId[COMPONENT_Y], COMPONENT_Y, uiAbsPartIdx, totalAdjustedDepthChan ); … … 1889 1902 //===== reconstruction ===== 1890 1903 1891 Bool bAboveAvail = false;1892 Bool bLeftAvail = false;1893 1894 1904 TComTURecurse rTu(pcCU, 0); 1895 1905 const ChromaFormat chFmt = rTu.GetChromaFormat(); … … 1898 1908 { 1899 1909 const Bool bUseFilteredPredictions=TComPrediction::filteringIntraReferenceSamples(COMPONENT_Y, VER_IDX, uiWidth, uiHeight, chFmt, pcCU->getSlice()->getSPS()->getSpsRangeExtension().getIntraSmoothingDisabledFlag()); 1900 initIntraPatternChType( rTu, bAboveAvail, bLeftAvail,COMPONENT_Y, bUseFilteredPredictions DEBUG_STRING_PASS_INTO(sTemp) );1901 predIntraAng( COMPONENT_Y, VER_IDX, 0, uiStride, piPred, uiStride, rTu, b AboveAvail, bLeftAvail, bUseFilteredPredictions );1910 initIntraPatternChType( rTu, COMPONENT_Y, bUseFilteredPredictions DEBUG_STRING_PASS_INTO(sTemp) ); 1911 predIntraAng( COMPONENT_Y, VER_IDX, 0, uiStride, piPred, uiStride, rTu, bUseFilteredPredictions ); 1902 1912 } 1903 1913 else if ( uiPredMode == 1 ) 1904 1914 { 1905 1915 const Bool bUseFilteredPredictions=TComPrediction::filteringIntraReferenceSamples(COMPONENT_Y, HOR_IDX, uiWidth, uiHeight, chFmt, pcCU->getSlice()->getSPS()->getSpsRangeExtension().getIntraSmoothingDisabledFlag()); 1906 initIntraPatternChType( rTu, bAboveAvail, bLeftAvail,COMPONENT_Y, bUseFilteredPredictions DEBUG_STRING_PASS_INTO(sTemp) );1907 predIntraAng( COMPONENT_Y, HOR_IDX, 0, uiStride, piPred, uiStride, rTu, b AboveAvail, bLeftAvail, bUseFilteredPredictions );1916 initIntraPatternChType( rTu, COMPONENT_Y, bUseFilteredPredictions DEBUG_STRING_PASS_INTO(sTemp) ); 1917 predIntraAng( COMPONENT_Y, HOR_IDX, 0, uiStride, piPred, uiStride, rTu, bUseFilteredPredictions ); 1908 1918 } 1909 1919 else if ( uiPredMode == 2 ) … … 2019 2029 TComTURecurse tuRecurseWithPU(tuRecurseCU, false, TComTU::DONT_SPLIT); 2020 2030 2021 Bool bAboveAvail = false; 2022 Bool bLeftAvail = false; 2023 initIntraPatternChType( tuRecurseWithPU, bAboveAvail, bLeftAvail, COMPONENT_Y, false DEBUG_STRING_PASS_INTO(sTemp) ); 2031 initIntraPatternChType( tuRecurseWithPU, COMPONENT_Y, false DEBUG_STRING_PASS_INTO(sTemp) ); 2024 2032 2025 2033 // get partition … … 2075 2083 2076 2084 //===== init pattern for luma prediction ===== 2077 Bool bAboveAvail = false;2078 Bool bLeftAvail = false;2079 2085 2080 initIntraPatternChType( tuRecurseWithPU, bAboveAvail, bLeftAvail,COMPONENT_Y, bUseFilter DEBUG_STRING_PASS_INTO(sTemp2) );2086 initIntraPatternChType( tuRecurseWithPU, COMPONENT_Y, bUseFilter DEBUG_STRING_PASS_INTO(sTemp2) ); 2081 2087 2082 predIntraAng( COMPONENT_Y, uiLumaPredMode, piOrgTU, uiStrideTU, piPredTU, uiStrideTU, tuRecurseWithPU, b AboveAvail, bLeftAvail, bUseFilter );2088 predIntraAng( COMPONENT_Y, uiLumaPredMode, piOrgTU, uiStrideTU, piPredTU, uiStrideTU, tuRecurseWithPU, bUseFilter ); 2083 2089 2084 2090 // copy for prediction of next part … … 2858 2864 //{ 2859 2865 //===== init pattern for luma prediction ===== 2860 Bool bAboveAvail = false;2861 Bool bLeftAvail = false;2862 2866 DEBUG_STRING_NEW(sTemp2) 2863 2867 … … 2867 2871 Int numModesForFullRD = m_pcEncCfg->getFastUDIUseMPMEnabled()?g_aucIntraModeNumFast_UseMPM[ uiWidthBit ] : g_aucIntraModeNumFast_NotUseMPM[ uiWidthBit ]; 2868 2872 2869 if (tuRecurseWithPU.ProcessComponentSection(COMPONENT_Y)) 2870 { 2871 initIntraPatternChType( tuRecurseWithPU, bAboveAvail, bLeftAvail, COMPONENT_Y, true DEBUG_STRING_PASS_INTO(sTemp2) ); 2872 } 2873 // this should always be true 2874 assert (tuRecurseWithPU.ProcessComponentSection(COMPONENT_Y)); 2875 initIntraPatternChType( tuRecurseWithPU, COMPONENT_Y, true DEBUG_STRING_PASS_INTO(sTemp2) ); 2873 2876 #if NH_3D_ENC_DEPTH 2874 2877 if( bOnlyIVP ) … … 2917 2920 const Bool bUseFilter=TComPrediction::filteringIntraReferenceSamples(COMPONENT_Y, uiMode, puRect.width, puRect.height, chFmt, sps.getSpsRangeExtension().getIntraSmoothingDisabledFlag()); 2918 2921 2919 predIntraAng( COMPONENT_Y, uiMode, piOrg, uiStride, piPred, uiStride, tuRecurseWithPU, b AboveAvail, bLeftAvail, bUseFilter, TComPrediction::UseDPCMForFirstPassIntraEstimation(tuRecurseWithPU, uiMode) );2922 predIntraAng( COMPONENT_Y, uiMode, piOrg, uiStride, piPred, uiStride, tuRecurseWithPU, bUseFilter, TComPrediction::UseDPCMForFirstPassIntraEstimation(tuRecurseWithPU, uiMode) ); 2920 2923 #if NH_3D_VSO // M34 2921 2924 Dist uiSad; … … 6366 6369 nonCoeffDist = m_pcRdCost->getDistPart( channelBitDepth, m_pcQTTempTComYuv[uiQTTempAccessLayer].getAddrPix( compID, tuCompRect.x0, tuCompRect.y0 ), 6367 6370 m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride( compID ), pcResi->getAddrPix( compID, tuCompRect.x0, tuCompRect.y0 ), 6368 pcResi->getStride(compID), tuCompRect.width, tuCompRect.height, compID); // initialized with zero residual d estortion6371 pcResi->getStride(compID), tuCompRect.width, tuCompRect.height, compID); // initialized with zero residual distortion 6369 6372 } 6370 6373 else … … 6388 6391 #endif 6389 6392 nonCoeffDist = m_pcRdCost->getDistPart( channelBitDepth, m_pTempPel, tuCompRect.width, pcResi->getAddrPix( compID, tuCompRect.x0, tuCompRect.y0 ), 6390 pcResi->getStride(compID), tuCompRect.width, tuCompRect.height, compID); // initialized with zero residual d estortion6393 pcResi->getStride(compID), tuCompRect.width, tuCompRect.height, compID); // initialized with zero residual distortion 6391 6394 6392 6395 } … … 6412 6415 if((puiZeroDist != NULL) && isFirstMode) 6413 6416 { 6414 *puiZeroDist += nonCoeffDist; // initialized with zero residual d estortion6417 *puiZeroDist += nonCoeffDist; // initialized with zero residual distortion 6415 6418 } 6416 6419 -
branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncSearch.h
r1279 r1287 127 127 TComMv m_integerMv2Nx2N[NUM_REF_PIC_LIST_01][MAX_NUM_REF]; 128 128 129 Bool m_isInitialized; 129 130 public: 130 131 TEncSearch(); 131 132 virtual ~TEncSearch(); 132 133 133 Void init( 134 Void init(TEncCfg* pcEncCfg, 134 135 TComTrQuant* pcTrQuant, 135 136 Int iSearchRange, … … 143 144 TEncSbac*** pppcRDSbacCoder, 144 145 TEncSbac* pcRDGoOnSbacCoder ); 146 147 Void destroy(); 145 148 146 149 protected: -
branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncSlice.cpp
r1279 r1287 680 680 681 681 // try compress 682 compressSlice ( pcPic, true 682 compressSlice ( pcPic, true, m_pcCfg->getFastDeltaQp()); 683 683 684 684 #if NH_3D_VSO … … 751 751 /** \param pcPic picture class 752 752 */ 753 Void TEncSlice::compressSlice( TComPic* pcPic, const Bool bCompressEntireSlice )753 Void TEncSlice::compressSlice( TComPic* pcPic, const Bool bCompressEntireSlice, const Bool bFastDeltaQP ) 754 754 { 755 755 // if bCompressEntireSlice is true, then the entire slice (not slice segment) is compressed, … … 781 781 TComBitCounter tempBitCounter; 782 782 const UInt frameWidthInCtus = pcPic->getPicSym()->getFrameWidthInCtus(); 783 784 m_pcCuEncoder->setFastDeltaQp(bFastDeltaQP); 783 785 784 786 //------------------------------------------------------------------------------ -
branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncSlice.h
r1200 r1287 126 126 // compress and encode slice 127 127 Void precompressSlice ( TComPic* pcPic ); ///< precompress slice for multi-loop slice-level QP opt. 128 Void compressSlice ( TComPic* pcPic, const Bool bCompressEntireSlice 128 Void compressSlice ( TComPic* pcPic, const Bool bCompressEntireSlice, const Bool bFastDeltaQP ); ///< analysis stage of slice 129 129 Void calCostSliceI ( TComPic* pcPic ); 130 130 Void encodeSlice ( TComPic* pcPic, TComOutputBitstream* pcSubstreams, UInt &numBinsCoded ); -
branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncTop.cpp
r1279 r1287 174 174 m_cLoopFilter. destroy(); 175 175 m_cRateCtrl. destroy(); 176 m_cSearch. destroy(); 176 177 Int iDepth; 177 178 for ( iDepth = 0; iDepth < m_maxTotalCUDepth+1; iDepth++ ) … … 953 954 hrd->setCpbSizeValueMinus1( i, j, 0, ( cpbSizeValue - 1 ) ); 954 955 hrd->setDuCpbSizeValueMinus1( i, j, 0, ( duCpbSizeValue - 1 ) ); 956 hrd->setDuBitRateValueMinus1( i, j, 0, ( duBitRateValue - 1 ) ); 955 957 hrd->setCbrFlag( i, j, 0, false ); 956 958 … … 1323 1325 } 1324 1326 1325 TComReferencePictureSet *rps=slice->getLocalRPS(); 1326 (*rps) = *(slice->getSPS()->getRPSList()->getReferencePictureSet(slice->getRPSidx())); 1327 const TComReferencePictureSet *rps = (slice->getSPS()->getRPSList()->getReferencePictureSet(slice->getRPSidx())); 1327 1328 slice->setRPS(rps); 1328 slice->getRPS()->setNumberOfPictures(slice->getRPS()->getNumberOfNegativePictures()+slice->getRPS()->getNumberOfPositivePictures());1329 1329 #if NH_MV 1330 1330 }
Note: See TracChangeset for help on using the changeset viewer.