Ticket #456: fix_ticket456.patch

File fix_ticket456.patch, 3.6 KB (added by chihming.fu, 12 years ago)

Put ALF and SAO flag at the location as CD described

  • Lib/TLibCommon/TypeDef.h

     
    4040
    4141//! \ingroup TLibCommon
    4242//! \{
     43
     44
    4345#define FAST_DECISION_FOR_MRG_RD_COST  1 ////< H0178: Fast Decision for Merge 2Nx2N RDCost
    4446
    4547#define REMOVE_DIV_OPERATION      1 ///< H0238: Simplified intra horizontal and vertical filtering
  • Lib/TLibDecoder/TDecCAVLC.cpp

     
    16711671        pcRPS->setNumberOfPictures(offset);       
    16721672      } 
    16731673    }
    1674     if(sps->getUseSAO() || sps->getUseALF() || sps->getScalingListFlag() || sps->getUseDF())
    1675     {
    1676       //!!!KS: order is different in WD5!
    1677       if (sps->getUseALF())
    1678       {
    1679         READ_FLAG(uiCode, "slice_adaptive_loop_filter_flag");
    1680         rpcSlice->setAlfEnabledFlag((Bool)uiCode);
    1681       }
    16821674      if (sps->getUseSAO())
    16831675      {
    16841676#if SAO_UNIT_INTERLEAVING
     
    16981690        }
    16991691#endif
    17001692      }
     1693#if SAO_UNIT_INTERLEAVING
     1694    if( (sps->getUseSAO()&& !rpcSlice->getSaoInterleavingFlag() ) || sps->getUseALF() || sps->getScalingListFlag() || sps->getUseDF())
     1695#else
     1696    if( sps->getUseSAO() || sps->getUseALF() || sps->getScalingListFlag() || sps->getUseDF())
     1697#endif
     1698    {
    17011699      READ_UVLC (    uiCode, "aps_id" );  rpcSlice->setAPSId(uiCode);
    17021700    }
    17031701    if (!rpcSlice->isIntra())
     
    19291927#if PARAMSET_VLC_CLEANUP
    19301928  if (!bEntropySlice)
    19311929  {
     1930    if (sps->getUseALF())
     1931    {
     1932      READ_FLAG(uiCode, "slice_adaptive_loop_filter_flag");
     1933      rpcSlice->setAlfEnabledFlag((Bool)uiCode);
     1934    }
     1935
    19321936    if(sps->getUseALF() && rpcSlice->getAlfEnabledFlag())
    19331937    {
    19341938      UInt uiNumLCUsInWidth   = sps->getWidth()  / g_uiMaxCUWidth;
  • Lib/TLibEncoder/TEncCavlc.cpp

     
    608608        }
    609609      }
    610610    }
    611     if(pcSlice->getSPS()->getUseSAO() || pcSlice->getSPS()->getUseALF()|| pcSlice->getSPS()->getScalingListFlag() || pcSlice->getSPS()->getUseDF())
    612     {
    613       if (pcSlice->getSPS()->getUseALF())
    614       {
    615 #if !LCU_SYNTAX_ALF
    616          if (pcSlice->getAlfEnabledFlag())
    617          {
    618            assert (pcSlice->getAPS()->getAlfEnabled());
    619          }
    620 #endif
    621          WRITE_FLAG( pcSlice->getAlfEnabledFlag(), "ALF on/off flag in slice header" );
    622       }
    623611      if (pcSlice->getSPS()->getUseSAO())
    624612      {
    625613#if SAO_UNIT_INTERLEAVING
     
    635623         }
    636624#endif
    637625      }
     626#if SAO_UNIT_INTERLEAVING
     627    if((pcSlice->getSPS()->getUseSAO() && !pcSlice->getSaoInterleavingFlag() ) || pcSlice->getSPS()->getUseALF()|| pcSlice->getSPS()->getScalingListFlag() || pcSlice->getSPS()->getUseDF())
     628#else
     629    if(pcSlice->getSPS()->getUseSAO() || pcSlice->getSPS()->getUseALF()|| pcSlice->getSPS()->getScalingListFlag() || pcSlice->getSPS()->getUseDF())
     630#endif
     631    {
    638632      WRITE_UVLC( pcSlice->getAPS()->getAPSID(), "aps_id");
    639633    }
    640634
     
    770764  assert(pcSlice->getMaxNumMergeCand()<=MRG_MAX_NUM_CANDS_SIGNALED);
    771765  assert(MRG_MAX_NUM_CANDS_SIGNALED<=MRG_MAX_NUM_CANDS);
    772766  WRITE_UVLC(MRG_MAX_NUM_CANDS - pcSlice->getMaxNumMergeCand(), "maxNumMergeCand");
     767
     768  if (!bEntropySlice)
     769  {
     770    if (pcSlice->getSPS()->getUseALF())
     771    {
     772      WRITE_FLAG( pcSlice->getAlfEnabledFlag(), "slice_adaptive_loop_filter_flag" );
     773    }
     774  }
     775
     776
    773777}
    774778
    775779