Changeset 1249 in SHVCSoftware for branches/SHM-dev/source/Lib
- Timestamp:
- 14 Jul 2015, 00:43:13 (9 years ago)
- Location:
- branches/SHM-dev/source/Lib/TLibEncoder
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.cpp ¶
r1248 r1249 204 204 Int bipredSearchRange, 205 205 Int iFastSearch, 206 Int iMaxDeltaQP,207 206 TEncEntropy* pcEntropyCoder, 208 207 TComRdCost* pcRdCost, … … 216 215 m_bipredSearchRange = bipredSearchRange; 217 216 m_iFastSearch = iFastSearch; 218 m_iMaxDeltaQP = iMaxDeltaQP;219 217 m_pcEntropyCoder = pcEntropyCoder; 220 218 m_pcRdCost = pcRdCost; … … 4501 4499 Void TEncSearch::encodeResAndCalcRdInterCU( TComDataCU* pcCU, TComYuv* pcYuvOrg, TComYuv* pcYuvPred, 4502 4500 TComYuv* pcYuvResi, TComYuv* pcYuvResiBest, TComYuv* pcYuvRec, 4503 Bool bSkipRes DEBUG_STRING_FN_DECLARE(sDebug) )4501 Bool bSkipResidual DEBUG_STRING_FN_DECLARE(sDebug) ) 4504 4502 { 4505 if ( pcCU->isIntra(0) ) 4506 { 4507 return; 4508 } 4509 4510 Bool bHighPass = pcCU->getSlice()->getDepth() ? true : false; 4511 UInt uiBits = 0, uiBitsBest = 0; 4512 Distortion uiDistortion = 0, uiDistortionBest = 0; 4513 4514 UInt uiWidth = pcCU->getWidth ( 0 ); 4515 UInt uiHeight = pcCU->getHeight( 0 ); 4516 4517 // The pcCU is not marked as skip-mode at this point, and its coeffs and arlCoeffs will all be 0. 4503 assert ( !pcCU->isIntra(0) ); 4504 4505 const UInt cuWidthPixels = pcCU->getWidth ( 0 ); 4506 const UInt cuHeightPixels = pcCU->getHeight( 0 ); 4507 const Int numValidComponents = pcCU->getPic()->getNumberValidComponents(); 4508 4509 // The pcCU is not marked as skip-mode at this point, and its m_pcTrCoeff, m_pcArlCoeff, m_puhCbf, m_puhTrIdx will all be 0. 4518 4510 // due to prior calls to TComDataCU::initEstData( ); 4519 4511 4520 // No residual coding : SKIP mode 4521 if ( bSkipRes ) 4512 if ( bSkipResidual ) // No residual coding : SKIP mode 4522 4513 { 4523 4514 pcCU->setSkipFlagSubParts( true, 0, pcCU->getDepth(0) ); … … 4526 4517 4527 4518 pcYuvPred->copyToPartYuv( pcYuvRec, 0 ); 4528 4529 for (UInt ch=0; ch < pcCU->getPic()->getNumberValidComponents(); ch++) 4530 { 4531 const ComponentID compID=ComponentID(ch); 4519 Distortion distortion = 0; 4520 4521 for (Int comp=0; comp < numValidComponents; comp++) 4522 { 4523 const ComponentID compID=ComponentID(comp); 4532 4524 const UInt csx=pcYuvOrg->getComponentScaleX(compID); 4533 4525 const UInt csy=pcYuvOrg->getComponentScaleY(compID); 4534 uiDistortion += m_pcRdCost->getDistPart( g_bitDepth[toChannelType(compID)], pcYuvRec->getAddr(compID), pcYuvRec->getStride(compID), pcYuvOrg->getAddr(compID),4535 pcYuvOrg->getStride(compID), uiWidth >> csx, uiHeight>> csy, compID);4526 distortion += m_pcRdCost->getDistPart( g_bitDepth[toChannelType(compID)], pcYuvRec->getAddr(compID), pcYuvRec->getStride(compID), pcYuvOrg->getAddr(compID), 4527 pcYuvOrg->getStride(compID), cuWidthPixels >> csx, cuHeightPixels >> csy, compID); 4536 4528 } 4537 4529 … … 4547 4539 m_pcEntropyCoder->encodeMergeIndex( pcCU, 0, true ); 4548 4540 4549 uiBits = m_pcEntropyCoder->getNumberOfWrittenBits();4541 UInt uiBits = m_pcEntropyCoder->getNumberOfWrittenBits(); 4550 4542 pcCU->getTotalBits() = uiBits; 4551 pcCU->getTotalDistortion() = uiDistortion;4552 pcCU->getTotalCost() = m_pcRdCost->calcRdCost( uiBits, uiDistortion );4543 pcCU->getTotalDistortion() = distortion; 4544 pcCU->getTotalCost() = m_pcRdCost->calcRdCost( uiBits, distortion ); 4553 4545 4554 4546 m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[pcCU->getDepth(0)][CI_TEMP_BEST]); 4555 4556 static const UInt cbfZero[MAX_NUM_COMPONENT]={0,0,0};4557 pcCU->setCbfSubParts( cbfZero, 0, pcCU->getDepth( 0 ) );4558 pcCU->setTrIdxSubParts( 0, 0, pcCU->getDepth(0) );4559 4547 4560 4548 #ifdef DEBUG_STRING … … 4570 4558 4571 4559 // Residual coding. 4572 Int qp; 4573 Int qpBest = 0; 4574 Int qpMin; 4575 Int qpMax; 4576 Double dCost, dCostBest = MAX_DOUBLE; 4577 4578 UInt uiTrLevel = 0; 4579 if( (pcCU->getWidth(0) > pcCU->getSlice()->getSPS()->getMaxTrSize()) ) 4580 { 4581 while( pcCU->getWidth(0) > (pcCU->getSlice()->getSPS()->getMaxTrSize()<<uiTrLevel) ) 4582 { 4583 uiTrLevel++; 4584 } 4585 } 4586 4587 // TODO: there should be a check on the CU depth (but see to-do below regarding this feature) eg: 4588 // bHighPass = (bHighPass && pcCU->getDepth(0) <= pcCU->getSlice()->getPPS()->getMaxCuDQPDepth()); 4589 #if SVC_EXTENSION 4590 qpMin = bHighPass ? Clip3( -pcCU->getSlice()->getQpBDOffsetY(), MAX_QP, pcCU->getQP(0) - m_iMaxDeltaQP ) : pcCU->getQP( 0 ); 4591 qpMax = bHighPass ? Clip3( -pcCU->getSlice()->getQpBDOffsetY(), MAX_QP, pcCU->getQP(0) + m_iMaxDeltaQP ) : pcCU->getQP( 0 ); 4592 #else 4593 qpMin = bHighPass ? Clip3( -pcCU->getSlice()->getSPS()->getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, pcCU->getQP(0) - m_iMaxDeltaQP ) : pcCU->getQP( 0 ); 4594 qpMax = bHighPass ? Clip3( -pcCU->getSlice()->getSPS()->getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, pcCU->getQP(0) + m_iMaxDeltaQP ) : pcCU->getQP( 0 ); 4595 #endif 4596 4597 pcYuvResi->subtract( pcYuvOrg, pcYuvPred, 0, uiWidth ); 4560 4561 pcYuvResi->subtract( pcYuvOrg, pcYuvPred, 0, cuWidthPixels ); 4598 4562 4599 4563 TComTURecurse tuLevel0(pcCU, 0); 4600 4564 4601 for ( qp = qpMin; qp <= qpMax; qp++ ) // TODO: see the to-do below about this loop. 4602 { 4603 dCost = 0.; 4604 uiBits = 0; 4605 uiDistortion = 0; 4606 4607 // TODO: see the to-do below. eg: 4608 //if (qpMin != qpMax) 4609 //{ 4610 // pcCU->setQPSubParts(qp, 0, pcCU->getDepth(0)); 4611 // pcCU->setSkipFlagSubParts(false, 0, pcCU->getDepth(0)); 4612 //} 4613 4614 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ pcCU->getDepth( 0 ) ][ CI_CURR_BEST ] ); 4615 4616 Distortion uiZeroDistortion = 0; 4617 4618 xEstimateResidualQT( pcYuvResi, dCost, uiBits, uiDistortion, &uiZeroDistortion, tuLevel0 DEBUG_STRING_PASS_INTO(sDebug) ); 4619 4620 // ------------------------------------------------------- 4621 // set the coefficients in the pcCU, and also calculates the residual data. 4622 // If a block full of 0's is efficient, then just use 0's. 4623 // The costs at this point do not include header bits. 4624 4625 m_pcEntropyCoder->resetBits(); 4626 m_pcEntropyCoder->encodeQtRootCbfZero( pcCU ); 4627 UInt zeroResiBits = m_pcEntropyCoder->getNumberOfWrittenBits(); 4628 Double dZeroCost = m_pcRdCost->calcRdCost( zeroResiBits, uiZeroDistortion ); 4629 4630 if(pcCU->isLosslessCoded( 0 )) 4631 { 4632 dZeroCost = dCost + 1; 4633 } 4634 4635 const Bool bRootCbf=pcCU->getQtRootCbf(0)!=0; 4636 if ( dZeroCost < dCost || !bRootCbf ) 4637 { 4638 if ( dZeroCost < dCost ) 4639 { 4640 dCost = dZeroCost; 4641 } 4642 uiDistortion = uiZeroDistortion; 4643 4644 const UInt uiQPartNum = tuLevel0.GetAbsPartIdxNumParts(); 4645 ::memset( pcCU->getTransformIdx() , 0, uiQPartNum * sizeof(UChar) ); 4646 for (UInt ch=0; ch < pcCU->getPic()->getNumberValidComponents(); ch++) 4647 { 4648 const ComponentID component = ComponentID(ch); 4649 ::memset( pcCU->getCbf( component ) , 0, uiQPartNum * sizeof(UChar) ); 4650 if (qpMin != qpMax) // If there is only one iteration, then these will already be 0. 4651 { 4652 const UInt componentShift = pcCU->getPic()->getComponentScaleX(component) + pcCU->getPic()->getComponentScaleY(component); 4653 ::memset( pcCU->getCoeff(component), 0, (uiWidth*uiHeight*sizeof(TCoeff))>>componentShift ); 4654 #if ADAPTIVE_QP_SELECTION 4655 ::memset( pcCU->getArlCoeff(component), 0, (uiWidth*uiHeight*sizeof(TCoeff))>>componentShift ); 4656 #endif 4657 } 4658 ::memset( pcCU->getCrossComponentPredictionAlpha(component), 0, ( uiQPartNum * sizeof(Char) ) ); 4659 } 4660 static const UInt useTS[MAX_NUM_COMPONENT]={0,0,0}; 4661 pcCU->setTransformSkipSubParts ( useTS, 0, pcCU->getDepth(0) ); 4565 Double nonZeroCost = 0; 4566 UInt nonZeroBits = 0; 4567 Distortion nonZeroDistortion = 0; 4568 Distortion zeroDistortion = 0; 4569 4570 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ pcCU->getDepth( 0 ) ][ CI_CURR_BEST ] ); 4571 4572 xEstimateInterResidualQT( pcYuvResi, nonZeroCost, nonZeroBits, nonZeroDistortion, &zeroDistortion, tuLevel0 DEBUG_STRING_PASS_INTO(sDebug) ); 4573 4574 // ------------------------------------------------------- 4575 // set the coefficients in the pcCU, and also calculates the residual data. 4576 // If a block full of 0's is efficient, then just use 0's. 4577 // The costs at this point do not include header bits. 4578 4579 m_pcEntropyCoder->resetBits(); 4580 m_pcEntropyCoder->encodeQtRootCbfZero( pcCU ); 4581 const UInt zeroResiBits = m_pcEntropyCoder->getNumberOfWrittenBits(); 4582 const Double zeroCost = (pcCU->isLosslessCoded( 0 )) ? (nonZeroCost+1) : (m_pcRdCost->calcRdCost( zeroResiBits, zeroDistortion )); 4583 4584 if ( zeroCost < nonZeroCost || !pcCU->getQtRootCbf(0) ) 4585 { 4586 const UInt uiQPartNum = tuLevel0.GetAbsPartIdxNumParts(); 4587 ::memset( pcCU->getTransformIdx() , 0, uiQPartNum * sizeof(UChar) ); 4588 for (Int comp=0; comp < numValidComponents; comp++) 4589 { 4590 const ComponentID component = ComponentID(comp); 4591 ::memset( pcCU->getCbf( component ) , 0, uiQPartNum * sizeof(UChar) ); 4592 ::memset( pcCU->getCrossComponentPredictionAlpha(component), 0, ( uiQPartNum * sizeof(Char) ) ); 4593 } 4594 static const UInt useTS[MAX_NUM_COMPONENT]={0,0,0}; 4595 pcCU->setTransformSkipSubParts ( useTS, 0, pcCU->getDepth(0) ); 4662 4596 #ifdef DEBUG_STRING 4663 sDebug.clear(); 4664 for(UInt i=0; i<MAX_NUM_COMPONENT+1; i++) 4665 { 4666 sDebug+=debug_reorder_data_inter_token[i]; 4667 } 4668 #endif 4669 } 4670 else 4671 { 4672 xSetResidualQTData( NULL, false, tuLevel0); // Call first time to set coefficients. 4673 } 4674 4675 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[pcCU->getDepth(0)][CI_CURR_BEST] ); 4676 4677 uiBits = 0; 4678 xAddSymbolBitsInter( pcCU, 0, 0, uiBits ); 4679 // we've now encoded the pcCU, and so have a valid bit cost 4680 4681 4682 Double dExactCost = m_pcRdCost->calcRdCost( uiBits, uiDistortion ); 4683 dCost = dExactCost; 4684 4685 // Is our new cost better? 4686 if ( dCost < dCostBest ) 4687 { 4688 if ( !pcCU->getQtRootCbf( 0 ) ) 4689 { 4690 pcYuvResiBest->clear(); // Clear the residual image, if we didn't code it. 4691 } 4692 else 4693 { 4694 xSetResidualQTData( pcYuvResiBest, true, tuLevel0 ); // else set the residual image data pcYUVResiBest from the various temp images. 4695 } 4696 4697 if( qpMin != qpMax && qp != qpMax ) 4698 { 4699 const UInt uiQPartNum = tuLevel0.GetAbsPartIdxNumParts(); 4700 ::memcpy( m_puhQTTempTrIdx, pcCU->getTransformIdx(), uiQPartNum * sizeof(UChar) ); 4701 for(UInt i=0; i<pcCU->getPic()->getNumberValidComponents(); i++) 4702 { 4703 const ComponentID compID=ComponentID(i); 4704 const UInt csr = pcCU->getPic()->getComponentScaleX(compID) + pcCU->getPic()->getComponentScaleY(compID); 4705 ::memcpy( m_puhQTTempCbf[compID], pcCU->getCbf( compID ), uiQPartNum * sizeof(UChar) ); 4706 ::memcpy( m_pcQTTempCoeff[compID], pcCU->getCoeff(compID), uiWidth * uiHeight * sizeof( TCoeff ) >> csr ); 4707 #if ADAPTIVE_QP_SELECTION 4708 ::memcpy( m_pcQTTempArlCoeff[compID], pcCU->getArlCoeff(compID), uiWidth * uiHeight * sizeof( TCoeff )>> csr ); 4709 #endif 4710 ::memcpy( m_puhQTTempTransformSkipFlag[compID], pcCU->getTransformSkip(compID), uiQPartNum * sizeof( UChar ) ); 4711 ::memcpy( m_phQTTempCrossComponentPredictionAlpha[compID], pcCU->getCrossComponentPredictionAlpha(compID), uiQPartNum * sizeof(Char) ); 4712 } 4713 } 4714 uiBitsBest = uiBits; 4715 uiDistortionBest = uiDistortion; 4716 dCostBest = dCost; 4717 qpBest = qp; 4718 4719 m_pcRDGoOnSbacCoder->store( m_pppcRDSbacCoder[ pcCU->getDepth( 0 ) ][ CI_TEMP_BEST ] ); 4720 } 4721 } 4722 4723 assert ( dCostBest != MAX_DOUBLE ); 4724 4725 if( qpMin != qpMax && qpBest != qpMax ) 4726 { 4727 // TODO: this code has never been used, the qp doesn't change the QP coded, and the following assert prevented this code running. 4728 // also, skip flag got stuck-on, as nothing cleared it. Recommend removing this. 4729 assert( 0 ); // check 4730 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ pcCU->getDepth( 0 ) ][ CI_TEMP_BEST ] ); 4731 4732 // copy best cbf and trIdx to pcCU 4733 const UInt uiQPartNum = tuLevel0.GetAbsPartIdxNumParts(); 4734 ::memcpy( pcCU->getTransformIdx(), m_puhQTTempTrIdx, uiQPartNum * sizeof(UChar) ); 4735 for(UInt i=0; i<pcCU->getPic()->getNumberValidComponents(); i++) 4736 { 4737 const ComponentID compID=ComponentID(i); 4738 const UInt csr = pcCU->getPic()->getComponentScaleX(compID) + pcCU->getPic()->getComponentScaleY(compID); 4739 ::memcpy( pcCU->getCbf( compID ), m_puhQTTempCbf[compID], uiQPartNum * sizeof(UChar) ); 4740 ::memcpy( pcCU->getCoeff(compID), m_pcQTTempCoeff[compID], uiWidth * uiHeight * sizeof( TCoeff ) >> csr ); 4741 #if ADAPTIVE_QP_SELECTION 4742 ::memcpy( pcCU->getArlCoeff(compID), m_pcQTTempArlCoeff[compID], uiWidth * uiHeight * sizeof( TCoeff ) >> csr ); 4743 #endif 4744 ::memcpy( pcCU->getTransformSkip(compID), m_puhQTTempTransformSkipFlag[compID], uiQPartNum * sizeof( UChar ) ); 4745 ::memcpy( pcCU->getCrossComponentPredictionAlpha(compID), m_phQTTempCrossComponentPredictionAlpha[compID], uiQPartNum * sizeof( Char ) ); 4746 } 4747 // TODO: see to-do above. eg: 4748 // pcCU->setSkipFlagSubParts( (pcCU->getMergeFlag( 0 ) && pcCU->getPartitionSize( 0 ) == SIZE_2Nx2N && !pcCU->getQtRootCbf( 0 )), 0, pcCU->getDepth(0) ); 4749 } 4750 pcYuvRec->addClip ( pcYuvPred, pcYuvResiBest, 0, uiWidth ); 4751 4752 // update with clipped distortion and cost (qp estimation loop uses unclipped values) 4753 4754 uiDistortionBest = 0; 4755 for(UInt ch=0; ch<pcYuvRec->getNumberValidComponents(); ch++) 4756 { 4757 const ComponentID compID=ComponentID(ch); 4758 uiDistortionBest += m_pcRdCost->getDistPart( g_bitDepth[toChannelType(compID)], pcYuvRec->getAddr(compID ), pcYuvRec->getStride(compID ), pcYuvOrg->getAddr(compID ), pcYuvOrg->getStride(compID), uiWidth >> pcYuvOrg->getComponentScaleX(compID), uiHeight >> pcYuvOrg->getComponentScaleY(compID), compID); 4759 } 4760 dCostBest = m_pcRdCost->calcRdCost( uiBitsBest, uiDistortionBest ); 4761 4762 pcCU->getTotalBits() = uiBitsBest; 4763 pcCU->getTotalDistortion() = uiDistortionBest; 4764 pcCU->getTotalCost() = dCostBest; 4765 4766 if( qpMin != qpMax) // TODO: see to-do above 4767 { 4768 pcCU->setQPSubParts( qpBest, 0, pcCU->getDepth(0) ); 4769 } 4597 sDebug.clear(); 4598 for(UInt i=0; i<MAX_NUM_COMPONENT+1; i++) 4599 { 4600 sDebug+=debug_reorder_data_inter_token[i]; 4601 } 4602 #endif 4603 } 4604 else 4605 { 4606 xSetInterResidualQTData( NULL, false, tuLevel0); // Call first time to set coefficients. 4607 } 4608 4609 // all decisions now made. Fully encode the CU, including the headers: 4610 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[pcCU->getDepth(0)][CI_CURR_BEST] ); 4611 4612 UInt finalBits = 0; 4613 xAddSymbolBitsInter( pcCU, 0, 0, finalBits ); 4614 // we've now encoded the pcCU, and so have a valid bit cost 4615 4616 if ( !pcCU->getQtRootCbf( 0 ) ) 4617 { 4618 pcYuvResiBest->clear(); // Clear the residual image, if we didn't code it. 4619 } 4620 else 4621 { 4622 xSetInterResidualQTData( pcYuvResiBest, true, tuLevel0 ); // else set the residual image data pcYUVResiBest from the various temp images. 4623 } 4624 m_pcRDGoOnSbacCoder->store( m_pppcRDSbacCoder[ pcCU->getDepth( 0 ) ][ CI_TEMP_BEST ] ); 4625 4626 pcYuvRec->addClip ( pcYuvPred, pcYuvResiBest, 0, cuWidthPixels ); 4627 4628 // update with clipped distortion and cost (previously unclipped reconstruction values were used) 4629 4630 Distortion finalDistortion = 0; 4631 for(Int comp=0; comp<numValidComponents; comp++) 4632 { 4633 const ComponentID compID=ComponentID(comp); 4634 finalDistortion += m_pcRdCost->getDistPart( g_bitDepth[toChannelType(compID)], pcYuvRec->getAddr(compID ), pcYuvRec->getStride(compID ), pcYuvOrg->getAddr(compID ), pcYuvOrg->getStride(compID), cuWidthPixels >> pcYuvOrg->getComponentScaleX(compID), cuHeightPixels >> pcYuvOrg->getComponentScaleY(compID), compID); 4635 } 4636 4637 pcCU->getTotalBits() = finalBits; 4638 pcCU->getTotalDistortion() = finalDistortion; 4639 pcCU->getTotalCost() = m_pcRdCost->calcRdCost( finalBits, finalDistortion ); 4770 4640 } 4771 4641 4772 4642 4773 4643 4774 Void TEncSearch::xEstimate ResidualQT( TComYuv *pcResi,4775 Double &rdCost,4776 UInt &ruiBits,4777 Distortion &ruiDist,4778 Distortion *puiZeroDist,4779 TComTU &rTu4780 DEBUG_STRING_FN_DECLARE(sDebug) )4644 Void TEncSearch::xEstimateInterResidualQT( TComYuv *pcResi, 4645 Double &rdCost, 4646 UInt &ruiBits, 4647 Distortion &ruiDist, 4648 Distortion *puiZeroDist, 4649 TComTU &rTu 4650 DEBUG_STRING_FN_DECLARE(sDebug) ) 4781 4651 { 4782 4652 TComDataCU *pcCU = rTu.getCU(); … … 5279 5149 { 5280 5150 DEBUG_STRING_NEW(childString) 5281 xEstimate ResidualQT( pcResi, dSubdivCost, uiSubdivBits, uiSubdivDist, bCheckFull ? NULL : puiZeroDist, tuRecurseChild DEBUG_STRING_PASS_INTO(childString));5151 xEstimateInterResidualQT( pcResi, dSubdivCost, uiSubdivBits, uiSubdivDist, bCheckFull ? NULL : puiZeroDist, tuRecurseChild DEBUG_STRING_PASS_INTO(childString)); 5282 5152 #ifdef DEBUG_STRING 5283 5153 // split the string by component and append to the relevant output (because decoder decodes in channel order, whereas this search searches by TU-order) … … 5322 5192 5323 5193 // when compID isn't a channel, code Cbfs: 5324 xEncode ResidualQT( MAX_NUM_COMPONENT, rTu );5194 xEncodeInterResidualQT( MAX_NUM_COMPONENT, rTu ); 5325 5195 for(UInt ch = 0; ch < numValidComp; ch++) 5326 5196 { 5327 xEncode ResidualQT( ComponentID(ch), rTu );5197 xEncodeInterResidualQT( ComponentID(ch), rTu ); 5328 5198 } 5329 5199 … … 5414 5284 5415 5285 5416 Void TEncSearch::xEncode ResidualQT( const ComponentID compID, TComTU &rTu )5286 Void TEncSearch::xEncodeInterResidualQT( const ComponentID compID, TComTU &rTu ) 5417 5287 { 5418 5288 TComDataCU* pcCU=rTu.getCU(); … … 5486 5356 do 5487 5357 { 5488 xEncode ResidualQT( compID, tuRecurseChild );5358 xEncodeInterResidualQT( compID, tuRecurseChild ); 5489 5359 } while (tuRecurseChild.nextSection(rTu)); 5490 5360 } … … 5495 5365 5496 5366 5497 Void TEncSearch::xSet ResidualQTData( TComYuv* pcResi, Bool bSpatial, TComTU &rTu ) // TODO: turn this into two functions for bSpatial=true and false.5367 Void TEncSearch::xSetInterResidualQTData( TComYuv* pcResi, Bool bSpatial, TComTU &rTu ) // TODO: turn this into two functions for bSpatial=true and false. 5498 5368 { 5499 5369 TComDataCU* pcCU=rTu.getCU(); … … 5552 5422 do 5553 5423 { 5554 xSet ResidualQTData( pcResi, bSpatial, tuRecurseChild );5424 xSetInterResidualQTData( pcResi, bSpatial, tuRecurseChild ); 5555 5425 } while (tuRecurseChild.nextSection(rTu)); 5556 5426 } -
TabularUnified branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.h ¶
r1243 r1249 116 116 Pel* m_pTempPel; 117 117 const UInt* m_puiDFilter; 118 Int m_iMaxDeltaQP;119 118 120 119 // AMVP cost computation … … 139 138 Int bipredSearchRange, 140 139 Int iFastSearch, 141 Int iMaxDeltaQP,142 140 TEncEntropy* pcEntropyCoder, 143 141 TComRdCost* pcRdCost, … … 214 212 TComYuv* pcYuvResiBest, 215 213 TComYuv* pcYuvRec, 216 Bool bSkipRes 214 Bool bSkipResidual 217 215 DEBUG_STRING_FN_DECLARE(sDebug) ); 218 216 … … 459 457 460 458 461 Void xEncode ResidualQT( const ComponentID compID, TComTU &rTu );462 Void xEstimate ResidualQT( TComYuv* pcResi, Double &rdCost, UInt &ruiBits, Distortion &ruiDist, Distortion *puiZeroDist, TComTU &rTu DEBUG_STRING_FN_DECLARE(sDebug) );463 Void xSet ResidualQTData( TComYuv* pcResi, Bool bSpatial, TComTU &rTu );459 Void xEncodeInterResidualQT( const ComponentID compID, TComTU &rTu ); 460 Void xEstimateInterResidualQT( TComYuv* pcResi, Double &rdCost, UInt &ruiBits, Distortion &ruiDist, Distortion *puiZeroDist, TComTU &rTu DEBUG_STRING_FN_DECLARE(sDebug) ); 461 Void xSetInterResidualQTData( TComYuv* pcResi, Bool bSpatial, TComTU &rTu ); 464 462 465 463 UInt xModeBitsIntra ( TComDataCU* pcCU, UInt uiMode, UInt uiPartOffset, UInt uiDepth, UInt uiInitTrDepth, const ChannelType compID ); -
TabularUnified branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp ¶
r1246 r1249 258 258 259 259 // initialize encoder search class 260 m_cSearch.init( this, &m_cTrQuant, m_iSearchRange, m_bipredSearchRange, m_iFastSearch, 0,&m_cEntropyCoder, &m_cRdCost, getRDSbacCoder(), getRDGoOnSbacCoder() );260 m_cSearch.init( this, &m_cTrQuant, m_iSearchRange, m_bipredSearchRange, m_iFastSearch, &m_cEntropyCoder, &m_cRdCost, getRDSbacCoder(), getRDGoOnSbacCoder() ); 261 261 262 262 m_iMaxRefPicNum = 0; … … 679 679 680 680 TComSlice::sortPicList(m_cListPic); 681 681 682 682 683 if (m_cListPic.size() >= (UInt)(m_iGOPSize + getMaxDecPicBuffering(MAX_TLAYER-1) + 2) ) … … 1104 1105 m_cPPS.setLoopFilterAcrossSlicesEnabledFlag( m_bLFCrossSliceBoundaryFlag ); 1105 1106 1107 1106 1108 Int histogram[MAX_NUM_REF + 1]; 1107 1109 for( Int i = 0; i <= MAX_NUM_REF; i++ )
Note: See TracChangeset for help on using the changeset viewer.