Ticket #555: bug_fix_rdoq_rem.patch

File bug_fix_rdoq_rem.patch, 3.2 KB (added by wchien, 12 years ago)
  • Lib/TLibCommon/TComRom.cpp

     
    494494};
    495495#endif
    496496
     497#if !FIX_COEF_REMAIN_BINARNIZATION
    497498// Rice parameters for absolute transform levels
    498499const UInt g_auiGoRiceRange[5] =
    499500{
     
    504505{
    505506  8, 7, 6, 5, 4
    506507};
     508#endif
    507509
    508510#if !SIMPLE_PARAM_UPDATE
    509511const UInt g_aauiGoRiceUpdate[5][24] =
  • Lib/TLibCommon/TComRom.h

     
    137137extern const UInt   g_uiLastCtx[ 28 ];
    138138#endif
    139139
     140#if !FIX_COEF_REMAIN_BINARNIZATION
    140141extern const UInt   g_auiGoRiceRange[5];                  //!< maximum value coded with Rice codes
    141142extern const UInt   g_auiGoRicePrefixLen[5];              //!< prefix length for each maximum value
     143#endif
    142144#if !SIMPLE_PARAM_UPDATE
    143145extern const UInt   g_aauiGoRiceUpdate[5][24];            //!< parameter update rules for Rice codes
    144146#endif
  • Lib/TLibCommon/TComTrQuant.cpp

     
    26232623
    26242624  if ( uiAbsLevel >= baseLevel )
    26252625  {
     2626#if FIX_COEF_REMAIN_BINARNIZATION
     2627    UInt symbol     = uiAbsLevel - baseLevel;
     2628    UInt length;
     2629    if (symbol < (8 << ui16AbsGoRice))
     2630    {
     2631      length = symbol>>ui16AbsGoRice;
     2632      iRate += (length+1+ui16AbsGoRice)<< 15;
     2633    }
     2634    else
     2635    {
     2636      length = ui16AbsGoRice;
     2637      symbol  = symbol - ( 8 << ui16AbsGoRice);   
     2638      while (symbol >= (1<<length))
     2639      {
     2640        symbol -=  (1<<(length++));   
     2641      }
     2642      iRate += (8+length+1-ui16AbsGoRice+length)<< 15;
     2643    }
     2644#else
    26262645    UInt uiSymbol     = uiAbsLevel - baseLevel;
    26272646    UInt uiMaxVlc     = g_auiGoRiceRange[ ui16AbsGoRice ];
    26282647    Bool bExpGolomb   = ( uiSymbol > uiMaxVlc );
     
    26392658    UShort ui16NumBins = min<UInt>( ui16PrefLen, g_auiGoRicePrefixLen[ ui16AbsGoRice ] ) + ui16AbsGoRice;
    26402659
    26412660    iRate += ui16NumBins << 15;
     2661#endif
    26422662
    26432663    if (c1Idx < C1FLAG_NUMBER)
    26442664    {
  • Lib/TLibCommon/TypeDef.h

     
    4040
    4141//! \ingroup TLibCommon
    4242//! \{
     43#define FIX_COEF_REMAIN_BINARNIZATION    1
    4344#define REMOVE_LASTTU_CBFDERIV           1  ///< I0152: CBF coding for last TU without derivation process
    4445
    4546#define INTRAMODE_BYPASSGROUP            1  ///< I0302: group coding of Intra_NxN
  • Lib/TLibDecoder/TDecSbac.cpp

     
    344344    m_pcTDecBinIf->decodeBinEP( codeWord );
    345345  }
    346346  while( codeWord);
     347#if FIX_COEF_REMAIN_BINARNIZATION
     348  prefix--;
     349#else
    347350  codeWord  = 1 - codeWord;
    348351  prefix -= codeWord;
    349352  codeWord=0;
     353#endif
    350354  if (prefix < 8 )
    351355  {
    352356    m_pcTDecBinIf->decodeBinsEP(codeWord,rParam);