Ticket #394: NewSliceModePatchForHM6.0rc1.patch

File NewSliceModePatchForHM6.0rc1.patch, 16.5 KB (added by shilin.xu, 10 years ago)
  • cfg/encoder_intra_he10.cfg

     
    6565SliceMode                : 0                # 0: Disable all slice options.
    6666                                            # 1: Enforce maximum number of LCU in an slice,
    6767                                            # 2: Enforce maximum number of bytes in an 'slice'
     68                                            # 3: Enforce maximum number of tiles in a slice
    6869SliceArgument            : 1500             # Argument for 'SliceMode'.
    6970                                            # If SliceMode==1 it represents max. SliceGranularity-sized blocks per slice.
    7071                                            # If SliceMode==2 it represents max. bytes per slice.
     72                                            # If SliceMode==3 it represents max. tiles per slice.
    7173
    7274LFCrossSliceBoundaryFlag : 1                # In-loop filtering, including ALF and DB, is across or not across slice boundary.
    7375                                            # 0:not across, 1: across
  • cfg/encoder_intra_main.cfg

     
    6666SliceMode                : 0                # 0: Disable all slice options.
    6767                                            # 1: Enforce maximum number of LCU in an slice,
    6868                                            # 2: Enforce maximum number of bytes in an 'slice'
     69                                            # 3: Enforce maximum number of tiles in a slice
    6970SliceArgument            : 1500             # Argument for 'SliceMode'.
    7071                                            # If SliceMode==1 it represents max. SliceGranularity-sized blocks per slice.
    7172                                            # If SliceMode==2 it represents max. bytes per slice.
     73                                            # If SliceMode==3 it represents max. tiles per slice.
    7274
    7375LFCrossSliceBoundaryFlag : 1                # In-loop filtering, including ALF and DB, is across or not across slice boundary.
    7476                                            # 0:not across, 1: across
  • cfg/encoder_lowdelay_he10.cfg

     
    7171SliceMode                : 0                # 0: Disable all slice options.
    7272                                            # 1: Enforce maximum number of LCU in an slice,
    7373                                            # 2: Enforce maximum number of bytes in an 'slice'
     74                                            # 3: Enforce maximum number of tiles in a slice
    7475SliceArgument            : 1500             # Argument for 'SliceMode'.
    7576                                            # If SliceMode==1 it represents max. SliceGranularity-sized blocks per slice.
    7677                                            # If SliceMode==2 it represents max. bytes per slice.
     78                                            # If SliceMode==3 it represents max. tiles per slice.
    7779
    7880LFCrossSliceBoundaryFlag : 1                # In-loop filtering, including ALF and DB, is across or not across slice boundary.
    7981                                            # 0:not across, 1: across
  • cfg/encoder_lowdelay_main.cfg

     
    7171SliceMode                : 0                # 0: Disable all slice options.
    7272                                            # 1: Enforce maximum number of LCU in an slice,
    7373                                            # 2: Enforce maximum number of bytes in an 'slice'
     74                                            # 3: Enforce maximum number of tiles in a slice
    7475SliceArgument            : 1500             # Argument for 'SliceMode'.
    7576                                            # If SliceMode==1 it represents max. SliceGranularity-sized blocks per slice.
    7677                                            # If SliceMode==2 it represents max. bytes per slice.
     78                                            # If SliceMode==3 it represents max. tiles per slice.
    7779
    7880LFCrossSliceBoundaryFlag : 1                # In-loop filtering, including ALF and DB, is across or not across slice boundary.
    7981                                            # 0:not across, 1: across
  • cfg/encoder_lowdelay_P_he10.cfg

     
    7171SliceMode                : 0                # 0: Disable all slice options.
    7272                                            # 1: Enforce maximum number of LCU in an slice,
    7373                                            # 2: Enforce maximum number of bytes in an 'slice'
     74                                            # 3: Enforce maximum number of tiles in a slice
    7475SliceArgument            : 1500             # Argument for 'SliceMode'.
    7576                                            # If SliceMode==1 it represents max. SliceGranularity-sized blocks per slice.
    7677                                            # If SliceMode==2 it represents max. bytes per slice.
     78                                            # If SliceMode==3 it represents max. tiles per slice.
    7779
    7880LFCrossSliceBoundaryFlag : 1                # In-loop filtering, including ALF and DB, is across or not across slice boundary.
    7981                                            # 0:not across, 1: across
  • cfg/encoder_lowdelay_P_main.cfg

     
    7171SliceMode                : 0                # 0: Disable all slice options.
    7272                                            # 1: Enforce maximum number of LCU in an slice,
    7373                                            # 2: Enforce maximum number of bytes in an 'slice'
     74                                            # 3: Enforce maximum number of tiles in a slice
    7475SliceArgument            : 1500             # Argument for 'SliceMode'.
    7576                                            # If SliceMode==1 it represents max. SliceGranularity-sized blocks per slice.
    7677                                            # If SliceMode==2 it represents max. bytes per slice.
     78                                            # If SliceMode==3 it represents max. tiles per slice.
    7779
    7880LFCrossSliceBoundaryFlag : 1                # In-loop filtering, including ALF and DB, is across or not across slice boundary.
    7981                                            # 0:not across, 1: across
  • cfg/encoder_randomaccess_he10.cfg

     
    7676SliceMode                : 0                # 0: Disable all slice options.
    7777                                            # 1: Enforce maximum number of LCU in an slice,
    7878                                            # 2: Enforce maximum number of bytes in an 'slice'
     79                                            # 3: Enforce maximum number of tiles in a slice
    7980SliceArgument            : 1500             # Argument for 'SliceMode'.
    8081                                            # If SliceMode==1 it represents max. SliceGranularity-sized blocks per slice.
    8182                                            # If SliceMode==2 it represents max. bytes per slice.
     83                                            # If SliceMode==3 it represents max. tiles per slice.
    8284
    8385LFCrossSliceBoundaryFlag : 1                # In-loop filtering, including ALF and DB, is across or not across slice boundary.
    8486                                            # 0:not across, 1: across
  • cfg/encoder_randomaccess_main.cfg

     
    7676SliceMode                : 0                # 0: Disable all slice options.
    7777                                            # 1: Enforce maximum number of LCU in an slice,
    7878                                            # 2: Enforce maximum number of bytes in an 'slice'
     79                                            # 3: Enforce maximum number of tiles in a slice
    7980SliceArgument            : 1500             # Argument for 'SliceMode'.
    8081                                            # If SliceMode==1 it represents max. SliceGranularity-sized blocks per slice.
    8182                                            # If SliceMode==2 it represents max. bytes per slice.
     83                                            # If SliceMode==3 it represents max. tiles per slice.
    8284
    8385LFCrossSliceBoundaryFlag : 1                # In-loop filtering, including ALF and DB, is across or not across slice boundary.
    8486                                            # 0:not across, 1: across
  • source/App/TAppEncoder/TAppEncCfg.cpp

     
    502502    xConfirmPara(  m_pcmLog2MaxSize < m_uiPCMLog2MinSize,                       "PCMLog2MaxSize must be equal to or greater than m_uiPCMLog2MinSize.");
    503503  }
    504504
    505   xConfirmPara( m_iSliceMode < 0 || m_iSliceMode > 2, "SliceMode exceeds supported range (0 to 2)" );
     505  xConfirmPara( m_iSliceMode < 0 || m_iSliceMode > 3, "SliceMode exceeds supported range (0 to 3)" );
    506506  if (m_iSliceMode!=0)
    507507  {
    508508    xConfirmPara( m_iSliceArgument < 1 ,         "SliceArgument should be larger than or equal to 1" );
    509509  }
     510  if (m_iSliceMode==3)
     511  {
     512    xConfirmPara( m_iSliceGranularity > 0 ,      "When SliceMode == 3 is chosen, the SliceGranularity must be 0" );
     513  }
    510514  xConfirmPara( m_iEntropySliceMode < 0 || m_iEntropySliceMode > 2, "EntropySliceMode exceeds supported range (0 to 2)" );
    511515  if (m_iEntropySliceMode!=0)
    512516  {
  • source/App/TAppEncoder/TAppEncTop.cpp

     
    189189  {
    190190    m_cTEncTop.setSliceArgument ( m_iSliceArgument * ( iNumPartInCU >> ( m_iSliceGranularity << 1 ) ) );
    191191  }
     192  if(m_iSliceMode==AD_HOC_SLICES_FIXED_NUMBER_OF_TILES_IN_SLICE)
     193  {
     194    m_cTEncTop.setSliceArgument ( m_iSliceArgument );
     195  }
    192196 
    193197  m_cTEncTop.setSliceGranularity        ( m_iSliceGranularity         );
    194198  if(m_iSliceMode == 0 )
  • source/Lib/TLibCommon/TypeDef.h

     
    198198
    199199#define AD_HOC_SLICES_FIXED_NUMBER_OF_LCU_IN_SLICE      1          ///< OPTION IDENTIFIER. mode==1 -> Limit maximum number of largest coding tree blocks in a slice
    200200#define AD_HOC_SLICES_FIXED_NUMBER_OF_BYTES_IN_SLICE    2          ///< OPTION IDENTIFIER. mode==2 -> Limit maximum number of bins/bits in a slice
     201#define AD_HOC_SLICES_FIXED_NUMBER_OF_TILES_IN_SLICE    3
    201202
    202203// Entropy slice options
    203204#define SHARP_FIXED_NUMBER_OF_LCU_IN_ENTROPY_SLICE            1          ///< OPTION IDENTIFIER. Limit maximum number of largest coding tree blocks in an entropy slice
  • source/Lib/TLibEncoder/TEncSlice.cpp

     
    11561156{
    11571157  TComSlice* pcSlice = rpcPic->getSlice(getSliceIdx());
    11581158  UInt uiStartCUAddrSlice, uiBoundingCUAddrSlice;
     1159  UInt uiCUAddrIncrement;
     1160  UInt uiTileIdxIncrement;
     1161  UInt uiTileIdx;
     1162  UInt uiTileWidthInLcu;
     1163  UInt uiTileHeightInLcu;
     1164  UInt uiTileTotalCount;
     1165
    11591166  uiStartCUAddrSlice        = pcSlice->getSliceCurStartCUAddr();
    11601167  UInt uiNumberOfCUsInFrame = rpcPic->getNumCUsInFrame();
    11611168  uiBoundingCUAddrSlice     = uiNumberOfCUsInFrame;
    11621169  if (bEncodeSlice)
    11631170  {
    1164     UInt uiCUAddrIncrement;
    11651171    switch (m_pcCfg->getSliceMode())
    11661172    {
    11671173    case AD_HOC_SLICES_FIXED_NUMBER_OF_LCU_IN_SLICE:
     
    11721178      uiCUAddrIncrement        = rpcPic->getNumCUsInFrame();
    11731179      uiBoundingCUAddrSlice    = pcSlice->getSliceCurEndCUAddr();
    11741180      break;
     1181    case AD_HOC_SLICES_FIXED_NUMBER_OF_TILES_IN_SLICE:
     1182      uiTileIdx                = rpcPic->getPicSym()->getTileIdxMap(
     1183        rpcPic->getPicSym()->getCUOrderMap(uiStartCUAddrSlice/rpcPic->getNumPartInCU())
     1184        );
     1185      uiCUAddrIncrement        = 0;
     1186      uiTileTotalCount         = (rpcPic->getPicSym()->getNumColumnsMinus1()+1) * (rpcPic->getPicSym()->getNumRowsMinus1()+1);
     1187
     1188      for(uiTileIdxIncrement = 0; uiTileIdxIncrement < m_pcCfg->getSliceArgument(); uiTileIdxIncrement++)
     1189      {
     1190        if((uiTileIdx + uiTileIdxIncrement) < uiTileTotalCount)
     1191        {
     1192          uiTileWidthInLcu   = rpcPic->getPicSym()->getTComTile(uiTileIdx + uiTileIdxIncrement)->getTileWidth();
     1193          uiTileHeightInLcu  = rpcPic->getPicSym()->getTComTile(uiTileIdx + uiTileIdxIncrement)->getTileHeight();
     1194          uiCUAddrIncrement += (uiTileWidthInLcu * uiTileHeightInLcu * rpcPic->getNumPartInCU()) >> (m_pcCfg->getSliceGranularity() << 1);
     1195        }
     1196      }
     1197
     1198      uiBoundingCUAddrSlice    = ((uiStartCUAddrSlice + uiCUAddrIncrement) < uiNumberOfCUsInFrame*rpcPic->getNumPartInCU()) ? (uiStartCUAddrSlice + uiCUAddrIncrement) : uiNumberOfCUsInFrame*rpcPic->getNumPartInCU();
     1199      break;
    11751200    default:
    11761201      uiCUAddrIncrement        = rpcPic->getNumCUsInFrame();
    11771202      uiBoundingCUAddrSlice    = uiNumberOfCUsInFrame*rpcPic->getNumPartInCU();
     
    11811206  }
    11821207  else
    11831208  {
    1184     UInt uiCUAddrIncrement     ;
    11851209    switch (m_pcCfg->getSliceMode())
    11861210    {
    11871211    case AD_HOC_SLICES_FIXED_NUMBER_OF_LCU_IN_SLICE:
    11881212      uiCUAddrIncrement        = m_pcCfg->getSliceArgument();
    11891213      uiBoundingCUAddrSlice    = ((uiStartCUAddrSlice + uiCUAddrIncrement) < uiNumberOfCUsInFrame*rpcPic->getNumPartInCU()) ? (uiStartCUAddrSlice + uiCUAddrIncrement) : uiNumberOfCUsInFrame*rpcPic->getNumPartInCU();
    11901214      break;
     1215    case AD_HOC_SLICES_FIXED_NUMBER_OF_TILES_IN_SLICE:
     1216      uiTileIdx                = rpcPic->getPicSym()->getTileIdxMap(
     1217        rpcPic->getPicSym()->getCUOrderMap(uiStartCUAddrSlice/rpcPic->getNumPartInCU())
     1218        );
     1219      uiCUAddrIncrement        = 0;
     1220      uiTileTotalCount         = (rpcPic->getPicSym()->getNumColumnsMinus1()+1) * (rpcPic->getPicSym()->getNumRowsMinus1()+1);
     1221
     1222      for(uiTileIdxIncrement = 0; uiTileIdxIncrement < m_pcCfg->getSliceArgument(); uiTileIdxIncrement++)
     1223      {
     1224        if((uiTileIdx + uiTileIdxIncrement) < uiTileTotalCount)
     1225        {
     1226          uiTileWidthInLcu   = rpcPic->getPicSym()->getTComTile(uiTileIdx + uiTileIdxIncrement)->getTileWidth();
     1227          uiTileHeightInLcu  = rpcPic->getPicSym()->getTComTile(uiTileIdx + uiTileIdxIncrement)->getTileHeight();
     1228          uiCUAddrIncrement += (uiTileWidthInLcu * uiTileHeightInLcu * rpcPic->getNumPartInCU()) >> (m_pcCfg->getSliceGranularity() << 1);
     1229        }
     1230      }
     1231
     1232      uiBoundingCUAddrSlice    = ((uiStartCUAddrSlice + uiCUAddrIncrement) < uiNumberOfCUsInFrame*rpcPic->getNumPartInCU()) ? (uiStartCUAddrSlice + uiCUAddrIncrement) : uiNumberOfCUsInFrame*rpcPic->getNumPartInCU();
     1233      break;
    11911234    default:
    11921235      uiCUAddrIncrement        = rpcPic->getNumCUsInFrame();
    11931236      uiBoundingCUAddrSlice    = uiNumberOfCUsInFrame*rpcPic->getNumPartInCU();
     
    12981341    // first. Set the flags accordingly.
    12991342    if ( (m_pcCfg->getSliceMode()==AD_HOC_SLICES_FIXED_NUMBER_OF_LCU_IN_SLICE && m_pcCfg->getEntropySliceMode()==SHARP_FIXED_NUMBER_OF_LCU_IN_ENTROPY_SLICE)
    13001343      || (m_pcCfg->getSliceMode()==0 && m_pcCfg->getEntropySliceMode()==SHARP_FIXED_NUMBER_OF_LCU_IN_ENTROPY_SLICE)
    1301       || (m_pcCfg->getSliceMode()==AD_HOC_SLICES_FIXED_NUMBER_OF_LCU_IN_SLICE && m_pcCfg->getEntropySliceMode()==0) )
     1344      || (m_pcCfg->getSliceMode()==AD_HOC_SLICES_FIXED_NUMBER_OF_LCU_IN_SLICE && m_pcCfg->getEntropySliceMode()==0)
     1345      || (m_pcCfg->getSliceMode()==AD_HOC_SLICES_FIXED_NUMBER_OF_TILES_IN_SLICE && m_pcCfg->getEntropySliceMode()==SHARP_FIXED_NUMBER_OF_LCU_IN_ENTROPY_SLICE)
     1346      || (m_pcCfg->getSliceMode()==AD_HOC_SLICES_FIXED_NUMBER_OF_TILES_IN_SLICE && m_pcCfg->getEntropySliceMode()==0) )
    13021347    {
    13031348      if (uiBoundingCUAddrSlice < uiBoundingCUAddrEntropySlice)
    13041349      {