Changeset 125 in SHVCSoftware for trunk/source/Lib/TLibDecoder/TDecEntropy.cpp


Ignore:
Timestamp:
16 Apr 2013, 06:39:31 (12 years ago)
Author:
seregin
Message:

copy from HM-10.0-dev-SHM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibDecoder/TDecEntropy.cpp

    r17 r125  
    44 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2012, ITU/ISO/IEC
     6 * Copyright (c) 2010-2013, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    4646}
    4747
    48 #include "TLibCommon/TComAdaptiveLoopFilter.h"
    4948#include "TLibCommon/TComSampleAdaptiveOffset.h"
    5049
     
    8887 * \returns Void
    8988 */
    90 Void TDecEntropy::decodeMergeIndex( TComDataCU* pcCU, UInt uiPartIdx, UInt uiAbsPartIdx, PartSize eCUMode, UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, UInt uiDepth )
     89Void TDecEntropy::decodeMergeIndex( TComDataCU* pcCU, UInt uiPartIdx, UInt uiAbsPartIdx, UInt uiDepth )
    9190{
    9291  UInt uiMergeIndex = 0;
    93   m_pcEntropyDecoderIf->parseMergeIndex( pcCU, uiMergeIndex, uiAbsPartIdx, uiDepth );
     92  m_pcEntropyDecoderIf->parseMergeIndex( pcCU, uiMergeIndex );
    9493  pcCU->setMergeIndexSubParts( uiMergeIndex, uiAbsPartIdx, uiPartIdx, uiDepth );
    9594}
     
    178177  }
    179178  Int numValidMergeCand = 0;
    180   bool isMerged = false;
     179  Bool isMerged = false;
    181180
    182181  pcSubCU->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 );
     
    187186    if ( pcCU->getMergeFlag( uiSubPartIdx ) )
    188187    {
    189       decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, ePartSize, uhInterDirNeighbours, cMvFieldNeighbours, uiDepth );
     188      decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, uiDepth );
    190189      UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx);
    191 #if REF_IDX_FRAMEWORK  // HM bug fix
     190#if 0 //REF_IDX_FRAMEWORK  // HM bug fix
    192191      if(uiPartIdx)
    193192      {
     
    204203        if ( !isMerged )
    205204        {
    206           pcSubCU->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
     205          pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
    207206          isMerged = true;
    208207        }
     
    212211      {
    213212        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 );
    215214      }
    216215      pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
     
    268267  else
    269268  {
    270     m_pcEntropyDecoderIf->parseInterDir( pcCU, uiInterDir, uiAbsPartIdx, uiDepth );
     269    m_pcEntropyDecoderIf->parseInterDir( pcCU, uiInterDir, uiAbsPartIdx );
    271270  }
    272271
     
    281280  if ( pcCU->getSlice()->getNumRefIdx( eRefList ) > 1 && iParseRefFrmIdx )
    282281  {
    283     m_pcEntropyDecoderIf->parseRefFrmIdx( pcCU, iRefFrmIdx, uiAbsPartIdx, uiDepth, eRefList );
     282    m_pcEntropyDecoderIf->parseRefFrmIdx( pcCU, iRefFrmIdx, eRefList );
    284283  }
    285284  else if ( !iParseRefFrmIdx )
     
    326325  cMv = cZeroMv;
    327326
    328 #if !SPS_AMVP_CLEANUP
    329   if ( (pcSubCU->getInterDir(uiPartAddr) & ( 1 << eRefList )) && (pcSubCU->getAMVPMode(uiPartAddr) == AM_EXPL) )
    330 #else
    331327  if ( (pcSubCU->getInterDir(uiPartAddr) & ( 1 << eRefList )) )
    332 #endif
    333328  {
    334329    m_pcEntropyDecoderIf->parseMVPIdx( iMVPIdx );
     
    339334  if ( iRefIdx >= 0 )
    340335  {
    341     m_pcPrediction->getMvPredAMVP( pcSubCU, uiPartIdx, uiPartAddr, eRefList, iRefIdx, cMv);
     336    m_pcPrediction->getMvPredAMVP( pcSubCU, uiPartIdx, uiPartAddr, eRefList, cMv);
    342337    cMv += pcSubCUMvField->getMvd( uiPartAddr );
    343338  }
     
    347342}
    348343
    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)
     344Void TDecEntropy::xDecodeTransform( TComDataCU* pcCU, UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP)
    350345{
    351346  UInt uiSubdiv;
     
    388383  {
    389384    assert( uiLog2TrafoSize > pcCU->getQuadtreeTULog2MinSizeInCU(uiAbsPartIdx) );
    390 #if TRANS_SPLIT_FLAG_CTX_REDUCTION
    391385    m_pcEntropyDecoderIf->parseTransformSubdivFlag( uiSubdiv, 5 - uiLog2TrafoSize );
    392 #else
    393     m_pcEntropyDecoderIf->parseTransformSubdivFlag( uiSubdiv, uiDepth );
    394 #endif
    395386  }
    396387 
     
    431422    const UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1);
    432423    const UInt uiStartAbsPartIdx = uiAbsPartIdx;
    433     UInt uiLumaTrMode, uiChromaTrMode;
    434     pcCU->convertTransIdx( uiStartAbsPartIdx, uiTrDepth+1, uiLumaTrMode, uiChromaTrMode );
    435424    UInt uiYCbf = 0;
    436425    UInt uiUCbf = 0;
     
    439428    for( Int i = 0; i < 4; i++ )
    440429    {
    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 );
    451434      uiAbsPartIdx += uiQPartNum;
    452435      offsetLuma += size;  offsetChroma += (size>>2);
    453436    }
    454437   
    455     pcCU->convertTransIdx( uiStartAbsPartIdx, uiTrDepth, uiLumaTrMode, uiChromaTrMode );
    456438    for( UInt ui = 0; ui < 4 * uiQPartNum; ++ui )
    457439    {
    458       pcCU->getCbf( TEXT_LUMA     )[uiStartAbsPartIdx + ui] |= uiYCbf << uiLumaTrMode;
    459       pcCU->getCbf( TEXT_CHROMA_U )[uiStartAbsPartIdx + ui] |= uiUCbf << uiChromaTrMode;
    460       pcCU->getCbf( TEXT_CHROMA_V )[uiStartAbsPartIdx + ui] |= uiVCbf << uiChromaTrMode;
     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;
    461443    }
    462444  }
     
    477459    }
    478460   
    479     UInt uiLumaTrMode, uiChromaTrMode;
    480     pcCU->convertTransIdx( uiAbsPartIdx, uiTrDepth, uiLumaTrMode, uiChromaTrMode );
    481 #if !REMOVE_NSQT
    482     if(pcCU->getPredictionMode( uiAbsPartIdx ) == MODE_INTER && pcCU->useNonSquarePU( uiAbsPartIdx ) )
    483     {
    484       pcCU->setNSQTIdxSubParts( uiLog2TrafoSize, uiAbsPartIdx, absTUPartIdx, uiLumaTrMode );
    485     }
    486 #endif
    487461    pcCU->setCbfSubParts ( 0, TEXT_LUMA, uiAbsPartIdx, uiDepth );
    488462#if INTRA_BL
     
    496470#endif
    497471    {
    498       pcCU->setCbfSubParts( 1 << uiLumaTrMode, TEXT_LUMA, uiAbsPartIdx, uiDepth );
     472      pcCU->setCbfSubParts( 1 << uiTrDepth, TEXT_LUMA, uiAbsPartIdx, uiDepth );
    499473    }
    500474    else
    501475    {
    502       m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_LUMA, uiLumaTrMode, uiDepth );
     476      m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_LUMA, uiTrDepth, uiDepth );
    503477    }
    504478
     
    533507      Int trWidth = width;
    534508      Int trHeight = height;
    535 #if !REMOVE_NSQT
    536       pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight );
    537 #endif
    538509      m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffY()+offsetLuma), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_LUMA );
    539510    }
     
    542513      Int trWidth = width >> 1;
    543514      Int trHeight = height >> 1;
    544 #if !REMOVE_NSQT
    545       pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight );
    546 #endif
    547515      if( cbfU )
    548516      {
     
    561529        Int trWidth = width;
    562530        Int trHeight = height;
    563 #if !REMOVE_NSQT
    564         pcCU->getNSQTSize( uiTrIdx - 1, uiAbsPartIdx, trWidth, trHeight );
    565 #endif
    566531        if( cbfU )
    567532        {
     
    613578    if( !( pcCU->getPartitionSize( uiAbsPartIdx) == SIZE_2Nx2N && pcCU->getMergeFlag( uiAbsPartIdx ) ) )
    614579    {
    615       m_pcEntropyDecoderIf->parseQtRootCbf( pcCU, uiAbsPartIdx, uiDepth, uiQtRootCbf );
     580      m_pcEntropyDecoderIf->parseQtRootCbf( uiAbsPartIdx, uiQtRootCbf );
    616581    }
    617582    if ( !uiQtRootCbf )
     
    619584      pcCU->setCbfSubParts( 0, 0, 0, uiAbsPartIdx, uiDepth );
    620585      pcCU->setTrIdxSubParts( 0 , uiAbsPartIdx, uiDepth );
    621 #if !REMOVE_NSQT
    622       pcCU->setNSQTIdxSubParts( uiAbsPartIdx, uiDepth );
    623 #endif
    624586      return;
    625587    }
    626588   
    627589  }
    628   xDecodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, 0, bCodeDQP );
     590  xDecodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, bCodeDQP );
    629591}
    630592
Note: See TracChangeset for help on using the changeset viewer.