Ignore:
Timestamp:
14 Nov 2012, 17:23:56 (12 years ago)
Author:
orange
Message:

Integrated JCT3V-B0068 (QTLPC: quadtree limitation + predictive coding of the quadtree for depth coding)

Location:
branches/HTM-4.1-dev2-Orange/source/Lib/TLibDecoder
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-4.1-dev2-Orange/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r177 r181  
    16741674    }
    16751675#endif
     1676#if OL_QTLIMIT_PREDCODING_B0068
     1677    if( bIsDepth )
     1678    {
     1679      READ_FLAG( uiCode, "use_qtlpc_flag" );
     1680      pcSPS->setUseQTLPC( uiCode );
     1681    }
     1682#endif
    16761683   
    16771684#if RWTH_SDC_DLT_B0036
  • branches/HTM-4.1-dev2-Orange/source/Lib/TLibDecoder/TDecSbac.cpp

    r177 r181  
    753753 
    754754  UInt uiSymbol;
    755   m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUSplitFlagSCModel.get( 0, 0, pcCU->getCtxSplitFlag( uiAbsPartIdx, uiDepth ) ) );
    756   DTRACE_CABAC_VL( g_nSymbolCounter++ )
    757   DTRACE_CABAC_T( "\tSplitFlag\n" )
     755
     756#if OL_QTLIMIT_PREDCODING_B0068
     757  Bool bParseSplitFlag    = true;
     758
     759  TComSPS *sps            = pcCU->getPic()->getSlice(0)->getSPS();
     760  TComPic *pcTexture      = pcCU->getSlice()->getTexturePic();
     761  Bool bDepthMapDetect    = (pcTexture != NULL);
     762  Bool bIntraSliceDetect  = (pcCU->getSlice()->getSliceType() == I_SLICE);
     763
     764  if(bDepthMapDetect && !bIntraSliceDetect && sps->getUseQTLPC())
     765  {
     766    TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr());
     767    assert(pcTextureCU->getDepth(uiAbsPartIdx) >= uiDepth);
     768    bParseSplitFlag         = (pcTextureCU->getDepth(uiAbsPartIdx) > uiDepth);
     769  }
     770
     771  if(bParseSplitFlag)
     772  {
     773#endif
     774    m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUSplitFlagSCModel.get( 0, 0, pcCU->getCtxSplitFlag( uiAbsPartIdx, uiDepth ) ) );
     775    DTRACE_CABAC_VL( g_nSymbolCounter++ )
     776    DTRACE_CABAC_T( "\tSplitFlag\n" )
     777#if OL_QTLIMIT_PREDCODING_B0068
     778  }
     779  else
     780    uiSymbol = 0;
     781#endif
     782
    758783  pcCU->setDepthSubParts( uiDepth + uiSymbol, uiAbsPartIdx );
    759784 
     
    771796  UInt uiSymbol, uiMode = 0;
    772797  PartSize eMode;
     798
     799#if OL_QTLIMIT_PREDCODING_B0068
     800  Bool bParsePartSize    = true;
     801  TComSPS *sps           = pcCU->getPic()->getSlice(0)->getSPS();
     802  TComPic *pcTexture     = pcCU->getSlice()->getTexturePic();
     803  Bool bDepthMapDetect   = (pcTexture != NULL);
     804  Bool bIntraSliceDetect = (pcCU->getSlice()->getSliceType() == I_SLICE);
     805
     806  if(bDepthMapDetect && !bIntraSliceDetect && sps->getUseQTLPC())
     807  {
     808    TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr());
     809    assert(pcTextureCU->getDepth(uiAbsPartIdx) >= uiDepth);
     810    if (pcTextureCU->getDepth(uiAbsPartIdx) == uiDepth && pcTextureCU->getPartitionSize( uiAbsPartIdx ) != SIZE_NxN)
     811    {
     812      bParsePartSize = false;
     813      eMode          = SIZE_2Nx2N;
     814    }
     815  }
     816#endif
    773817 
    774818  if ( pcCU->isIntra( uiAbsPartIdx ) )
    775819  {
    776     uiSymbol = 1;
    777     if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth )
    778     {
    779       m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, 0) );
    780     }
    781     eMode = uiSymbol ? SIZE_2Nx2N : SIZE_NxN;
     820#if OL_QTLIMIT_PREDCODING_B0068
     821    if(bParsePartSize)
     822    {
     823#endif
     824      uiSymbol = 1;
     825      if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth )
     826      {
     827        m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, 0) );
     828      }
     829      eMode = uiSymbol ? SIZE_2Nx2N : SIZE_NxN;
     830#if OL_QTLIMIT_PREDCODING_B0068
     831    }
     832#endif
    782833    UInt uiTrLevel = 0;   
    783834    UInt uiWidthInBit  = g_aucConvertToBit[pcCU->getWidth(uiAbsPartIdx)]+2;
     
    795846  else
    796847  {
    797     UInt uiMaxNumBits = 2;
    798     if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth && !( pcCU->getSlice()->getSPS()->getDisInter4x4() && (g_uiMaxCUWidth>>uiDepth) == 8 && (g_uiMaxCUHeight>>uiDepth) == 8 ) )
    799     {
    800       uiMaxNumBits ++;
    801     }
    802     for ( UInt ui = 0; ui < uiMaxNumBits; ui++ )
    803     {
    804       m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, ui) );
    805       if ( uiSymbol )
    806       {
    807         break;
    808       }
    809       uiMode++;
    810     }
    811     eMode = (PartSize) uiMode;
    812     if ( pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) )
    813     {
    814       if (eMode == SIZE_2NxN)
    815       {
     848#if OL_QTLIMIT_PREDCODING_B0068
     849    if(bParsePartSize)
     850    {
     851#endif
     852      UInt uiMaxNumBits = 2;
     853      if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth && !( pcCU->getSlice()->getSPS()->getDisInter4x4() && (g_uiMaxCUWidth>>uiDepth) == 8 && (g_uiMaxCUHeight>>uiDepth) == 8 ) )
     854      {
     855        uiMaxNumBits ++;
     856      }
     857      for ( UInt ui = 0; ui < uiMaxNumBits; ui++ )
     858      {
     859        m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, ui) );
     860        if ( uiSymbol )
     861        {
     862          break;
     863        }
     864        uiMode++;
     865      }
     866      eMode = (PartSize) uiMode;
     867      if ( pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) )
     868      {
     869        if (eMode == SIZE_2NxN)
     870        {
     871#if AMP_CTX
     872            m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUAMPSCModel.get( 0, 0, 0 ));
     873#else
     874          m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUYPosiSCModel.get( 0, 0, 0 ));
     875#endif
     876          if (uiSymbol == 0)
     877          {
     878#if AMP_CTX
     879            m_pcTDecBinIf->decodeBinEP(uiSymbol);
     880#else
     881            m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUYPosiSCModel.get( 0, 0, 1 ));
     882#endif
     883            eMode = (uiSymbol == 0? SIZE_2NxnU : SIZE_2NxnD);
     884          }
     885        }
     886        else if (eMode == SIZE_Nx2N)
     887        {
    816888#if AMP_CTX
    817889          m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUAMPSCModel.get( 0, 0, 0 ));
    818890#else
    819         m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUYPosiSCModel.get( 0, 0, 0 ));
    820 #endif
    821         if (uiSymbol == 0)
    822         {
     891          m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUXPosiSCModel.get( 0, 0, 0 ));
     892#endif
     893          if (uiSymbol == 0)
     894          {
    823895#if AMP_CTX
    824           m_pcTDecBinIf->decodeBinEP(uiSymbol);
    825 #else
    826           m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUYPosiSCModel.get( 0, 0, 1 ));
    827 #endif
    828           eMode = (uiSymbol == 0? SIZE_2NxnU : SIZE_2NxnD);
     896            m_pcTDecBinIf->decodeBinEP(uiSymbol);
     897#else
     898            m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUXPosiSCModel.get( 0, 0, 1 ));
     899#endif
     900            eMode = (uiSymbol == 0? SIZE_nLx2N : SIZE_nRx2N);
     901          }
    829902        }
    830903      }
    831       else if (eMode == SIZE_Nx2N)
    832       {
    833 #if AMP_CTX
    834         m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUAMPSCModel.get( 0, 0, 0 ));
    835 #else
    836         m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUXPosiSCModel.get( 0, 0, 0 ));
    837 #endif
    838         if (uiSymbol == 0)
    839         {
    840 #if AMP_CTX
    841           m_pcTDecBinIf->decodeBinEP(uiSymbol);
    842 #else
    843           m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUXPosiSCModel.get( 0, 0, 1 ));
    844 #endif
    845           eMode = (uiSymbol == 0? SIZE_nLx2N : SIZE_nRx2N);
    846         }
    847       }
    848     }
     904#if OL_QTLIMIT_PREDCODING_B0068
     905    }
     906#endif
    849907  }
    850908  pcCU->setPartSizeSubParts( eMode, uiAbsPartIdx, uiDepth );
Note: See TracChangeset for help on using the changeset viewer.