Ticket #394: NewSliceModePatchForHM6.0dev_r0.patch

File NewSliceModePatchForHM6.0dev_r0.patch, 16.8 KB (added by shilin.xu, 12 years ago)
  • cfg/encoder_intra_he10.cfg

     
    6464SliceMode                : 0                # 0: Disable all slice options.
    6565                                            # 1: Enforce maximum number of LCU in an slice,
    6666                                            # 2: Enforce maximum number of bytes in an 'slice'
     67                                            # 3: Enforce maximum number of tiles in a slice
    6768SliceArgument            : 1500             # Argument for 'SliceMode'.
    6869                                            # If SliceMode==1 it represents max. SliceGranularity-sized blocks per slice.
    6970                                            # If SliceMode==2 it represents max. bytes per slice.
     71                                            # If SliceMode==3 it represents max. tiles per slice.
    7072
    7173LFCrossSliceBoundaryFlag : 1                # In-loop filtering, including ALF and DB, is across or not across slice boundary.
    7274                                            # 0:not across, 1: across
  • cfg/encoder_intra_main.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_lowdelay_he10.cfg

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

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

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

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

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

     
    7575SliceMode                : 0                # 0: Disable all slice options.
    7676                                            # 1: Enforce maximum number of LCU in an slice,
    7777                                            # 2: Enforce maximum number of bytes in an 'slice'
     78                                            # 3: Enforce maximum number of tiles in a slice
    7879SliceArgument            : 1500             # Argument for 'SliceMode'.
    7980                                            # If SliceMode==1 it represents max. SliceGranularity-sized blocks per slice.
    8081                                            # If SliceMode==2 it represents max. bytes per slice.
     82                                            # If SliceMode==3 it represents max. tiles per slice.
    8183
    8284LFCrossSliceBoundaryFlag : 1                # In-loop filtering, including ALF and DB, is across or not across slice boundary.
    8385                                            # 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#if FIXED_NUMBER_OF_TILES_SLICE_MODE
     506  xConfirmPara( m_iSliceMode < 0 || m_iSliceMode > 3, "SliceMode exceeds supported range (0 to 3)" );
     507#endif
    506508  if (m_iSliceMode!=0)
    507509  {
    508510    xConfirmPara( m_iSliceArgument < 1 ,         "SliceArgument should be larger than or equal to 1" );
    509511  }
     512#if FIXED_NUMBER_OF_TILES_SLICE_MODE
     513  if (m_iSliceMode==3)
     514  {
     515    xConfirmPara( m_iSliceGranularity > 0 ,      "When SliceMode == 3 is chosen, the SliceGranularity must be 0" );
     516  }
     517#endif
    510518  xConfirmPara( m_iEntropySliceMode < 0 || m_iEntropySliceMode > 2, "EntropySliceMode exceeds supported range (0 to 2)" );
    511519  if (m_iEntropySliceMode!=0)
    512520  {
  • source/App/TAppEncoder/TAppEncTop.cpp

     
    207207  {
    208208    m_cTEncTop.setSliceArgument ( m_iSliceArgument * ( iNumPartInCU >> ( m_iSliceGranularity << 1 ) ) );
    209209  }
     210#if FIXED_NUMBER_OF_TILES_SLICE_MODE
     211  if(m_iSliceMode==AD_HOC_SLICES_FIXED_NUMBER_OF_TILES_IN_SLICE)
     212  {
     213    m_cTEncTop.setSliceArgument ( m_iSliceArgument );
     214  }
     215#endif
    210216 
    211217  m_cTEncTop.setSliceGranularity        ( m_iSliceGranularity         );
    212218  if(m_iSliceMode == 0 )
  • source/Lib/TLibCommon/TypeDef.h

     
    211211
    212212#define FULL_NBIT 0 ///< When enabled, does not use g_uiBitIncrement anymore to support > 8 bit data
    213213
     214#define FIXED_NUMBER_OF_TILES_SLICE_MODE                1
    214215#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
    215216#define AD_HOC_SLICES_FIXED_NUMBER_OF_BYTES_IN_SLICE    2          ///< OPTION IDENTIFIER. mode==2 -> Limit maximum number of bins/bits in a slice
     217#if FIXED_NUMBER_OF_TILES_SLICE_MODE
     218#define AD_HOC_SLICES_FIXED_NUMBER_OF_TILES_IN_SLICE    3
     219#endif
    216220
    217221// Entropy slice options
    218222#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

     
    12261226{
    12271227  TComSlice* pcSlice = rpcPic->getSlice(getSliceIdx());
    12281228  UInt uiStartCUAddrSlice, uiBoundingCUAddrSlice;
     1229#if FIXED_NUMBER_OF_TILES_SLICE_MODE
     1230  UInt tileIdxIncrement;
     1231  UInt tileIdx;
     1232  UInt tileWidthInLcu;
     1233  UInt tileHeightInLcu;
     1234  UInt tileTotalCount;
     1235#endif
     1236
    12291237  uiStartCUAddrSlice        = pcSlice->getSliceCurStartCUAddr();
    12301238  UInt uiNumberOfCUsInFrame = rpcPic->getNumCUsInFrame();
    12311239  uiBoundingCUAddrSlice     = uiNumberOfCUsInFrame;
     
    12421250      uiCUAddrIncrement        = rpcPic->getNumCUsInFrame();
    12431251      uiBoundingCUAddrSlice    = pcSlice->getSliceCurEndCUAddr();
    12441252      break;
     1253#if FIXED_NUMBER_OF_TILES_SLICE_MODE
     1254    case AD_HOC_SLICES_FIXED_NUMBER_OF_TILES_IN_SLICE:
     1255      tileIdx                = rpcPic->getPicSym()->getTileIdxMap(
     1256        rpcPic->getPicSym()->getCUOrderMap(uiStartCUAddrSlice/rpcPic->getNumPartInCU())
     1257        );
     1258      uiCUAddrIncrement        = 0;
     1259      tileTotalCount         = (rpcPic->getPicSym()->getNumColumnsMinus1()+1) * (rpcPic->getPicSym()->getNumRowsMinus1()+1);
     1260
     1261      for(tileIdxIncrement = 0; tileIdxIncrement < m_pcCfg->getSliceArgument(); tileIdxIncrement++)
     1262      {
     1263        if((tileIdx + tileIdxIncrement) < tileTotalCount)
     1264        {
     1265          tileWidthInLcu   = rpcPic->getPicSym()->getTComTile(tileIdx + tileIdxIncrement)->getTileWidth();
     1266          tileHeightInLcu  = rpcPic->getPicSym()->getTComTile(tileIdx + tileIdxIncrement)->getTileHeight();
     1267          uiCUAddrIncrement += (tileWidthInLcu * tileHeightInLcu * rpcPic->getNumPartInCU()) >> (m_pcCfg->getSliceGranularity() << 1);
     1268        }
     1269      }
     1270
     1271      uiBoundingCUAddrSlice    = ((uiStartCUAddrSlice + uiCUAddrIncrement) < uiNumberOfCUsInFrame*rpcPic->getNumPartInCU()) ? (uiStartCUAddrSlice + uiCUAddrIncrement) : uiNumberOfCUsInFrame*rpcPic->getNumPartInCU();
     1272      break;
     1273#endif
    12451274    default:
    12461275      uiCUAddrIncrement        = rpcPic->getNumCUsInFrame();
    12471276      uiBoundingCUAddrSlice    = uiNumberOfCUsInFrame*rpcPic->getNumPartInCU();
     
    12581287      uiCUAddrIncrement        = m_pcCfg->getSliceArgument();
    12591288      uiBoundingCUAddrSlice    = ((uiStartCUAddrSlice + uiCUAddrIncrement) < uiNumberOfCUsInFrame*rpcPic->getNumPartInCU()) ? (uiStartCUAddrSlice + uiCUAddrIncrement) : uiNumberOfCUsInFrame*rpcPic->getNumPartInCU();
    12601289      break;
     1290#if FIXED_NUMBER_OF_TILES_SLICE_MODE
     1291    case AD_HOC_SLICES_FIXED_NUMBER_OF_TILES_IN_SLICE:
     1292      tileIdx                = rpcPic->getPicSym()->getTileIdxMap(
     1293        rpcPic->getPicSym()->getCUOrderMap(uiStartCUAddrSlice/rpcPic->getNumPartInCU())
     1294        );
     1295      uiCUAddrIncrement        = 0;
     1296      tileTotalCount         = (rpcPic->getPicSym()->getNumColumnsMinus1()+1) * (rpcPic->getPicSym()->getNumRowsMinus1()+1);
     1297
     1298      for(tileIdxIncrement = 0; tileIdxIncrement < m_pcCfg->getSliceArgument(); tileIdxIncrement++)
     1299      {
     1300        if((tileIdx + tileIdxIncrement) < tileTotalCount)
     1301        {
     1302          tileWidthInLcu   = rpcPic->getPicSym()->getTComTile(tileIdx + tileIdxIncrement)->getTileWidth();
     1303          tileHeightInLcu  = rpcPic->getPicSym()->getTComTile(tileIdx + tileIdxIncrement)->getTileHeight();
     1304          uiCUAddrIncrement += (tileWidthInLcu * tileHeightInLcu * rpcPic->getNumPartInCU()) >> (m_pcCfg->getSliceGranularity() << 1);
     1305        }
     1306      }
     1307
     1308      uiBoundingCUAddrSlice    = ((uiStartCUAddrSlice + uiCUAddrIncrement) < uiNumberOfCUsInFrame*rpcPic->getNumPartInCU()) ? (uiStartCUAddrSlice + uiCUAddrIncrement) : uiNumberOfCUsInFrame*rpcPic->getNumPartInCU();
     1309      break;
     1310#endif
    12611311    default:
    12621312      uiCUAddrIncrement        = rpcPic->getNumCUsInFrame();
    12631313      uiBoundingCUAddrSlice    = uiNumberOfCUsInFrame*rpcPic->getNumPartInCU();
     
    13681418    // first. Set the flags accordingly.
    13691419    if ( (m_pcCfg->getSliceMode()==AD_HOC_SLICES_FIXED_NUMBER_OF_LCU_IN_SLICE && m_pcCfg->getEntropySliceMode()==SHARP_FIXED_NUMBER_OF_LCU_IN_ENTROPY_SLICE)
    13701420      || (m_pcCfg->getSliceMode()==0 && m_pcCfg->getEntropySliceMode()==SHARP_FIXED_NUMBER_OF_LCU_IN_ENTROPY_SLICE)
    1371       || (m_pcCfg->getSliceMode()==AD_HOC_SLICES_FIXED_NUMBER_OF_LCU_IN_SLICE && m_pcCfg->getEntropySliceMode()==0) )
     1421      || (m_pcCfg->getSliceMode()==AD_HOC_SLICES_FIXED_NUMBER_OF_LCU_IN_SLICE && m_pcCfg->getEntropySliceMode()==0)
     1422#if FIXED_NUMBER_OF_TILES_SLICE_MODE
     1423      || (m_pcCfg->getSliceMode()==AD_HOC_SLICES_FIXED_NUMBER_OF_TILES_IN_SLICE && m_pcCfg->getEntropySliceMode()==SHARP_FIXED_NUMBER_OF_LCU_IN_ENTROPY_SLICE)
     1424      || (m_pcCfg->getSliceMode()==AD_HOC_SLICES_FIXED_NUMBER_OF_TILES_IN_SLICE && m_pcCfg->getEntropySliceMode()==0)
     1425#endif
     1426)
    13721427    {
    13731428      if (uiBoundingCUAddrSlice < uiBoundingCUAddrEntropySlice)
    13741429      {