Changeset 125 in SHVCSoftware for trunk/source/Lib/TLibDecoder/TDecEntropy.cpp
- Timestamp:
- 16 Apr 2013, 06:39:31 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibDecoder/TDecEntropy.cpp
r17 r125 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 46 46 } 47 47 48 #include "TLibCommon/TComAdaptiveLoopFilter.h"49 48 #include "TLibCommon/TComSampleAdaptiveOffset.h" 50 49 … … 88 87 * \returns Void 89 88 */ 90 Void TDecEntropy::decodeMergeIndex( TComDataCU* pcCU, UInt uiPartIdx, UInt uiAbsPartIdx, PartSize eCUMode, UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours,UInt uiDepth )89 Void TDecEntropy::decodeMergeIndex( TComDataCU* pcCU, UInt uiPartIdx, UInt uiAbsPartIdx, UInt uiDepth ) 91 90 { 92 91 UInt uiMergeIndex = 0; 93 m_pcEntropyDecoderIf->parseMergeIndex( pcCU, uiMergeIndex , uiAbsPartIdx, uiDepth);92 m_pcEntropyDecoderIf->parseMergeIndex( pcCU, uiMergeIndex ); 94 93 pcCU->setMergeIndexSubParts( uiMergeIndex, uiAbsPartIdx, uiPartIdx, uiDepth ); 95 94 } … … 178 177 } 179 178 Int numValidMergeCand = 0; 180 bool isMerged = false;179 Bool isMerged = false; 181 180 182 181 pcSubCU->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 ); … … 187 186 if ( pcCU->getMergeFlag( uiSubPartIdx ) ) 188 187 { 189 decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, ePartSize, uhInterDirNeighbours, cMvFieldNeighbours,uiDepth );188 decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, uiDepth ); 190 189 UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); 191 #if REF_IDX_FRAMEWORK // HM bug fix190 #if 0 //REF_IDX_FRAMEWORK // HM bug fix 192 191 if(uiPartIdx) 193 192 { … … 204 203 if ( !isMerged ) 205 204 { 206 pcSubCU->getInterMergeCandidates( 0, 0, uiDepth,cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );205 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); 207 206 isMerged = true; 208 207 } … … 212 211 { 213 212 uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); 214 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth,cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );213 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 215 214 } 216 215 pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); … … 268 267 else 269 268 { 270 m_pcEntropyDecoderIf->parseInterDir( pcCU, uiInterDir, uiAbsPartIdx , uiDepth);269 m_pcEntropyDecoderIf->parseInterDir( pcCU, uiInterDir, uiAbsPartIdx ); 271 270 } 272 271 … … 281 280 if ( pcCU->getSlice()->getNumRefIdx( eRefList ) > 1 && iParseRefFrmIdx ) 282 281 { 283 m_pcEntropyDecoderIf->parseRefFrmIdx( pcCU, iRefFrmIdx, uiAbsPartIdx, uiDepth,eRefList );282 m_pcEntropyDecoderIf->parseRefFrmIdx( pcCU, iRefFrmIdx, eRefList ); 284 283 } 285 284 else if ( !iParseRefFrmIdx ) … … 326 325 cMv = cZeroMv; 327 326 328 #if !SPS_AMVP_CLEANUP329 if ( (pcSubCU->getInterDir(uiPartAddr) & ( 1 << eRefList )) && (pcSubCU->getAMVPMode(uiPartAddr) == AM_EXPL) )330 #else331 327 if ( (pcSubCU->getInterDir(uiPartAddr) & ( 1 << eRefList )) ) 332 #endif333 328 { 334 329 m_pcEntropyDecoderIf->parseMVPIdx( iMVPIdx ); … … 339 334 if ( iRefIdx >= 0 ) 340 335 { 341 m_pcPrediction->getMvPredAMVP( pcSubCU, uiPartIdx, uiPartAddr, eRefList, iRefIdx,cMv);336 m_pcPrediction->getMvPredAMVP( pcSubCU, uiPartIdx, uiPartAddr, eRefList, cMv); 342 337 cMv += pcSubCUMvField->getMvd( uiPartAddr ); 343 338 } … … 347 342 } 348 343 349 Void TDecEntropy::xDecodeTransform( TComDataCU* pcCU, UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt absTUPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, UInt uiInnerQuadIdx, Bool& bCodeDQP)344 Void TDecEntropy::xDecodeTransform( TComDataCU* pcCU, UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP) 350 345 { 351 346 UInt uiSubdiv; … … 388 383 { 389 384 assert( uiLog2TrafoSize > pcCU->getQuadtreeTULog2MinSizeInCU(uiAbsPartIdx) ); 390 #if TRANS_SPLIT_FLAG_CTX_REDUCTION391 385 m_pcEntropyDecoderIf->parseTransformSubdivFlag( uiSubdiv, 5 - uiLog2TrafoSize ); 392 #else393 m_pcEntropyDecoderIf->parseTransformSubdivFlag( uiSubdiv, uiDepth );394 #endif395 386 } 396 387 … … 431 422 const UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); 432 423 const UInt uiStartAbsPartIdx = uiAbsPartIdx; 433 UInt uiLumaTrMode, uiChromaTrMode;434 pcCU->convertTransIdx( uiStartAbsPartIdx, uiTrDepth+1, uiLumaTrMode, uiChromaTrMode );435 424 UInt uiYCbf = 0; 436 425 UInt uiUCbf = 0; … … 439 428 for( Int i = 0; i < 4; i++ ) 440 429 { 441 #if REMOVE_NSQT 442 UInt nsAddr = uiAbsPartIdx; 443 #else 444 UInt nsAddr = 0; 445 nsAddr = pcCU->getNSAbsPartIdx( uiLog2TrafoSize-1, uiAbsPartIdx, absTUPartIdx, i, uiTrDepth+1 ); 446 #endif 447 xDecodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, nsAddr, uiDepth, width, height, uiTrIdx, i, bCodeDQP ); 448 uiYCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiLumaTrMode ); 449 uiUCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiChromaTrMode ); 450 uiVCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiChromaTrMode ); 430 xDecodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP ); 431 uiYCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrDepth+1 ); 432 uiUCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth+1 ); 433 uiVCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth+1 ); 451 434 uiAbsPartIdx += uiQPartNum; 452 435 offsetLuma += size; offsetChroma += (size>>2); 453 436 } 454 437 455 pcCU->convertTransIdx( uiStartAbsPartIdx, uiTrDepth, uiLumaTrMode, uiChromaTrMode );456 438 for( UInt ui = 0; ui < 4 * uiQPartNum; ++ui ) 457 439 { 458 pcCU->getCbf( TEXT_LUMA )[uiStartAbsPartIdx + ui] |= uiYCbf << ui LumaTrMode;459 pcCU->getCbf( TEXT_CHROMA_U )[uiStartAbsPartIdx + ui] |= uiUCbf << ui ChromaTrMode;460 pcCU->getCbf( TEXT_CHROMA_V )[uiStartAbsPartIdx + ui] |= uiVCbf << ui ChromaTrMode;440 pcCU->getCbf( TEXT_LUMA )[uiStartAbsPartIdx + ui] |= uiYCbf << uiTrDepth; 441 pcCU->getCbf( TEXT_CHROMA_U )[uiStartAbsPartIdx + ui] |= uiUCbf << uiTrDepth; 442 pcCU->getCbf( TEXT_CHROMA_V )[uiStartAbsPartIdx + ui] |= uiVCbf << uiTrDepth; 461 443 } 462 444 } … … 477 459 } 478 460 479 UInt uiLumaTrMode, uiChromaTrMode;480 pcCU->convertTransIdx( uiAbsPartIdx, uiTrDepth, uiLumaTrMode, uiChromaTrMode );481 #if !REMOVE_NSQT482 if(pcCU->getPredictionMode( uiAbsPartIdx ) == MODE_INTER && pcCU->useNonSquarePU( uiAbsPartIdx ) )483 {484 pcCU->setNSQTIdxSubParts( uiLog2TrafoSize, uiAbsPartIdx, absTUPartIdx, uiLumaTrMode );485 }486 #endif487 461 pcCU->setCbfSubParts ( 0, TEXT_LUMA, uiAbsPartIdx, uiDepth ); 488 462 #if INTRA_BL … … 496 470 #endif 497 471 { 498 pcCU->setCbfSubParts( 1 << ui LumaTrMode, TEXT_LUMA, uiAbsPartIdx, uiDepth );472 pcCU->setCbfSubParts( 1 << uiTrDepth, TEXT_LUMA, uiAbsPartIdx, uiDepth ); 499 473 } 500 474 else 501 475 { 502 m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_LUMA, ui LumaTrMode, uiDepth );476 m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_LUMA, uiTrDepth, uiDepth ); 503 477 } 504 478 … … 533 507 Int trWidth = width; 534 508 Int trHeight = height; 535 #if !REMOVE_NSQT536 pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight );537 #endif538 509 m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffY()+offsetLuma), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_LUMA ); 539 510 } … … 542 513 Int trWidth = width >> 1; 543 514 Int trHeight = height >> 1; 544 #if !REMOVE_NSQT545 pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight );546 #endif547 515 if( cbfU ) 548 516 { … … 561 529 Int trWidth = width; 562 530 Int trHeight = height; 563 #if !REMOVE_NSQT564 pcCU->getNSQTSize( uiTrIdx - 1, uiAbsPartIdx, trWidth, trHeight );565 #endif566 531 if( cbfU ) 567 532 { … … 613 578 if( !( pcCU->getPartitionSize( uiAbsPartIdx) == SIZE_2Nx2N && pcCU->getMergeFlag( uiAbsPartIdx ) ) ) 614 579 { 615 m_pcEntropyDecoderIf->parseQtRootCbf( pcCU, uiAbsPartIdx, uiDepth, uiQtRootCbf );580 m_pcEntropyDecoderIf->parseQtRootCbf( uiAbsPartIdx, uiQtRootCbf ); 616 581 } 617 582 if ( !uiQtRootCbf ) … … 619 584 pcCU->setCbfSubParts( 0, 0, 0, uiAbsPartIdx, uiDepth ); 620 585 pcCU->setTrIdxSubParts( 0 , uiAbsPartIdx, uiDepth ); 621 #if !REMOVE_NSQT622 pcCU->setNSQTIdxSubParts( uiAbsPartIdx, uiDepth );623 #endif624 586 return; 625 587 } 626 588 627 589 } 628 xDecodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, ui AbsPartIdx, uiDepth, uiWidth, uiHeight, 0, 0, bCodeDQP );590 xDecodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, bCodeDQP ); 629 591 } 630 592
Note: See TracChangeset for help on using the changeset viewer.