Ticket #392: bugfix_for_ticket_392_v1.patch

File bugfix_for_ticket_392_v1.patch, 4.7 KB (added by shibahara, 12 years ago)
  • Lib/TLibCommon/TypeDef.h

     
    6868#define CLIPSCALEDMVP               1  ///< H0216: Clipping scaled MV to 16 bit
    6969
    7070#define UNIFIED_TRANSFORM_TREE      1   ///< H0123: unified tree structure for TU
     71#define FIX_TICKET_392              1   ///< Fix Ticket #392 (encoder decoder mismatch occures when QP_adaptation enabled)
    7172
    7273#define SIGMAP_CTX_SUBBLOCK       1 ///< H0290: 4x4 sub-block based region for significant_flag context selection
    7374
  • Lib/TLibDecoder/TDecEntropy.cpp

     
    593593  const UInt uiLog2TrafoSize = g_aucConvertToBit[pcCU->getSlice()->getSPS()->getMaxCUWidth()]+2 - uiDepth;
    594594
    595595#if UNIFIED_TRANSFORM_TREE
     596#if FIX_TICKET_392 && UNIFIED_TRANSFORM_TREE
     597  if(uiTrIdx==0)
     598  {
     599    m_bakAbsPartIdxCU = uiAbsPartIdx;
     600  }
     601#endif
    596602  if( uiLog2TrafoSize == 2 )
    597603  {
    598604    UInt partNum = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 );
     
    814820      {
    815821        if ( bCodeDQP )
    816822        {
     823#if FIX_TICKET_392 && UNIFIED_TRANSFORM_TREE
     824          decodeQP( pcCU, m_bakAbsPartIdxCU);
     825#else
    817826          decodeQP( pcCU, uiAbsPartIdx, uiDepth);
     827#endif
    818828          bCodeDQP = false;
    819829        }
    820830      }
     
    881891}
    882892#endif // UNIFIED_TRANSFORM_TREE
    883893
     894#if FIX_TICKET_392 && UNIFIED_TRANSFORM_TREE
     895Void TDecEntropy::decodeQP          ( TComDataCU* pcCU, UInt uiAbsPartIdx )
     896{
     897  if ( pcCU->getSlice()->getPPS()->getUseDQP() )
     898  {
     899    m_pcEntropyDecoderIf->parseDeltaQP( pcCU, uiAbsPartIdx, pcCU->getDepth( uiAbsPartIdx ) );
     900  }
     901}
     902#else
    884903Void TDecEntropy::decodeQP          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    885904{
    886905  if ( pcCU->getSlice()->getPPS()->getUseDQP() )
     
    888907    m_pcEntropyDecoderIf->parseDeltaQP( pcCU, uiAbsPartIdx, uiDepth );
    889908  }
    890909}
     910#endif
    891911
    892912#if !UNIFIED_TRANSFORM_TREE
    893913Void TDecEntropy::xDecodeCoeff( TComDataCU* pcCU, UInt uiLumaOffset, UInt uiChromaOffset, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, UInt uiTrIdx, UInt uiCurrTrIdx, Bool& bCodeDQP )
  • Lib/TLibDecoder/TDecEntropy.h

     
    166166  TComPrediction* m_pcPrediction;
    167167  UInt    m_uiBakAbsPartIdx;
    168168  UInt    m_uiBakChromaOffset;
     169#if FIX_TICKET_392 && UNIFIED_TRANSFORM_TREE
     170  UInt    m_bakAbsPartIdxCU;
     171#endif
    169172 
    170173public:
    171174  Void init (TComPrediction* p) {m_pcPrediction = p;}
     
    231234#if !UNIFIED_TRANSFORM_TREE
    232235  Void decodeTransformIdx      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    233236#endif
     237#if FIX_TICKET_392 && UNIFIED_TRANSFORM_TREE
     238  Void decodeQP                ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     239#else
    234240  Void decodeQP                ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     241#endif
    235242 
    236243  Void readTileMarker         ( UInt& uiTileIdx, UInt uiBitsUsed )  {  m_pcEntropyDecoderIf->readTileMarker( uiTileIdx, uiBitsUsed ); }
    237244  Void updateContextTables    ( SliceType eSliceType, Int iQp ) { m_pcEntropyDecoderIf->updateContextTables( eSliceType, iQp ); }
  • Lib/TLibEncoder/TEncEntropy.cpp

     
    947947  UInt cbfU = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrIdx );
    948948  UInt cbfV = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrIdx );
    949949
     950#if FIX_TICKET_392 && UNIFIED_TRANSFORM_TREE
     951  if(uiTrIdx==0)
     952  {
     953    m_bakAbsPartIdxCU = uiAbsPartIdx;
     954  }
     955#endif
    950956  if( uiLog2TrafoSize == 2 )
    951957  {
    952958    UInt partNum = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 );
     
    11651171        {
    11661172          if ( bCodeDQP )
    11671173          {
     1174#if FIX_TICKET_392 && UNIFIED_TRANSFORM_TREE
     1175            encodeQP( pcCU, m_bakAbsPartIdxCU );
     1176#else
    11681177            encodeQP( pcCU, uiAbsPartIdx );
     1178#endif
    11691179            bCodeDQP = false;
    11701180          }
    11711181        }
  • Lib/TLibEncoder/TEncEntropy.h

     
    165165private:
    166166  UInt    m_uiBakAbsPartIdx;
    167167  UInt    m_uiBakChromaOffset;
     168#if FIX_TICKET_392 && UNIFIED_TRANSFORM_TREE
     169  UInt    m_bakAbsPartIdxCU;
     170#endif
    168171
    169172public:
    170173  Void    setEntropyCoder           ( TEncEntropyIf* e, TComSlice* pcSlice );