Changeset 294 in 3DVCSoftware


Ignore:
Timestamp:
19 Feb 2013, 20:33:52 (11 years ago)
Author:
tech
Message:

Removed HM-6.1 related guard macros.

Location:
branches/HTM-5.1-dev0/source
Files:
77 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-5.1-dev0/source/App/TAppDecoder/TAppDecTop.cpp

    r289 r294  
    369369      if(newPicture[viewDepthId])
    370370      {
    371 #if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER
    372371        xWriteOutput( pcListPic[viewDepthId], viewDepthId, nalu.m_temporalId );
    373 #else
    374         xWriteOutput( pcListPic[viewDepthId], viewDepthId );
    375 #endif
    376372      }
    377373    }
     
    440436}
    441437
    442 #if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER
    443438Void TAppDecTop::xWriteOutput( TComList<TComPic*>* pcListPic, Int viewDepthId, UInt tId )
    444 #else
    445 Void TAppDecTop::xWriteOutput( TComList<TComPic*>* pcListPic, Int viewDepthId )
    446 #endif
    447439{
    448440  TComList<TComPic*>::iterator iterPic   = pcListPic->begin();
     
    463455  {
    464456    TComPic* pcPic = *(iterPic);
    465 #if PIC_CROPPING
    466457    TComSPS *sps = pcPic->getSlice(0)->getSPS();
    467 #endif
    468458   
    469 #if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER
    470459    if ( pcPic->getOutputMark() && (not_displayed >  pcPic->getSlice(0)->getSPS()->getNumReorderPics(tId) && pcPic->getPOC() > m_pocLastDisplay[viewDepthId]))
    471 #else
    472     if ( pcPic->getOutputMark() && (not_displayed >  pcPic->getSlice(0)->getSPS()->getNumReorderFrames() && pcPic->getPOC() > m_pocLastDisplay[viewDepthId]))
    473 #endif
    474460    {
    475461      // write to file
     
    477463      if ( m_pchReconFile )
    478464      {
    479 #if PIC_CROPPING
    480465        m_tVideoIOYuvReconFile[viewDepthId]->write( pcPic->getPicYuvRec(), sps->getPicCropLeftOffset(), sps->getPicCropRightOffset(), sps->getPicCropTopOffset(), sps->getPicCropBottomOffset() );
    481 #else
    482         m_tVideoIOYuvReconFile[viewDepthId]->write( pcPic->getPicYuvRec(), pcPic->getSlice(0)->getSPS()->getPad() );
    483 #endif
    484466      }
    485467     
     
    526508  {
    527509    TComPic* pcPic = *(iterPic);
    528 #if PIC_CROPPING
    529510    TComSPS *sps = pcPic->getSlice(0)->getSPS();
    530 #endif
    531511
    532512    if ( pcPic->getOutputMark() )
     
    535515      if ( m_pchReconFile )
    536516      {
    537 #if PIC_CROPPING
    538517        m_tVideoIOYuvReconFile[viewDepthId]->write( pcPic->getPicYuvRec(), sps->getPicCropLeftOffset(), sps->getPicCropRightOffset(), sps->getPicCropTopOffset(), sps->getPicCropBottomOffset() );
    539 #else
    540         m_tVideoIOYuvReconFile[viewDepthId]->write( pcPic->getPicYuvRec(), pcPic->getSlice(0)->getSPS()->getPad() );
    541 #endif
    542518      }
    543519     
  • branches/HTM-5.1-dev0/source/App/TAppDecoder/TAppDecTop.h

    r231 r294  
    121121//  Void  xInitDecLib       (); ///< initialize decoder class
    122122 
    123 #if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER
    124123  Void  xWriteOutput      ( TComList<TComPic*>* pcListPic, Int viewDepthId, UInt tId); ///< write YUV to file
    125 #else
    126   Void  xWriteOutput      ( TComList<TComPic*>* pcListPic, Int viewDepthId ); ///< write YUV to file
    127 #endif
    128124  Void  xFlushOutput      ( TComList<TComPic*>* pcListPic, Int viewDepthId ); ///< flush all remaining decoded pictures to file
    129125
  • branches/HTM-5.1-dev0/source/App/TAppEncoder/TAppEncCfg.cpp

    r292 r294  
    233233  ("SourceWidth,-wdt",        m_iSourceWidth,           0,                            "Source picture width")
    234234  ("SourceHeight,-hgt",       m_iSourceHeight,          0,                            "Source picture height")
    235 #if PIC_CROPPING
    236235  ("CroppingMode",            m_croppingMode,           0,                            "Cropping mode (0: no cropping, 1:automatic padding, 2: padding, 3:cropping")
    237236  ("CropLeft",                m_cropLeft,               0,                            "Left cropping/padding for cropping mode 3")
     
    241240  ("HorizontalPadding,-pdx",  m_aiPad[0],               0,                            "horizontal source padding for cropping mode 2")
    242241  ("VerticalPadding,-pdy",    m_aiPad[1],               0,                            "vertical source padding for cropping mode 2")
    243 #endif
    244242  ("InputBitDepth",         m_uiInputBitDepth, 8u, "bit-depth of input file")
    245243  ("BitDepth",              m_uiInputBitDepth, 8u, "deprecated alias of InputBitDepth")
    246244  ("OutputBitDepth",        m_uiOutputBitDepth, 0u, "bit-depth of output file")
    247245  ("InternalBitDepth",      m_uiInternalBitDepth, 0u, "Internal bit-depth (BitDepth+BitIncrement)")
    248 #if !PIC_CROPPING
    249   ("HorizontalPadding,-pdx",m_aiPad[0],      0, "horizontal source padding size")
    250   ("VerticalPadding,-pdy",  m_aiPad[1],      0, "vertical source padding size")
    251   ("PAD",                   m_bUsePAD,   false, "automatic source padding of multiple of 16" )
    252 #endif
    253246  ("FrameRate,-fr",         m_iFrameRate,        0, "Frame rate")
    254247  ("FrameSkip,-fs",         m_FrameSkip,         0u, "Number of frames to skip at start of input YUV")
     
    279272  ("DecodingRefreshType,-dr",m_iDecodingRefreshType, 0, "intra refresh, (0:none 1:CRA 2:IDR)")
    280273  ("GOPSize,g",      m_iGOPSize,      1, "GOP size of temporal structure")
    281 #if !H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER
    282   ("MaxNumberOfReorderPictures",   m_numReorderFrames,               -1, "Max. number of reorder pictures: -1: encoder determines value, >=0: set explicitly")
    283   ("MaxNumberOfReferencePictures", m_maxNumberOfReferencePictures, 6, "Max. number of reference pictures")
    284 #endif
    285274  ("ListCombination,-lc", m_bUseLComb, true, "combined reference list flag for uni-prediction in B-slices")
    286275  ("LCModification", m_bLCMod, false, "enables signalling of combined reference list derivation")
     
    321310  ("TemporalLayerQPOffset_L3,-tq3", m_aiTLayerQPOffset[3], MAX_QP + 1, "QP offset of temporal layer 3")
    322311 
    323 #if !H0566_TLA
    324   ("TLayeringBasedOnCodingStruct,-tl", m_bTLayering, false, "Temporal ID is set based on the hierarchical coding structure")
    325  
    326   ("TLayerSwitchingFlag_L0,-ts0", m_abTLayerSwitchingFlag[0], false, "Switching flag for temporal layer 0")
    327   ("TLayerSwitchingFlag_L1,-ts1", m_abTLayerSwitchingFlag[1], false, "Switching flag for temporal layer 1")
    328   ("TLayerSwitchingFlag_L2,-ts2", m_abTLayerSwitchingFlag[2], false, "Switching flag for temporal layer 2")
    329   ("TLayerSwitchingFlag_L3,-ts3", m_abTLayerSwitchingFlag[3], false, "Switching flag for temporal layer 3")
    330 #endif
    331312
    332313  /* Entropy coding parameters */
     
    349330  ("IVSEnable",                       m_bUseIVS                 , true         , "Use inter-view vector scaling" )
    350331#endif
    351 #if DBL_CONTROL
    352332  ("DeblockingFilterControlPresent", m_DeblockingFilterControlPresent, true)
    353 #endif
    354333
    355334  /* Camera Paremetes */
     
    412391  ("ALF", m_abUseALF, std::vector<Bool>(1,true), "Enables ALF")
    413392  ("SAO", m_abUseSAO, std::vector<Bool>(1, true), "SAO")
    414 #if SAO_UNIT_INTERLEAVING
    415393  ("MaxNumOffsetsPerPic", m_maxNumOffsetsPerPic, 2048, "2048: default")   
    416394  ("SAOInterleaving", m_saoInterleavingFlag, false, "0: SAO Picture Mode, 1: SAO Interleaving ")   
    417 #endif
    418395
    419396  ("ALFEncodePassReduction", m_iALFEncodePassReduction, 0, "0:Original 16-pass, 1: 1-pass, 2: 2-pass encoding")
    420397
    421398  ("ALFMaxNumFilter,-ALFMNF", m_iALFMaxNumberFilters, 16, "16: No Constrained, 1-15: Constrained max number of filter")
    422 #if LCU_SYNTAX_ALF
    423399  ("ALFParamInSlice", m_bALFParamInSlice, false, "ALF parameters in 0: APS, 1: slice header")
    424400  ("ALFPicBasedEncode", m_bALFPicBasedEncode, true, "ALF picture-based encoding 0: false, 1: true")
    425 #endif
    426401
    427402    ("SliceMode",            m_iSliceMode,           0, "0: Disable all Recon slice limits, 1: Enforce max # of LCUs, 2: Enforce max # of bytes")
     
    446421    ("TileInfoPresentFlag",         m_iColumnRowInfoPresent,         1,          "0: tiles parameters are NOT present in the PPS. 1: tiles parameters are present in the PPS")
    447422    ("UniformSpacingIdc",           m_iUniformSpacingIdr,            0,          "Indicates if the column and row boundaries are distributed uniformly")
    448 #if !REMOVE_TILE_DEPENDENCE
    449     ("TileBoundaryIndependenceIdc", m_iTileBoundaryIndependenceIdr,  1,          "Indicates if the column and row boundaries break the prediction")
    450 #endif
    451423    ("NumTileColumnsMinus1",        m_iNumColumnsMinus1,             0,          "Number of columns in a picture minus 1")
    452424    ("ColumnWidthArray",            cfg_ColumnWidth,                 string(""), "Array containing ColumnWidth values in units of LCU")
     
    463435    ("ScalingList",                 m_useScalingListId,              0,          "0: no scaling list, 1: default scaling lists, 2: scaling lists specified in ScalingListFile")
    464436    ("ScalingListFile",             cfg_ScalingListFile,             string(""), "Scaling list file name")
    465 #if MULTIBITS_DATA_HIDING
    466437    ("SignHideFlag,-SBH",                m_signHideFlag, 1)
    467438    ("SignHideThreshold,-TSIG",          m_signHidingThreshold,         4)
    468 #endif
    469439#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    470440  ("DMM",                         m_bUseDMM,                       false,      "depth model modes flag")
     
    484454  ("FEN", m_bUseFastEnc, false, "fast encoder setting")
    485455  ("ECU", m_bUseEarlyCU, false, "Early CU setting")
    486 #if FAST_DECISION_FOR_MRG_RD_COST
    487456  ("FDM", m_useFastDecisionForMerge, true, "Fast decision for Merge RD Cost")
    488 #endif
    489457  ("CFM", m_bUseCbfFastMode, false, "Cbf fast mode setting")
    490458#if HHI_INTERVIEW_SKIP
     
    624592  }
    625593
    626 #if PIC_CROPPING
    627594  switch (m_croppingMode)
    628595  {
     
    674641    }
    675642  }
    676 #else
    677 
    678   // compute source padding size
    679   if ( m_bUsePAD )
    680   {
    681     if ( m_iSourceWidth%MAX_PAD_SIZE )
    682     {
    683       m_aiPad[0] = (m_iSourceWidth/MAX_PAD_SIZE+1)*MAX_PAD_SIZE - m_iSourceWidth;
    684     }
    685    
    686     if ( m_iSourceHeight%MAX_PAD_SIZE )
    687     {
    688       m_aiPad[1] = (m_iSourceHeight/MAX_PAD_SIZE+1)*MAX_PAD_SIZE - m_iSourceHeight;
    689     }
    690   }
    691   m_iSourceWidth  += m_aiPad[0];
    692   m_iSourceHeight += m_aiPad[1];
    693 #endif
    694643 
    695644  // allocate slice-based dQP values
     
    897846  xConfirmPara( (m_iIntraPeriod > 0 && m_iIntraPeriod < m_iGOPSize) || m_iIntraPeriod == 0, "Intra period must be more than GOP size, or -1 , not 0" );
    898847  xConfirmPara( m_iDecodingRefreshType < 0 || m_iDecodingRefreshType > 2,                   "Decoding Refresh Type must be equal to 0, 1 or 2" );
    899 #if H0736_AVC_STYLE_QP_RANGE
    900848  xConfirmPara( m_aiQP[0] < -6 * ((Int)m_uiInternalBitDepth - 8) || m_aiQP[0] > 51,         "QP exceeds supported range (-QpBDOffsety to 51)" );
    901849  if ( m_aiQP.size() >= 2 )
     
    903851    xConfirmPara( m_aiQP[1] < -6 * ((Int)m_uiInternalBitDepth - 8) || m_aiQP[1] > 51,       "QP depth exceeds supported range (-QpBDOffsety to 51)" );
    904852  }
    905 #else
    906   xConfirmPara( m_aiQP[0] < 0 || m_aiQP[0] > 51,                                             "QP exceeds supported range (0 to 51)" );
    907   if ( m_aiQP.size() >= 2 )
    908   {
    909     xConfirmPara( m_aiQP[1] < 0 || m_aiQP[1] > 51,                                           "QP Depth exceeds supported range (0 to 51)" );
    910   }
    911 #endif
    912853  xConfirmPara( m_iALFEncodePassReduction < 0 || m_iALFEncodePassReduction > 2,             "ALFEncodePassReduction must be equal to 0, 1 or 2");
    913 #if LCU_SYNTAX_ALF
    914854  xConfirmPara( m_iALFMaxNumberFilters < 1,                                                 "ALFMaxNumFilter should be larger than 1"); 
    915 #else
    916   xConfirmPara( m_iALFMaxNumberFilters < 1 || m_iALFMaxNumberFilters > 16,                  "ALFMaxNumFilter exceeds supported range (1 to 16)"); 
    917 #endif
    918855  xConfirmPara( m_loopFilterBetaOffsetDiv2 < -13 || m_loopFilterBetaOffsetDiv2 > 13,          "Loop Filter Beta Offset div. 2 exceeds supported range (-13 to 13)");
    919856  xConfirmPara( m_loopFilterTcOffsetDiv2 < -13 || m_loopFilterTcOffsetDiv2 > 13,              "Loop Filter Tc Offset div. 2 exceeds supported range (-13 to 13)");
     
    941878  xConfirmPara( m_uiMaxCUWidth < 16,                                                        "Maximum partition width size should be larger than or equal to 16");
    942879  xConfirmPara( m_uiMaxCUHeight < 16,                                                       "Maximum partition height size should be larger than or equal to 16");
    943 #if PIC_CROPPING
    944880  xConfirmPara( (m_iSourceWidth  % (m_uiMaxCUWidth  >> (m_uiMaxCUDepth-1)))!=0,             "Resulting coded frame width must be a multiple of the minimum CU size");
    945881  xConfirmPara( (m_iSourceHeight % (m_uiMaxCUHeight >> (m_uiMaxCUDepth-1)))!=0,             "Resulting coded frame height must be a multiple of the minimum CU size");
    946 #else
    947   xConfirmPara( (m_iSourceWidth  % (m_uiMaxCUWidth  >> (m_uiMaxCUDepth-1)))!=0,             "Frame width should be multiple of minimum CU size");
    948   xConfirmPara( (m_iSourceHeight % (m_uiMaxCUHeight >> (m_uiMaxCUDepth-1)))!=0,             "Frame height should be multiple of minimum CU size");
    949 #endif
    950882 
    951883  xConfirmPara( m_uiQuadtreeTULog2MinSize < 2,                                        "QuadtreeTULog2MinSize must be 2 or greater.");
     
    1005937  }
    1006938#if ADAPTIVE_QP_SELECTION
    1007 #if H0736_AVC_STYLE_QP_RANGE
    1008939  xConfirmPara( m_bUseAdaptQpSelect == true && m_aiQP[0] < 0,                                              "AdaptiveQpSelection must be disabled when QP < 0.");
    1009940  xConfirmPara( m_bUseAdaptQpSelect == true && m_aiQP[1] < 0,                                              "AdaptiveQpSelection must be disabled when QP < 0.");
    1010941  xConfirmPara( m_bUseAdaptQpSelect == true && (m_iChromaQpOffset !=0 || m_iChromaQpOffset2nd != 0 ),  "AdaptiveQpSelection must be disabled when ChromaQpOffset is not equal to 0.");
    1011 #endif
    1012942#endif
    1013943
     
    1020950  }
    1021951
    1022 #if FIXED_NUMBER_OF_TILES_SLICE_MODE
    1023952  xConfirmPara( m_iSliceMode < 0 || m_iSliceMode > 3, "SliceMode exceeds supported range (0 to 3)" );
    1024 #endif
    1025953  if (m_iSliceMode!=0)
    1026954  {
    1027955    xConfirmPara( m_iSliceArgument < 1 ,         "SliceArgument should be larger than or equal to 1" );
    1028956  }
    1029 #if FIXED_NUMBER_OF_TILES_SLICE_MODE
    1030957  if (m_iSliceMode==3)
    1031958  {
    1032959    xConfirmPara( m_iSliceGranularity > 0 ,      "When SliceMode == 3 is chosen, the SliceGranularity must be 0" );
    1033960  }
    1034 #endif
    1035961  xConfirmPara( m_iEntropySliceMode < 0 || m_iEntropySliceMode > 2, "EntropySliceMode exceeds supported range (0 to 2)" );
    1036962  if (m_iEntropySliceMode!=0)
     
    1042968  xConfirmPara( m_iSliceGranularity > m_iMaxCuDQPDepth, "SliceGranularity must be smaller smaller than or equal to maximum dqp depth" );
    1043969
    1044 #if NO_COMBINED_PARALLEL
    1045970  bool tileFlag = (m_iNumColumnsMinus1 > 0 || m_iNumRowsMinus1 > 0 );
    1046971  xConfirmPara( tileFlag && m_iEntropySliceMode,            "Tile and Entropy Slice can not be applied together");
    1047972  xConfirmPara( tileFlag && m_iWaveFrontSynchro,            "Tile and Wavefront can not be applied together");
    1048973  xConfirmPara( m_iWaveFrontSynchro && m_iEntropySliceMode, "Wavefront and Entropy Slice can not be applied together"); 
    1049 #endif
    1050974
    1051975  // max CU width and height should be power of 2
     
    12391163      for( Int i = 0; i < MAX_GOP; i++ ) { isOK[i] = false; }
    12401164      Int numOK = 0;
    1241 #if !H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER
    1242       Int numReorderFramesRequired=0;
    1243       m_maxNumberOfReferencePictures=0;
    1244       Int lastDisp = -1;
    1245 #endif
    12461165      m_extraRPSs[viewId] = 0;
    12471166      //start looping through frames in coding order until we can verify that the GOP structure is correct.
     
    14271346            }
    14281347          }
    1429 #if !H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER
    1430           if(m_maxNumberOfReferencePictures<numRefs)
    1431           {
    1432             m_maxNumberOfReferencePictures=numRefs;
    1433           }
    1434 #endif
    14351348          refList[numRefs] = curPOC;
    14361349          numRefs++;
    1437 #if !H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER
    1438           Int nonDisplayed=0;
    1439           for(Int i=0; i<numRefs; i++)
    1440           {
    1441             if(refList[i]==lastDisp+1)
    1442             {
    1443               lastDisp=refList[i];
    1444               i=0;
    1445             }
    1446           }
    1447           for(Int i=0; i<numRefs; i++)
    1448           {
    1449             if(refList[i]>lastDisp)
    1450             {
    1451               nonDisplayed++;
    1452             }
    1453           }
    1454           if(nonDisplayed>numReorderFramesRequired)
    1455           {
    1456             numReorderFramesRequired=nonDisplayed;
    1457           }
    1458 #endif
    14591350        }
    14601351        checkGOP++;
    14611352      }
    1462 #if !H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER
    1463       if (m_numReorderFrames == -1)
    1464       {
    1465         m_numReorderFrames = numReorderFramesRequired;
    1466       }
    1467 #endif
    14681353      xConfirmPara( errorGOP, "Invalid GOP structure given" );
    1469 #if H0566_TLA
    14701354      m_maxTempLayer[viewId] = 1;
    1471 #endif
    14721355      for( Int i = 0; i < m_iGOPSize; i++ )
    14731356      {
    1474 #if H0566_TLA
    14751357        if( m_GOPListsMvc[viewId][i].m_temporalId >= m_maxTempLayer[viewId] )
    14761358        {
    14771359          m_maxTempLayer[viewId] = m_GOPListsMvc[viewId][i].m_temporalId + 1;
    14781360        }
    1479 #endif
    14801361        xConfirmPara( m_GOPListsMvc[viewId][i].m_sliceType != 'B' && m_GOPListsMvc[viewId][i].m_sliceType != 'P', "Slice type must be equal to B or P" );
    14811362      }
    14821363
    1483 #if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER
    14841364      for( Int i = 0; i < MAX_TLAYER; i++ )
    14851365      {
     
    15381418        m_maxDecPicBuffering[viewId][MAX_TLAYER-1] = m_numReorderPics[viewId][MAX_TLAYER-1];
    15391419      }
    1540 #endif
    1541 
    1542 #if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER
     1420
    15431421      xConfirmPara( m_bUseLComb == false && m_numReorderPics[viewId][MAX_TLAYER-1] != 0, "ListCombination can only be 0 in low delay coding (more precisely when L0 and L1 are identical)" );  // Note however this is not the full necessary condition as ref_pic_list_combination_flag can only be 0 if L0 == L1.
    1544 #else
    1545       xConfirmPara( m_bUseLComb==false && m_numReorderFrames!=0, "ListCombination can only be 0 in low delay coding (more precisely when L0 and L1 are identical)" );  // Note however this is not the full necessary condition as ref_pic_list_combination_flag can only be 0 if L0 == L1.
    1546       xConfirmPara( m_numReorderFrames < numReorderFramesRequired, "For the used GOP the encoder requires more pictures for reordering than specified in MaxNumberOfReorderPictures" );
    1547 #endif
    15481422    }
    15491423  }
     
    16551529    }
    16561530  }
    1657 #if PIC_CROPPING
    16581531  printf("Real     Format              : %dx%d %dHz\n", m_iSourceWidth - m_cropLeft - m_cropRight, m_iSourceHeight - m_cropTop - m_cropBottom, m_iFrameRate );
    1659 #else
    1660   printf("Real     Format              : %dx%d %dHz\n", m_iSourceWidth - m_aiPad[0], m_iSourceHeight-m_aiPad[1], m_iFrameRate );
    1661 #endif
    16621532  printf("Internal Format              : %dx%d %dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate );
    16631533  printf("Frame index                  : %u - %d (%d frames)\n", m_FrameSkip, m_FrameSkip+m_iFrameToBeEncoded-1, m_iFrameToBeEncoded );
     
    17271597 
    17281598  printf("TOOL CFG General: "); 
    1729 #if LCU_SYNTAX_ALF
    17301599  printf("ALFMNF:%d ", m_iALFMaxNumberFilters);
    17311600  printf("ALFInSlice:%d ", m_bALFParamInSlice);
    17321601  printf("ALFPicEnc:%d ", m_bALFPicBasedEncode);
    1733 #endif
    17341602  printf("IBD:%d ", !!g_uiBitIncrement);
    17351603  printf("HAD:%d ", m_bUseHADME           );
     
    17371605  printf("SQP:%d ", m_uiDeltaQpRD         );
    17381606  printf("ASR:%d ", m_bUseASR             );
    1739 #if !PIC_CROPPING
    1740   printf("PAD:%d ", m_bUsePAD             );
    1741 #endif
    17421607  printf("LComb:%d ", m_bUseLComb         );
    17431608  printf("LCMod:%d ", m_bLCMod         );
    17441609  printf("FEN:%d ", m_bUseFastEnc         );
    17451610  printf("ECU:%d ", m_bUseEarlyCU         );
    1746 #if FAST_DECISION_FOR_MRG_RD_COST
    17471611  printf("FDM:%d ", m_useFastDecisionForMerge );
    1748 #endif
    17491612  printf("CFM:%d ", m_bUseCbfFastMode         );
    17501613  printf("RQT:%d ", 1     );
     
    17611624  }
    17621625  printf("CIP:%d ", m_bUseConstrainedIntraPred);
    1763 #if BURST_IPCM
    17641626  printf("PCM:%d ", (m_usePCM && (1<<m_uiPCMLog2MinSize) <= m_uiMaxCUWidth)? 1 : 0);
    1765 #else
    1766   printf("PCM:%d ", ((1<<m_uiPCMLog2MinSize) <= m_uiMaxCUWidth)? 1 : 0);
    1767 #endif
    1768 #if SAO_UNIT_INTERLEAVING
    17691627  printf("SAOInterleaving:%d ", (m_saoInterleavingFlag)?(1):(0));
    1770 #endif
    17711628#if LOSSLESS_CODING
    17721629  printf("LosslessCuEnabled:%d ", (m_useLossless)? 1:0 );
     
    17741631  printf("WPP:%d ", (Int)m_bUseWeightPred);
    17751632  printf("WPB:%d ", m_uiBiPredIdc);
    1776 #if !REMOVE_TILE_DEPENDENCE
    1777   printf("TileBoundaryIndependence:%d ", m_iTileBoundaryIndependenceIdr );
    1778 #endif
    17791633  printf("TileLocationInSliceHdr:%d ", m_iTileLocationInSliceHeaderFlag);
    17801634  printf("TileMarker:%d", m_iTileMarkerFlag);
     
    17991653#endif
    18001654
    1801 #if MULTIBITS_DATA_HIDING
    18021655  printf(" SignBitHidingFlag:%d SignBitHidingThreshold:%d", m_signHideFlag, m_signHidingThreshold);
    1803 #endif
    18041656  printf("\n");
    18051657  printf("TOOL CFG VIDEO  : ");
  • branches/HTM-5.1-dev0/source/App/TAppEncoder/TAppEncCfg.h

    r292 r294  
    7373  Int       m_iSourceWidth;                                   ///< source width in pixel
    7474  Int       m_iSourceHeight;                                  ///< source height in pixel
    75 #if PIC_CROPPING
    7675  Int       m_croppingMode;
    7776  Int       m_cropLeft;
     
    7978  Int       m_cropTop;
    8079  Int       m_cropBottom;
    81 #endif
    8280  Int       m_iFrameToBeEncoded;                              ///< number of encoded frames
    83 #if !PIC_CROPPING
    84   Bool      m_bUsePAD;                                        ///< flag for using source padding
    85 #endif
    8681  Int       m_aiPad[2];                                       ///< number of padded pixels for width and height
    8782 
     
    10095  Int       m_extraRPSs[MAX_VIEW_NUM];
    10196  GOPEntryMvc m_GOPListsMvc[MAX_VIEW_NUM][MAX_GOP+1];
    102 #if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER
    10397  Int       m_numReorderPics[MAX_VIEW_NUM][MAX_TLAYER];       ///< total number of reorder pictures
    10498  Int       m_maxDecPicBuffering[MAX_VIEW_NUM][MAX_TLAYER];   ///< total number of reference pictures needed for decoding
    105 #else
    106   Int       m_numReorderFrames;                               ///< total number of reorder pictures
    107   Int       m_maxNumberOfReferencePictures;                   ///< total number of reference pictures needed for decoding
    108 #endif
    10999  Bool      m_bUseLComb;                                      ///< flag for using combined reference list for uni-prediction in B-slices (JCTVC-D421)
    110100  Bool      m_bLCMod;                                         ///< flag for specifying whether the combined reference list for uni-prediction in B-slices is uploaded explicitly
     
    136126  Int       m_iQPAdaptationRange;                             ///< dQP range by QP adaptation
    137127 
    138 #if H0566_TLA
    139128  Int       m_maxTempLayer[MAX_VIEW_NUM];                     ///< Max temporal layer
    140 #else
    141   Bool      m_bTLayering;                                     ///< indicates whether temporal IDs are set based on the hierarchical coding structure
    142   Bool      m_abTLayerSwitchingFlag[MAX_TLAYER];              ///< temporal layer switching flags corresponding to each temporal layer
    143 #endif
    144129
    145130  // coding unit (CU) definition
     
    179164  Bool      m_bUseIVS;                                        ///< flag for using inter-view vector scaling
    180165#endif
    181 #if SAO_UNIT_INTERLEAVING
    182166  Int       m_maxNumOffsetsPerPic;                            ///< SAO maximun number of offset per picture
    183167  Bool      m_saoInterleavingFlag;                            ///< SAO interleaving flag
    184 #endif
    185168  // coding tools (loop filter)
    186169  vector<Bool> m_abUseALF;                                    ///< flag for using adaptive loop filter [0] - video, [1] - depth
     
    188171 
    189172  Int       m_iALFMaxNumberFilters;                           ///< ALF Max Number Filters in one picture
    190 #if LCU_SYNTAX_ALF
    191173  Bool      m_bALFParamInSlice;
    192174  Bool      m_bALFPicBasedEncode;
    193 #endif
    194175
    195176  vector<Bool> m_abLoopFilterDisable;                         ///< flag for using deblocking filter filter [0] - video, [1] - depth
     
    197178  Int       m_loopFilterBetaOffsetDiv2;                     ///< beta offset for deblocking filter
    198179  Int       m_loopFilterTcOffsetDiv2;                       ///< tc offset for deblocking filter
    199 #if DBL_CONTROL
    200180  Bool      m_DeblockingFilterControlPresent;                 ///< deblocking filter control present flag in PPS
    201 #endif
    202181 
    203182  Bool      m_bUseLMChroma;                                  ///< JL: Chroma intra prediction based on luma signal
     
    242221#endif
    243222
    244 #if FAST_DECISION_FOR_MRG_RD_COST
    245223  Bool      m_useFastDecisionForMerge;         ///< flag for using Fast Decision Merge RD-Cost
    246 #endif
    247224  Bool      m_bUseCbfFastMode;                 ///< flag for using Cbf Fast PU Mode Decision
    248225  Int       m_iSliceMode;                      ///< 0: Disable all Recon slice limits, 1 : Maximum number of largest coding units per slice, 2: Maximum number of bytes in a slice
     
    257234  Int       m_iColumnRowInfoPresent;
    258235  Int       m_iUniformSpacingIdr;
    259 #if !REMOVE_TILE_DEPENDENCE
    260   Int       m_iTileBoundaryIndependenceIdr;
    261 #endif
    262236  Int       m_iNumColumnsMinus1;
    263237  char*     m_pchColumnWidth;
     
    287261#endif
    288262
    289 #if MULTIBITS_DATA_HIDING
    290263  Int       m_signHideFlag;
    291264  Int       m_signHidingThreshold;
    292 #endif
    293265#if HHI_MPI
    294266  Bool      m_bUseMVI;  ///< flag for using Motion Vector Inheritance for depth map coding
  • branches/HTM-5.1-dev0/source/App/TAppEncoder/TAppEncTop.cpp

    r292 r294  
    9797    m_acTEncTopList[iViewIdx]->setSourceWidth                  ( m_iSourceWidth );
    9898    m_acTEncTopList[iViewIdx]->setSourceHeight                 ( m_iSourceHeight );
    99 #if PIC_CROPPING
    10099    m_acTEncTopList[iViewIdx]->setCroppingMode                 ( m_croppingMode );
    101100    m_acTEncTopList[iViewIdx]->setCropLeft                     ( m_cropLeft );
     
    103102    m_acTEncTopList[iViewIdx]->setCropTop                      ( m_cropTop );
    104103    m_acTEncTopList[iViewIdx]->setCropBottom                   ( m_cropBottom );
    105 #endif
    106104    m_acTEncTopList[iViewIdx]->setFrameToBeEncoded             ( m_iFrameToBeEncoded );
    107105    m_acTEncTopList[iViewIdx]->setViewId                       ( iViewIdx );
     
    138136    m_acTEncTopList[iViewIdx]->setGopList                      ( m_GOPListsMvc[iViewIdx] );
    139137    m_acTEncTopList[iViewIdx]->setExtraRPSs                    ( m_extraRPSs[iViewIdx] );
    140 #if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER
    141138    for(Int i = 0; i < MAX_TLAYER; i++)
    142139    {
     
    144141      m_acTEncTopList[iViewIdx]->setMaxDecPicBuffering         ( m_maxDecPicBuffering[iViewIdx][i], i );
    145142    }
    146 #else
    147     m_acTEncTopList[iViewIdx]->setNumReorderFrames             ( m_numReorderFrames );
    148     m_acTEncTopList[iViewIdx]->setMaxNumberOfReferencePictures ( m_maxNumberOfReferencePictures );
    149 #endif
    150143    for( UInt uiLoop = 0; uiLoop < MAX_TLAYER; ++uiLoop )
    151144    {
     
    157150    m_acTEncTopList[iViewIdx]->setPad                          ( m_aiPad );
    158151   
    159 #if H0566_TLA
    160152    m_acTEncTopList[iViewIdx]->setMaxTempLayer                 ( m_maxTempLayer[iViewIdx] );
    161 #else
    162     m_acTEncTopList[iViewIdx]->setTLayering                    ( m_bTLayering );
    163     m_acTEncTopList[iViewIdx]->setTLayerSwitchingFlag          ( m_abTLayerSwitchingFlag );
    164 #endif
    165153
    166154    m_acTEncTopList[iViewIdx]->setDisInter4x4                  ( m_bDisInter4x4);
     
    176164    m_acTEncTopList[iViewIdx]->setLoopFilterBetaOffset         ( m_loopFilterBetaOffsetDiv2  );
    177165    m_acTEncTopList[iViewIdx]->setLoopFilterTcOffset           ( m_loopFilterTcOffsetDiv2    );
    178 #if DBL_CONTROL
    179166    m_acTEncTopList[iViewIdx]->setDeblockingFilterControlPresent( m_DeblockingFilterControlPresent);
    180 #endif
    181167
    182168  //====== Motion search ========
     
    201187#if LOSSLESS_CODING
    202188    Int lowestQP;
    203 #if H0736_AVC_STYLE_QP_RANGE
    204189    lowestQP =  - ( (Int)(6*(g_uiBitDepth + g_uiBitIncrement - 8)) );
    205 #else
    206     lowestQP = 0;
    207 #endif
    208190    if ((m_iMaxDeltaQP == 0 ) && (m_aiQP[0] == lowestQP) && (m_useLossless == true))
    209191    {
     
    260242    m_acTEncTopList[iViewIdx]->setdQPs                         ( m_aidQP        );
    261243    m_acTEncTopList[iViewIdx]->setUseRDOQ                      ( m_abUseRDOQ[0] );
    262 #if !PIC_CROPPING
    263     m_acTEncTopList[iViewIdx]->setUsePAD                       ( m_bUsePAD      );
    264 #endif
    265244    m_acTEncTopList[iViewIdx]->setQuadtreeTULog2MaxSize        ( m_uiQuadtreeTULog2MaxSize );
    266245    m_acTEncTopList[iViewIdx]->setQuadtreeTULog2MinSize        ( m_uiQuadtreeTULog2MinSize );
     
    269248    m_acTEncTopList[iViewIdx]->setUseFastEnc                   ( m_bUseFastEnc  );
    270249    m_acTEncTopList[iViewIdx]->setUseEarlyCU                   ( m_bUseEarlyCU  );
    271 #if FAST_DECISION_FOR_MRG_RD_COST
    272250    m_acTEncTopList[iViewIdx]->setUseFastDecisionForMerge      ( m_useFastDecisionForMerge  );
    273 #endif
    274251    m_acTEncTopList[iViewIdx]->setUseCbfFastMode               ( m_bUseCbfFastMode  );
    275252#if HHI_INTERVIEW_SKIP
     
    304281      m_acTEncTopList[iViewIdx]->setSliceArgument ( m_iSliceArgument * ( iNumPartInCU >> ( m_iSliceGranularity << 1 ) ) );
    305282    }
    306 #if FIXED_NUMBER_OF_TILES_SLICE_MODE
    307283    if(m_iSliceMode==AD_HOC_SLICES_FIXED_NUMBER_OF_TILES_IN_SLICE)
    308284    {
    309285      m_acTEncTopList[iViewIdx]->setSliceArgument ( m_iSliceArgument );
    310286    }
    311 #endif
    312287    m_acTEncTopList[iViewIdx]->setSliceGranularity        ( m_iSliceGranularity         );
    313288    if(m_iSliceMode == 0 )
     
    327302    m_acTEncTopList[iViewIdx]->setUseIVS               ( m_bUseIVS          );
    328303#endif
    329 #if SAO_UNIT_INTERLEAVING
    330304    m_acTEncTopList[iViewIdx]->setMaxNumOffsetsPerPic (m_maxNumOffsetsPerPic);
    331305    m_acTEncTopList[iViewIdx]->setSaoInterleavingFlag (m_saoInterleavingFlag);
    332 #endif
    333306    m_acTEncTopList[iViewIdx]->setPCMInputBitDepthFlag  ( m_bPCMInputBitDepthFlag);
    334307    m_acTEncTopList[iViewIdx]->setPCMFilterDisableFlag  ( m_bPCMFilterDisableFlag);
     
    338311    m_acTEncTopList[iViewIdx]->setColumnRowInfoPresent       ( m_iColumnRowInfoPresent );
    339312    m_acTEncTopList[iViewIdx]->setUniformSpacingIdr          ( m_iUniformSpacingIdr );
    340 #if !REMOVE_TILE_DEPENDENCE
    341     m_acTEncTopList[iViewIdx]->setTileBoundaryIndependenceIdr( m_iTileBoundaryIndependenceIdr );
    342 #endif
    343313    m_acTEncTopList[iViewIdx]->setNumColumnsMinus1           ( m_iNumColumnsMinus1 );
    344314    m_acTEncTopList[iViewIdx]->setNumRowsMinus1              ( m_iNumRowsMinus1 );
     
    357327    m_acTEncTopList[iViewIdx]->setMaxTileMarkerOffset         ( m_dMaxTileMarkerOffset );
    358328    m_acTEncTopList[iViewIdx]->setTileBehaviorControlPresentFlag( m_iTileBehaviorControlPresentFlag );
    359 #if !REMOVE_TILE_DEPENDENCE
    360     if(m_iTileBoundaryIndependenceIdr == 0 || uiTilesCount == 1)
    361 #else
    362329    if(uiTilesCount == 1)
    363 #endif
    364330    {
    365331      m_bLFCrossTileBoundaryFlag = true;
     
    376342    m_acTEncTopList[iViewIdx]->setUseScalingListId           ( m_useScalingListId  );
    377343    m_acTEncTopList[iViewIdx]->setScalingListFile            ( m_scalingListFile   );
    378 #if MULTIBITS_DATA_HIDING
    379344    m_acTEncTopList[iViewIdx]->setSignHideFlag(m_signHideFlag);
    380345    m_acTEncTopList[iViewIdx]->setTSIG(m_signHidingThreshold);
    381 #endif
    382 
    383 #if LCU_SYNTAX_ALF
     346
    384347    if(uiTilesCount > 1)
    385348    {
     
    389352    m_acTEncTopList[iViewIdx]->setALFParamInSlice              ( m_bALFParamInSlice);
    390353    m_acTEncTopList[iViewIdx]->setALFPicBasedEncode            ( m_bALFPicBasedEncode);
    391 #endif
    392354
    393355    //====== Depth tools ========
     
    445407      m_acTEncDepthTopList[iViewIdx]->setSourceWidth                  ( m_iSourceWidth );
    446408      m_acTEncDepthTopList[iViewIdx]->setSourceHeight                 ( m_iSourceHeight );
    447 #if PIC_CROPPING
    448409      m_acTEncDepthTopList[iViewIdx]->setCroppingMode                 ( m_croppingMode );
    449410      m_acTEncDepthTopList[iViewIdx]->setCropLeft                     ( m_cropLeft );
     
    451412      m_acTEncDepthTopList[iViewIdx]->setCropTop                      ( m_cropTop );
    452413      m_acTEncDepthTopList[iViewIdx]->setCropBottom                   ( m_cropBottom );
    453 #endif
    454414      m_acTEncDepthTopList[iViewIdx]->setFrameToBeEncoded             ( m_iFrameToBeEncoded );
    455415      m_acTEncDepthTopList[iViewIdx]->setViewId                       ( iViewIdx );
     
    480440      m_acTEncDepthTopList[iViewIdx]->setGopList                      ( m_GOPListsMvc[iViewIdx] );
    481441      m_acTEncDepthTopList[iViewIdx]->setExtraRPSs                    ( m_extraRPSs[iViewIdx] );
    482 #if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER
    483442      for(Int i = 0; i < MAX_TLAYER; i++)
    484443      {
     
    486445        m_acTEncDepthTopList[iViewIdx]->setMaxDecPicBuffering         ( m_maxDecPicBuffering[iViewIdx][i], i );
    487446      }
    488 #else
    489       m_acTEncDepthTopList[iViewIdx]->setNumReorderFrames             ( m_numReorderFrames );
    490       m_acTEncDepthTopList[iViewIdx]->setMaxNumberOfReferencePictures ( m_maxNumberOfReferencePictures );
    491 #endif
    492447      for( UInt uiLoop = 0; uiLoop < MAX_TLAYER; ++uiLoop )
    493448      {
     
    499454      m_acTEncDepthTopList[iViewIdx]->setPad                          ( m_aiPad );
    500455
    501 #if H0566_TLA
    502456      m_acTEncDepthTopList[iViewIdx]->setMaxTempLayer                 ( m_maxTempLayer[iViewIdx] );
    503 #else
    504       m_acTEncDepthTopList[iViewIdx]->setTLayering                    ( m_bTLayering );
    505       m_acTEncDepthTopList[iViewIdx]->setTLayerSwitchingFlag          ( m_abTLayerSwitchingFlag );
    506 #endif
    507457
    508458      m_acTEncDepthTopList[iViewIdx]->setDisInter4x4                  ( m_bDisInter4x4);
     
    518468      m_acTEncDepthTopList[iViewIdx]->setLoopFilterBetaOffset         ( m_loopFilterBetaOffsetDiv2  );
    519469      m_acTEncDepthTopList[iViewIdx]->setLoopFilterTcOffset           ( m_loopFilterTcOffsetDiv2    );
    520 #if DBL_CONTROL
    521470      m_acTEncDepthTopList[iViewIdx]->setDeblockingFilterControlPresent( m_DeblockingFilterControlPresent);
    522 #endif
    523471
    524472      //====== Motion search ========
     
    560508      m_acTEncDepthTopList[iViewIdx]->setdQPs                         ( m_aidQPdepth   );
    561509      m_acTEncDepthTopList[iViewIdx]->setUseRDOQ                      ( m_abUseRDOQ[1] );
    562 #if !PIC_CROPPING
    563       m_acTEncDepthTopList[iViewIdx]->setUsePAD                       ( m_bUsePAD      );
    564 #endif
    565510      m_acTEncDepthTopList[iViewIdx]->setQuadtreeTULog2MaxSize        ( m_uiQuadtreeTULog2MaxSize );
    566511      m_acTEncDepthTopList[iViewIdx]->setQuadtreeTULog2MinSize        ( m_uiQuadtreeTULog2MinSize );
     
    569514      m_acTEncDepthTopList[iViewIdx]->setUseFastEnc                   ( m_bUseFastEnc  );
    570515      m_acTEncDepthTopList[iViewIdx]->setUseEarlyCU                   ( m_bUseEarlyCU  );
    571 #if FAST_DECISION_FOR_MRG_RD_COST
    572516      m_acTEncDepthTopList[iViewIdx]->setUseFastDecisionForMerge      ( m_useFastDecisionForMerge  );
    573 #endif
    574517      m_acTEncDepthTopList[iViewIdx]->setUseCbfFastMode               ( m_bUseCbfFastMode  );
    575518#if HHI_INTERVIEW_SKIP
     
    633576        m_acTEncDepthTopList[iViewIdx]->setSliceArgument ( m_iSliceArgument * ( iNumPartInCU >> ( m_iSliceGranularity << 1 ) ) );
    634577      }
    635 #if FIXED_NUMBER_OF_TILES_SLICE_MODE
    636578      if(m_iSliceMode==AD_HOC_SLICES_FIXED_NUMBER_OF_TILES_IN_SLICE)
    637579      {
    638580        m_acTEncDepthTopList[iViewIdx]->setSliceArgument ( m_iSliceArgument );
    639581      }
    640 #endif
    641582      m_acTEncDepthTopList[iViewIdx]->setSliceGranularity        ( m_iSliceGranularity         );
    642583      if(m_iSliceMode == 0 )
     
    652593     m_acTEncDepthTopList[iViewIdx]->setUseIVS                ( m_bUseIVS );
    653594#endif
    654 #if SAO_UNIT_INTERLEAVING
    655595      m_acTEncDepthTopList[iViewIdx]->setMaxNumOffsetsPerPic (m_maxNumOffsetsPerPic);
    656596      m_acTEncDepthTopList[iViewIdx]->setSaoInterleavingFlag (m_saoInterleavingFlag);
    657 #endif
    658597      m_acTEncDepthTopList[iViewIdx]->setPCMInputBitDepthFlag  ( m_bPCMInputBitDepthFlag);
    659598      m_acTEncDepthTopList[iViewIdx]->setPCMFilterDisableFlag  ( m_bPCMFilterDisableFlag);
     
    663602      m_acTEncDepthTopList[iViewIdx]->setColumnRowInfoPresent       ( m_iColumnRowInfoPresent );
    664603      m_acTEncDepthTopList[iViewIdx]->setUniformSpacingIdr          ( m_iUniformSpacingIdr );
    665 #if !REMOVE_TILE_DEPENDENCE
    666       m_acTEncDepthTopList[iViewIdx]->setTileBoundaryIndependenceIdr( m_iTileBoundaryIndependenceIdr );
    667 #endif
    668604      m_acTEncDepthTopList[iViewIdx]->setNumColumnsMinus1           ( m_iNumColumnsMinus1 );
    669605      m_acTEncDepthTopList[iViewIdx]->setNumRowsMinus1              ( m_iNumRowsMinus1 );
     
    682618      m_acTEncDepthTopList[iViewIdx]->setMaxTileMarkerOffset         ( m_dMaxTileMarkerOffset );
    683619      m_acTEncDepthTopList[iViewIdx]->setTileBehaviorControlPresentFlag( m_iTileBehaviorControlPresentFlag );
    684 #if !REMOVE_TILE_DEPENDENCE
    685       if(m_iTileBoundaryIndependenceIdr == 0 || uiTilesCount == 1)
    686 #else
    687620      if(uiTilesCount == 1)
    688 #endif
    689621      {
    690622        m_bLFCrossTileBoundaryFlag = true;
     
    701633      m_acTEncDepthTopList[iViewIdx]->setUseScalingListId           ( m_useScalingListId  );
    702634      m_acTEncDepthTopList[iViewIdx]->setScalingListFile            ( m_scalingListFile   );
    703 #if MULTIBITS_DATA_HIDING
    704635      m_acTEncDepthTopList[iViewIdx]->setSignHideFlag(m_signHideFlag);
    705636      m_acTEncDepthTopList[iViewIdx]->setTSIG(m_signHidingThreshold);
    706 #endif
    707 
    708 #if LCU_SYNTAX_ALF
     637
    709638      if(uiTilesCount > 1)
    710639      {
     
    714643      m_acTEncDepthTopList[iViewIdx]->setALFParamInSlice              ( m_bALFParamInSlice);
    715644      m_acTEncDepthTopList[iViewIdx]->setALFPicBasedEncode            ( m_bALFPicBasedEncode);
    716 #endif
    717645
    718646  //====== Depth tools ========
     
    13251253        if (m_pchReconFileList[iViewIdx])
    13261254        {
    1327 #if PIC_CROPPING
    13281255          m_acTVideoIOYuvReconFileList[iViewIdx]->write( pcPicYuvRec, m_cropLeft, m_cropRight, m_cropTop, m_cropBottom );
    1329 #else
    1330           m_acTVideoIOYuvReconFileList[iViewIdx]->write( pcPicYuvRec, m_aiPad );
    1331 #endif
    13321256        }
    13331257      }
     
    13361260        if (m_pchDepthReconFileList[iViewIdx])
    13371261        {
    1338 #if PIC_CROPPING
    13391262          m_acTVideoIOYuvDepthReconFileList[iViewIdx]->write( pcPicYuvRec, m_cropLeft, m_cropRight, m_cropTop, m_cropBottom );
    1340 #else
    1341           m_acTVideoIOYuvDepthReconFileList[iViewIdx]->write( pcPicYuvRec, m_aiPad );
    1342 #endif
    13431263        }
    13441264      }
     
    13931313    {
    13941314    case NAL_UNIT_CODED_SLICE:
    1395 #if H0566_TLA
    13961315#if !QC_REM_IDV_B0046
    13971316    case NAL_UNIT_CODED_SLICE_IDV:
     
    13991318    case NAL_UNIT_CODED_SLICE_TLA:
    14001319    case NAL_UNIT_CODED_SLICE_CRA:
    1401 #else
    1402     case NAL_UNIT_CODED_SLICE_DATAPART_A:
    1403     case NAL_UNIT_CODED_SLICE_DATAPART_B:
    1404     case NAL_UNIT_CODED_SLICE_CDR:
    1405 #endif
    14061320    case NAL_UNIT_CODED_SLICE_IDR:
    14071321    case NAL_UNIT_SPS:
  • branches/HTM-5.1-dev0/source/App/TAppRenderer/TAppRendererTop.cpp

    r210 r294  
    429429      // Write Output
    430430
    431 #if PIC_CROPPING
    432431      m_apcTVideoIOYuvSynthOutput[m_bSweep ? 0 : iSynthViewIdx]->write( pcPicYuvSynthOut, 0, 0, 0, 0 );
    433 #else
    434       m_apcTVideoIOYuvSynthOutput[m_bSweep ? 0 : iSynthViewIdx]->write( pcPicYuvSynthOut, aiPad );
    435 #endif
    436432    }
    437433    iFrame++;
     
    665661
    666662          // Write Output
    667 #if PIC_CROPPING
    668663          m_apcTVideoIOYuvSynthOutput[m_bSweep ? 0 : iModelNum]->write( pcPicYuvSynthOut, 0 ,0 ,0, 0 );
    669 #else
    670           m_apcTVideoIOYuvSynthOutput[m_bSweep ? 0 : iModelNum]->write( pcPicYuvSynthOut, aiPad );
    671 #endif
    672664        }
    673665      }
     
    867859
    868860      // Write Output
    869 #if PIC_CROPPING
    870861      m_apcTVideoIOYuvSynthOutput[m_bSweep ? 0 : iSynthViewIdx]->write( pcPicYuvSynthOut, 0, 0, 0, 0 );
    871 #else
    872       m_apcTVideoIOYuvSynthOutput[m_bSweep ? 0 : iSynthViewIdx]->write( pcPicYuvSynthOut, aiPad );
    873 #endif
    874862    }
    875863    iFrame++;
     
    998986
    999987      // Write Output
    1000 #if PIC_CROPPING
    1001988      m_apcTVideoIOYuvSynthOutput[iViewIdx-1]->write( pcPicYuvSynthOut, 0, 0, 0 );
    1002 #else
    1003       m_apcTVideoIOYuvSynthOutput[iViewIdx-1]->write( pcPicYuvSynthOut, aiPad );
    1004 #endif
    1005989
    1006990    }
  • branches/HTM-5.1-dev0/source/Lib/TLibCommon/CommonDef.h

    r292 r294  
    437437
    438438// Explicit temporal layer QP offset
    439 #if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER
    440439#define MAX_TLAYER                  8           ///< max number of temporal layer
    441 #else
    442 #define MAX_TLAYER                  4           ///< max number of temporal layer
    443 #endif
    444440#define HB_LAMBDA_FOR_LDC           1           ///< use of B-style lambda for non-key pictures in low-delay mode
    445441
     
    466462#define MAX_NUM_REF_PICS 16
    467463
    468 #if !NAL_REF_FLAG
    469 enum NalRefIdc
    470 {
    471   NAL_REF_IDC_PRIORITY_LOWEST = 0,
    472   NAL_REF_IDC_PRIORITY_LOW,
    473   NAL_REF_IDC_PRIORITY_HIGH,
    474   NAL_REF_IDC_PRIORITY_HIGHEST
    475 };
    476 #endif
    477464
    478465enum NalUnitType
     
    480467  NAL_UNIT_UNSPECIFIED_0 = 0,
    481468  NAL_UNIT_CODED_SLICE,
    482 #if H0566_TLA
    483469#if QC_REM_IDV_B0046
    484470  NAL_UNIT_RESERVED,
     
    488474  NAL_UNIT_CODED_SLICE_TLA,
    489475  NAL_UNIT_CODED_SLICE_CRA,
    490 #else
    491   NAL_UNIT_CODED_SLICE_DATAPART_A,
    492   NAL_UNIT_CODED_SLICE_DATAPART_B,
    493   NAL_UNIT_CODED_SLICE_CDR,
    494 #endif
    495476  NAL_UNIT_CODED_SLICE_IDR,
    496477  NAL_UNIT_SEI,
  • branches/HTM-5.1-dev0/source/Lib/TLibCommon/ContextModel.cpp

    r56 r294  
    5656Void ContextModel::init( Int qp, Int initValue )
    5757{
    58 #if H0736_AVC_STYLE_QP_RANGE
    5958  qp = Clip3(0, 51, qp);
    60 #endif
    6159
    62 #if CABAC_LINEAR_INIT
    6360  Int  slope      = (initValue>>4)*5 - 45;
    6461  Int  offset     = ((initValue&15)<<3)-16;
     
    6663  UInt mpState    = (initState >= 64 );
    6764  m_ucState       = ( (mpState? (initState - 64):(63 - initState)) <<1) + mpState;
    68 #else
    69   Int m = m_slopes[initValue>>4];
    70   Int n = initValue & 15;
    71  
    72   Int val = max( 0, min( 3839, (n<<8) + m * (qp-26) + 128 ) );
    73   val -= 1920;
    74   Int valMps = val >= 0;
    75   val = ( val ^ (val>>11) ) + 128;
    76   Int segmentIdx = val >> 8;
    77   Int pStateIdx = m_accumulatedSegOffset[segmentIdx] + ( (val&255) * m_segOffset[segmentIdx] >> 8);
    78  
    79   m_ucState = (pStateIdx<<1) + valMps;
    80 #endif
    8165}
    8266
     
    143127#endif
    144128};
    145 #if !CABAC_LINEAR_INIT
    146 const Int ContextModel::m_slopes[16] = { -239, -143, -85, -51, -31, -19, -11, 0, 11, 19, 31, 51, 85, 143, 239, 399 };
    147 const Int ContextModel::m_segOffset[8]            = {   6,  7,  5,  7, 10, 14, 16,  1 };
    148 const Int ContextModel::m_accumulatedSegOffset[8] = {  -3,  3, 10, 15, 22, 32, 46, 62 };
    149 #endif
    150129//! \}
  • branches/HTM-5.1-dev0/source/Lib/TLibCommon/ContextModel.h

    r56 r294  
    103103  static UChar m_nextState[128][2];
    104104#endif
    105 #if !CABAC_LINEAR_INIT
    106   static const Int m_slopes[16];
    107   static const Int m_segOffset[8];
    108   static const Int m_accumulatedSegOffset[8];
    109 #endif
    110105#if CABAC_INIT_FLAG
    111106  UInt          m_binsCoded;
  • branches/HTM-5.1-dev0/source/Lib/TLibCommon/ContextTables.h

    r287 r294  
    5757
    5858#define NUM_MERGE_FLAG_EXT_CTX        1       ///< number of context models for merge flag of merge extended
    59 #if MRG_IDX_CTX_RED
    6059#define NUM_MERGE_IDX_EXT_CTX         1       ///< number of context models for merge index of merge extended
    61 #else
    62 #define NUM_MERGE_IDX_EXT_CTX         4       ///< number of context models for merge index of merge extended
    63 #endif
    6460
    6561#if HHI_INTER_VIEW_RESIDUAL_PRED
     
    6965#define NUM_ALF_CTRL_FLAG_CTX         1       ///< number of context models for ALF control flag
    7066#define NUM_PART_SIZE_CTX             4       ///< number of context models for partition size
    71 #if AMP_CTX
    7267#define NUM_CU_AMP_CTX                1       ///< number of context models for partition size (AMP)
    73 #else
    74 #define NUM_CU_X_POS_CTX              2       ///< number of context models for partition size (AMP)
    75 #define NUM_CU_Y_POS_CTX              2       ///< number of context models for partition size (AMP)
    76 #endif
    7768#define NUM_PRED_MODE_CTX             1       ///< number of context models for prediction mode
    7869
     
    9586#define NUM_SIG_FLAG_CTX_LUMA         27      ///< number of context models for luma sig flag
    9687#define NUM_SIG_FLAG_CTX_CHROMA       21      ///< number of context models for chroma sig flag
    97 #if LAST_CTX_REDUCTION
    9888#define NUM_CTX_LAST_FLAG_XY          15      ///< number of context models for last coefficient position
    99 #else
    100 #define NUM_CTX_LAST_FLAG_XY          18      ///< number of context models for last coefficient position
    101 #endif
    102 
    103 #if LEVEL_CTX_LUMA_RED
     89
    10490#define NUM_ONE_FLAG_CTX              24      ///< number of context models for greater than 1 flag
    10591#define NUM_ONE_FLAG_CTX_LUMA         16      ///< number of context models for greater than 1 flag of luma
    10692#define NUM_ONE_FLAG_CTX_CHROMA        8      ///< number of context models for greater than 1 flag of chroma
    107 #if RESTRICT_GR1GR2FLAG_NUMBER
    10893#define NUM_ABS_FLAG_CTX               6      ///< number of context models for greater than 2 flag
    10994#define NUM_ABS_FLAG_CTX_LUMA          4      ///< number of context models for greater than 2 flag of luma
    11095#define NUM_ABS_FLAG_CTX_CHROMA        2      ///< number of context models for greater than 2 flag of chroma
    111 #else
    112 #define NUM_ABS_FLAG_CTX              18      ///< number of context models for greater than 2 flag
    113 #define NUM_ABS_FLAG_CTX_LUMA         12      ///< number of context models for greater than 2 flag of luma
    114 #define NUM_ABS_FLAG_CTX_CHROMA        6      ///< number of context models for greater than 2 flag of chroma
    115 #endif
    116 #else
    117 #define NUM_ONE_FLAG_CTX              32      ///< number of context models for greater than 1 flag
    118 #define NUM_ONE_FLAG_CTX_LUMA         24      ///< number of context models for greater than 1 flag of luma
    119 #define NUM_ONE_FLAG_CTX_CHROMA        8      ///< number of context models for greater than 1 flag of chroma
    120 #if RESTRICT_GR1GR2FLAG_NUMBER
    121 #define NUM_ABS_FLAG_CTX               8      ///< number of context models for greater than 2 flag
    122 #define NUM_ABS_FLAG_CTX_LUMA          6      ///< number of context models for greater than 2 flag of luma
    123 #define NUM_ABS_FLAG_CTX_CHROMA        2      ///< number of context models for greater than 2 flag of chroma
    124 #else
    125 #define NUM_ABS_FLAG_CTX              24      ///< number of context models for greater than 2 flag
    126 #define NUM_ABS_FLAG_CTX_LUMA         18      ///< number of context models for greater than 2 flag of luma
    127 #define NUM_ABS_FLAG_CTX_CHROMA        6      ///< number of context models for greater than 2 flag of chroma
    128 #endif
    129 #endif
    13096
    13197#define NUM_MVP_IDX_CTX               2       ///< number of context models for MVP index
     
    138104#define NUM_SAO_UVLC_CTX              2       ///< number of context models for SAO UVLC
    139105#define NUM_SAO_SVLC_CTX              3       ///< number of context models for SAO SVLC
    140 #if SAO_UNIT_INTERLEAVING
    141106#define NUM_SAO_RUN_CTX               3       ///< number of context models for AO SVLC (filter coeff.)
    142107#define NUM_SAO_MERGE_LEFT_FLAG_CTX   3       ///< number of context models for AO SVLC (filter coeff.)
    143108#define NUM_SAO_MERGE_UP_FLAG_CTX     1       ///< number of context models for AO SVLC (filter coeff.)
    144109#define NUM_SAO_TYPE_IDX_CTX          2       ///< number of context models for AO SVLC (filter coeff.)
    145 #endif
    146 #if CABAC_LINEAR_INIT
    147110#define CNU                          154      ///< dummy initialization value for unused context models 'Context model Not Used'
    148 #else
    149 #define CNU                          119      ///< dummy initialization value for unused context models 'Context model Not Used'
    150 #endif
    151111
    152112#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     
    181141
    182142// initial probability for split flag
    183 #if CABAC_LINEAR_INIT
    184143static const UChar
    185144INIT_SPLIT_FLAG[3][NUM_SPLIT_FLAG_CTX] = 
     
    227186INIT_MERGE_IDX_EXT[3][NUM_MERGE_IDX_EXT_CTX] = 
    228187{
    229 #if MRG_IDX_CTX_RED
    230188  { CNU, },
    231189  { 122, },
    232190  { 137, },
    233 #else
    234   { CNU,  CNU,  CNU,  CNU, },
    235   { 122,  138,  153,  182, },
    236   { 137,  139,  154,  139, },
    237 #endif
    238191};
    239192
     
    256209};
    257210
    258 #if AMP_CTX
    259211static const UChar
    260212INIT_CU_AMP_POS[3][NUM_CU_AMP_CTX] = 
     
    264216  { 154, },
    265217};
    266 #else
    267 static const UChar
    268 INIT_CU_X_POS[3][NUM_CU_X_POS_CTX] = 
    269 {
    270   { CNU,  CNU, },
    271   { 154,  139, },
    272   { 154,  139, },
    273 };
    274 
    275 static const UChar
    276 INIT_CU_Y_POS[3][NUM_CU_Y_POS_CTX] = 
    277 {
    278   { CNU,  CNU, },
    279   { 154,  154, },
    280   { 154,  139, },
    281 };
    282 #endif
    283218
    284219static const UChar
     
    358293};
    359294
    360 #if LAST_CTX_REDUCTION
    361295static const UChar
    362296INIT_LAST[3][2*NUM_CTX_LAST_FLAG_XY] = 
     
    372306  },
    373307};
    374 #else
    375 static const UChar
    376 INIT_LAST[3][2*NUM_CTX_LAST_FLAG_XY] = 
    377 {
    378   { 110,  110,  124,  110,  140,  111,  124,  125,  111,  127,  111,  138,  111,  156,  127,  127,  111,   94,
    379     108,  123,   63,   63,  139,  124,   93,  108,  125,  111,  110,   63,  CNU,  CNU,  CNU,  CNU,  CNU,  CNU,
    380   },
    381   { 125,  110,  124,  110,  125,  110,  153,  125,  111,  111,  110,  153,  139,  111,  111,  111,  125,  139,
    382     108,  123,  108,  152,  124,   94,  123,  137,  139,  110,  110,  154,  CNU,  CNU,  CNU,  CNU,  CNU,  CNU,
    383   },
    384   { 125,  110,  124,  110,  125,  110,  153,  125,  111,  111,  110,  153,  139,  111,  111,  111,  125,  139, 
    385     108,  123,   93,  152,  124,   94,  123,  152,  139,  110,  110,  154,  CNU,  CNU,  CNU,  CNU,  CNU,  CNU,
    386   },
    387 };
    388 #endif
    389308
    390309static const UChar
     
    410329};
    411330
    412 #if LEVEL_CTX_LUMA_RED
    413331static const UChar
    414332INIT_ONE_FLAG[3][NUM_ONE_FLAG_CTX] =
     
    419337};
    420338
    421 #if RESTRICT_GR1GR2FLAG_NUMBER
    422339static const UChar
    423340INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] = 
     
    427344  { 107,  167,   91,  107,  107,  167, },
    428345};
    429 #else
    430 static const UChar
    431 INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] = 
    432 {
    433   { 138,  139,  111,  153,  139,  111,  136,  167,  139,  167,  153,  139,  152,  139,  140,  152,  184,  141, },
    434   { 107,  153,  125,  167,  153,  140,   91,  137,  153,  122,  167,  139,  107,  153,  140,  167,  183,  140, },
    435   { 107,  153,  125,  167,  153,  140,   91,  137,  153,  107,  167,  139,  107,  153,  140,  167,  183,  140, },
    436 };
    437 #endif
    438 #else
    439 static const UChar
    440 INIT_ONE_FLAG[3][NUM_ONE_FLAG_CTX] =
    441 {
    442   { 140,   92,  137,  138,  140,  152,  138,  139,  126,  168,  139,  139,  153,   74,  149,   92,  139,  107,  122,  152,  110,   93,  152,  138,  140,  179,  166,  182,  140,  227,  122,  197, },
    443   { 154,  196,  196,  167,  154,  152,  167,  182,  155,  139,  139,  139,  182,  134,  149,  136,  153,  121,  136,  137,  139,  122,  152,  167,  169,  194,  166,  167,  154,  167,  137,  182, },
    444   { 154,  196,  167,  167,  154,  152,  167,  182,  155,  139,  139,  139,  182,  134,  149,  136,  153,  121,  136,  122,  139,  107,  152,  152,  169,  208,  166,  167,  154,  152,  167,  182, },
    445 };
    446 
    447 #if RESTRICT_GR1GR2FLAG_NUMBER
    448 static const UChar
    449 INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] = 
    450 {
    451   { 138,  153,  139,  136,  167,  153,  152,  152, },
    452   { 107,  167,  139,   91,  122,  152,  107,  167, },
    453   { 107,  167,  139,   91,  107,   93,  107,  167, },
    454 };
    455 #else
    456 static const UChar
    457 INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] = 
    458 {
    459   { 138,  139,  111,  153,  139,  111,  139,  125,  111,  136,  167,  139,  167,  153,  139,  153,  139,  110,  152,  139,  140,  152,  184,  141, },
    460   { 107,  153,  125,  167,  153,  140,  139,  154,  155,   91,  137,  153,  122,  167,  139,  152,  138,  139,  107,  153,  140,  167,  183,  140, },
    461   { 107,  153,  125,  167,  153,  140,  139,  154,  155,   91,  137,  153,  107,  167,  139,   93,  138,  139,  107,  153,  140,  167,  183,  140, },
    462 };
    463 #endif
    464 #endif
    465346
    466347static const UChar
     
    520401};
    521402
    522 #if SAO_UNIT_INTERLEAVING
    523403static const UChar
    524404INIT_SAO_MERGE_LEFT_FLAG[3][NUM_SAO_MERGE_LEFT_FLAG_CTX] =
     
    544424  { 200,  140, },
    545425};
    546 #endif
    547426
    548427static const UChar
     
    553432{ CNU,  153,  138,  138,  CNU,  CNU,  CNU,  CNU,  CNU,  CNU, },
    554433};
    555 #else
    556 static const UChar
    557 INIT_SPLIT_FLAG[3][NUM_SPLIT_FLAG_CTX] =
    558 {
    559   {
    560      87,  74, 107,
    561    
    562   },
    563   {
    564      84, 103, 105,
    565    
    566   },
    567   {
    568      84, 103, 105,
    569    
    570   },
    571 };
    572 
    573 // initial probability for skip flag
    574 static const UChar
    575 INIT_SKIP_FLAG[3][NUM_SKIP_FLAG_CTX] =
    576 {
    577   {
    578     CNU, CNU, CNU,
    579    
    580   },
    581   {
    582     165, 168, 154,
    583    
    584   },
    585   {
    586     165, 168, 154,
    587    
    588   },
    589 };
    590 
    591 // initial probability for skip flag
    592 static const UChar
    593 INIT_ALF_CTRL_FLAG[3][NUM_ALF_CTRL_FLAG_CTX] =
    594 {
    595   {
    596     153,
    597    
    598   },
    599   {
    600      87,
    601    
    602   },
    603   {
    604     135,
    605    
    606   },
    607 };
    608 
    609 // initial probability for merge flag
    610 static const UChar
    611 INIT_MERGE_FLAG_EXT[3][NUM_MERGE_FLAG_EXT_CTX] =
    612 {
    613   {
    614     CNU,
    615    
    616   },
    617   {
    618     72,
    619    
    620   },
    621   {
    622     119,
    623    
    624   },
    625 };
    626 
    627 static const UChar
    628 INIT_MERGE_IDX_EXT[3][NUM_MERGE_IDX_EXT_CTX] =
    629 {
    630 #if MRG_IDX_CTX_RED
    631   {
    632     CNU,
    633    
    634   },
    635   {
    636     100,
    637    
    638   },
    639   {
    640     116,
    641   },
    642 #else
    643   {
    644     CNU, CNU, CNU, CNU,
    645    
    646   },
    647   {
    648     100,  86, 102, 133,
    649    
    650   },
    651   {
    652     116,  87, 119, 103,
    653    
    654   },
    655 #endif
    656 };
    657 
    658 // initial probability for PU size
    659 static const UChar
    660 INIT_PART_SIZE[3][NUM_PART_SIZE_CTX] =
    661 {
    662   {
    663     167, CNU, CNU, CNU,
    664    
    665   },
    666   {
    667     119,  87, CNU, CNU,
    668    
    669   },
    670   {
    671     119,  87, CNU, CNU,
    672    
    673   },
    674 };
    675 #if AMP_CTX
    676 static const UChar
    677 INIT_CU_AMP_POS[3][NUM_CU_AMP_CTX] =
    678 {
    679   {
    680     CNU,
    681   },
    682   {
    683     119,
    684   },
    685   {
    686     119,
    687   },
    688 };
    689 #else
    690 // initial probability for AMP split position (X)
    691 static const UChar
    692 INIT_CU_X_POS[3][NUM_CU_X_POS_CTX] =
    693 {
    694   {
    695     CNU, CNU,
    696    
    697   },
    698   {
    699     119, 103,
    700    
    701   },
    702   {
    703     119, 103,
    704    
    705   },
    706 };
    707 
    708 // initial probability for AMP split position (Y)
    709 static const UChar
    710 INIT_CU_Y_POS[3][NUM_CU_Y_POS_CTX] =
    711 {
    712   {
    713     CNU, CNU,
    714    
    715   },
    716   {
    717     119, 119,
    718    
    719   },
    720   {
    721     119, 103,
    722    
    723   },
    724 };
    725 #endif
    726 // initial probability for prediction mode
    727 static const UChar
    728 INIT_PRED_MODE[3][NUM_PRED_MODE_CTX] =
    729 {
    730   {
    731     CNU,
    732    
    733   },
    734   {
    735     114,
    736    
    737   },
    738   {
    739     98,
    740    
    741   },
    742 };
    743 
    744 // initial probability for intra direction of luma
    745 static const UChar
    746 INIT_INTRA_PRED_MODE[3][NUM_ADI_CTX] =
    747 {
    748   {
    749     167,
    750    
    751   },
    752   {
    753     119,
    754    
    755   },
    756   {
    757     150,
    758    
    759   },
    760 };
    761 
    762 // initial probability for intra direction of chroma
    763 static const UChar
    764 INIT_CHROMA_PRED_MODE[3][NUM_CHROMA_PRED_CTX] =
    765 {
    766   {
    767     53, 103,
    768    
    769   },
    770   {
    771     85,  87,
    772    
    773   },
    774   {
    775     101,  87,
    776    
    777   },
    778 };
    779 
    780 // initial probability for temporal direction
    781 static const UChar
    782 INIT_INTER_DIR[3][NUM_INTER_DIR_CTX] =
    783 {
    784   {
    785     CNU, CNU, CNU, CNU,
    786    
    787   },
    788   {
    789     CNU, CNU, CNU, CNU,
    790    
    791   },
    792   {
    793     41,  39,  38,  36,
    794    
    795   },
    796 };
    797 
    798 // initial probability for motion vector difference
    799 static const UChar
    800 INIT_MVD[3][NUM_MV_RES_CTX] =
    801 {
    802   {
    803     CNU, CNU,
    804    
    805   },
    806   {
    807     120, 166,
    808    
    809   },
    810   {
    811     135, 166,
    812    
    813   },
    814 };
    815 
    816 // initial probability for reference frame index
    817 static const UChar
    818 INIT_REF_PIC[3][NUM_REF_NO_CTX] =
    819 {
    820   {
    821     CNU, CNU, CNU, CNU,
    822    
    823   },
    824   {
    825     102, 118, 103, CNU,
    826    
    827   },
    828   {
    829     118, 118, 134, CNU,
    830    
    831   },
    832 };
    833 
    834 // initial probability for dQP
    835 static const UChar
    836 INIT_DQP[3][NUM_DELTA_QP_CTX] =
    837 {
    838   {
    839     CNU, CNU, CNU,
    840    
    841   },
    842   {
    843     CNU, CNU, CNU,
    844    
    845   },
    846   {
    847     CNU, CNU, CNU,
    848    
    849   },
    850 };
    851 
    852 static const UChar
    853 INIT_QT_CBF[3][2*NUM_QT_CBF_CTX] =
    854 {
    855   {
    856      73,  74, CNU, CNU, CNU,
    857      55,  86, 133, CNU, CNU,
    858    
    859   },
    860   {
    861     102,  89, CNU, CNU, CNU,
    862     114,  84, 117, CNU, CNU,
    863    
    864   },
    865   {
    866     102,  89, CNU, CNU, CNU,
    867     114,  68, 117, CNU, CNU,
    868    
    869   },
    870 };
    871 
    872 static const UChar
    873 INIT_QT_ROOT_CBF[3][NUM_QT_ROOT_CBF_CTX] =
    874 {
    875   {
    876     CNU,
    877    
    878   },
    879   {
    880     39,
    881    
    882   },
    883   {
    884     39,
    885    
    886   },
    887 };
    888 
    889 #if LAST_CTX_REDUCTION
    890 static const UChar
    891 INIT_LAST[3][2*NUM_CTX_LAST_FLAG_XY] =
    892 {
    893   {
    894     72,  72,  71,  72, 104,  89,  88,  89,  59,  73,  89, 106,  60,  59,  43,   
    895     54,  70,  53,  CNU, CNU, CNU,  CNU, CNU, CNU,  CNU, CNU, CNU, CNU, CNU, CNU,
    896   },
    897   {
    898     57,  72,  55,  72,  57,  72,   88,  73,  73,  72,  103,  73,  89,  73,  57, 
    899     54,  70,  54,  CNU, CNU, CNU,  CNU, CNU, CNU,  CNU, CNU, CNU, CNU, CNU, CNU,
    900   },
    901   {
    902     88,  72,  71,  72,  57,  72,  88,  73,  73,  72,   103,  73,  89,  73,  57,   
    903     54,  70,  69,   CNU, CNU, CNU,  CNU, CNU, CNU,  CNU, CNU, CNU, CNU, CNU, CNU,
    904   },
    905 };
    906 #else
    907 static const UChar
    908 INIT_LAST[3][2*NUM_CTX_LAST_FLAG_XY] =
    909 {
    910   {
    911     72,  72,  71,  72, 104,  89,  71,  88,  89,  59,  73,  86,  89, 106,  60,  59,  43,  55,
    912     54,  70,  53,  53,  87,  71,  69,  54,  88,  73,  72,  53, CNU, CNU, CNU, CNU, CNU, CNU,
    913    
    914   },
    915   {
    916     57,  72,  71,  72,  57,  72, 102,  88,  73,  73,  72, 102, 103,  73,  89,  73,  57,  87,
    917     54,  70,  54, 101,  71,  55,  70, 116, 103,  72,  72, 119, CNU, CNU, CNU, CNU, CNU, CNU,
    918    
    919   },
    920   {
    921     88,  72,  71,  72,  57,  72, 102,  88,  73,  73,  72, 118, 103,  73,  89,  73,  57,  87,
    922     54,  70,  69,  85,  71,  55,  70,  85, 103,  72,  72, 119, CNU, CNU, CNU, CNU, CNU, CNU,
    923    
    924   },
    925 };
    926 #endif
    927 
    928 static const UChar
    929 INIT_SIG_CG_FLAG[3][2 * NUM_SIG_CG_FLAG_CTX] =
    930 {
    931   {
    932     83, 122,
    933     98, 121,
    934    
    935   },
    936   {
    937     99, 120,
    938     67, 119,
    939    
    940   },
    941   {
    942     99, 120,
    943     67, 119,
    944    
    945   },
    946 };
    947 
    948 static const UChar
    949 INIT_SIG_FLAG[3][NUM_SIG_FLAG_CTX] =
    950 {
    951   {
    952     74,  73,  88,  72,  72,  55,  71,  54,  71,  88, 103,  71,  53,  87, 134,  86,  84,  70,  68,  89,  90,  84,  88,  74, 130, 118,  88,
    953     120,  87, 149,  70,  52, 118, 133, 116, 114, 129, 132, 162, 115,  51, 115,  66, 120,  74, 115,  87,  89,
    954   },
    955   {
    956     152, 119, 103, 118,  87,  70,  70,  53, 118, 134, 118, 101,  68,  85, 101, 116, 100,  68,  67, 136, 168, 147, 150, 120, 115, 118, 119,
    957     136, 102,  70,  53,  67, 117, 102, 117, 115, 114,  84, 115,  99, 100,  83, 114, 152, 168, 131, 150, 120,
    958   },
    959   {
    960     152, 119, 103, 118,  87,  70,  70,  53,  71, 103, 118, 101,  68,  85, 101, 116, 116,  68,  67, 152, 168, 147, 150, 120, 115, 118, 119,
    961     136, 102,  86,  84,  67, 117, 102, 117, 115,  99, 100, 115,  99, 100,  83, 114, 152, 152, 131, 150, 120,
    962   },
    963 };
    964 
    965 #if LEVEL_CTX_LUMA_RED
    966 static const UChar
    967 INIT_ONE_FLAG[3][NUM_ONE_FLAG_CTX] =
    968 {
    969   {
    970     104,  68, 116,  86, 104, 132,  86,  87, 102,  66, 114,  68,  87,  84, 100, 101,
    971       104, 130, 147, 149, 104, 196, 100, 165,
    972   },
    973   {
    974     119, 179, 179, 164, 119,  85, 117, 149, 133,  98, 114, 115, 118,  99, 115, 116,
    975       135, 146, 147, 164, 119, 148, 116, 133,
    976   },
    977   {
    978     119, 179, 148, 164, 119,  85, 117, 149, 133,  98, 114, 115, 118,  99, 115, 100,
    979       135, 177, 147, 164, 119, 132, 148, 149,
    980   },
    981 };
    982 
    983 #if RESTRICT_GR1GR2FLAG_NUMBER
    984 static const UChar
    985 INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] =
    986 {
    987   {
    988     86, 102, 115, 117, 101, 101,
    989   },
    990   {
    991     84, 117, 83, 100, 84, 117,
    992   },
    993   {
    994     84, 117, 83,  84, 84, 117,
    995   },
    996 };
    997 #else
    998 static const UChar
    999 INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] =
    1000 {
    1001   {
    1002     86, 103,  73, 102, 103,  73, 115, 117, 103, 117, 118, 103,
    1003       101, 103, 104, 101, 167, 121,
    1004   },
    1005   {
    1006     84, 102,  88, 117, 118, 104, 83, 116, 118, 100, 117,  87,
    1007       84, 118, 120, 117, 150, 120,
    1008     },
    1009     {
    1010       84, 102,  88, 117, 118, 104, 83, 116, 118,  84, 117,  87,
    1011         84, 118, 120, 117, 150, 120,
    1012     },
    1013 };
    1014 #endif
    1015 #else
    1016 static const UChar
    1017 INIT_ONE_FLAG[3][NUM_ONE_FLAG_CTX] =
    1018 {
    1019   {
    1020     104,  68, 116,  86, 104, 132,  86,  87, 105, 134,  87, 103, 102,  66, 114,  68,  87,  84, 100, 101,  72,  69, 101,  86,
    1021     104, 130, 147, 149, 104, 196, 100, 165,
    1022   },
    1023   {
    1024     119, 179, 179, 164, 119,  85, 117, 149, 136, 103, 103, 103, 133,  98, 114, 115, 118,  99, 115, 116,  87, 100,  85, 117,
    1025     135, 146, 147, 164, 119, 148, 116, 133,
    1026   },
    1027   {
    1028     119, 179, 148, 164, 119,  85, 117, 149, 136,  87, 103, 103, 133,  98, 114, 115, 118,  99, 115, 100,  87,  84,  85,  85,
    1029     135, 177, 147, 164, 119, 132, 148, 149,
    1030   },
    1031 };
    1032 
    1033 #if RESTRICT_GR1GR2FLAG_NUMBER
    1034 static const UChar
    1035 INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] =
    1036 {
    1037   {
    1038     86, 102, 103, 115, 117, 102, 101, 101,
    1039   },
    1040   {
    1041     84, 117, 103, 83, 100, 85, 84, 117,
    1042   },
    1043   {
    1044     84, 117, 87, 83, 84, 69, 84, 117,
    1045   },
    1046 };
    1047 #else
    1048 static const UChar
    1049 INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] =
    1050 {
    1051   {
    1052     86, 103,  73, 102, 103,  73, 103,  88,  89, 115, 117, 103, 117, 118, 103, 102, 103,  72,
    1053     101, 103, 104, 101, 167, 121,
    1054   },
    1055   {
    1056     84, 102,  88, 117, 118, 104, 103, 119, 136,  83, 116, 118, 100, 117,  87,  85,  86, 103,
    1057     84, 118, 120, 117, 150, 120,
    1058   },
    1059   {
    1060     84, 102,  88, 117, 118, 104,  87, 119, 136,  83, 116, 118,  84, 117,  87,  69,  86,  87,
    1061     84, 118, 120, 117, 150, 120,
    1062   },
    1063 };
    1064 #endif
    1065 #endif
    1066 // initial probability for motion vector predictor index
    1067 static const UChar
    1068 INIT_MVP_IDX[3][NUM_MVP_IDX_CTX] =
    1069 {
    1070   {
    1071     CNU, CNU,
    1072    
    1073   },
    1074   {
    1075     134, CNU,
    1076    
    1077   },
    1078   {
    1079     134, CNU,
    1080    
    1081   },
    1082 };
    1083 
    1084 // initial probability for ALF flag
    1085 static const UChar
    1086 INIT_ALF_FLAG[3][NUM_ALF_FLAG_CTX] =
    1087 {
    1088   {
    1089     118,
    1090    
    1091   },
    1092   {
    1093     102,
    1094    
    1095   },
    1096   {
    1097     102,
    1098    
    1099   },
    1100 };
    1101 
    1102 // initial probability for ALF side information (unsigned)
    1103 static const UChar
    1104 INIT_ALF_UVLC[3][NUM_ALF_UVLC_CTX] =
    1105 {
    1106   {
    1107     120, 119,
    1108    
    1109   },
    1110   {
    1111     119, 119,
    1112    
    1113   },
    1114   {
    1115     119, 119,
    1116    
    1117   },
    1118 };
    1119 
    1120 // initial probability for ALF side information (signed)
    1121 static const UChar
    1122 INIT_ALF_SVLC[3][NUM_ALF_SVLC_CTX] =
    1123 {
    1124   {
    1125     139, 119, 124,
    1126    
    1127   },
    1128   {
    1129      90, 119, 140,
    1130    
    1131   },
    1132   {
    1133      90, 119, 124,
    1134    
    1135   },
    1136 };
    1137 
    1138 // initial probability for SAO flag
    1139 static const UChar
    1140 INIT_SAO_FLAG[3][NUM_SAO_FLAG_CTX] =
    1141 {
    1142   {
    1143     119,
    1144    
    1145   },
    1146   {
    1147     102,
    1148    
    1149   },
    1150   {
    1151     102,
    1152    
    1153   },
    1154 };
    1155 
    1156 // initial probability for SAO side information (unsigned)
    1157 static const UChar
    1158 INIT_SAO_UVLC[3][NUM_SAO_UVLC_CTX] =
    1159 {
    1160   {
    1161      61, 104,
    1162    
    1163   },
    1164   {
    1165     168, 120,
    1166    
    1167   },
    1168   {
    1169     184, 120,
    1170    
    1171   },
    1172 };
    1173 
    1174 // initial probability for SAO side information (signed)
    1175 static const UChar
    1176 INIT_SAO_SVLC[3][NUM_SAO_SVLC_CTX] =
    1177 {
    1178   {
    1179     171, 119, 199,
    1180    
    1181   },
    1182   {
    1183     169, 119, 151,
    1184    
    1185   },
    1186   {
    1187     169, 119, 151,
    1188    
    1189   },
    1190 };
    1191 
    1192 #if SAO_UNIT_INTERLEAVING
    1193 static const UChar
    1194 INIT_SAO_MERGE_LEFT_FLAG[3][NUM_SAO_MERGE_LEFT_FLAG_CTX] =
    1195 {
    1196   {
    1197     118, 118, 118,
    1198   },
    1199   {
    1200     102, 102, 102,
    1201     },
    1202     {
    1203       102, 102, 102,
    1204     },
    1205 };
    1206 
    1207 static const UChar
    1208 INIT_SAO_MERGE_UP_FLAG[3][NUM_SAO_MERGE_UP_FLAG_CTX] =
    1209 {
    1210   {
    1211     109,
    1212   },
    1213   {
    1214     102,
    1215   },
    1216   {
    1217     102,
    1218   },
    1219 };
    1220 static const UChar
    1221 INIT_SAO_TYPE_IDX[3][NUM_SAO_TYPE_IDX_CTX] =
    1222 {
    1223   {
    1224     64, 104
    1225   },
    1226   {
    1227   168, 120
    1228   },
    1229   {
    1230     184, 120
    1231   },
    1232 };
    1233 static const Short
    1234 INIT_SAO_RUN[3][NUM_SAO_RUN_CTX][2] =
    1235 {
    1236   {
    1237     {   11,   57 }, {   -1,   62 }, {    0,   64 }
    1238   },
    1239   {
    1240     {    6,   66 }, {   -1,   64 }, {    0,   64 }
    1241   },
    1242   {
    1243     {    1,   73 }, {    2,   61 }, {    0,   64 }
    1244   }
    1245 };
    1246 #endif
    1247 
    1248 static const UChar
    1249 INIT_TRANS_SUBDIV_FLAG[3][NUM_TRANS_SUBDIV_FLAG_CTX] =
    1250 {
    1251   {
    1252     CNU, 162, 148, 100, CNU, CNU, CNU, CNU, CNU, CNU,
    1253    
    1254   },
    1255   {
    1256     CNU,  71,  86,  55, CNU, CNU, CNU, CNU, CNU, CNU,
    1257    
    1258   },
    1259   {
    1260     CNU, 102,  86,  86, CNU, CNU, CNU, CNU, CNU, CNU,
    1261    
    1262   },
    1263 };
    1264 #endif
    1265434
    1266435#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
  • branches/HTM-5.1-dev0/source/Lib/TLibCommon/NAL.h

    r210 r294  
    4646{
    4747  NalUnitType m_nalUnitType; ///< nal_unit_type
    48 #if NAL_REF_FLAG
    4948  Bool        m_nalRefFlag;  ///< nal_ref_flag
    50 #else
    51   NalRefIdc   m_nalRefIDC;   ///< nal_ref_idc
    52 #endif
    5349#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    5450  unsigned    m_layerId;
     
    5854  Bool        m_isDepth;     ///< is_depth
    5955  unsigned    m_temporalId;  ///< temporal_id
    60 #if !H0388
    61   bool        m_OutputFlag;  ///< output_flag
    62 #endif
    6356#endif
    6457
    6558  /** construct an NALunit structure with given header values. */
    66 #if H0388
    67 #if NAL_REF_FLAG
    6859  NALUnit(
    6960    NalUnitType nalUnitType,
     
    8677    ,m_temporalId  (temporalId)
    8778  {}
    88 #else
    89   NALUnit(
    90     NalUnitType  nalUnitType,
    91     NalRefIdc    nalRefIDC,
    92     Int          viewId,
    93     Bool         isDepth,
    94     unsigned temporalID = 0)
    95   {
    96     m_nalUnitType = nalUnitType;
    97     m_nalRefIDC   = nalRefIDC;
    98 #if !VIDYO_VPS_INTEGRATION
    99     m_viewId      = viewId;
    100     m_isDepth     = isDepth;
    101 #else
    102     m_layerId = layerId;
    103 #endif
    104     m_temporalId  = temporalID;
    105   }
    106 #endif
    107 #else
    108   NALUnit(
    109     NalUnitType  nalUnitType,
    110     NalRefIdc    nalRefIDC,
    111 #if !VIDYO_VPS_INTEGRATION   
    112     Int          viewId,
    113     Bool         isDepth,
    114 #else
    115     unsigned         layerId,
    116 #endif
    117     unsigned     temporalID = 0,
    118     bool         outputFlag = true)
    119   {
    120     m_nalUnitType = nalUnitType;
    121     m_nalRefIDC   = nalRefIDC;
    122 #if !VIDYO_VPS_INTEGRATION
    123     m_viewId      = viewId;
    124     m_isDepth     = isDepth;
    125 #else
    126     m_layerId = layerId;
    127 #endif
    128     m_temporalId  = temporalID;
    129     m_OutputFlag  = outputFlag;
    130   }
    131 #endif
    13279
    13380  /** default constructor - no initialization; must be perfomed by user */
     
    13885  {
    13986    return m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR
    140 #if H0566_TLA
    14187#if !QC_REM_IDV_B0046   
    14288        || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDV
     
    14490        || m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA
    14591        || m_nalUnitType == NAL_UNIT_CODED_SLICE_TLA
    146 #else
    147         || m_nalUnitType == NAL_UNIT_CODED_SLICE_CDR
    148 #endif
    14992        || m_nalUnitType == NAL_UNIT_CODED_SLICE;
    15093  }
  • branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComAdaptiveLoopFilter.cpp

    r56 r294  
    4646
    4747
    48 #if !LCU_SYNTAX_ALF
    49 ALFParam::~ALFParam()
    50 {
    51   if (coeff_chroma != NULL)
    52   {
    53     delete[] coeff_chroma;
    54   }
    55   if (coeffmulti)
    56   {
    57     for (Int i=0; i<NO_VAR_BINS; i++)
    58     {
    59       if (coeffmulti[i] != NULL)
    60       {
    61         delete[] coeffmulti[i];
    62       }
    63     }
    64     delete[] coeffmulti;
    65   }
    66 
    67   if (nbSPred != NULL)
    68   {
    69     delete[] nbSPred;
    70   }
    71   if (filterPattern != NULL)
    72   {
    73     delete[] filterPattern;
    74   }
    75 }
    76 #endif
    7748
    7849// ====================================================================================================================
     
    8051// ====================================================================================================================
    8152
    82 #if ALF_SINGLE_FILTER_SHAPE
    8353Int TComAdaptiveLoopFilter::weightsShape1Sym[ALF_MAX_NUM_COEF+1] =
    8454{
     
    10979  depthIntShape1Sym
    11080};
    111 #else
    112 //Shape0: Star5x5
    113 Int TComAdaptiveLoopFilter::weightsShape0Sym[10] =
    114 {
    115   2,    2,    2,   
    116   2, 2, 2,       
    117   2, 2, 1, 1
    118 };
    119 
    120 
    121 //Shape1: Cross9x9
    122 Int TComAdaptiveLoopFilter::weightsShape1Sym[10] =
    123 {
    124               2,
    125               2,
    126               2,
    127               2,
    128   2, 2, 2, 2, 1,
    129               1
    130 };
    131 
    132 
    133 Int* TComAdaptiveLoopFilter::weightsTabShapes[NUM_ALF_FILTER_SHAPE] =
    134 {
    135   weightsShape0Sym, weightsShape1Sym
    136 };
    137 
    138 Int TComAdaptiveLoopFilter::m_sqrFiltLengthTab[NUM_ALF_FILTER_SHAPE] =
    139 {
    140   9, 9
    141 };
    142 
    143 // Shape0
    144 Int depthIntShape0Sym[10] =
    145 {
    146   1,    3,    1,
    147   3, 4, 3,
    148   3, 4, 5, 5                 
    149 };
    150 // Shape1
    151 Int depthIntShape1Sym[10] =
    152 {
    153               5,
    154               6,
    155               7,
    156               8,
    157   5, 6, 7, 8, 9,
    158               9 
    159 };
    160 
    161 
    162 Int* pDepthIntTabShapes[NUM_ALF_FILTER_SHAPE] =
    163 {
    164   depthIntShape0Sym, depthIntShape1Sym
    165 };
    166 #endif
    167 
    168 #if LCU_SYNTAX_ALF
     81
    16982Int kTableShape1[ALF_MAX_NUM_COEF+1] =
    17083{     
     
    17992  kTableShape1
    18093};
    181 #endif
    18294
    18395// ====================================================================================================================
     
    194106}
    195107
    196 #if LCU_SYNTAX_ALF
    197108/// AlfCUCtrlInfo
    198109Void AlfCUCtrlInfo::reset()
     
    530441}
    531442
    532 #endif
    533443
    534444
     
    543453  m_pvpAlfLCU    = NULL;
    544454  m_pvpSliceTileAlfLCU = NULL;
    545 #if LCU_SYNTAX_ALF
    546455  for(Int c=0; c< NUM_ALF_COMPONENT; c++)
    547456  {
     
    550459  m_varImg = NULL;
    551460  m_filterCoeffSym = NULL;
    552 #endif
    553461
    554462}
     
    755663Void TComAdaptiveLoopFilter::create( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth )
    756664{
    757 #if LCU_SYNTAX_ALF
    758665  destroy();
    759 #endif
    760666  if ( !m_pcTempPicYuv )
    761667  {
     
    765671  m_img_height = iPicHeight;
    766672  m_img_width = iPicWidth;
    767 #if LCU_SYNTAX_ALF
    768673  initMatrix_Pel(&(m_varImg), m_img_height, m_img_width);
    769 #else
    770   for(Int i=0; i< NUM_ALF_CLASS_METHOD; i++)
    771   {
    772     initMatrix_Pel(&(m_varImgMethods[i]), m_img_height, m_img_width);
    773   }
    774 #endif
    775674  initMatrix_int(&m_filterCoeffSym, NO_VAR_BINS, ALF_MAX_NUM_COEF);
    776675  UInt uiNumLCUsInWidth   = m_img_width  / uiMaxCUWidth;
     
    782681  m_uiNumCUsInFrame = uiNumLCUsInWidth* uiNumLCUsInHeight;
    783682
    784 #if LCU_SYNTAX_ALF
    785683  m_numLCUInPicWidth = uiNumLCUsInWidth;
    786684  m_numLCUInPicHeight= uiNumLCUsInHeight;
    787685  m_lcuHeight = uiMaxCUHeight;
    788 #if ALF_SINGLE_FILTER_SHAPE
    789686  m_lineIdxPadBot = m_lcuHeight - 4 - 3; // DFRegion, Vertical Taps
    790 #else
    791   m_lineIdxPadBot = m_lcuHeight - 4 - 4; // DFRegion, Vertical Taps
    792 #endif
    793687  m_lineIdxPadTop = m_lcuHeight - 4; // DFRegion
    794688
    795689  m_lcuHeightChroma = m_lcuHeight>>1;
    796 #if ALF_SINGLE_FILTER_SHAPE
    797690  m_lineIdxPadBotChroma = m_lcuHeightChroma - 2 - 3; // DFRegion, Vertical Taps
    798 #else
    799   m_lineIdxPadBotChroma = m_lcuHeightChroma - 2 - 4; // DFRegion, Vertical Taps
    800 #endif
    801691  m_lineIdxPadTopChroma = m_lcuHeightChroma - 2 ; // DFRegion
    802692
    803693  createLCUAlfInfo();
    804 #else
    805   createRegionIndexMap(m_varImgMethods[ALF_RA], m_img_width, m_img_height);
    806 #endif
    807694}
    808695
     
    813700    m_pcTempPicYuv->destroy();
    814701    delete m_pcTempPicYuv;
    815 #if LCU_SYNTAX_ALF
    816702    m_pcTempPicYuv = NULL;
    817 #endif
    818   }
    819 #if LCU_SYNTAX_ALF
     703  }
    820704  if(m_varImg != NULL)
    821705  {
     
    828712    m_filterCoeffSym = NULL;
    829713  }
    830 #else
    831   for(Int i=0; i< NUM_ALF_CLASS_METHOD; i++)
    832   {
    833     destroyMatrix_Pel(m_varImgMethods[i]);
    834   }
    835   destroyMatrix_int(m_filterCoeffSym);
    836 #endif
    837 #if LCU_SYNTAX_ALF
    838714  destroyLCUAlfInfo();
    839 #endif
    840 
    841 }
    842 
    843 #if !LCU_SYNTAX_ALF
    844 // --------------------------------------------------------------------------------------------------------------------
    845 // allocate / free / copy functions
    846 // --------------------------------------------------------------------------------------------------------------------
    847 Void TComAdaptiveLoopFilter::allocALFParam(ALFParam* pAlfParam)
    848 {
    849   pAlfParam->alf_flag = 0;
    850   pAlfParam->coeff_chroma = new Int[ALF_MAX_NUM_COEF];
    851   ::memset(pAlfParam->coeff_chroma, 0, sizeof(Int)*ALF_MAX_NUM_COEF );
    852   pAlfParam->coeffmulti = new Int*[NO_VAR_BINS];
    853   for (int i=0; i<NO_VAR_BINS; i++)
    854   {
    855     pAlfParam->coeffmulti[i] = new Int[ALF_MAX_NUM_COEF];
    856     ::memset(pAlfParam->coeffmulti[i],        0, sizeof(Int)*ALF_MAX_NUM_COEF );
    857   }
    858   pAlfParam->nbSPred = new Int[NO_VAR_BINS];
    859   ::memset(pAlfParam->nbSPred, 0, sizeof(Int)*NO_VAR_BINS);
    860   pAlfParam->filterPattern = new Int[NO_VAR_BINS];
    861   ::memset(pAlfParam->filterPattern, 0, sizeof(Int)*NO_VAR_BINS);
    862   pAlfParam->alf_pcr_region_flag = 0;
    863 }
    864 
    865 Void TComAdaptiveLoopFilter::freeALFParam(ALFParam* pAlfParam)
    866 {
    867   assert(pAlfParam != NULL);
    868   if (pAlfParam->coeff_chroma != NULL)
    869   {
    870     delete[] pAlfParam->coeff_chroma;
    871     pAlfParam->coeff_chroma = NULL;
    872   }
    873   for (int i=0; i<NO_VAR_BINS; i++)
    874   {
    875     delete[] pAlfParam->coeffmulti[i];
    876     pAlfParam->coeffmulti[i] = NULL;
    877   }
    878   delete[] pAlfParam->coeffmulti;
    879   pAlfParam->coeffmulti = NULL;
    880 
    881   delete[] pAlfParam->nbSPred;
    882   pAlfParam->nbSPred = NULL;
    883 
    884   delete[] pAlfParam->filterPattern;
    885   pAlfParam->filterPattern = NULL;
    886 }
    887 
    888 
    889 Void TComAdaptiveLoopFilter::copyALFParam(ALFParam* pDesAlfParam, ALFParam* pSrcAlfParam)
    890 {
    891   pDesAlfParam->alf_flag = pSrcAlfParam->alf_flag;
    892   pDesAlfParam->chroma_idc = pSrcAlfParam->chroma_idc;
    893   pDesAlfParam->num_coeff = pSrcAlfParam->num_coeff;
    894   pDesAlfParam->filter_shape_chroma = pSrcAlfParam->filter_shape_chroma;
    895   pDesAlfParam->num_coeff_chroma = pSrcAlfParam->num_coeff_chroma;
    896   pDesAlfParam->alf_pcr_region_flag = pSrcAlfParam->alf_pcr_region_flag;
    897   ::memcpy(pDesAlfParam->coeff_chroma, pSrcAlfParam->coeff_chroma, sizeof(Int)*ALF_MAX_NUM_COEF);
    898   pDesAlfParam->filter_shape = pSrcAlfParam->filter_shape;
    899   ::memcpy(pDesAlfParam->filterPattern, pSrcAlfParam->filterPattern, sizeof(Int)*NO_VAR_BINS);
    900   pDesAlfParam->startSecondFilter = pSrcAlfParam->startSecondFilter;
    901 
    902   //Coeff send related
    903   pDesAlfParam->filters_per_group = pSrcAlfParam->filters_per_group; //this can be updated using codedVarBins
    904   pDesAlfParam->predMethod = pSrcAlfParam->predMethod;
    905   ::memcpy(pDesAlfParam->nbSPred, pSrcAlfParam->nbSPred, sizeof(Int)*NO_VAR_BINS);
    906   for (int i=0; i<NO_VAR_BINS; i++)
    907   {
    908     ::memcpy(pDesAlfParam->coeffmulti[i], pSrcAlfParam->coeffmulti[i], sizeof(Int)*ALF_MAX_NUM_COEF);
    909   }
    910 }
    911 // --------------------------------------------------------------------------------------------------------------------
    912 // prediction of filter coefficients
    913 // --------------------------------------------------------------------------------------------------------------------
    914 
    915 Void TComAdaptiveLoopFilter::predictALFCoeffChroma( ALFParam* pAlfParam )
    916 {
    917   Int i, sum, pred, N;
    918   const Int* pFiltMag = NULL;
    919   pFiltMag = weightsTabShapes[pAlfParam->filter_shape_chroma];
    920   N = pAlfParam->num_coeff_chroma;
    921   sum=0;
    922   for(i=0; i<N;i++)
    923   {
    924     sum+=pFiltMag[i]*pAlfParam->coeff_chroma[i];
    925   }
    926   pred=(1<<ALF_NUM_BIT_SHIFT)-(sum-pAlfParam->coeff_chroma[N-1]);
    927 #if ALF_CHROMA_COEF_PRED_HARMONIZATION
    928   pAlfParam->coeff_chroma[N-1]=pAlfParam->coeff_chroma[N-1] - pred;
    929 #else
    930   pAlfParam->coeff_chroma[N-1]=pred-pAlfParam->coeff_chroma[N-1];
    931 #endif
    932 }
    933 
    934 #if ALF_CHROMA_COEF_PRED_HARMONIZATION
    935 Void TComAdaptiveLoopFilter::reconstructALFCoeffChroma( ALFParam* pAlfParam )
    936 {
    937   Int i, sum, pred, N;
    938   const Int* pFiltMag = NULL;
    939   pFiltMag = weightsTabShapes[pAlfParam->filter_shape_chroma];
    940   N = pAlfParam->num_coeff_chroma;
    941   sum=0;
    942   for(i=0; i<N;i++)
    943   {
    944     sum+=pFiltMag[i]*pAlfParam->coeff_chroma[i];
    945   }
    946   pred=(1<<ALF_NUM_BIT_SHIFT)-(sum-pAlfParam->coeff_chroma[N-1]);
    947   pAlfParam->coeff_chroma[N-1]=pred+ pAlfParam->coeff_chroma[N-1];
    948 }
    949 #endif
    950 #endif
     715
     716}
     717
    951718
    952719// --------------------------------------------------------------------------------------------------------------------
     
    954721// --------------------------------------------------------------------------------------------------------------------
    955722
    956 #if LCU_SYNTAX_ALF
    957723/** ALF reconstruction process for one picture
    958724 * \param [in, out] pcPic the decoded/filtered picture (input: decoded picture; output filtered picture)
     
    1113879}
    1114880
    1115 #else
    1116 
    1117 /**
    1118  \param [in, out] pcPic         picture (TComPic) class (input/output)
    1119  \param [in] pcAlfParam    ALF parameter
    1120  \param [in,out] vAlfCUCtrlParam ALF CU control parameters
    1121  \todo   for temporal buffer, it uses residual picture buffer, which may not be safe. Make it be safer.
    1122  */
    1123 Void TComAdaptiveLoopFilter::ALFProcess(TComPic* pcPic, ALFParam* pcAlfParam, std::vector<AlfCUCtrlInfo>& vAlfCUCtrlParam)
    1124 {
    1125   assert(m_uiNumSlicesInPic == vAlfCUCtrlParam.size());
    1126   if(!pcAlfParam->alf_flag)
    1127   {
    1128     return;
    1129   }
    1130 
    1131   m_lcuHeight     = pcPic->getSlice(0)->getSPS()->getMaxCUHeight();
    1132 #if ALF_SINGLE_FILTER_SHAPE
    1133   m_lineIdxPadBot = m_lcuHeight - 4 - 3;             // DFRegion, Vertical Taps
    1134 #else
    1135   m_lineIdxPadBot = m_lcuHeight - 4 - 4;             // DFRegion, Vertical Taps
    1136 #endif
    1137   m_lineIdxPadTop = m_lcuHeight - 4;                 // DFRegion
    1138 
    1139   m_lcuHeightChroma     = m_lcuHeight>>1;
    1140 #if ALF_SINGLE_FILTER_SHAPE
    1141   m_lineIdxPadBotChroma = m_lcuHeightChroma - 2 - 3; // DFRegion, Vertical Taps
    1142 #else
    1143   m_lineIdxPadBotChroma = m_lcuHeightChroma - 2 - 4; // DFRegion, Vertical Taps
    1144 #endif
    1145   m_lineIdxPadTopChroma = m_lcuHeightChroma - 2 ;    // DFRegion
    1146 
    1147   TComPicYuv* pcPicYuvRec    = pcPic->getPicYuvRec();
    1148   TComPicYuv* pcPicYuvExtRec = m_pcTempPicYuv;
    1149     pcPicYuvRec   ->copyToPic          ( pcPicYuvExtRec );
    1150     pcPicYuvExtRec->setBorderExtension ( false );
    1151     pcPicYuvExtRec->extendPicBorder    ();
    1152 
    1153   if(m_uiNumSlicesInPic == 1)
    1154   {
    1155     AlfCUCtrlInfo* pcAlfCtrlParam = &(vAlfCUCtrlParam[0]);
    1156     if(pcAlfCtrlParam->cu_control_flag)
    1157     {
    1158       UInt idx = 0;
    1159       for(UInt uiCUAddr = 0; uiCUAddr < pcPic->getNumCUsInFrame(); uiCUAddr++)
    1160       {
    1161         TComDataCU *pcCU = pcPic->getCU(uiCUAddr);
    1162         setAlfCtrlFlags(pcAlfCtrlParam, pcCU, 0, 0, idx);
    1163       }
    1164     }
    1165   }
    1166   else
    1167   {
    1168     transferCtrlFlagsFromAlfParam(vAlfCUCtrlParam);
    1169   }
    1170   xALFLuma(pcPic, pcAlfParam, vAlfCUCtrlParam, pcPicYuvExtRec, pcPicYuvRec);
    1171   if(pcAlfParam->chroma_idc)
    1172   {
    1173 #if ALF_CHROMA_COEF_PRED_HARMONIZATION
    1174     reconstructALFCoeffChroma(pcAlfParam);
    1175 #else
    1176     predictALFCoeffChroma(pcAlfParam);
    1177 #endif
    1178     checkFilterCoeffValue(pcAlfParam->coeff_chroma, pcAlfParam->num_coeff_chroma, true );
    1179 
    1180     xALFChroma( pcAlfParam, pcPicYuvExtRec, pcPicYuvRec);
    1181   }
    1182 }
    1183 #endif
    1184881// ====================================================================================================================
    1185882// Protected member functions
     
    1216913}
    1217914
    1218 #if !LCU_SYNTAX_ALF
    1219 
    1220 Void TComAdaptiveLoopFilter::xALFLuma(TComPic* pcPic, ALFParam* pcAlfParam, std::vector<AlfCUCtrlInfo>& vAlfCUCtrlParam,TComPicYuv* pcPicDec, TComPicYuv* pcPicRest)
    1221 {
    1222   Int    LumaStride = pcPicDec->getStride();
    1223   Pel* pDec = pcPicDec->getLumaAddr();
    1224   Pel* pRest = pcPicRest->getLumaAddr();
    1225 
    1226   decodeFilterSet(pcAlfParam, m_varIndTab, m_filterCoeffSym);
    1227 
    1228   m_uiVarGenMethod = pcAlfParam->alf_pcr_region_flag;
    1229   m_varImg         = m_varImgMethods[m_uiVarGenMethod];
    1230   calcVar(m_varImg, pRest, LumaStride, pcAlfParam->alf_pcr_region_flag);
    1231 
    1232   if(!m_bUseNonCrossALF)
    1233   {
    1234     Bool bCUCtrlEnabled = false;
    1235     for(UInt s=0; s< m_uiNumSlicesInPic; s++)
    1236     {
    1237       if(!pcPic->getValidSlice(s))
    1238       {
    1239         continue;
    1240       }
    1241       if( vAlfCUCtrlParam[s].cu_control_flag == 1)
    1242       {
    1243         bCUCtrlEnabled = true;
    1244       }
    1245     }
    1246 
    1247     if(bCUCtrlEnabled) 
    1248     {
    1249       xCUAdaptive(pcPic, pcAlfParam->filter_shape, pRest, pDec, LumaStride);
    1250     } 
    1251     else
    1252     {
    1253       filterLuma(pRest, pDec, LumaStride, 0, m_img_height-1, 0, m_img_width-1,  pcAlfParam->filter_shape, m_filterCoeffSym, m_varIndTab, m_varImg);
    1254     }
    1255   }
    1256   else
    1257   {
    1258     Pel* pTemp = m_pcSliceYuvTmp->getLumaAddr();
    1259     for(UInt s=0; s< m_uiNumSlicesInPic; s++)
    1260     {
    1261       if(!pcPic->getValidSlice(s))
    1262       {
    1263         continue;
    1264       }
    1265       std::vector< std::vector<AlfLCUInfo*> > & vpSliceTileAlfLCU = m_pvpSliceTileAlfLCU[s];
    1266 
    1267       for(Int t=0; t< (Int)vpSliceTileAlfLCU.size(); t++)
    1268       {
    1269         std::vector<AlfLCUInfo*> & vpAlfLCU = vpSliceTileAlfLCU[t];
    1270 
    1271         copyRegion(vpAlfLCU, pTemp, pDec, LumaStride);
    1272         extendRegionBorder(vpAlfLCU, pTemp, LumaStride);
    1273         if(vAlfCUCtrlParam[s].cu_control_flag == 1)
    1274         {
    1275           xCUAdaptiveRegion(vpAlfLCU, pTemp, pRest, LumaStride, pcAlfParam->filter_shape, m_filterCoeffSym, m_varIndTab, m_varImg);
    1276         }
    1277         else
    1278         {
    1279           filterLumaRegion(vpAlfLCU, pTemp, pRest, LumaStride, pcAlfParam->filter_shape, m_filterCoeffSym, m_varIndTab, m_varImg);
    1280         }
    1281       }
    1282     }
    1283   }
    1284 }
    1285 
    1286 Void TComAdaptiveLoopFilter::decodeFilterSet(ALFParam* pcAlfParam, Int* varIndTab, Int** filterCoeff)
    1287 {
    1288   // reconstruct merge table
    1289   memset(m_varIndTab, 0, NO_VAR_BINS * sizeof(Int));
    1290   if(pcAlfParam->filters_per_group > 1)
    1291   {
    1292     for(Int i = 1; i < NO_VAR_BINS; ++i)
    1293     {
    1294       if(pcAlfParam->filterPattern[i])
    1295       {
    1296         varIndTab[i] = varIndTab[i-1] + 1;
    1297       }
    1298       else
    1299       {
    1300         varIndTab[i] = varIndTab[i-1];
    1301       }
    1302     }
    1303   }
    1304   predictALFCoeffLuma( pcAlfParam);
    1305   // reconstruct filter sets
    1306   reconstructFilterCoeffs( pcAlfParam, filterCoeff);
    1307 
    1308 }
    1309 
    1310 
    1311 Void TComAdaptiveLoopFilter::filterLuma(Pel *pImgRes, Pel *pImgPad, Int stride,
    1312   Int ypos, Int yposEnd, Int xpos, Int xposEnd,
    1313   Int filtNo, Int** filterSet, Int* mergeTable, Pel** ppVarImg)
    1314 {
    1315   static Int numBitsMinus1= (Int)ALF_NUM_BIT_SHIFT;
    1316   static Int offset       = (1<<( (Int)ALF_NUM_BIT_SHIFT-1));
    1317   static Int shiftHeight  = (Int)(log((double)VAR_SIZE_H)/log(2.0));
    1318   static Int shiftWidth   = (Int)(log((double)VAR_SIZE_W)/log(2.0));
    1319 
    1320   Pel *pImgPad1,*pImgPad2,*pImgPad3,*pImgPad4;
    1321   Pel *pVar;
    1322   Int i, j, pixelInt;
    1323   Int *coef = NULL;
    1324 
    1325   pImgPad    += (ypos*stride);
    1326   pImgRes    += (ypos*stride);
    1327 
    1328   Int yLineInLCU;
    1329   Int paddingLine;
    1330 #if !ALF_SINGLE_FILTER_SHAPE
    1331   Int varInd = 0;
    1332 #endif
    1333   Int newCenterCoeff[4][NO_VAR_BINS];
    1334 
    1335   for(i=0; i< 4; i++)
    1336   {
    1337     ::memset(&(newCenterCoeff[i][0]), 0, sizeof(Int)*NO_VAR_BINS);
    1338   }
    1339 
    1340 #if ALF_SINGLE_FILTER_SHAPE
    1341   if(filtNo == ALF_CROSS9x7_SQUARE3x3)
    1342 #else
    1343   if(filtNo == ALF_CROSS9x9)
    1344 #endif
    1345   {
    1346     for (i=0; i<NO_VAR_BINS; i++)
    1347     {
    1348       coef = filterSet[i];
    1349       //VB line 1
    1350       newCenterCoeff[0][i] = coef[8] + ((coef[0] + coef[1] + coef[2] + coef[3])<<1);
    1351       //VB line 2
    1352       newCenterCoeff[1][i] = coef[8] + ((coef[0] + coef[1] + coef[2])<<1);
    1353       //VB line 3
    1354       newCenterCoeff[2][i] = coef[8] + ((coef[0] + coef[1])<<1);
    1355       //VB line 4
    1356       newCenterCoeff[3][i] = coef[8] + ((coef[0])<<1);
    1357     }
    1358   }
    1359 
    1360 
    1361   switch(filtNo)
    1362   {
    1363 #if !ALF_SINGLE_FILTER_SHAPE
    1364   case ALF_STAR5x5:
    1365     {
    1366       for(i= ypos; i<= yposEnd; i++)
    1367       {
    1368 
    1369         yLineInLCU = i % m_lcuHeight;   
    1370 
    1371         if (yLineInLCU<m_lineIdxPadBot || i-yLineInLCU+m_lcuHeight >= m_img_height)
    1372         {
    1373           pImgPad1 = pImgPad +   stride;
    1374           pImgPad2 = pImgPad -   stride;
    1375           pImgPad3 = pImgPad + 2*stride;
    1376           pImgPad4 = pImgPad - 2*stride;
    1377         }
    1378         else if (yLineInLCU<m_lineIdxPadTop)
    1379         {
    1380           paddingLine = - yLineInLCU + m_lineIdxPadTop - 1;
    1381           pImgPad1 = pImgPad + min(paddingLine, 1)*stride;
    1382           pImgPad2 = pImgPad -   stride;
    1383           pImgPad3 = pImgPad + min(paddingLine, 2)*stride;
    1384           pImgPad4 = pImgPad - 2*stride;
    1385         }
    1386         else
    1387         {
    1388           paddingLine = yLineInLCU - m_lineIdxPadTop ;
    1389           pImgPad1 = pImgPad + stride;
    1390           pImgPad2 = pImgPad - min(paddingLine, 1)*stride;
    1391           pImgPad3 = pImgPad + 2*stride;
    1392           pImgPad4 = pImgPad - min(paddingLine, 2)*stride;
    1393         }
    1394 
    1395         pVar = ppVarImg[i>>shiftHeight] + (xpos>>shiftWidth);
    1396 
    1397         if ( (yLineInLCU == m_lineIdxPadTop || yLineInLCU == m_lineIdxPadTop-1) && i-yLineInLCU+m_lcuHeight < m_img_height )
    1398         {
    1399           for(j= xpos; j<= xposEnd; j++)
    1400           {
    1401             pImgRes[j] = pImgPad[j];
    1402           }
    1403         }
    1404         else if ( (yLineInLCU == m_lineIdxPadTop+1 || yLineInLCU == m_lineIdxPadTop-2) && i-yLineInLCU+m_lcuHeight < m_img_height )
    1405         {
    1406           for(j= xpos; j<= xposEnd ; j++)
    1407           {
    1408             if (j % VAR_SIZE_W==0)
    1409             {
    1410               coef = filterSet[mergeTable[*(pVar++)]];
    1411             }
    1412 
    1413             pixelInt  = 0;
    1414 
    1415             pixelInt += coef[0]* (pImgPad3[j+2]+pImgPad4[j-2]);
    1416             pixelInt += coef[1]* (pImgPad3[j  ]+pImgPad4[j  ]);
    1417             pixelInt += coef[2]* (pImgPad3[j-2]+pImgPad4[j+2]);
    1418 
    1419             pixelInt += coef[3]* (pImgPad1[j+1]+pImgPad2[j-1]);
    1420             pixelInt += coef[4]* (pImgPad1[j  ]+pImgPad2[j  ]);
    1421             pixelInt += coef[5]* (pImgPad1[j-1]+pImgPad2[j+1]);
    1422 
    1423             pixelInt += coef[6]* (pImgPad[j+2]+pImgPad[j-2]);
    1424             pixelInt += coef[7]* (pImgPad[j+1]+pImgPad[j-1]);
    1425             pixelInt += coef[8]* (pImgPad[j  ]);
    1426 
    1427             pixelInt=(int)((pixelInt+offset) >> numBitsMinus1);
    1428             pImgRes[j] = ( Clip( pixelInt ) + pImgPad[j] ) >> 1;
    1429           }
    1430         }
    1431         else
    1432         {
    1433 
    1434         for(j= xpos; j<= xposEnd ; j++)
    1435         {
    1436           if (j % VAR_SIZE_W==0)
    1437           {
    1438             coef = filterSet[mergeTable[*(pVar++)]];
    1439           }
    1440 
    1441           pixelInt  = 0;
    1442 
    1443           pixelInt += coef[0]* (pImgPad3[j+2]+pImgPad4[j-2]);
    1444           pixelInt += coef[1]* (pImgPad3[j  ]+pImgPad4[j  ]);
    1445           pixelInt += coef[2]* (pImgPad3[j-2]+pImgPad4[j+2]);
    1446 
    1447           pixelInt += coef[3]* (pImgPad1[j+1]+pImgPad2[j-1]);
    1448           pixelInt += coef[4]* (pImgPad1[j  ]+pImgPad2[j  ]);
    1449           pixelInt += coef[5]* (pImgPad1[j-1]+pImgPad2[j+1]);
    1450 
    1451           pixelInt += coef[6]* (pImgPad[j+2]+pImgPad[j-2]);
    1452           pixelInt += coef[7]* (pImgPad[j+1]+pImgPad[j-1]);
    1453           pixelInt += coef[8]* (pImgPad[j  ]);
    1454 
    1455           pixelInt=(Int)((pixelInt+offset) >> numBitsMinus1);
    1456           pImgRes[j] = Clip( pixelInt );
    1457         }
    1458 
    1459         }
    1460 
    1461         pImgPad += stride;
    1462         pImgRes += stride;
    1463       }
    1464     }
    1465     break;
    1466   case ALF_CROSS9x9:
    1467     {
    1468       Pel *pImgPad5, *pImgPad6, *pImgPad7, *pImgPad8;
    1469 #else
    1470   case ALF_CROSS9x7_SQUARE3x3:
    1471     {
    1472       Pel *pImgPad5, *pImgPad6;
    1473 #endif
    1474       for(i= ypos; i<= yposEnd; i++)
    1475       {
    1476         yLineInLCU = i % m_lcuHeight;   
    1477 
    1478         if (yLineInLCU<m_lineIdxPadBot || i-yLineInLCU+m_lcuHeight >= m_img_height)
    1479         {
    1480           pImgPad1 = pImgPad +   stride;
    1481           pImgPad2 = pImgPad -   stride;
    1482           pImgPad3 = pImgPad + 2*stride;
    1483           pImgPad4 = pImgPad - 2*stride;
    1484           pImgPad5 = pImgPad + 3*stride;
    1485           pImgPad6 = pImgPad - 3*stride;
    1486 #if !ALF_SINGLE_FILTER_SHAPE
    1487           pImgPad7 = pImgPad + 4*stride;
    1488           pImgPad8 = pImgPad - 4*stride;
    1489 #endif
    1490         }
    1491         else if (yLineInLCU<m_lineIdxPadTop)
    1492         {
    1493           paddingLine = - yLineInLCU + m_lineIdxPadTop - 1;
    1494 #if ALF_SINGLE_FILTER_SHAPE
    1495           pImgPad1 = (paddingLine < 1) ? pImgPad : pImgPad + min(paddingLine, 1)*stride;
    1496           pImgPad2 = (paddingLine < 1) ? pImgPad : pImgPad -   stride;
    1497           pImgPad3 = (paddingLine < 2) ? pImgPad : pImgPad + min(paddingLine, 2)*stride;
    1498           pImgPad4 = (paddingLine < 2) ? pImgPad : pImgPad - 2*stride;
    1499           pImgPad5 = (paddingLine < 3) ? pImgPad : pImgPad + min(paddingLine, 3)*stride;
    1500           pImgPad6 = (paddingLine < 3) ? pImgPad : pImgPad - 3*stride;
    1501 #else
    1502           pImgPad1 = pImgPad + min(paddingLine, 1)*stride;
    1503           pImgPad2 = pImgPad -   stride;
    1504           pImgPad3 = pImgPad + min(paddingLine, 2)*stride;
    1505           pImgPad4 = pImgPad - 2*stride;
    1506           pImgPad5 = pImgPad + min(paddingLine, 3)*stride;
    1507           pImgPad6 = pImgPad - 3*stride;
    1508           pImgPad7 = pImgPad + min(paddingLine, 4)*stride;
    1509           pImgPad8 = pImgPad - 4*stride;
    1510 #endif
    1511         }
    1512         else
    1513         {
    1514           paddingLine = yLineInLCU - m_lineIdxPadTop ;
    1515 #if ALF_SINGLE_FILTER_SHAPE
    1516           pImgPad1 = (paddingLine < 1) ? pImgPad : pImgPad +   stride;
    1517           pImgPad2 = (paddingLine < 1) ? pImgPad : pImgPad - min(paddingLine, 1)*stride;
    1518           pImgPad3 = (paddingLine < 2) ? pImgPad : pImgPad + 2*stride;
    1519           pImgPad4 = (paddingLine < 2) ? pImgPad : pImgPad - min(paddingLine, 2)*stride;
    1520           pImgPad5 = (paddingLine < 3) ? pImgPad : pImgPad + 3*stride;
    1521           pImgPad6 = (paddingLine < 3) ? pImgPad : pImgPad - min(paddingLine, 3)*stride;
    1522 #else
    1523           pImgPad1 = pImgPad + stride;
    1524           pImgPad2 = pImgPad - min(paddingLine, 1)*stride;
    1525           pImgPad3 = pImgPad + 2*stride;
    1526           pImgPad4 = pImgPad - min(paddingLine, 2)*stride;
    1527           pImgPad5 = pImgPad + 3*stride;
    1528           pImgPad6 = pImgPad - min(paddingLine, 3)*stride;
    1529           pImgPad7 = pImgPad + 4*stride;
    1530           pImgPad8 = pImgPad - min(paddingLine, 4)*stride;
    1531 #endif
    1532         }
    1533 
    1534         pVar = ppVarImg[i>>shiftHeight] + (xpos>>shiftWidth);
    1535 
    1536 #if ALF_SINGLE_FILTER_SHAPE
    1537         {
    1538           for(j= xpos; j<= xposEnd ; j++)
    1539           {
    1540             if (j % VAR_SIZE_W==0)
    1541             {
    1542               coef = filterSet[mergeTable[*(pVar++)]];
    1543             }
    1544 
    1545             pixelInt  = 0;
    1546 
    1547             pixelInt += coef[0]* (pImgPad5[j]+pImgPad6[j]);
    1548             pixelInt += coef[1]* (pImgPad3[j]+pImgPad4[j]);
    1549             pixelInt += coef[2]* (pImgPad1[j-1]+pImgPad2[j+1]);
    1550             pixelInt += coef[3]* (pImgPad1[j]+pImgPad2[j]);
    1551             pixelInt += coef[4]* (pImgPad1[j+1]+pImgPad2[j-1]);
    1552             pixelInt += coef[5]* (pImgPad[j+4]+pImgPad[j-4]);
    1553             pixelInt += coef[6]* (pImgPad[j+3]+pImgPad[j-3]);
    1554             pixelInt += coef[7]* (pImgPad[j+2]+pImgPad[j-2]);
    1555             pixelInt += coef[8]* (pImgPad[j+1]+pImgPad[j-1]);
    1556             pixelInt += coef[9]* (pImgPad[j  ]);
    1557 
    1558             pixelInt=(Int)((pixelInt+offset) >> numBitsMinus1);
    1559             pImgRes[j] = Clip( pixelInt );
    1560           }
    1561         }
    1562 #else
    1563         if ( (yLineInLCU == m_lineIdxPadTop || yLineInLCU == m_lineIdxPadTop-1) && i-yLineInLCU+m_lcuHeight < m_img_height )
    1564         {
    1565           for(j= xpos; j<= xposEnd ; j++)
    1566           {
    1567             if (j % VAR_SIZE_W==0)
    1568             {
    1569               varInd = *(pVar++);
    1570               coef = filterSet[mergeTable[varInd]];
    1571             }
    1572 
    1573             pixelInt  = 0;
    1574 
    1575             pixelInt += coef[4]* (pImgPad[j+4]+pImgPad[j-4]);
    1576             pixelInt += coef[5]* (pImgPad[j+3]+pImgPad[j-3]);
    1577             pixelInt += coef[6]* (pImgPad[j+2]+pImgPad[j-2]);
    1578             pixelInt += coef[7]* (pImgPad[j+1]+pImgPad[j-1]);
    1579             pixelInt += newCenterCoeff[0][mergeTable[varInd]]* (pImgPad[j]);
    1580 
    1581             pixelInt=(int)((pixelInt+offset) >> numBitsMinus1);
    1582             pImgRes[j] = Clip( pixelInt );
    1583           }
    1584         }
    1585         else if ( (yLineInLCU == m_lineIdxPadTop+1 || yLineInLCU == m_lineIdxPadTop-2) && i-yLineInLCU+m_lcuHeight < m_img_height )
    1586         {
    1587           for(j= xpos; j<= xposEnd ; j++)
    1588           {
    1589             if (j % VAR_SIZE_W==0)
    1590             {
    1591               varInd = *(pVar++);
    1592               coef = filterSet[mergeTable[varInd]];
    1593             }
    1594 
    1595             pixelInt  = 0;
    1596 
    1597             pixelInt += coef[3]* (pImgPad1[j]+pImgPad2[j]);
    1598 
    1599             pixelInt += coef[4]* (pImgPad[j+4]+pImgPad[j-4]);
    1600             pixelInt += coef[5]* (pImgPad[j+3]+pImgPad[j-3]);
    1601             pixelInt += coef[6]* (pImgPad[j+2]+pImgPad[j-2]);
    1602             pixelInt += coef[7]* (pImgPad[j+1]+pImgPad[j-1]);
    1603             pixelInt += newCenterCoeff[1][mergeTable[varInd]]* (pImgPad[j]);
    1604 
    1605             pixelInt=(int)((pixelInt+offset) >> numBitsMinus1);
    1606             pImgRes[j] = Clip( pixelInt );
    1607           }
    1608         }
    1609         else if ( (yLineInLCU == m_lineIdxPadTop+2 || yLineInLCU == m_lineIdxPadTop-3) && i-yLineInLCU+m_lcuHeight < m_img_height )
    1610         {
    1611           for(j= xpos; j<= xposEnd ; j++)
    1612           {
    1613             if (j % VAR_SIZE_W==0)
    1614             {
    1615               varInd = *(pVar++);
    1616               coef = filterSet[mergeTable[varInd]];
    1617             }
    1618 
    1619             pixelInt  = 0;
    1620 
    1621             pixelInt += coef[2]* (pImgPad3[j]+pImgPad4[j]);
    1622 
    1623             pixelInt += coef[3]* (pImgPad1[j]+pImgPad2[j]);
    1624 
    1625             pixelInt += coef[4]* (pImgPad[j+4]+pImgPad[j-4]);
    1626             pixelInt += coef[5]* (pImgPad[j+3]+pImgPad[j-3]);
    1627             pixelInt += coef[6]* (pImgPad[j+2]+pImgPad[j-2]);
    1628             pixelInt += coef[7]* (pImgPad[j+1]+pImgPad[j-1]);
    1629             pixelInt += newCenterCoeff[2][mergeTable[varInd]]* (pImgPad[j  ]);
    1630 
    1631             pixelInt=(int)((pixelInt+offset) >> numBitsMinus1);
    1632             pImgRes[j] = Clip( pixelInt );
    1633           }
    1634         }
    1635         else if ( (yLineInLCU == m_lineIdxPadTop+3 || yLineInLCU == m_lineIdxPadTop-4) && i-yLineInLCU+m_lcuHeight < m_img_height )
    1636         {
    1637           for(j= xpos; j<= xposEnd ; j++)
    1638           {
    1639             if (j % VAR_SIZE_W==0)
    1640             {
    1641               varInd = *(pVar++);
    1642               coef = filterSet[mergeTable[varInd]];
    1643             }
    1644 
    1645             pixelInt  = 0;
    1646 
    1647             pixelInt += coef[1]* (pImgPad5[j]+pImgPad6[j]);
    1648 
    1649             pixelInt += coef[2]* (pImgPad3[j]+pImgPad4[j]);
    1650 
    1651             pixelInt += coef[3]* (pImgPad1[j]+pImgPad2[j]);
    1652 
    1653             pixelInt += coef[4]* (pImgPad[j+4]+pImgPad[j-4]);
    1654             pixelInt += coef[5]* (pImgPad[j+3]+pImgPad[j-3]);
    1655             pixelInt += coef[6]* (pImgPad[j+2]+pImgPad[j-2]);
    1656             pixelInt += coef[7]* (pImgPad[j+1]+pImgPad[j-1]);
    1657             pixelInt += newCenterCoeff[3][mergeTable[varInd]]* (pImgPad[j  ]);
    1658 
    1659             pixelInt=(int)((pixelInt+offset) >> numBitsMinus1);
    1660             pImgRes[j] = Clip( pixelInt );
    1661           }
    1662         }
    1663         else
    1664         {
    1665           for(j= xpos; j<= xposEnd ; j++)
    1666           {
    1667             if (j % VAR_SIZE_W==0)
    1668             {
    1669               coef = filterSet[mergeTable[*(pVar++)]];
    1670             }
    1671 
    1672             pixelInt  = 0;
    1673 
    1674             pixelInt += coef[0]* (pImgPad7[j]+pImgPad8[j]);
    1675 
    1676             pixelInt += coef[1]* (pImgPad5[j]+pImgPad6[j]);
    1677 
    1678             pixelInt += coef[2]* (pImgPad3[j]+pImgPad4[j]);
    1679 
    1680             pixelInt += coef[3]* (pImgPad1[j]+pImgPad2[j]);
    1681 
    1682             pixelInt += coef[4]* (pImgPad[j+4]+pImgPad[j-4]);
    1683             pixelInt += coef[5]* (pImgPad[j+3]+pImgPad[j-3]);
    1684             pixelInt += coef[6]* (pImgPad[j+2]+pImgPad[j-2]);
    1685             pixelInt += coef[7]* (pImgPad[j+1]+pImgPad[j-1]);
    1686             pixelInt += coef[8]* (pImgPad[j  ]);
    1687 
    1688             pixelInt=(Int)((pixelInt+offset) >> numBitsMinus1);
    1689             pImgRes[j] = Clip( pixelInt );
    1690           }
    1691         }
    1692 #endif
    1693         pImgPad += stride;
    1694         pImgRes += stride;
    1695       }
    1696     }
    1697     break;
    1698   default:
    1699     {
    1700       printf("Not a supported filter shape\n");
    1701       assert(0);
    1702       exit(1);
    1703     }
    1704   }
    1705 }
    1706 
    1707 
    1708 
    1709 Void TComAdaptiveLoopFilter::xCUAdaptive(TComPic* pcPic, Int filtNo, Pel *imgYFilt, Pel *imgYRec, Int Stride)
    1710 {
    1711   // for every CU, call CU-adaptive ALF process
    1712   for( UInt uiCUAddr = 0; uiCUAddr < pcPic->getNumCUsInFrame() ; uiCUAddr++ )
    1713   {
    1714     TComDataCU* pcCU = pcPic->getCU( uiCUAddr );
    1715     xSubCUAdaptive(pcCU, filtNo, imgYFilt, imgYRec, 0, 0, Stride);
    1716   }
    1717 }
    1718 
    1719 Void TComAdaptiveLoopFilter::xSubCUAdaptive(TComDataCU* pcCU, Int filtNo, Pel *imgYFilt, Pel *imgYRec, UInt uiAbsPartIdx, UInt uiDepth, Int Stride)
    1720 {
    1721   TComPic* pcPic = pcCU->getPic();
    1722 
    1723   if(pcPic==NULL)
    1724   {
    1725     return;
    1726   }
    1727   Bool bBoundary = false;
    1728   UInt uiLPelX   = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ];
    1729   UInt uiRPelX   = uiLPelX + (g_uiMaxCUWidth>>uiDepth)  - 1;
    1730   UInt uiTPelY   = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ];
    1731   UInt uiBPelY   = uiTPelY + (g_uiMaxCUHeight>>uiDepth) - 1;
    1732 
    1733   // check picture boundary
    1734   if ( ( uiRPelX >= m_img_width ) || ( uiBPelY >= m_img_height ) )
    1735   {
    1736     bBoundary = true;
    1737   }
    1738 
    1739   if ( ( ( uiDepth < pcCU->getDepth( uiAbsPartIdx ) ) && ( uiDepth < (g_uiMaxCUDepth-g_uiAddCUDepth) ) ) || bBoundary )
    1740   {
    1741     UInt uiQNumParts = ( pcPic->getNumPartInCU() >> (uiDepth<<1) )>>2;
    1742     for ( UInt uiPartUnitIdx = 0; uiPartUnitIdx < 4; uiPartUnitIdx++, uiAbsPartIdx+=uiQNumParts )
    1743     {
    1744       uiLPelX   = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ];
    1745       uiTPelY   = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ];
    1746 
    1747       if( ( uiLPelX < m_img_width ) && ( uiTPelY < m_img_height ) )
    1748         xSubCUAdaptive(pcCU, filtNo, imgYFilt, imgYRec, uiAbsPartIdx, uiDepth+1, Stride);
    1749     }
    1750     return;
    1751   }
    1752 
    1753   if ( pcCU->getAlfCtrlFlag(uiAbsPartIdx) )
    1754   {
    1755     filterLuma(imgYFilt, imgYRec, Stride, uiTPelY, min(uiBPelY,(unsigned int)(m_img_height-1)), uiLPelX, min(uiRPelX,(unsigned int)(m_img_width-1))
    1756       ,filtNo, m_filterCoeffSym, m_varIndTab, m_varImg);
    1757   }
    1758 }
    1759 
    1760 /** Predict ALF luma filter coefficients. Centre coefficient is always predicted. Left neighbour is predicted according to flag.
    1761  */
    1762 Void TComAdaptiveLoopFilter::predictALFCoeffLuma(ALFParam* pcAlfParam)
    1763 {
    1764   Int sum, coeffPred, ind;
    1765   const Int* pFiltMag = NULL;
    1766   pFiltMag = weightsTabShapes[pcAlfParam->filter_shape];
    1767   for(ind = 0; ind < pcAlfParam->filters_per_group; ++ind)
    1768   {
    1769     sum = 0;
    1770     for(Int i = 0; i < pcAlfParam->num_coeff-2; i++)
    1771     {
    1772       sum +=  pFiltMag[i]*pcAlfParam->coeffmulti[ind][i];
    1773     }
    1774     if(pcAlfParam->nbSPred[ind]==0)
    1775     {
    1776       if((pcAlfParam->predMethod==0)|(ind==0))
    1777       {
    1778         coeffPred = ((1<<ALF_NUM_BIT_SHIFT)-sum) >> 2;
    1779       }
    1780       else
    1781       {
    1782         coeffPred = (0-sum) >> 2;
    1783       }
    1784       pcAlfParam->coeffmulti[ind][pcAlfParam->num_coeff-2] = coeffPred + pcAlfParam->coeffmulti[ind][pcAlfParam->num_coeff-2];
    1785     }
    1786     sum += pFiltMag[pcAlfParam->num_coeff-2]*pcAlfParam->coeffmulti[ind][pcAlfParam->num_coeff-2];
    1787     if((pcAlfParam->predMethod==0)|(ind==0))
    1788     {
    1789       coeffPred = (1<<ALF_NUM_BIT_SHIFT)-sum;
    1790     }
    1791     else
    1792     {
    1793       coeffPred = -sum;
    1794     }
    1795     pcAlfParam->coeffmulti[ind][pcAlfParam->num_coeff-1] = coeffPred + pcAlfParam->coeffmulti[ind][pcAlfParam->num_coeff-1];
    1796   }
    1797 }
    1798 
    1799 Void TComAdaptiveLoopFilter::reconstructFilterCoeffs(ALFParam* pcAlfParam,int **pfilterCoeffSym)
    1800 {
    1801   int i, ind;
    1802 
    1803   // Copy non zero filters in filterCoeffTmp
    1804   for(ind = 0; ind < pcAlfParam->filters_per_group; ++ind)
    1805   {
    1806     for(i = 0; i < pcAlfParam->num_coeff; i++)
    1807     {
    1808       pfilterCoeffSym[ind][i] = pcAlfParam->coeffmulti[ind][i];
    1809     }
    1810   }
    1811   // Undo prediction
    1812   for(ind = 1; ind < pcAlfParam->filters_per_group; ++ind)
    1813   {
    1814     if(pcAlfParam->predMethod)
    1815     {
    1816       // Prediction
    1817       for(i = 0; i < pcAlfParam->num_coeff; ++i)
    1818       {
    1819         pfilterCoeffSym[ind][i] = (int)(pfilterCoeffSym[ind][i] + pfilterCoeffSym[ind - 1][i]);
    1820       }
    1821     }
    1822   }
    1823 
    1824   for(ind = 0; ind < pcAlfParam->filters_per_group; ind++)
    1825   {
    1826     checkFilterCoeffValue(pfilterCoeffSym[ind], pcAlfParam->num_coeff, false );
    1827   }
    1828 }
    1829 
    1830 
    1831 #endif
    1832915
    1833916static Pel Clip_post(int high, int val)
     
    1836919}
    1837920
    1838 #if !LCU_SYNTAX_ALF
    1839 
    1840 /** Calculate ALF grouping indices for block-based (BA) mode
    1841  * \param [out] imgYvar grouping indices buffer
    1842  * \param [in] imgYpad picture buffer
    1843  * \param [in] stride picture stride size
    1844  * \param [in] adaptationMode  ALF_BA or ALF_RA mode
    1845  */
    1846 Void TComAdaptiveLoopFilter::calcVar(Pel **imgYvar, Pel *imgYpad, Int stride, Int adaptationMode)
    1847 {
    1848   if(adaptationMode == ALF_RA)
    1849   {
    1850     return;
    1851   }
    1852   static Int shiftH = (Int)(log((double)VAR_SIZE_H)/log(2.0));
    1853   static Int shiftW = (Int)(log((double)VAR_SIZE_W)/log(2.0));
    1854   static Int varmax = (Int)NO_VAR_BINS-1;
    1855 #if ALF_16_BA_GROUPS
    1856   static Int th[NO_VAR_BINS] = {0, 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5};
    1857   static Int avgVarTab[3][6] = { {0,  1,  2,  3,  4,  5,},
    1858   {0,  6,  7,  8,  9, 10,},
    1859   {0, 11, 12, 13, 14, 15}   };
    1860 #else
    1861   static Int step1  = (Int)((Int)(NO_VAR_BINS)/3) - 1; 
    1862   static Int th[NO_VAR_BINS] = {0, 1, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4};
    1863 #endif 
    1864   Int i, j, avgvar, vertical, horizontal,direction, yoffset;
    1865   Pel *pimgYpad, *pimgYpadup, *pimgYpaddown;
    1866 
    1867   for(i = 0; i < m_img_height - 3; i=i+4)
    1868   {
    1869     yoffset      = ((i)*stride) + stride;
    1870     pimgYpad     = &imgYpad [yoffset];
    1871     pimgYpadup   = &imgYpad [yoffset + stride];
    1872     pimgYpaddown = &imgYpad [yoffset - stride];
    1873 
    1874     for(j = 0; j < m_img_width - 3 ; j=j+4)
    1875     {
    1876       // Compute at sub-sample by 2
    1877       vertical   =  abs((pimgYpad[j+1]<<1  ) - pimgYpaddown[j+1]   - pimgYpadup[j+1]);
    1878       horizontal =  abs((pimgYpad[j+1]<<1  ) - pimgYpad    [j+2]   - pimgYpad  [j  ]);
    1879 
    1880       vertical   += abs((pimgYpad[j+2]<<1  ) - pimgYpaddown[j+2]   - pimgYpadup[j+2]);
    1881       horizontal += abs((pimgYpad[j+2]<<1  ) - pimgYpad    [j+3]   - pimgYpad  [j+1]);
    1882 
    1883       vertical   += abs((pimgYpad[j+1+stride]<<1) - pimgYpaddown[j+1+stride] - pimgYpadup[j+1+stride]);
    1884       horizontal += abs((pimgYpad[j+1+stride]<<1) - pimgYpad    [j+2+stride] - pimgYpad  [j+stride  ]);
    1885 
    1886       vertical   += abs((pimgYpad[j+2+stride]<<1) - pimgYpaddown[j+2+stride] - pimgYpadup[j+2+stride]);
    1887       horizontal += abs((pimgYpad[j+2+stride]<<1) - pimgYpad    [j+3+stride] - pimgYpad  [j+1+stride]);
    1888 
    1889       direction = 0;
    1890       if (vertical > 2*horizontal)
    1891       {
    1892         direction = 1; //vertical
    1893       }
    1894       if (horizontal > 2*vertical)
    1895       {
    1896         direction = 2; //horizontal
    1897       }
    1898 
    1899       avgvar = (vertical + horizontal) >> 2;
    1900       avgvar = (Pel) Clip_post(varmax, avgvar >>(g_uiBitIncrement+1));
    1901       avgvar = th[avgvar];
    1902 #if ALF_16_BA_GROUPS
    1903       avgvar = avgVarTab[direction][avgvar];
    1904 #else     
    1905       avgvar = Clip_post(step1, (Int) avgvar ) + (step1+1)*direction;
    1906 #endif
    1907       imgYvar[(i )>>shiftH][(j)>>shiftW] = avgvar;
    1908     }
    1909   }
    1910 }
    1911 
    1912 Void TComAdaptiveLoopFilter::createRegionIndexMap(Pel **imgYVar, Int imgWidth, Int imgHeight)
    1913 {
    1914   int varStepSizeWidth = VAR_SIZE_W;
    1915   int varStepSizeHeight = VAR_SIZE_H;
    1916   int shiftHeight = (int)(log((double)varStepSizeHeight)/log(2.0));
    1917   int shiftWidth = (int)(log((double)varStepSizeWidth)/log(2.0));
    1918 
    1919   int i, j;
    1920   int regionTable[NO_VAR_BINS] = {0, 1, 4, 5, 15, 2, 3, 6, 14, 11, 10, 7, 13, 12,  9,  8};
    1921   int xInterval;
    1922   int yInterval;
    1923   int yIndex;
    1924   int yIndexOffset;
    1925   int yStartLine;
    1926   int yEndLine;
    1927 
    1928   xInterval = ((( (imgWidth+63)/64) + 1) / 4 * 64)>>shiftWidth; 
    1929   yInterval = ((((imgHeight+63)/64) + 1) / 4 * 64)>>shiftHeight;
    1930 
    1931   for (yIndex = 0; yIndex < 4 ; yIndex++)
    1932   {
    1933     yIndexOffset = yIndex * 4;
    1934     yStartLine = yIndex * yInterval;
    1935     yEndLine   = (yIndex == 3) ? imgHeight>>shiftHeight : (yStartLine+yInterval);
    1936 
    1937     for(i = yStartLine; i < yEndLine ; i++)
    1938     {
    1939       for(j = 0; j < xInterval ; j++)
    1940       {
    1941         imgYVar[i][j] = regionTable[yIndexOffset+0];     
    1942       }
    1943 
    1944       for(j = xInterval; j < xInterval*2 ; j++)
    1945       {
    1946         imgYVar[i][j] = regionTable[yIndexOffset+1];     
    1947       }
    1948 
    1949       for(j = xInterval*2; j < xInterval*3 ; j++)
    1950       {
    1951         imgYVar[i][j] = regionTable[yIndexOffset+2];     
    1952       }
    1953 
    1954       for(j = xInterval*3; j < imgWidth>>shiftWidth ; j++)
    1955       {
    1956         imgYVar[i][j] = regionTable[yIndexOffset+3];     
    1957       }
    1958     }
    1959   }
    1960 
    1961 }
    1962 
    1963 // --------------------------------------------------------------------------------------------------------------------
    1964 // ALF for chroma
    1965 // --------------------------------------------------------------------------------------------------------------------
    1966 
    1967 /**
    1968  \param pcPicDec    picture before ALF
    1969  \param pcPicRest   picture after  ALF
    1970  \param qh          filter coefficient
    1971  \param iTap        filter tap
    1972  \param iColor      0 for Cb and 1 for Cr
    1973  */
    1974 Void TComAdaptiveLoopFilter::filterChroma(Pel *pImgRes, Pel *pImgPad, Int stride,
    1975                                           Int ypos, Int yposEnd, Int xpos, Int xposEnd,
    1976                                           Int filtNo, Int* coef)
    1977 {
    1978   static Int numBitsMinus1= (Int)ALF_NUM_BIT_SHIFT;
    1979   static Int offset       = (1<<( (Int)ALF_NUM_BIT_SHIFT-1));
    1980 
    1981   Pel *pImgPad1,*pImgPad2,*pImgPad3,*pImgPad4;
    1982   Int i, j, pixelInt;
    1983 
    1984   pImgPad    += (ypos*stride);
    1985   pImgRes    += (ypos*stride);
    1986 
    1987   Int imgHeightChroma = m_img_height>>1;
    1988   Int yLineInLCU;
    1989   Int paddingline;
    1990   Int newCenterCoeff[4];
    1991 
    1992   ::memset(newCenterCoeff, 0, sizeof(Int)*4);
    1993 #if ALF_SINGLE_FILTER_SHAPE
    1994   if(filtNo == ALF_CROSS9x7_SQUARE3x3)
    1995 #else
    1996   if (filtNo == ALF_CROSS9x9)
    1997 #endif
    1998   {
    1999     //VB line 1
    2000     newCenterCoeff[0] = coef[8] + ((coef[0] + coef[1] + coef[2] + coef[3])<<1);
    2001     //VB line 2
    2002     newCenterCoeff[1] = coef[8] + ((coef[0] + coef[1] + coef[2])<<1);
    2003     //VB line 3
    2004     newCenterCoeff[2] = coef[8] + ((coef[0] + coef[1])<<1);
    2005     //VB line 4
    2006     newCenterCoeff[3] = coef[8] + ((coef[0])<<1);
    2007   }
    2008 
    2009   switch(filtNo)
    2010   {
    2011 #if !ALF_SINGLE_FILTER_SHAPE
    2012   case ALF_STAR5x5:
    2013     {
    2014       for(i= ypos; i<= yposEnd; i++)
    2015       {
    2016         yLineInLCU = i % m_lcuHeightChroma;
    2017 
    2018         if (yLineInLCU < m_lineIdxPadBotChroma || i-yLineInLCU+m_lcuHeightChroma >= imgHeightChroma )
    2019         {
    2020           pImgPad1 = pImgPad + stride;
    2021           pImgPad2 = pImgPad - stride;
    2022           pImgPad3 = pImgPad + 2*stride;
    2023           pImgPad4 = pImgPad - 2*stride;
    2024         }
    2025         else if (yLineInLCU < m_lineIdxPadTopChroma)
    2026         {
    2027           paddingline = - yLineInLCU + m_lineIdxPadTopChroma - 1;
    2028           pImgPad1 = pImgPad + min(paddingline, 1)*stride;
    2029           pImgPad2 = pImgPad - stride;
    2030           pImgPad3 = pImgPad + min(paddingline, 2)*stride;
    2031           pImgPad4 = pImgPad - 2*stride;
    2032         }
    2033         else
    2034         {
    2035           paddingline = yLineInLCU - m_lineIdxPadTopChroma ;
    2036           pImgPad1 = pImgPad + stride;
    2037           pImgPad2 = pImgPad - min(paddingline, 1)*stride;
    2038           pImgPad3 = pImgPad + 2*stride;
    2039           pImgPad4 = pImgPad - min(paddingline, 2)*stride;
    2040         }
    2041 
    2042         if ( (yLineInLCU == m_lineIdxPadTopChroma || yLineInLCU == m_lineIdxPadTopChroma-1) && i-yLineInLCU+m_lcuHeightChroma < imgHeightChroma )
    2043         {
    2044           for(j= xpos; j<= xposEnd ; j++)
    2045           {
    2046             pImgRes[j] = pImgPad[j];
    2047           }
    2048         }
    2049         else if ( (yLineInLCU == m_lineIdxPadTopChroma+1 || yLineInLCU == m_lineIdxPadTopChroma-2) && i-yLineInLCU+m_lcuHeightChroma < imgHeightChroma )
    2050         {
    2051           for(j= xpos; j<= xposEnd ; j++)
    2052           {
    2053             pixelInt  = 0;
    2054 
    2055             pixelInt += coef[0]* (pImgPad3[j+2]+pImgPad4[j-2]);
    2056             pixelInt += coef[1]* (pImgPad3[j  ]+pImgPad4[j  ]);
    2057             pixelInt += coef[2]* (pImgPad3[j-2]+pImgPad4[j+2]);
    2058 
    2059             pixelInt += coef[3]* (pImgPad1[j+1]+pImgPad2[j-1]);
    2060             pixelInt += coef[4]* (pImgPad1[j  ]+pImgPad2[j  ]);
    2061             pixelInt += coef[5]* (pImgPad1[j-1]+pImgPad2[j+1]);
    2062 
    2063             pixelInt += coef[6]* (pImgPad[j+2]+pImgPad[j-2]);
    2064             pixelInt += coef[7]* (pImgPad[j+1]+pImgPad[j-1]);
    2065             pixelInt += coef[8]* (pImgPad[j  ]);
    2066 
    2067             pixelInt=(Int)((pixelInt+offset) >> numBitsMinus1);
    2068 
    2069             pImgRes[j] = (Clip( pixelInt ) + pImgPad[j]) >> 1;
    2070           }
    2071         }
    2072         else
    2073         {
    2074 
    2075         for(j= xpos; j<= xposEnd ; j++)
    2076         {
    2077           pixelInt  = 0;
    2078 
    2079           pixelInt += coef[0]* (pImgPad3[j+2]+pImgPad4[j-2]);
    2080           pixelInt += coef[1]* (pImgPad3[j  ]+pImgPad4[j  ]);
    2081           pixelInt += coef[2]* (pImgPad3[j-2]+pImgPad4[j+2]);
    2082 
    2083           pixelInt += coef[3]* (pImgPad1[j+1]+pImgPad2[j-1]);
    2084           pixelInt += coef[4]* (pImgPad1[j  ]+pImgPad2[j  ]);
    2085           pixelInt += coef[5]* (pImgPad1[j-1]+pImgPad2[j+1]);
    2086 
    2087           pixelInt += coef[6]* (pImgPad[j+2]+pImgPad[j-2]);
    2088           pixelInt += coef[7]* (pImgPad[j+1]+pImgPad[j-1]);
    2089           pixelInt += coef[8]* (pImgPad[j  ]);
    2090 
    2091           pixelInt=(Int)((pixelInt+offset) >> numBitsMinus1);
    2092 
    2093           pImgRes[j] = Clip( pixelInt );
    2094         }
    2095 
    2096         }
    2097         pImgPad += stride;
    2098         pImgRes += stride;
    2099       }
    2100     }
    2101     break;
    2102   case ALF_CROSS9x9:
    2103     {
    2104       Pel *pImgPad5, *pImgPad6, *pImgPad7, *pImgPad8;
    2105 #else
    2106   case ALF_CROSS9x7_SQUARE3x3:
    2107     {
    2108       Pel *pImgPad5, *pImgPad6;
    2109 #endif
    2110       for(i= ypos; i<= yposEnd; i++)
    2111       {
    2112         yLineInLCU = i % m_lcuHeightChroma;
    2113 #if ALF_SINGLE_FILTER_SHAPE
    2114         if (yLineInLCU<2 && i> 2)
    2115 #else
    2116         if (yLineInLCU<2)
    2117 #endif
    2118         {
    2119           paddingline = yLineInLCU + 2 ;
    2120           pImgPad1 = pImgPad + stride;
    2121           pImgPad2 = pImgPad - stride;
    2122           pImgPad3 = pImgPad + 2*stride;
    2123           pImgPad4 = pImgPad - 2*stride;
    2124 #if ALF_SINGLE_FILTER_SHAPE
    2125           pImgPad5 = (paddingline < 3) ? pImgPad : pImgPad + 3*stride;
    2126           pImgPad6 = (paddingline < 3) ? pImgPad : pImgPad - min(paddingline, 3)*stride;
    2127 #else
    2128           pImgPad5 = pImgPad + 3*stride;
    2129           pImgPad6 = pImgPad - min(paddingline, 3)*stride;
    2130           pImgPad7 = pImgPad + 4*stride;
    2131           pImgPad8 = pImgPad - min(paddingline, 4)*stride;
    2132 #endif
    2133         }
    2134         else if (yLineInLCU < m_lineIdxPadBotChroma || i-yLineInLCU+m_lcuHeightChroma >= imgHeightChroma )
    2135         {
    2136           pImgPad1 = pImgPad + stride;
    2137           pImgPad2 = pImgPad - stride;
    2138           pImgPad3 = pImgPad + 2*stride;
    2139           pImgPad4 = pImgPad - 2*stride;
    2140           pImgPad5 = pImgPad + 3*stride;
    2141           pImgPad6 = pImgPad - 3*stride;
    2142 #if !ALF_SINGLE_FILTER_SHAPE
    2143           pImgPad7 = pImgPad + 4*stride;
    2144           pImgPad8 = pImgPad - 4*stride;
    2145 #endif
    2146         }
    2147         else if (yLineInLCU < m_lineIdxPadTopChroma)
    2148         {
    2149           paddingline = - yLineInLCU + m_lineIdxPadTopChroma - 1;
    2150 #if ALF_SINGLE_FILTER_SHAPE
    2151           pImgPad1 = (paddingline < 1) ? pImgPad : pImgPad + min(paddingline, 1)*stride;
    2152           pImgPad2 = (paddingline < 1) ? pImgPad : pImgPad -   stride;
    2153           pImgPad3 = (paddingline < 2) ? pImgPad : pImgPad + min(paddingline, 2)*stride;
    2154           pImgPad4 = (paddingline < 2) ? pImgPad : pImgPad - 2*stride;
    2155           pImgPad5 = (paddingline < 3) ? pImgPad : pImgPad + min(paddingline, 3)*stride;
    2156           pImgPad6 = (paddingline < 3) ? pImgPad : pImgPad - 3*stride;
    2157 #else
    2158           pImgPad1 = pImgPad + min(paddingline, 1)*stride;
    2159           pImgPad2 = pImgPad - stride;
    2160           pImgPad3 = pImgPad + min(paddingline, 2)*stride;
    2161           pImgPad4 = pImgPad - 2*stride;
    2162           pImgPad5 = pImgPad + min(paddingline, 3)*stride;
    2163           pImgPad6 = pImgPad - 3*stride;
    2164           pImgPad7 = pImgPad + min(paddingline, 4)*stride;
    2165           pImgPad8 = pImgPad - 4*stride;
    2166 #endif
    2167         }
    2168         else
    2169         {
    2170           paddingline = yLineInLCU - m_lineIdxPadTopChroma ;
    2171 #if ALF_SINGLE_FILTER_SHAPE
    2172           pImgPad1 = (paddingline < 1) ? pImgPad : pImgPad +   stride;
    2173           pImgPad2 = (paddingline < 1) ? pImgPad : pImgPad - min(paddingline, 1)*stride;
    2174           pImgPad3 = (paddingline < 2) ? pImgPad : pImgPad + 2*stride;
    2175           pImgPad4 = (paddingline < 2) ? pImgPad : pImgPad - min(paddingline, 2)*stride;
    2176           pImgPad5 = (paddingline < 3) ? pImgPad : pImgPad + 3*stride;
    2177           pImgPad6 = (paddingline < 3) ? pImgPad : pImgPad - min(paddingline, 3)*stride;
    2178 #else
    2179           pImgPad1 = pImgPad + stride;
    2180           pImgPad2 = pImgPad - min(paddingline, 1)*stride;
    2181           pImgPad3 = pImgPad + 2*stride;
    2182           pImgPad4 = pImgPad - min(paddingline, 2)*stride;
    2183           pImgPad5 = pImgPad + 3*stride;
    2184           pImgPad6 = pImgPad - min(paddingline, 3)*stride;
    2185           pImgPad7 = pImgPad + 4*stride;
    2186           pImgPad8 = pImgPad - min(paddingline, 4)*stride;
    2187 #endif
    2188         }
    2189 
    2190 #if ALF_SINGLE_FILTER_SHAPE
    2191           for(j= xpos; j<= xposEnd ; j++)
    2192           {
    2193             pixelInt  = 0;
    2194 
    2195             pixelInt += coef[0]* (pImgPad5[j]+pImgPad6[j]);
    2196             pixelInt += coef[1]* (pImgPad3[j]+pImgPad4[j]);
    2197             pixelInt += coef[2]* (pImgPad1[j-1]+pImgPad2[j+1]);
    2198             pixelInt += coef[3]* (pImgPad1[j]+pImgPad2[j]);
    2199             pixelInt += coef[4]* (pImgPad1[j+1]+pImgPad2[j-1]);
    2200             pixelInt += coef[5]* (pImgPad[j+4]+pImgPad[j-4]);
    2201             pixelInt += coef[6]* (pImgPad[j+3]+pImgPad[j-3]);
    2202             pixelInt += coef[7]* (pImgPad[j+2]+pImgPad[j-2]);
    2203             pixelInt += coef[8]* (pImgPad[j+1]+pImgPad[j-1]);
    2204             pixelInt += coef[9]* (pImgPad[j  ]);
    2205 
    2206             pixelInt=(Int)((pixelInt+offset) >> numBitsMinus1);
    2207 
    2208             pImgRes[j] = Clip( pixelInt );
    2209           }
    2210 #else
    2211         if ( (yLineInLCU == m_lineIdxPadTopChroma || yLineInLCU == m_lineIdxPadTopChroma-1) && i-yLineInLCU+m_lcuHeightChroma < imgHeightChroma )
    2212         {
    2213           for(j= xpos; j<= xposEnd ; j++)
    2214           {
    2215             pixelInt  = 0;
    2216 
    2217             pixelInt += coef[4]* (pImgPad[j+4]+pImgPad[j-4]);
    2218             pixelInt += coef[5]* (pImgPad[j+3]+pImgPad[j-3]);
    2219             pixelInt += coef[6]* (pImgPad[j+2]+pImgPad[j-2]);
    2220             pixelInt += coef[7]* (pImgPad[j+1]+pImgPad[j-1]);
    2221             pixelInt += newCenterCoeff[0]* (pImgPad[j  ]);
    2222 
    2223             pixelInt=(Int)((pixelInt+offset) >> numBitsMinus1);
    2224 
    2225             pImgRes[j] = Clip( pixelInt );
    2226           }
    2227         }
    2228         else if ( (yLineInLCU == m_lineIdxPadTopChroma+1 || yLineInLCU == m_lineIdxPadTopChroma-2) && i-yLineInLCU+m_lcuHeightChroma < imgHeightChroma )
    2229         {
    2230           for(j= xpos; j<= xposEnd ; j++)
    2231           {
    2232             pixelInt  = 0;
    2233            
    2234             pixelInt += coef[3]* (pImgPad1[j]+pImgPad2[j]);
    2235 
    2236             pixelInt += coef[4]* (pImgPad[j+4]+pImgPad[j-4]);
    2237             pixelInt += coef[5]* (pImgPad[j+3]+pImgPad[j-3]);
    2238             pixelInt += coef[6]* (pImgPad[j+2]+pImgPad[j-2]);
    2239             pixelInt += coef[7]* (pImgPad[j+1]+pImgPad[j-1]);
    2240             pixelInt += newCenterCoeff[1]* (pImgPad[j  ]);
    2241 
    2242             pixelInt=(Int)((pixelInt+offset) >> numBitsMinus1);
    2243 
    2244             pImgRes[j] = Clip( pixelInt );
    2245           }
    2246         }
    2247         else if ( (yLineInLCU == 0 && i>0) || (yLineInLCU == m_lineIdxPadTopChroma-3 && i-yLineInLCU+m_lcuHeightChroma < imgHeightChroma) )
    2248         {
    2249           for(j= xpos; j<= xposEnd ; j++)
    2250           {
    2251             pixelInt  = 0;
    2252 
    2253             pixelInt += coef[2]* (pImgPad3[j]+pImgPad4[j]);
    2254 
    2255             pixelInt += coef[3]* (pImgPad1[j]+pImgPad2[j]);
    2256 
    2257             pixelInt += coef[4]* (pImgPad[j+4]+pImgPad[j-4]);
    2258             pixelInt += coef[5]* (pImgPad[j+3]+pImgPad[j-3]);
    2259             pixelInt += coef[6]* (pImgPad[j+2]+pImgPad[j-2]);
    2260             pixelInt += coef[7]* (pImgPad[j+1]+pImgPad[j-1]);
    2261             pixelInt += newCenterCoeff[2]* (pImgPad[j  ]);
    2262 
    2263             pixelInt=(Int)((pixelInt+offset) >> numBitsMinus1);
    2264 
    2265             pImgRes[j] = Clip( pixelInt );
    2266           }
    2267         }
    2268         else if ( (yLineInLCU == 1 && i>1) || (yLineInLCU == m_lineIdxPadTopChroma-4 && i-yLineInLCU+m_lcuHeightChroma < imgHeightChroma) )
    2269         {
    2270           for(j= xpos; j<= xposEnd ; j++)
    2271           {
    2272             pixelInt  = 0;
    2273 
    2274             pixelInt += coef[1]* (pImgPad5[j]+pImgPad6[j]);
    2275 
    2276             pixelInt += coef[2]* (pImgPad3[j]+pImgPad4[j]);
    2277 
    2278             pixelInt += coef[3]* (pImgPad1[j]+pImgPad2[j]);
    2279 
    2280             pixelInt += coef[4]* (pImgPad[j+4]+pImgPad[j-4]);
    2281             pixelInt += coef[5]* (pImgPad[j+3]+pImgPad[j-3]);
    2282             pixelInt += coef[6]* (pImgPad[j+2]+pImgPad[j-2]);
    2283             pixelInt += coef[7]* (pImgPad[j+1]+pImgPad[j-1]);
    2284             pixelInt += newCenterCoeff[3]* (pImgPad[j  ]);
    2285 
    2286             pixelInt=(Int)((pixelInt+offset) >> numBitsMinus1);
    2287 
    2288             pImgRes[j] = Clip( pixelInt );
    2289           }
    2290         }
    2291         else
    2292         {         
    2293           for(j= xpos; j<= xposEnd ; j++)
    2294           {
    2295             pixelInt  = 0;
    2296 
    2297             pixelInt += coef[0]* (pImgPad7[j]+pImgPad8[j]);
    2298 
    2299             pixelInt += coef[1]* (pImgPad5[j]+pImgPad6[j]);
    2300 
    2301             pixelInt += coef[2]* (pImgPad3[j]+pImgPad4[j]);
    2302 
    2303             pixelInt += coef[3]* (pImgPad1[j]+pImgPad2[j]);
    2304 
    2305             pixelInt += coef[4]* (pImgPad[j+4]+pImgPad[j-4]);
    2306             pixelInt += coef[5]* (pImgPad[j+3]+pImgPad[j-3]);
    2307             pixelInt += coef[6]* (pImgPad[j+2]+pImgPad[j-2]);
    2308             pixelInt += coef[7]* (pImgPad[j+1]+pImgPad[j-1]);
    2309             pixelInt += coef[8]* (pImgPad[j  ]);
    2310 
    2311             pixelInt=(Int)((pixelInt+offset) >> numBitsMinus1);
    2312 
    2313             pImgRes[j] = Clip( pixelInt );
    2314           }
    2315         }
    2316 #endif
    2317         pImgPad += stride;
    2318         pImgRes += stride;
    2319 
    2320       }
    2321     }
    2322 
    2323     break;
    2324   default:
    2325     {
    2326       printf("Not a supported filter shape\n");
    2327       assert(0);
    2328       exit(1);
    2329     }
    2330   }
    2331 
    2332 }
    2333 
    2334 /** Chroma filtering for multi-slice picture
    2335  * \param componentID slice parameters
    2336  * \param pcPicDecYuv original picture
    2337  * \param pcPicRestYuv picture before filtering
    2338  * \param coeff filter coefficients
    2339  * \param filtNo  filter shape
    2340  * \param chromaFormatShift size adjustment for chroma (1 for 4:2:0 format)
    2341  */
    2342 Void TComAdaptiveLoopFilter::xFilterChromaSlices(Int componentID, TComPicYuv* pcPicDecYuv, TComPicYuv* pcPicRestYuv, Int *coeff, Int filtNo, Int chromaFormatShift)
    2343 {
    2344   Pel* pPicDec   = (componentID == ALF_Cb)?(    pcPicDecYuv->getCbAddr()):(    pcPicDecYuv->getCrAddr());
    2345   Pel* pPicSlice = (componentID == ALF_Cb)?(m_pcSliceYuvTmp->getCbAddr()):(m_pcSliceYuvTmp->getCrAddr());
    2346   Pel* pRest     = (componentID == ALF_Cb)?(   pcPicRestYuv->getCbAddr()):(   pcPicRestYuv->getCrAddr());
    2347   Int  stride    = pcPicDecYuv->getCStride();
    2348 
    2349   for(UInt s=0; s< m_uiNumSlicesInPic; s++)
    2350   {
    2351     if(!m_pcPic->getValidSlice(s))
    2352     {
    2353       continue;
    2354     }
    2355     std::vector< std::vector<AlfLCUInfo*> > & vpSliceTileAlfLCU = m_pvpSliceTileAlfLCU[s];
    2356 
    2357     for(Int t=0; t< (Int)vpSliceTileAlfLCU.size(); t++)
    2358     {
    2359       std::vector<AlfLCUInfo*> & vpAlfLCU = vpSliceTileAlfLCU[t];
    2360 
    2361       copyRegion(vpAlfLCU, pPicSlice, pPicDec, stride, chromaFormatShift);
    2362       extendRegionBorder(vpAlfLCU, pPicSlice, stride, chromaFormatShift);
    2363       filterChromaRegion(vpAlfLCU, pPicSlice, pRest, stride, coeff, filtNo, chromaFormatShift);
    2364     }
    2365   }
    2366 }
    2367 
    2368 /** Chroma filtering for one component in multi-slice picture
    2369  * \param componentID slice parameters
    2370  * \param pcPicDecYuv original picture
    2371  * \param pcPicRestYuv picture before filtering
    2372  * \param shape  filter shape
    2373  * \param pCoeff filter coefficients
    2374  */
    2375 Void TComAdaptiveLoopFilter::xFilterChromaOneCmp(Int componentID, TComPicYuv *pDecYuv, TComPicYuv *pRestYuv, Int shape, Int *pCoeff)
    2376 {
    2377   Int chromaFormatShift = 1;
    2378   if(!m_bUseNonCrossALF)
    2379   {
    2380     Pel* pDec    = (componentID == ALF_Cb)?(pDecYuv->getCbAddr()): (pDecYuv->getCrAddr());
    2381     Pel* pRest   = (componentID == ALF_Cb)?(pRestYuv->getCbAddr()):(pRestYuv->getCrAddr());
    2382     Int  iStride = pDecYuv->getCStride();
    2383     filterChroma(pRest, pDec, iStride, 0, (Int)(m_img_height>>1) -1, 0, (Int)(m_img_width>>1)-1, shape, pCoeff);
    2384   }
    2385   else
    2386   {
    2387     xFilterChromaSlices(componentID, pDecYuv, pRestYuv, pCoeff, shape, chromaFormatShift);
    2388   }
    2389 }
    2390 
    2391 /** Chroma filtering for  multi-slice picture
    2392  * \param pcAlfParam ALF parameters
    2393  * \param pcPicDec to-be-filtered picture buffer
    2394  * \param pcPicRest filtered picture buffer
    2395  */
    2396 Void TComAdaptiveLoopFilter::xALFChroma(ALFParam* pcAlfParam, TComPicYuv* pcPicDec, TComPicYuv* pcPicRest)
    2397 {
    2398   if((pcAlfParam->chroma_idc>>1)&0x01)
    2399   {
    2400     xFilterChromaOneCmp(ALF_Cb, pcPicDec, pcPicRest, pcAlfParam->filter_shape_chroma, pcAlfParam->coeff_chroma);
    2401   }
    2402 
    2403   if(pcAlfParam->chroma_idc&0x01)
    2404   {
    2405     xFilterChromaOneCmp(ALF_Cr, pcPicDec, pcPicRest, pcAlfParam->filter_shape_chroma, pcAlfParam->coeff_chroma);
    2406   }
    2407 }
    2408 
    2409 #endif
    2410921
    2411922Void TComAdaptiveLoopFilter::setAlfCtrlFlags(AlfCUCtrlInfo* pAlfParam, TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt &idx)
     
    24981009 * \param numSlicesInPic number of slices in picture
    24991010 */
    2500 #if LCU_SYNTAX_ALF
    25011011Void TComAdaptiveLoopFilter::createPicAlfInfo(TComPic* pcPic, Int numSlicesInPic, Int alfQP)
    2502 #else
    2503 Void TComAdaptiveLoopFilter::createPicAlfInfo(TComPic* pcPic, Int numSlicesInPic)
    2504 #endif
    25051012{
    25061013  m_uiNumSlicesInPic = numSlicesInPic;
     
    25101017  m_pcPic = pcPic;
    25111018
    2512 #if LCU_SYNTAX_ALF
    25131019  m_isNonCrossSlice = pcPic->getIndependentSliceBoundaryForNDBFilter();
    25141020  m_suWidth = pcPic->getMinCUWidth();
    25151021  m_suHeight= pcPic->getMinCUHeight();
    25161022  m_alfQP = alfQP;
    2517 #endif
    2518 #if !LCU_SYNTAX_ALF 
    2519   if(m_uiNumSlicesInPic > 1 || m_bUseNonCrossALF)
    2520   {
    2521 #endif
    25221023    m_ppSliceAlfLCUs = new AlfLCUInfo*[m_uiNumSlicesInPic];
    25231024    m_pvpAlfLCU = new std::vector< AlfLCUInfo* >[m_uiNumSlicesInPic];
     
    25841085      m_pcSliceYuvTmp = pcPic->getYuvPicBufferForIndependentBoundaryProcessing();
    25851086    }
    2586 #if !LCU_SYNTAX_ALF
    2587   }
    2588 #endif
    25891087
    25901088}
     
    25941092Void TComAdaptiveLoopFilter::destroyPicAlfInfo()
    25951093{
    2596 #if !LCU_SYNTAX_ALF
    2597   if(m_bUseNonCrossALF)
    2598   {
    2599 #endif
    26001094    for(Int s=0; s< m_uiNumSlicesInPic; s++)
    26011095    {
     
    26141108    delete[] m_pvpSliceTileAlfLCU;
    26151109    m_pvpSliceTileAlfLCU = NULL;
    2616 #if !LCU_SYNTAX_ALF
    2617   }
    2618 #endif
    2619 }
    2620 
    2621 #if !LCU_SYNTAX_ALF
    2622 /** ALF for cu-on/off-controlled region
    2623  * \param vpAlfLCU ALF LCU information container
    2624  * \param imgDec to-be-filtered picture buffer
    2625  * \param imgRest filtered picture buffer
    2626  * \param stride picture buffer stride size
    2627  * \param filtNo filter shape
    2628  * \param filterCoeff filter coefficients
    2629  * \param mergeTable merge table for filter set
    2630  * \param varImg BA index
    2631  */
    2632 Void TComAdaptiveLoopFilter::xCUAdaptiveRegion(std::vector<AlfLCUInfo*> &vpAlfLCU, Pel* imgDec, Pel* imgRest, Int stride, Int filtNo, Int** filterCoeff, Int* mergeTable, Pel** varImg)
    2633 {
    2634   UInt SUWidth   = m_pcPic->getMinCUWidth();
    2635   UInt SUHeight  = m_pcPic->getMinCUHeight();
    2636   UInt idx, startSU, endSU, currSU, LCUX, LCUY, LPelX, TPelY;
    2637   TComDataCU* pcCU;
    2638 
    2639   for(idx=0; idx< vpAlfLCU.size(); idx++)
    2640   {
    2641     AlfLCUInfo&    rAlfLCU = *(vpAlfLCU[idx]);
    2642     pcCU                   = rAlfLCU.pcCU;
    2643     startSU              = rAlfLCU.startSU;
    2644     endSU                = rAlfLCU.endSU;
    2645     LCUX                 = pcCU->getCUPelX();
    2646     LCUY                 = pcCU->getCUPelY();
    2647 
    2648     for(currSU= startSU; currSU<= endSU; currSU++)
    2649     {
    2650       LPelX   = LCUX + g_auiRasterToPelX[ g_auiZscanToRaster[currSU] ];
    2651       TPelY   = LCUY + g_auiRasterToPelY[ g_auiZscanToRaster[currSU] ];
    2652       if( !( LPelX < m_img_width )  || !( TPelY < m_img_height )  )
    2653       {
    2654         continue;
    2655       }
    2656       if(pcCU->getAlfCtrlFlag(currSU))
    2657       {
    2658         filterLuma(imgRest, imgDec, stride, TPelY, TPelY+ SUHeight-1, LPelX, LPelX+ SUWidth-1,  filtNo, m_filterCoeffSym, m_varIndTab, m_varImg);
    2659       }
    2660     }
    2661   }
    2662 
    2663 }
    2664 
    2665 /** ALF for "non" cu-on/off-controlled region
    2666  * \param vpAlfLCU ALF LCU information container
    2667  * \param imgDec to-be-filtered picture buffer
    2668  * \param imgRest filtered picture buffer
    2669  * \param stride picture buffer stride size
    2670  * \param filtNo filter shape
    2671  * \param filterCoeff filter coefficients
    2672  * \param mergeTable merge table for filter set
    2673  * \param varImg BA index
    2674  */
    2675 Void TComAdaptiveLoopFilter::filterLumaRegion(std::vector<AlfLCUInfo*> &vpAlfLCU, Pel* imgDec, Pel* imgRest, Int stride, Int filtNo, Int** filterCoeff, Int* mergeTable, Pel** varImg)
    2676 {
    2677 
    2678   Int height, width;
    2679   Int ypos, xpos;
    2680 
    2681   for(Int i=0; i< vpAlfLCU.size(); i++)
    2682   {
    2683     AlfLCUInfo& rAlfLCU = *(vpAlfLCU[i]);
    2684     for(UInt j=0; j< rAlfLCU.numSGU; j++)
    2685     {
    2686       ypos   = (Int)(rAlfLCU[j].posY  );
    2687       xpos   = (Int)(rAlfLCU[j].posX  );
    2688       height = (Int)(rAlfLCU[j].height);
    2689       width  = (Int)(rAlfLCU[j].width );
    2690 
    2691       filterLuma(imgRest, imgDec, stride, ypos, ypos+ height-1, xpos, xpos+ width-1,  filtNo, filterCoeff, mergeTable, varImg);
    2692     }
    2693   }
    2694 }
    2695 
    2696 
    2697 /** Perform ALF for one chroma region
    2698  * \param vpAlfLCU ALF LCU data container
    2699  * \param pDec to-be-filtered picture buffer
    2700  * \param pRest filtered picture buffer
    2701  * \param stride picture buffer stride
    2702  * \param coeff  filter coefficients
    2703  * \param filtNo filter shape
    2704  * \param chromaFormatShift chroma component size adjustment (1 for 4:2:0)
    2705  */
    2706 Void TComAdaptiveLoopFilter::filterChromaRegion(std::vector<AlfLCUInfo*> &vpAlfLCU, Pel* pDec, Pel* pRest, Int stride, Int *coeff, Int filtNo, Int chromaFormatShift)
    2707 {
    2708   Int height, width;
    2709   Int ypos, xpos;
    2710 
    2711   for(Int i=0; i< vpAlfLCU.size(); i++)
    2712   {
    2713     AlfLCUInfo& cAlfLCU = *(vpAlfLCU[i]);
    2714     for(Int j=0; j< cAlfLCU.numSGU; j++)
    2715     {
    2716       ypos   = (Int)(cAlfLCU[j].posY   >> chromaFormatShift);
    2717       xpos   = (Int)(cAlfLCU[j].posX   >> chromaFormatShift);
    2718       height = (Int)(cAlfLCU[j].height >> chromaFormatShift);
    2719       width  = (Int)(cAlfLCU[j].width  >> chromaFormatShift);
    2720 
    2721       filterChroma(pRest, pDec, stride, ypos, ypos+ height -1, xpos, xpos+ width-1, filtNo, coeff);
    2722     }
    2723   }
    2724 }
    2725 
    2726 #endif
     1110}
     1111
    27271112
    27281113/** Copy ALF CU control flags from ALF parameters for slices
     
    28461231    {
    28471232      NDBFBlockInfo& rSGU = rAlfLCU[n];
    2848 #if LCU_SYNTAX_ALF
    28491233      if(rSGU.allBordersAvailable)
    28501234      {
    28511235        continue;
    28521236      }
    2853 #endif
    28541237      posX     = rSGU.posX >> formatShift;
    28551238      posY     = rSGU.posY >> formatShift;
     
    31271510}
    31281511
    3129 #if LCU_SYNTAX_ALF
    31301512/** reconstruct ALF luma coefficient
    31311513 * \param [in] alfLCUParam ALF parameters
     
    32321614  coeffPred = (1<<ALF_NUM_BIT_SHIFT) - sum;
    32331615#endif
    3234 #if ALF_CHROMA_COEF_PRED_HARMONIZATION
    32351616  filterCoeff[0][alfLCUParam->num_coeff-1] = coeffPred + alfLCUParam->coeffmulti[0][alfLCUParam->num_coeff-1];
    3236 #else
    3237   filterCoeff[0][alfLCUParam->num_coeff-1] = coeffPred - alfLCUParam->coeffmulti[0][alfLCUParam->num_coeff-1];
    3238 #endif
    32391617}
    32401618
     
    34441822  Int pred = (1<<ALF_NUM_BIT_SHIFT) - (sum);
    34451823#endif
    3446 #if ALF_CHROMA_COEF_PRED_HARMONIZATION
    34471824  coeff[numCoef-1] = coeff[numCoef-1] - pred;
    3448 #else
    3449   coeff[numCoef-1] = pred- coeff[numCoef-1];
    3450 #endif
    3451 }
    3452 
    3453 #if ALF_SINGLE_FILTER_SHAPE
     1825}
     1826
    34541827/** filtering pixels
    34551828 * \param [out] imgRes filtered picture
     
    35761949  } 
    35771950}
    3578 #endif
    35791951
    35801952#if LCUALF_QP_DEPENDENT_BITS
     
    36231995  static Int shiftW = (Int)(log((double)VAR_SIZE_W)/log(2.0));
    36241996  static Int varMax = (Int)NO_VAR_BINS-1; 
    3625 #if ALF_16_BA_GROUPS
    36261997  static Int th[NO_VAR_BINS] = {0, 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5};
    36271998  static Int avgVarTab[3][6] = { {0,  1,  2,  3,  4,  5,},
    36281999  {0,  6,  7,  8,  9, 10,},
    36292000  {0, 11, 12, 13, 14, 15}   };
    3630 #else
    3631   static Int step   = (Int)((Int)(NO_VAR_BINS)/3) - 1; 
    3632   static Int th[NO_VAR_BINS] = {0, 1, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4};
    3633 #endif
    36342001
    36352002  Int i, j, avgVar, vertical, horizontal, direction, yOffset;
     
    36832050      avgVar = (Pel) Clip_post( varMax, avgVar>>(g_uiBitIncrement+1) );
    36842051      avgVar = th[avgVar];
    3685 #if ALF_16_BA_GROUPS
    36862052      avgVar = avgVarTab[direction][avgVar];
    3687 #else     
    3688       avgVar = Clip_post(step, (Int)avgVar) + (step+1)*direction;
    3689 #endif
    36902053      imgYvar[i>>shiftH][j>>shiftW] = avgVar;
    36912054    }
     
    37672130  return pBuf;
    37682131}
    3769 #endif
    37702132
    37712133
  • branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComAdaptiveLoopFilter.h

    r56 r294  
    4949// ====================================================================================================================
    5050
    51 #if LCU_SYNTAX_ALF
    5251  #define LCUALF_QP_DEPENDENT_BITS    1 
    53 #endif
    54 
    55 #if ALF_SINGLE_FILTER_SHAPE
     52
    5653#define ALF_FILTER_LEN       10
    5754#define ALF_MAX_NUM_COEF     ALF_FILTER_LEN    //!< maximum number of filter coefficients
    58 #else
    59 #define ALF_MAX_NUM_COEF      9                                       //!< maximum number of filter coefficients
    60 #endif
    6155#define MAX_SQR_FILT_LENGTH   41                                      //!< ((max_horizontal_tap * max_vertical_tap) / 2 + 1) = ((11 * 5) / 2 + 1)
    6256
    63 #if LCU_SYNTAX_ALF && LCUALF_QP_DEPENDENT_BITS
     57#if LCUALF_QP_DEPENDENT_BITS
    6458#define ALF_QP1               28
    6559#define ALF_QP2               34
     
    7872
    7973
    80 #if LCU_SYNTAX_ALF
    8174/// Luma/Chroma component ID
    8275enum ALFComponentID
     
    9689  NUM_ALF_MERGE_TYPE
    9790};
    98 #else
    99 ///
    100 /// Chroma component ID
    101 ///
    102 enum AlfChromaID
    103 {
    104   ALF_Cb = 0,
    105   ALF_Cr = 1
    106 };
    107 
    108 
    109 ///
    110 /// Adaptation mode ID
    111 ///
    112 enum ALFClassficationMethod
    113 {
    114   ALF_BA =0,
    115   ALF_RA,
    116   NUM_ALF_CLASS_METHOD
    117 };
    118 #endif
    11991///
    12092/// Filter shape
     
    12294enum ALFFilterShape
    12395{
    124 #if ALF_SINGLE_FILTER_SHAPE
    12596  ALF_CROSS9x7_SQUARE3x3 = 0,
    126 #else
    127   ALF_STAR5x5 = 0,
    128   ALF_CROSS9x9,
    129 #endif
    13097  NUM_ALF_FILTER_SHAPE
    13198};
    13299
    133 #if LCU_SYNTAX_ALF
    134100extern Int* kTableTabShapes[NUM_ALF_FILTER_SHAPE];
    135 #endif
    136 #if ALF_SINGLE_FILTER_SHAPE
    137101extern Int depthIntShape1Sym[ALF_MAX_NUM_COEF+1];
    138 #else
    139 extern Int depthIntShape0Sym[10];
    140 extern Int depthIntShape1Sym[10];
    141 #endif
    142102extern Int *pDepthIntTabShapes[NUM_ALF_FILTER_SHAPE];
    143103
     
    156116  const AlfCUCtrlInfo& operator= (const AlfCUCtrlInfo& src);  //!< "=" operator
    157117  AlfCUCtrlInfo():cu_control_flag(0), num_alf_cu_flag(0), alf_max_depth(0) {} //!< constructor
    158 #if LCU_SYNTAX_ALF
    159118  Void reset();
    160 #endif
    161119};
    162120
     
    190148
    191149  // filter shape information
    192 #if ALF_SINGLE_FILTER_SHAPE
    193150  static Int weightsShape1Sym[ALF_MAX_NUM_COEF+1];
    194 #else
    195   static Int weightsShape0Sym[10];
    196   static Int weightsShape1Sym[10];
    197 #endif
    198151  static Int *weightsTabShapes[NUM_ALF_FILTER_SHAPE];
    199152  static Int m_sqrFiltLengthTab[NUM_ALF_FILTER_SHAPE];
     
    209162  //classification
    210163  Int      m_varIndTab[NO_VAR_BINS];
    211 #if !LCU_SYNTAX_ALF
    212   UInt     m_uiVarGenMethod;
    213   Pel** m_varImgMethods[NUM_ALF_CLASS_METHOD];
    214 #endif
    215164  Pel** m_varImg;
    216165
     
    237186  std::vector< std::vector< AlfLCUInfo* > > *m_pvpSliceTileAlfLCU;
    238187
    239 #if LCU_SYNTAX_ALF
    240188  Int m_suWidth;
    241189  Int m_suHeight;
     
    245193  Bool m_isNonCrossSlice;
    246194  Int m_alfQP;
    247 #endif
    248195
    249196private: //private member variables
     
    252199protected: //protected methods
    253200
    254 #if LCU_SYNTAX_ALF
    255201  Void createLCUAlfInfo();
    256202  Void destroyLCUAlfInfo();
     
    266212  Bool isEnabledComponent(ALFParam** alfLCUParam);
    267213  Int  getAlfPrecisionBit(Int qp);
    268 #if ALF_SINGLE_FILTER_SHAPE
    269214  Void filterOneCompRegion(Pel *imgRes, Pel *imgPad, Int stride, Bool isChroma, Int yPos, Int yPosEnd, Int xPos, Int xPosEnd, Int** filterSet, Int* mergeTable, Pel** varImg); 
    270 #endif
    271215  Void calcOneRegionVar(Pel **imgYvar, Pel *imgYpad, Int stride, Bool isOnlyOneGroup, Int yPos, Int yPosEnd, Int xPos, Int xPosEnd);
    272 #endif
    273216
    274217
    275218  Void InitAlfLCUInfo(AlfLCUInfo& rAlfLCU, Int sliceID, Int tileID, TComDataCU* pcCU, UInt maxNumSUInLCU);
    276 #if !LCU_SYNTAX_ALF
    277   Void createRegionIndexMap(Pel **imgY_var, Int img_width, Int img_height); //!< create RA index for regions
    278   Void calcVar(Pel **imgYvar, Pel *imgYpad, Int stride, Int adaptationMode); //!< Calculate ALF grouping indices for block-based (BA) mode
    279   Void filterLuma(Pel *pImgYRes, Pel *pImgYPad, Int stride, Int ypos, Int yposEnd, Int xpos, Int xposEnd, Int filtNo, Int** filterSet, Int* mergeTable, Pel** ppVarImg); //!< filtering operation for luma region
    280   Void filterChroma(Pel *pImgRes, Pel *pImgPad, Int stride, Int ypos, Int yposEnd, Int xpos, Int xposEnd, Int filtNo, Int* coef);
    281   Void filterChromaRegion(std::vector<AlfLCUInfo*> &vpAlfLCU, Pel* pDec, Pel* pRest, Int stride, Int *coeff, Int filtNo, Int chromaFormatShift); //!< filtering operation for chroma region
    282   Void xCUAdaptive   (TComPic* pcPic, Int filtNo, Pel *imgYFilt, Pel *imgYRec, Int Stride);
    283   Void xSubCUAdaptive(TComDataCU* pcCU, Int filtNo, Pel *imgYFilt, Pel *imgYRec, UInt uiAbsPartIdx, UInt uiDepth, Int Stride);
    284   Void reconstructFilterCoeffs(ALFParam* pcAlfParam,int **pfilterCoeffSym);
    285   Void predictALFCoeffLuma  ( ALFParam* pAlfParam );                    //!< prediction of luma ALF coefficients
    286 #endif
    287219  Void checkFilterCoeffValue( Int *filter, Int filterLength, Bool isChroma );
    288 #if !LCU_SYNTAX_ALF
    289   Void decodeFilterSet(ALFParam* pcAlfParam, Int* varIndTab, Int** filterCoeff);
    290   Void xALFChroma   ( ALFParam* pcAlfParam, TComPicYuv* pcPicDec, TComPicYuv* pcPicRest );
    291   Void xFilterChromaSlices(Int componentID, TComPicYuv* pcPicDecYuv, TComPicYuv* pcPicRestYuv, Int *coeff, Int filtNo, Int chromaFormatShift);
    292   Void xFilterChromaOneCmp(Int componentID, TComPicYuv *pDecYuv, TComPicYuv *pRestYuv, Int shape, Int *pCoeff);
    293   Void xALFLuma( TComPic* pcPic, ALFParam* pcAlfParam, std::vector<AlfCUCtrlInfo>& vAlfCUCtrlParam, TComPicYuv* pcPicDec, TComPicYuv* pcPicRest );
    294 #endif
    295220  Void setAlfCtrlFlags(AlfCUCtrlInfo* pAlfParam, TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt &idx);
    296221  Void transferCtrlFlagsFromAlfParam(std::vector<AlfCUCtrlInfo>& vAlfParamSlices); //!< Copy ALF CU control flags from ALF parameters for slices 
     
    299224  Void copyRegion(std::vector<AlfLCUInfo*> &vpAlfLCU, Pel* pPicDst, Pel* pPicSrc, Int stride, Int formatShift = 0);
    300225  Void extendRegionBorder(std::vector<AlfLCUInfo*> &vpAlfLCU, Pel* pPelSrc, Int stride, Int formatShift = 0);
    301 #if !LCU_SYNTAX_ALF 
    302   Void filterLumaRegion (std::vector<AlfLCUInfo*> &vpAlfLCU, Pel* imgDec, Pel* imgRest, Int stride, Int filtNo, Int** filterCoeff, Int* mergeTable, Pel** varImg);
    303   Void xCUAdaptiveRegion(std::vector<AlfLCUInfo*> &vpAlfLCU, Pel* imgDec, Pel* imgRest, Int stride, Int filtNo, Int** filterCoeff, Int* mergeTable, Pel** varImg);
    304 #endif
    305226  Int  getCtrlFlagsFromAlfParam(AlfLCUInfo* pcAlfLCU, Int iAlfDepth, UInt* puiFlags);
    306227
     
    317238  Void destroy ();
    318239
    319 #if LCU_SYNTAX_ALF
    320240  Void ALFProcess          (TComPic* pcPic, std::vector<AlfCUCtrlInfo>& vAlfCUCtrlParam, Bool isAlfCoefInSlice);
    321241  Void resetLCUAlfInfo     ();
     
    324244
    325245  ALFParam*** getAlfLCUParam() {return m_alfFiltInfo;}
    326 #else
    327   Void predictALFCoeffChroma  ( ALFParam* pAlfParam );                  //!< prediction of chroma ALF coefficients
    328 #if ALF_CHROMA_COEF_PRED_HARMONIZATION
    329   Void reconstructALFCoeffChroma( ALFParam* pAlfParam );
    330 #endif
    331   Void ALFProcess             ( TComPic* pcPic, ALFParam* pcAlfParam, std::vector<AlfCUCtrlInfo>& vAlfCUCtrlParam ); ///< interface function for ALF process
    332 
    333   Void allocALFParam  ( ALFParam* pAlfParam ); //!< allocate ALF parameters
    334   Void freeALFParam   ( ALFParam* pAlfParam ); //!< free ALF parameters
    335   Void copyALFParam   ( ALFParam* pDesAlfParam, ALFParam* pSrcAlfParam ); //!< copy ALF parameters
    336 #endif
    337246  Int  getNumCUsInPic()  {return m_uiNumCUsInFrame;} //!< get number of LCU in picture for ALF process
    338 #if LCU_SYNTAX_ALF
    339247  Void createPicAlfInfo (TComPic* pcPic, Int uiNumSlicesInPic = 1, Int alfQP = 26);
    340 #else
    341   Void createPicAlfInfo (TComPic* pcPic, Int numSlicesInPic = 1);
    342 #endif
    343248  Void destroyPicAlfInfo();
    344249
  • branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComBitStream.cpp

    r56 r294  
    7373  m_puiTileMarkerLocation     = new UInt[MAX_MARKER_PER_NALU];
    7474  m_uiTileMarkerLocationCount = 0;
    75 #if TILES_WPP_ENTRY_POINT_SIGNALLING
    7675  m_numBitsRead = 0;
    77 #endif
    7876}
    7977
     
    212210  assert( uiNumberOfBits <= 32 );
    213211 
    214 #if TILES_WPP_ENTRY_POINT_SIGNALLING
    215212  m_numBitsRead += uiNumberOfBits;
    216 #endif
    217213
    218214  /* NB, bits are extracted from the MSB of each byte. */
     
    334330    buf->push_back(uiByte);
    335331  }
    336 #if OL_FLUSH && !OL_FLUSH_ALIGN
     332#if !OL_FLUSH_ALIGN
    337333  buf->push_back(0); // The final chunk might not start byte aligned.
    338334#endif
  • branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComBitStream.h

    r56 r294  
    176176  UInt m_uiTileMarkerLocationCount;
    177177  UInt *m_puiTileMarkerLocation;
    178 #if TILES_WPP_ENTRY_POINT_SIGNALLING
    179178  UInt  m_numBitsRead;
    180 #endif
    181179
    182180public:
     
    192190  Void        pseudoRead      ( UInt uiNumberOfBits, UInt& ruiBits );
    193191  Void        read            ( UInt uiNumberOfBits, UInt& ruiBits );
    194 #if OL_FLUSH && !OL_FLUSH_ALIGN
     192#if !OL_FLUSH_ALIGN
    195193  Void        readByte        ( UInt &ruiBits )
    196194  {
     
    228226  Void                backupByte() { m_fifo_idx--; }
    229227#endif
    230 #if TILES_WPP_ENTRY_POINT_SIGNALLING
    231228  UInt  getNumBitsRead() { return m_numBitsRead; }
     229};
     230
     231//! \}
     232
    232233#endif
    233 };
    234 
    235 //! \}
    236 
    237 #endif
  • branches/HTM-5.1-dev0/source/Lib/TLibCommon/TComDataCU.cpp

    r293 r294  
    105105          }
    106106          iVSPIndexTrue[idx] = iCount;
    107 #if SIMP_MRG_PRUN
    108107          if ( mrgCandIdx == iCount )
    109108          {
    110109            return false;
    111110          }
    112 #endif
    113111          iCount ++;
    114112        }
     
    257255  if ( !bDecSubCu )
    258256  {
    259 #if H0736_AVC_STYLE_QP_RANGE
    260257    m_phQP               = (Char*     )xMalloc(Char,     uiNumPartition);
    261 #else
    262     m_phQP               = (UChar*    )xMalloc(UChar,    uiNumPartition);
    263 #endif
    264258    m_puhDepth           = (UChar*    )xMalloc(UChar,    uiNumPartition);
    265259#if HHI_MPI
     
    550544  this->height = src.height;
    551545  ::memcpy(this->isBorderAvailable, src.isBorderAvailable, sizeof(Bool)*((Int)NUM_SGU_BORDER));
    552 #if LCU_SYNTAX_ALF
    553546  this->allBordersAvailable = src.allBordersAvailable;
    554 #endif
    555547
    556548  return *this;
     
    587579  m_uiTotalBins        = 0;
    588580  m_uiNumPartition     = pcPic->getNumPartInCU();
    589 #if BURST_IPCM
    590581  m_numSucIPCM       = 0;
    591582  m_lastCUSucIPCMFlag   = false;
    592 #endif
    593583
    594584  for(int i=0; i<pcPic->getNumPartInCU(); i++)
     
    816806}
    817807
    818 #if H0736_AVC_STYLE_QP_RANGE
    819808/** initialize prediction data with enabling sub-LCU-level delta QP
    820809*\param  uiDepth  depth of the current CU
     
    825814*/
    826815Void TComDataCU::initEstData( UInt uiDepth, Int qp )
    827 #else
    828 /** initialize prediction data with enabling sub-LCU-level delta QP
    829 *\param  uiDepth  depth of the current CU
    830 *\param  uiQP     QP for the current CU
    831 *- set CU width and CU height according to depth
    832 *- set QP value according to input QP
    833 *- set last-coded QP value according to input last-coded QP
    834 */
    835 Void TComDataCU::initEstData( UInt uiDepth, UInt uiQP )
    836 #endif
    837816{
    838817  m_dTotalCost         = MAX_DOUBLE;
     
    866845      m_pePredMode[ui] = MODE_NONE;
    867846      m_pbIPCMFlag[ui] = 0;
    868 #if H0736_AVC_STYLE_QP_RANGE
    869847      m_phQP[ui] = qp;
    870 #else
    871       m_phQP[ui] = uiQP;
    872 #endif
    873848      m_puiAlfCtrlFlag[ui]= false;
    874849      m_pbMergeFlag[ui] = 0;
     
    947922
    948923// initialize Sub partition
    949 #if H0736_AVC_STYLE_QP_RANGE
    950924Void TComDataCU::initSubCU( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth, Int qp )
    951 #else
    952 Void TComDataCU::initSubCU( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth, UInt uiQP )
    953 #endif
    954925{
    955926  assert( uiPartUnitIdx<4 );
     
    971942  m_uiNumPartition     = pcCU->getTotalNumPart() >> 2;
    972943
    973 #if BURST_IPCM
    974944  m_numSucIPCM       = 0;
    975945  m_lastCUSucIPCMFlag   = false;
    976 #endif
    977946
    978947  Int iSizeInUchar = sizeof( UChar  ) * m_uiNumPartition;
     
    982951#endif
    983952
    984 #if H0736_AVC_STYLE_QP_RANGE
    985953  Int sizeInChar = sizeof( Char  ) * m_uiNumPartition;
    986954  memset( m_phQP,              qp,  sizeInChar );
    987 #else
    988   memset( m_phQP,              uiQP, iSizeInUchar );
    989 #endif
    990955
    991956  memset( m_puiAlfCtrlFlag,     0, iSizeInBool );
     
    14181383#endif
    14191384 
    1420 #if H0736_AVC_STYLE_QP_RANGE
    14211385  Int sizeInChar  = sizeof( Char ) * uiNumPartition;
    14221386  memcpy( m_phQP       + uiOffset, pcCU->getQP(),             sizeInChar                        );
    1423 #else
    1424   memcpy( m_phQP       + uiOffset, pcCU->getQP(),             iSizeInUchar                        );
    1425 #endif
    14261387  memcpy( m_pePartSize + uiOffset, pcCU->getPartitionSize(),  sizeof( *m_pePartSize ) * uiNumPartition );
    14271388  memcpy( m_pePredMode + uiOffset, pcCU->getPredictionMode(), sizeof( *m_pePredMode ) * uiNumPartition );
     
    15581519#endif
    15591520 
    1560 #if H0736_AVC_STYLE_QP_RANGE
    15611521  Int sizeInChar  = sizeof( Char ) * m_uiNumPartition;
    15621522  memcpy( rpcCU->getQP() + m_uiAbsIdxInLCU, m_phQP, sizeInChar  );
    1563 #else
    1564   memcpy( rpcCU->getQP() + m_uiAbsIdxInLCU, m_phQP, iSizeInUchar );
    1565 #endif
    15661523
    15671524  memcpy( rpcCU->getPartitionSize()  + m_uiAbsIdxInLCU, m_pePartSize, sizeof( *m_pePartSize ) * m_uiNumPartition );
     
    16951652#endif
    16961653 
    1697 #if H0736_AVC_STYLE_QP_RANGE
    16981654  Int sizeInChar  = sizeof( Char ) * uiQNumPart;
    16991655  memcpy( rpcCU->getQP() + uiPartOffset, m_phQP, sizeInChar );
    1700 #else
    1701   memcpy( rpcCU->getQP() + uiPartOffset, m_phQP, iSizeInUchar );
    1702 #endif 
    17031656  memcpy( rpcCU->getPartitionSize()  + uiPartOffset, m_pePartSize, sizeof( *m_pePartSize ) * uiQNumPart );
    17041657#if HHI_INTERVIEW_SKIP
     
    18571810       (bEnforceEntropySliceRestriction && (m_pcCULeft==NULL || m_pcCULeft->getSlice()==NULL || m_pcCULeft->getSCUAddr()+uiLPartUnitIdx < m_pcPic->getCU( getAddr() )->getEntropySliceStartCU(uiCurrPartUnitIdx)))
    18581811      ||
    1859 #if !REMOVE_TILE_DEPENDENCE
    1860        (bEnforceTileRestriction && ( m_pcCULeft==NULL || m_pcCULeft->getSlice()==NULL || (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))  )  )
    1861 #else
    18621812       (bEnforceTileRestriction && ( m_pcCULeft==NULL || m_pcCULeft->getSlice()==NULL || (m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))  )  )
    1863 #endif
    18641813      )
    18651814  {
     
    19191868       (bEnforceEntropySliceRestriction && (m_pcCUAbove==NULL || m_pcCUAbove->getSlice()==NULL || m_pcCUAbove->getSCUAddr()+uiAPartUnitIdx < m_pcPic->getCU( getAddr() )->getEntropySliceStartCU(uiCurrPartUnitIdx)))
    19201869      ||
    1921 #if !REMOVE_TILE_DEPENDENCE
    1922        (bEnforceTileRestriction &&(m_pcCUAbove==NULL || m_pcCUAbove->getSlice()==NULL || (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))))
    1923 #else
    19241870       (bEnforceTileRestriction &&(m_pcCUAbove==NULL || m_pcCUAbove->getSlice()==NULL || (m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))))
    1925 #endif
    19261871      )
    19271872  {
     
    19701915  if ( (bEnforceSliceRestriction && (m_pcCUAbove==NULL || m_pcCUAbove->getSlice()==NULL ||
    19711916       m_pcCUAbove->getSCUAddr()+uiALPartUnitIdx < m_pcPic->getCU( getAddr() )->getSliceStartCU(uiCurrPartUnitIdx)||
    1972 #if !REMOVE_TILE_DEPENDENCE
    1973        (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    1974 #else
    19751917       (m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    1976 #endif
    19771918       ))||
    19781919       (bEnforceEntropySliceRestriction && (m_pcCUAbove==NULL || m_pcCUAbove->getSlice()==NULL ||
    19791920       m_pcCUAbove->getSCUAddr()+uiALPartUnitIdx < m_pcPic->getCU( getAddr() )->getEntropySliceStartCU(uiCurrPartUnitIdx)||
    1980 #if !REMOVE_TILE_DEPENDENCE
    1981        (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    1982 #else
    19831921       (m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    1984 #endif
    19851922       ))
    19861923     )
     
    19961933  if ( (bEnforceSliceRestriction && (m_pcCULeft==NULL || m_pcCULeft->getSlice()==NULL ||
    19971934       m_pcCULeft->getSCUAddr()+uiALPartUnitIdx < m_pcPic->getCU( getAddr() )->getSliceStartCU(uiCurrPartUnitIdx)||
    1998 #if !REMOVE_TILE_DEPENDENCE
    1999        (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2000 #else
    20011935       (m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2002 #endif
    20031936       ))||
    20041937       (bEnforceEntropySliceRestriction && (m_pcCULeft==NULL || m_pcCULeft->getSlice()==NULL ||
    20051938       m_pcCULeft->getSCUAddr()+uiALPartUnitIdx < m_pcPic->getCU( getAddr() )->getEntropySliceStartCU(uiCurrPartUnitIdx)||
    2006 #if !REMOVE_TILE_DEPENDENCE
    2007        (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2008 #else
    20091939       (m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2010 #endif
    20111940       ))
    20121941     )
     
    20241953  if ( (bEnforceSliceRestriction && (m_pcCUAboveLeft==NULL || m_pcCUAboveLeft->getSlice()==NULL ||
    20251954       m_pcCUAboveLeft->getSCUAddr()+uiALPartUnitIdx < m_pcPic->getCU( getAddr() )->getSliceStartCU(uiCurrPartUnitIdx)||
    2026 #if !REMOVE_TILE_DEPENDENCE
    2027        (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAboveLeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2028 #else
    20291955       (m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAboveLeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2030 #endif
    20311956       ))||
    20321957       (bEnforceEntropySliceRestriction && (m_pcCUAboveLeft==NULL || m_pcCUAboveLeft->getSlice()==NULL ||
    20331958       m_pcCUAboveLeft->getSCUAddr()+uiALPartUnitIdx < m_pcPic->getCU( getAddr() )->getEntropySliceStartCU(uiCurrPartUnitIdx)||
    2034 #if !REMOVE_TILE_DEPENDENCE
    2035        (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAboveLeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2036 #else
    20371959       (m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAboveLeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2038 #endif
    20391960       ))
    20401961     )
     
    20962017  if ( (bEnforceSliceRestriction && (m_pcCUAbove==NULL || m_pcCUAbove->getSlice()==NULL ||
    20972018       m_pcCUAbove->getSCUAddr()+uiARPartUnitIdx < m_pcPic->getCU( getAddr() )->getSliceStartCU(uiCurrPartUnitIdx)||
    2098 #if !REMOVE_TILE_DEPENDENCE
    2099        (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2100 #else
    21012019       (m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2102 #endif
    21032020       ))||
    21042021       (bEnforceEntropySliceRestriction && (m_pcCUAbove==NULL || m_pcCUAbove->getSlice()==NULL ||
    21052022       m_pcCUAbove->getSCUAddr()+uiARPartUnitIdx < m_pcPic->getCU( getAddr() )->getEntropySliceStartCU(uiCurrPartUnitIdx)||
    2106 #if !REMOVE_TILE_DEPENDENCE
    2107        (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2108 #else
    21092023       (m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2110 #endif
    21112024       ))
    21122025     )
     
    21312044       m_pcPic->getPicSym()->getInverseCUOrderMap( m_pcCUAboveRight->getAddr()) > m_pcPic->getPicSym()->getInverseCUOrderMap( getAddr()) ||
    21322045       m_pcCUAboveRight->getSCUAddr()+uiARPartUnitIdx < m_pcPic->getCU( getAddr() )->getSliceStartCU(uiCurrPartUnitIdx)||
    2133 #if !REMOVE_TILE_DEPENDENCE
    2134        (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAboveRight->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2135 #else
    21362046       (m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAboveRight->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2137 #endif
    21382047       ))||
    21392048       (bEnforceEntropySliceRestriction && (m_pcCUAboveRight==NULL || m_pcCUAboveRight->getSlice()==NULL ||
    21402049       m_pcPic->getPicSym()->getInverseCUOrderMap( m_pcCUAboveRight->getAddr()) > m_pcPic->getPicSym()->getInverseCUOrderMap( getAddr()) ||
    21412050       m_pcCUAboveRight->getSCUAddr()+uiARPartUnitIdx < m_pcPic->getCU( getAddr() )->getEntropySliceStartCU(uiCurrPartUnitIdx)||
    2142 #if !REMOVE_TILE_DEPENDENCE
    2143        (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAboveRight->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2144 #else
    21452051       (m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAboveRight->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2146 #endif
    21472052       ))
    21482053     )
     
    21992104  if ( (bEnforceSliceRestriction && (m_pcCULeft==NULL || m_pcCULeft->getSlice()==NULL ||
    22002105       m_pcCULeft->getSCUAddr()+uiBLPartUnitIdx < m_pcPic->getCU( getAddr() )->getSliceStartCU(uiCurrPartUnitIdx)||
    2201 #if !REMOVE_TILE_DEPENDENCE
    2202        (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2203 #else
    22042106       (m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2205 #endif
    22062107       ))||
    22072108       (bEnforceEntropySliceRestriction && (m_pcCULeft==NULL || m_pcCULeft->getSlice()==NULL ||
    22082109       m_pcCULeft->getSCUAddr()+uiBLPartUnitIdx < m_pcPic->getCU( getAddr() )->getEntropySliceStartCU(uiCurrPartUnitIdx)||
    2209 #if !REMOVE_TILE_DEPENDENCE
    2210        (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2211 #else
    22122110       (m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2213 #endif
    22142111       ))
    22152112     )
     
    22702167  if ( (bEnforceSliceRestriction && (m_pcCULeft==NULL || m_pcCULeft->getSlice()==NULL ||
    22712168       m_pcCULeft->getSCUAddr()+uiBLPartUnitIdx < m_pcPic->getCU( getAddr() )->getSliceStartCU(uiCurrPartUnitIdx)||
    2272 #if !REMOVE_TILE_DEPENDENCE
    2273        (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2274 #else
    22752169       (m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2276 #endif
    22772170       ))||
    22782171       (bEnforceEntropySliceRestriction && (m_pcCULeft==NULL || m_pcCULeft->getSlice()==NULL ||
    22792172       m_pcCULeft->getSCUAddr()+uiBLPartUnitIdx < m_pcPic->getCU( getAddr() )->getEntropySliceStartCU(uiCurrPartUnitIdx)||
    2280 #if !REMOVE_TILE_DEPENDENCE
    2281        (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2282 #else
    22832173       (m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2284 #endif
    22852174       ))
    22862175     )
     
    23422231  if ( (bEnforceSliceRestriction && (m_pcCUAbove==NULL || m_pcCUAbove->getSlice()==NULL ||
    23432232       m_pcCUAbove->getSCUAddr()+uiARPartUnitIdx < m_pcPic->getCU( getAddr() )->getSliceStartCU(uiCurrPartUnitIdx)||
    2344 #if !REMOVE_TILE_DEPENDENCE
    2345        (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2346 #else
    23472233       (m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2348 #endif
    23492234       ))||
    23502235       (bEnforceEntropySliceRestriction && (m_pcCUAbove==NULL || m_pcCUAbove->getSlice()==NULL ||
    23512236       m_pcCUAbove->getSCUAddr()+uiARPartUnitIdx < m_pcPic->getCU( getAddr() )->getEntropySliceStartCU(uiCurrPartUnitIdx)||
    2352 #if !REMOVE_TILE_DEPENDENCE
    2353        (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2354 #else
    23552237       (m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2356 #endif
    23572238       ))
    23582239     )
     
    23732254       m_pcPic->getPicSym()->getInverseCUOrderMap( m_pcCUAboveRight->getAddr()) > m_pcPic->getPicSym()->getInverseCUOrderMap( getAddr()) ||
    23742255       m_pcCUAboveRight->getSCUAddr()+uiARPartUnitIdx < m_pcPic->getCU( getAddr() )->getSliceStartCU(uiCurrPartUnitIdx)||
    2375 #if !REMOVE_TILE_DEPENDENCE
    2376        (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAboveRight->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2377 #else
    23782256       (m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAboveRight->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2379 #endif
    23802257       ))||
    23812258       (bEnforceEntropySliceRestriction && (m_pcCUAboveRight==NULL || m_pcCUAboveRight->getSlice()==NULL ||
    23822259       m_pcPic->getPicSym()->getInverseCUOrderMap( m_pcCUAboveRight->getAddr()) > m_pcPic->getPicSym()->getInverseCUOrderMap( getAddr()) ||
    23832260       m_pcCUAboveRight->getSCUAddr()+uiARPartUnitIdx < m_pcPic->getCU( getAddr() )->getEntropySliceStartCU(uiCurrPartUnitIdx)||
    2384 #if !REMOVE_TILE_DEPENDENCE
    2385        (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAboveRight->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2386 #else
    23872261       (m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAboveRight->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2388 #endif
    23892262       ))
    23902263     )
     
    24332306  if ( (bEnforceSliceRestriction && (m_pcCULeft==NULL || m_pcCULeft->getSlice()==NULL ||
    24342307       m_pcCULeft->getSCUAddr()+uiLPartUnitIdx < m_pcPic->getCU( getAddr() )->getSliceStartCU(uiAbsZorderQpMinCUIdx)||
    2435 #if !REMOVE_TILE_DEPENDENCE
    2436        (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2437 #else
    24382308       (m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2439 #endif
    24402309       ))||
    24412310       (bEnforceEntropySliceRestriction && (m_pcCULeft==NULL || m_pcCULeft->getSlice()==NULL ||
    24422311       m_pcCULeft->getSCUAddr()+uiLPartUnitIdx < m_pcPic->getCU( getAddr() )->getEntropySliceStartCU(uiAbsZorderQpMinCUIdx)||
    2443 #if !REMOVE_TILE_DEPENDENCE
    2444        (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2445 #else
    24462312       (m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2447 #endif
    24482313       ))
    24492314     )
     
    24522317  }
    24532318
    2454 #if H0204_QP_PREDICTION
    24552319  if ( m_pcCULeft && m_pcCULeft->getAddr() != getAddr() )
    24562320  {
    24572321    return NULL;
    24582322  }
    2459 #endif
    24602323
    24612324  return m_pcCULeft;
    24622325}
    24632326
    2464 #if H0204_QP_PREDICTION
    24652327/** Get Above QpMinCu
    24662328*\param   aPartUnitIdx
     
    25002362  if ( (enforceSliceRestriction && (m_pcCUAbove==NULL || m_pcCUAbove->getSlice()==NULL ||
    25012363       m_pcCUAbove->getSCUAddr()+aPartUnitIdx < m_pcPic->getCU( getAddr() )->getSliceStartCU(absZorderQpMinCUIdx)||
    2502 #if !REMOVE_TILE_DEPENDENCE
    2503        (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2504 #else
    25052364       (m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2506 #endif
    25072365       ))||
    25082366       (enforceEntropySliceRestriction && (m_pcCUAbove==NULL || m_pcCUAbove->getSlice()==NULL ||
    25092367       m_pcCUAbove->getSCUAddr()+aPartUnitIdx < m_pcPic->getCU( getAddr() )->getEntropySliceStartCU(absZorderQpMinCUIdx)||
    2510 #if !REMOVE_TILE_DEPENDENCE
    2511        (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2512 #else
    25132368       (m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))
    2514 #endif
    25152369       ))
    25162370     )
     
    25262380  return m_pcCUAbove;
    25272381}
    2528 #endif
    2529 
    2530 #if H0736_AVC_STYLE_QP_RANGE
     2382
    25312383/** Get reference QP from left QpMinCu or latest coded QP
    25322384*\param   uiCurrAbsIdxInLCU
     
    25342386*/
    25352387Char TComDataCU::getRefQP( UInt uiCurrAbsIdxInLCU )
    2536 #else
    2537 /** Get reference QP from left QpMinCu or latest coded QP
    2538 *\param   uiCurrAbsIdxInLCU
    2539 *\returns UChar   reference QP value
    2540 */
    2541 UChar TComDataCU::getRefQP( UInt uiCurrAbsIdxInLCU )
    2542 #endif
    2543 {
    2544 #if H0204_QP_PREDICTION
     2388{
    25452389  UInt        lPartIdx, aPartIdx;
    25462390  lPartIdx = 0;
     
    25492393  TComDataCU* cUAbove = getQpMinCuAbove( aPartIdx, m_uiAbsIdxInLCU + uiCurrAbsIdxInLCU );
    25502394  return (((cULeft? cULeft->getQP( lPartIdx ): getLastCodedQP( uiCurrAbsIdxInLCU )) + (cUAbove? cUAbove->getQP( aPartIdx ): getLastCodedQP( uiCurrAbsIdxInLCU )) + 1) >> 1);
    2551 #else
    2552   // Left CU
    2553   TComDataCU* pcCULeft;
    2554   UInt        uiLPartIdx;
    2555   pcCULeft = getQpMinCuLeft( uiLPartIdx, m_uiAbsIdxInLCU + uiCurrAbsIdxInLCU );
    2556   if ( pcCULeft )
    2557   {
    2558     return pcCULeft->getQP(uiLPartIdx);
    2559   }
    2560   // Last QP
    2561   return getLastCodedQP( uiCurrAbsIdxInLCU );
    2562 #endif
    25632395}
    25642396
     
    25752407}
    25762408
    2577 #if H0736_AVC_STYLE_QP_RANGE
    25782409Char TComDataCU::getLastCodedQP( UInt uiAbsPartIdx )
    2579 #else
    2580 UChar TComDataCU::getLastCodedQP( UInt uiAbsPartIdx )
    2581 #endif
    25822410{
    25832411  UInt uiQUPartIdxMask = ~((1<<(8-(getSlice()->getPPS()->getMaxCuDQPDepth()<<1)))-1);
     
    26162444Bool TComDataCU::isLosslessCoded(UInt absPartIdx)
    26172445{
    2618 #if H0736_AVC_STYLE_QP_RANGE
    26192446  return ( getSlice()->getSPS()->getUseLossless() && ((getQP(absPartIdx) + getSlice()->getSPS()->getQpBDOffsetY()) == 0) );
    2620 #else
    2621   return ( getSlice()->getSPS()->getUseLossless() && (getQP(absPartPIdx)  == 0) );
    2622 #endif
    26232447}
    26242448#endif
     
    26332457{
    26342458  uiModeList[0] = PLANAR_IDX;
    2635 #if LOGI_INTRA_NAME_3MPM
    26362459  uiModeList[1] = VER_IDX;
    26372460  uiModeList[2] = HOR_IDX;
    2638 #else
    2639   uiModeList[1] = 1;
    2640   uiModeList[2] = 2;
    2641 #endif
    26422461  uiModeList[3] = DC_IDX;
    26432462  uiModeList[4] = LM_CHROMA_IDX;
     
    26532472    if( uiLumaMode == uiModeList[i] )
    26542473    {
    2655 #if LOGI_INTRA_NAME_3MPM
    26562474      uiModeList[i] = 34; // VER+8 mode
    2657 #else
    2658       uiModeList[i] = 7; // VER+8 mode
    2659 #endif
    26602475      break;
    26612476    }
     
    26792494  pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
    26802495 
    2681 #if DEFAULT_DC
    26822496  iLeftIntraDir  = pcTempCU ? ( pcTempCU->isIntra( uiTempPartIdx ) ? pcTempCU->getLumaIntraDir( uiTempPartIdx ) : DC_IDX ) : DC_IDX;
    2683 #else
    2684   iLeftIntraDir  = pcTempCU ? ( pcTempCU->isIntra( uiTempPartIdx ) ? pcTempCU->getLumaIntraDir( uiTempPartIdx ) : PLANAR_IDX ) : PLANAR_IDX;
    2685 #endif
    26862497#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    26872498  mapDMMtoIntraMode( iLeftIntraDir );
     
    26942505  pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx, true, true, false, true );
    26952506 
    2696 #if DEFAULT_DC
    26972507  iAboveIntraDir = pcTempCU ? ( pcTempCU->isIntra( uiTempPartIdx ) ? pcTempCU->getLumaIntraDir( uiTempPartIdx ) : DC_IDX ) : DC_IDX;
    2698 #else
    2699   iAboveIntraDir = pcTempCU ? ( pcTempCU->isIntra( uiTempPartIdx ) ? pcTempCU->getLumaIntraDir( uiTempPartIdx ) : PLANAR_IDX ) : PLANAR_IDX;
    2700 #endif
    27012508#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    27022509  mapDMMtoIntraMode( iAboveIntraDir );
     
    27062513#endif
    27072514 
    2708 #if LOGI_INTRA_NAME_3MPM
    27092515  uiPredNum = 3;
    27102516  if(iLeftIntraDir == iAboveIntraDir)
     
    27462552    }
    27472553  }
    2748 #else
    2749   Int iIdx  = getIntraSizeIdx(uiAbsPartIdx);
    2750  
    2751  
    2752   if ( iLeftIntraDir >= g_aucIntraModeNumAng[iIdx] )
    2753   {
    2754     iLeftIntraDir = PLANAR_IDX;
    2755   }
    2756  
    2757  
    2758   if ( iAboveIntraDir >= g_aucIntraModeNumAng[iIdx] )
    2759   {
    2760     iAboveIntraDir = PLANAR_IDX;
    2761   }
    2762  
    2763   if(iLeftIntraDir == iAboveIntraDir)
    2764   {
    2765     uiPredNum = 2;
    2766    
    2767     if( piMode )
    2768     {
    2769       *piMode = iLeftIntraDir;
    2770     }
    2771    
    2772     iAboveIntraDir = iLeftIntraDir == PLANAR_IDX ? DC_IDX : PLANAR_IDX; // DC or Planar
    2773    
    2774     assert( iLeftIntraDir != iAboveIntraDir );
    2775    
    2776     uiIntraDirPred[0] = min(iLeftIntraDir, iAboveIntraDir);
    2777     uiIntraDirPred[1] = max(iLeftIntraDir, iAboveIntraDir);
    2778   }
    2779   else
    2780   {
    2781     uiPredNum = 2;
    2782     uiIntraDirPred[0] = min(iLeftIntraDir, iAboveIntraDir);
    2783     uiIntraDirPred[1] = max(iLeftIntraDir, iAboveIntraDir);
    2784   }
    2785 #endif
    27862554 
    27872555  return uiPredNum;
     
    28332601  UInt quadtreeTUMaxDepth = getPredictionMode( absPartIdx ) == MODE_INTRA ? m_pcSlice->getSPS()->getQuadtreeTUMaxDepthIntra() : m_pcSlice->getSPS()->getQuadtreeTUMaxDepthInter();
    28342602  Int intraSplitFlag = ( getPredictionMode( absPartIdx ) == MODE_INTRA && partSize == SIZE_NxN ) ? 1 : 0;
    2835 #if G519_TU_AMP_NSQT_HARMONIZATION
    28362603  Int interSplitFlag = ((quadtreeTUMaxDepth == 1) && (getPredictionMode( absPartIdx ) == MODE_INTER) && (partSize != SIZE_2Nx2N) );
    2837 #else
    2838   Int interSplitFlag = ((quadtreeTUMaxDepth == 1) && (getPredictionMode( absPartIdx ) == MODE_INTER) && (partSize == SIZE_Nx2N || partSize == SIZE_2NxN) );
    2839 #endif
    28402604 
    28412605  UInt log2MinTUSizeInCU = 0;
     
    30062770}
    30072771
    3008 #if H0736_AVC_STYLE_QP_RANGE
    30092772Void TComDataCU::setQPSubParts( Int qp, UInt uiAbsPartIdx, UInt uiDepth )
    3010 #else
    3011 Void TComDataCU::setQPSubParts( UInt uiQP, UInt uiAbsPartIdx, UInt uiDepth )
    3012 #endif
    30132773{
    30142774  UInt uiCurrPartNumb = m_pcPic->getNumPartInCU() >> (uiDepth << 1);
     
    30192779    if( m_pcPic->getCU( getAddr() )->getEntropySliceStartCU(uiSCUIdx+getZorderIdxInCU()) == pcSlice->getEntropySliceCurStartCUAddr() )
    30202780    {
    3021 #if H0736_AVC_STYLE_QP_RANGE
    30222781      m_phQP[uiSCUIdx] = qp;
    3023 #else
    3024       m_phQP[uiSCUIdx] = uiQP;
    3025 #endif
    30262782    }
    30272783  }
     
    38323588 * \param numValidMergeCand
    38333589 */
    3834 #if SIMP_MRG_PRUN
    38353590#if MERL_VSP_C0152
    38363591Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int* iVSPIndexTrue, Int mrgCandIdx )
    38373592#else
    38383593Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx )
    3839 #endif
    3840 #else
    3841 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand )
    38423594#endif
    38433595{
     
    38633615  }
    38643616  // compute the location of the current PU
    3865 #if PARALLEL_MERGE
    38663617  Int xP, yP, nPSW, nPSH;
    38673618  this->getPartPosition(uiPUIdx, xP, yP, nPSW, nPSH);
    3868 #endif
    38693619
    38703620#if MERL_VSP_C0152
     
    39153665      xInheritVspMode( pcTextureCU, uiPartIdxCenter, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ;
    39163666#endif
    3917 #if SIMP_MRG_PRUN
    39183667      if ( mrgCandIdx == iCount )
    39193668      {
    39203669        return;
    39213670      }
    3922 #endif
    39233671      iCount ++;
    39243672    }
     
    40023750      xInheritVspMode( pcTextureCU, uiPartIdxCenter, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ;
    40033751#endif
    4004 #if SIMP_MRG_PRUN
    40053752      if ( mrgCandIdx == iCount )
    40063753      {
    40073754        return;
    40083755      }
    4009 #endif
    40103756      iCount ++;
    40113757    }
     
    40593805    }
    40603806#endif
    4061 #if SIMP_MRG_PRUN
    40623807    if ( mrgCandIdx == iCount )
    40633808    {
    40643809      return;
    40653810    }
    4066 #endif
    40673811    iCount ++;
    40683812  }
     
    40873831      pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false;
    40883832#endif
    4089 #if SIMP_MRG_PRUN
    40903833      if ( mrgCandIdx == iCount )
    40913834          return;
    4092 #endif
    40933835      iCount ++;
    40943836    }   
     
    41063848  UInt uiLeftPartIdx = 0;
    41073849  TComDataCU* pcCULeft = 0;
    4108 #if MVP_AT_ENTROPYSLICE_BOUNDARY
    41093850  pcCULeft = getPULeft( uiLeftPartIdx, uiPartIdxLB, true, false );
    4110 #else
    4111   pcCULeft = getPULeft( uiLeftPartIdx, uiPartIdxLB );
    4112 #endif
    4113 #if PARALLEL_MERGE
    41143851  if (pcCULeft)
    41153852  {
     
    41193856    }
    41203857  }
    4121 #endif
    41223858  PartSize partSize = getPartitionSize( uiAbsPartIdx );
    41233859  if (!(uiPUIdx == 1 && (partSize == SIZE_Nx2N || partSize == SIZE_nLx2N || partSize == SIZE_nRx2N)))
     
    41753911        xInheritVspMode( pcCULeft, uiLeftPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ;
    41763912#endif
    4177 #if SIMP_MRG_PRUN
    41783913        if ( mrgCandIdx == iCount )
    41793914        {
    41803915          return;
    41813916        }
    4182 #endif
    41833917        iCount ++;
    41843918#if H3D_IVMP
     
    42133947    }
    42143948#endif
    4215 #if SIMP_MRG_PRUN
    42163949    if ( mrgCandIdx == iCount )
    42173950    {
    42183951      return;
    42193952    }
    4220 #endif
    42213953    iCount ++;
    42223954  }
     
    42313963
    42323964  // above
    4233 #if !SIMP_MRG_PRUN
    4234   partSize = getPartitionSize( uiAbsPartIdx );
    4235   if (!(uiPUIdx == 1 && (partSize == SIZE_2NxN || partSize == SIZE_2NxnU || partSize == SIZE_2NxnD)))
    4236   {
    4237 #endif
    42383965  UInt uiAbovePartIdx = 0;
    42393966  TComDataCU* pcCUAbove = 0;
    4240 #if MVP_AT_ENTROPYSLICE_BOUNDARY
    42413967  pcCUAbove = getPUAbove( uiAbovePartIdx, uiPartIdxRT, true, false, true );
    4242 #else
    4243   pcCUAbove = getPUAbove( uiAbovePartIdx, uiPartIdxRT, true, true, true );
    4244 #endif
    4245 #if PARALLEL_MERGE
    42463968    if (pcCUAbove)
    42473969    {
     
    42513973      }
    42523974    }
    4253 #endif
    4254 #if SIMP_MRG_PRUN
    42553975  if ( pcCUAbove && !pcCUAbove->isIntra( uiAbovePartIdx )
    42563976#if MERL_VSP_C0152
     
    42593979    && !(uiPUIdx == 1 && (cCurPS == SIZE_2NxN || cCurPS == SIZE_2NxnU || cCurPS == SIZE_2NxnD))
    42603980    && ( !pcCULeft || pcCULeft->isIntra( uiLeftPartIdx ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAbove, uiAbovePartIdx ) ) )
    4261 #else
    4262   if ( pcCUAbove && !pcCUAbove->isIntra( uiAbovePartIdx ) )
    4263 #endif
    42643981  {
    42653982    abCandIsInter[iCount] = true;
     
    43074024     xInheritVspMode( pcCUAbove, uiAbovePartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ;
    43084025#endif
    4309 #if SIMP_MRG_PRUN
    43104026    if ( mrgCandIdx == iCount )
    43114027    {
    43124028      return;
    43134029    }
    4314 #endif
    43154030    iCount ++;
    43164031#if H3D_IVMP
     
    43184033#endif
    43194034  }
    4320 #if !SIMP_MRG_PRUN
    4321   }
    4322 #endif
    43234035
    43244036#if H3D_IVMP
     
    43474059    }
    43484060#endif
    4349 #if SIMP_MRG_PRUN
    43504061    if ( mrgCandIdx == iCount )
    43514062    {
    43524063      return;
    43534064    }
    4354 #endif
    43554065    iCount ++;
    43564066  }
     
    43674077  UInt uiAboveRightPartIdx = 0;
    43684078  TComDataCU* pcCUAboveRight = 0;
    4369 #if MVP_AT_ENTROPYSLICE_BOUNDARY
    43704079  pcCUAboveRight = getPUAboveRight( uiAboveRightPartIdx, uiPartIdxRT, true, false, true );
    4371 #else
    4372   pcCUAboveRight = getPUAboveRight( uiAboveRightPartIdx, uiPartIdxRT, true, true, true);
    4373 #endif
    4374 #if PARALLEL_MERGE
    43754080  if (pcCUAboveRight)
    43764081  {
     
    43804085    }
    43814086  }
    4382 #endif
    4383 #if SIMP_MRG_PRUN
    43844087  if ( pcCUAboveRight && !pcCUAboveRight->isIntra( uiAboveRightPartIdx )
    43854088#if MERL_VSP_C0152
     
    43874090#endif
    43884091    && ( !pcCUAbove || pcCUAbove->isIntra( uiAbovePartIdx ) || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveRight, uiAboveRightPartIdx ) ) )
    4389 #else
    4390   if ( pcCUAboveRight && !pcCUAboveRight->isIntra( uiAboveRightPartIdx ) )
    4391 #endif
    43924092  {
    43934093    abCandIsInter[iCount] = true;
     
    44134113    xInheritVspMode( pcCUAboveRight, uiAboveRightPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ;
    44144114#endif
    4415 #if SIMP_MRG_PRUN
    44164115    if ( mrgCandIdx == iCount )
    44174116    {
    44184117      return;
    44194118    }
    4420 #endif
    44214119    iCount ++;
    44224120  }
     
    44474145    }
    44484146#endif
    4449 #if SIMP_MRG_PRUN
    44504147    if ( mrgCandIdx == iCount )
    44514148    {
    44524149      return;
    44534150    }
    4454 #endif
    44554151    iCount ++;
    44564152  }
     
    44954191        pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false;
    44964192#endif
    4497 #if SIMP_MRG_PRUN
    44984193        if ( mrgCandIdx == iCount )
    44994194          return;
    4500 #endif
    45014195        iCount ++;
    45024196      }
     
    45264220  UInt uiLeftBottomPartIdx = 0;
    45274221  TComDataCU* pcCULeftBottom = 0;
    4528 #if MVP_AT_ENTROPYSLICE_BOUNDARY
    45294222  pcCULeftBottom = this->getPUBelowLeft( uiLeftBottomPartIdx, uiPartIdxLB, true, false );
    4530 #else
    4531   pcCULeftBottom = this->getPUBelowLeft( uiLeftBottomPartIdx, uiPartIdxLB );
    4532 #endif
    4533 #if PARALLEL_MERGE
    45344223  if (pcCULeftBottom)
    45354224  {
     
    45394228    }
    45404229  }
    4541 #endif
    4542 #if SIMP_MRG_PRUN
    45434230  if ( pcCULeftBottom && !pcCULeftBottom->isIntra( uiLeftBottomPartIdx )
    45444231#if MERL_VSP_C0152
     
    45464233#endif
    45474234    && ( !pcCULeft || pcCULeft->isIntra( uiLeftPartIdx ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCULeftBottom, uiLeftBottomPartIdx ) ) )
    4548 #else
    4549   if ( pcCULeftBottom && !pcCULeftBottom->isIntra( uiLeftBottomPartIdx ) )
    4550 #endif
    45514235  {
    45524236    abCandIsInter[iCount] = true;
     
    45724256     xInheritVspMode( pcCULeftBottom, uiLeftBottomPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ;
    45734257#endif
    4574 #if SIMP_MRG_PRUN
    45754258    if ( mrgCandIdx == iCount )
    45764259    {
    45774260      return;
    45784261    }
    4579 #endif
    45804262    iCount ++;
    45814263  }
     
    46114293    }
    46124294#endif
    4613 #if SIMP_MRG_PRUN
    46144295    if ( mrgCandIdx == iCount )
    46154296    {
    46164297      return;
    46174298    }
    4618 #endif
    46194299    iCount ++;
    46204300  }
     
    46374317    UInt uiAboveLeftPartIdx = 0;
    46384318    TComDataCU* pcCUAboveLeft = 0;
    4639 #if MVP_AT_ENTROPYSLICE_BOUNDARY
    46404319    pcCUAboveLeft = getPUAboveLeft( uiAboveLeftPartIdx, uiAbsPartAddr, true, false, true );
    4641 #else
    4642     pcCUAboveLeft = getPUAboveLeft( uiAboveLeftPartIdx, uiAbsPartAddr, true, true, true );
    4643 #endif
    4644 #if PARALLEL_MERGE
    46454320    if (pcCUAboveLeft)
    46464321    {
     
    46504325      }
    46514326    }
    4652 #endif
    4653 #if SIMP_MRG_PRUN
    46544327    if( pcCUAboveLeft && !pcCUAboveLeft->isIntra( uiAboveLeftPartIdx )
    46554328#if MERL_VSP_C0152
     
    46594332     && ( !pcCUAbove || pcCUAbove->isIntra( uiAbovePartIdx ) || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) )
    46604333     )
    4661 #else
    4662     if( pcCUAboveLeft && !pcCUAboveLeft->isIntra( uiAboveLeftPartIdx ) )
    4663 #endif
    46644334    {
    46654335      abCandIsInter[iCount] = true;
     
    46854355     xInheritVspMode( pcCUAboveLeft, uiAboveLeftPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ;
    46864356#endif
    4687 #if SIMP_MRG_PRUN
    46884357      if ( mrgCandIdx == iCount )
    46894358      {
    46904359        return;
    46914360      }
    4692 #endif
    46934361      iCount ++;
    46944362    }
     
    47144382    {
    47154383      RefPicList  eRefPicList = ( i==1 ? REF_PIC_LIST_1 : REF_PIC_LIST_0 );
    4716 #if SET_MERGE_TMVP_REFIDX
    47174384      Int iRefIdxTmp;
    47184385      if ( uiPUIdx != 0 )
     
    47244391        iRefIdxTmp = (pcCULeft != NULL) ? pcCULeft->getCUMvField(eRefPicList)->getRefIdx(uiLeftPartIdx) : -1;
    47254392      }
    4726 #else     
    4727       Int iRefIdxTmp = (pcCULeft != NULL) ? pcCULeft->getCUMvField(eRefPicList)->getRefIdx(uiLeftPartIdx) : -1;
    4728 #endif
    47294393      iRefIdxSkip[i] = (iRefIdxTmp != -1) ? iRefIdxTmp : 0;
    47304394    }
     
    48584522      pcMvFieldNeighbours[(uiArrayAddr<<1)+1].getMv().m_bDvMcp = false;
    48594523#endif
    4860 #if SIMP_MRG_PRUN
    48614524      if ( mrgCandIdx == iCount )
    48624525      {
     
    48644527      }
    48654528      iCount++;
    4866 #endif
    48674529    }
    48684530    uiIdx++;
     
    48704532  }
    48714533
    4872 #if SIMP_MRG_PRUN
    48734534  UInt uiArrayAddr = iCount;
    4874 #else
    4875 #if H3D_IVMP
    4876   for( UInt uiOuter = 0; uiOuter < MRG_MAX_NUM_CANDS_MEM; uiOuter++ )
    4877 #else
    4878   for( UInt uiOuter = 0; uiOuter < MRG_MAX_NUM_CANDS; uiOuter++ )
    4879 #endif
    4880   {
    4881     if( abCandIsInter[ uiOuter ] )
    4882     {
    4883 #if H3D_IVMP
    4884       for( UInt uiIter = uiOuter + 1; uiIter < MRG_MAX_NUM_CANDS_MEM; uiIter++ )
    4885 #else
    4886       for( UInt uiIter = uiOuter + 1; uiIter < MRG_MAX_NUM_CANDS; uiIter++ )
    4887 #endif
    4888       {
    4889         UInt uiMvFieldNeighIdxCurr = uiOuter << 1;
    4890         UInt uiMvFieldNeighIdxComp = uiIter << 1;
    4891         if( getSlice()->isInterB() )
    4892         {
    4893           if( puhInterDirNeighbours[ uiOuter ] == 3 )
    4894           {
    4895             if( pcMvFieldNeighbours[ uiMvFieldNeighIdxCurr ].getRefIdx() == pcMvFieldNeighbours[ uiMvFieldNeighIdxComp ].getRefIdx() && pcMvFieldNeighbours[ uiMvFieldNeighIdxCurr + 1 ].getRefIdx() == pcMvFieldNeighbours[ uiMvFieldNeighIdxComp + 1 ].getRefIdx() &&
    4896               pcMvFieldNeighbours[ uiMvFieldNeighIdxCurr ].getMv() == pcMvFieldNeighbours[ uiMvFieldNeighIdxComp ].getMv() && pcMvFieldNeighbours[ uiMvFieldNeighIdxCurr + 1 ].getMv() == pcMvFieldNeighbours[ uiMvFieldNeighIdxComp + 1 ].getMv() &&
    4897               puhInterDirNeighbours[ uiOuter ] == puhInterDirNeighbours[ uiIter ] )
    4898             {
    4899               abCandIsInter[ uiIter ] = false;
    4900             }
    4901           }
    4902           else if( puhInterDirNeighbours[ uiOuter ] == 2 )
    4903           {
    4904             if( pcMvFieldNeighbours[ uiMvFieldNeighIdxCurr + 1 ].getRefIdx() == pcMvFieldNeighbours[ uiMvFieldNeighIdxComp + 1 ].getRefIdx() &&
    4905               pcMvFieldNeighbours[ uiMvFieldNeighIdxCurr + 1 ].getMv() == pcMvFieldNeighbours[ uiMvFieldNeighIdxComp + 1 ].getMv() &&
    4906               puhInterDirNeighbours[ uiOuter ] == puhInterDirNeighbours[ uiIter ] )
    4907             {
    4908               abCandIsInter[ uiIter ] = false;
    4909             }
    4910           }
    4911           else
    4912           {
    4913             if( pcMvFieldNeighbours[ uiMvFieldNeighIdxCurr ].getRefIdx() == pcMvFieldNeighbours[ uiMvFieldNeighIdxComp ].getRefIdx() &&
    4914               pcMvFieldNeighbours[ uiMvFieldNeighIdxCurr ].getMv() == pcMvFieldNeighbours[ uiMvFieldNeighIdxComp ].getMv() &&
    4915               puhInterDirNeighbours[ uiOuter ] == puhInterDirNeighbours[ uiIter ] )
    4916             {
    4917               abCandIsInter[ uiIter ] = false;
    4918             }
    4919           }
    4920         }
    4921         else
    4922         {
    4923           if( pcMvFieldNeighbours[ uiMvFieldNeighIdxCurr ].getRefIdx() == pcMvFieldNeighbours[ uiMvFieldNeighIdxComp ].getRefIdx() &&
    4924               pcMvFieldNeighbours[ uiMvFieldNeighIdxCurr ].getMv() == pcMvFieldNeighbours[ uiMvFieldNeighIdxComp ].getMv() )
    4925           {
    4926             assert( puhInterDirNeighbours[ uiOuter ] == puhInterDirNeighbours[ uiIter ] );
    4927             abCandIsInter[ uiIter ] = false;
    4928           }
    4929         }
    4930       }
    4931     }
    4932   }
    4933 
    4934 #if H3D_IVMP
    4935   bool abCandIsInterFlag[MRG_MAX_NUM_CANDS_MEM];
    4936   for (int i=0; i<MRG_MAX_NUM_CANDS_MEM; i++)
    4937 #else
    4938   bool abCandIsInterFlag[MRG_MAX_NUM_CANDS];
    4939   for (int i=0; i<MRG_MAX_NUM_CANDS; i++)
    4940 #endif
    4941   {
    4942     abCandIsInterFlag[i] = abCandIsInter[ i ];
    4943     abCandIsInter[ i ] = false;
    4944   }
    4945 
    4946   UInt uiArrayAddr = 0;
    4947    
    4948 #if H3D_IVMP
    4949   for (int i=0; i<MRG_MAX_NUM_CANDS_MEM; i++)
    4950 #else
    4951   for (int i=0; i<MRG_MAX_NUM_CANDS; i++)
    4952 #endif
    4953   {
    4954     if (abCandIsInterFlag[i])
    4955     {
    4956       abCandIsInter[uiArrayAddr] = true;
    4957       puhInterDirNeighbours[uiArrayAddr] = puhInterDirNeighbours[i];
    4958       pcMvFieldNeighbours[uiArrayAddr<<1].setMvField(pcMvFieldNeighbours[i<<1].getMv(), pcMvFieldNeighbours[i<<1].getRefIdx());
    4959       pcMvFieldNeighbours[(uiArrayAddr<<1)+1].setMvField(pcMvFieldNeighbours[(i<<1)+1].getMv(), pcMvFieldNeighbours[(i<<1)+1].getRefIdx());
    4960       ++uiArrayAddr;
    4961     }
    4962   }
    4963 
    4964 #if H3D_IVMP
    4965   for (int i=uiArrayAddr; i<MRG_MAX_NUM_CANDS_MEM; i++)
    4966 #else
    4967   for (int i=uiArrayAddr; i<MRG_MAX_NUM_CANDS; i++)
    4968 #endif
    4969   {
    4970     puhInterDirNeighbours[i] = (getSlice()->isInterB()) ? 3 : 1;
    4971     abCandIsInter[i] = false;
    4972     TComMv tmpMv;
    4973     tmpMv.set(0,0);
    4974     pcMvFieldNeighbours[i<<1].setMvField(tmpMv, 0);
    4975     if ( getSlice()->isInterB() )
    4976     {
    4977       pcMvFieldNeighbours[(i<<1)+1].setMvField(tmpMv, 0);
    4978     }
    4979   }
    4980 #endif
    49814535  UInt uiCutoff = uiArrayAddr;
    49824536   
     
    50334587      }
    50344588    }
    5035 #if !REMOVE_NON_SCALED 
    5036     Int iScaledCount = 0;
    5037 #if H3D_IVMP
    5038     for (int i=0; i<uiCutoff && uiArrayAddr!=MRG_MAX_NUM_CANDS_MEM && iScaledCount<1; i++)
    5039 #else
    5040     for (int i=0; i<uiCutoff && uiArrayAddr!=MRG_MAX_NUM_CANDS && iScaledCount<1; i++)
    5041 #endif
    5042     {
    5043 #if H3D_IVMP
    5044       for (int j=0; j<2 && uiArrayAddr!=MRG_MAX_NUM_CANDS_MEM && iScaledCount<1; j++)
    5045 #else
    5046       for (int j=0; j<2 && uiArrayAddr!=MRG_MAX_NUM_CANDS && iScaledCount<1; j++)
    5047 #endif
    5048       {
    5049         if (abCandIsInter[i] && pcMvFieldNeighbours[(i<<1)+j].getRefIdx()>=0 && pcMvFieldNeighbours[(i<<1)+j].getRefIdx() < m_pcSlice->getNumRefIdx((j==0)?REF_PIC_LIST_1:REF_PIC_LIST_0))
    5050         {
    5051           Int iCurrPOC = m_pcSlice->getPOC();
    5052           Int iCurrRefPOC1 = m_pcSlice->getRefPOC( (j==0)?REF_PIC_LIST_1:REF_PIC_LIST_0, pcMvFieldNeighbours[(i<<1)+j].getRefIdx() );
    5053           Int iCurrRefPOC2 = m_pcSlice->getRefPOC( (j==0)?REF_PIC_LIST_0:REF_PIC_LIST_1, pcMvFieldNeighbours[(i<<1)+j].getRefIdx() );
    5054 
    5055           if (iCurrRefPOC1 != iCurrRefPOC2 && abs(iCurrPOC-iCurrRefPOC1) == abs(iCurrPOC-iCurrRefPOC2))
    5056           {
    5057             abCandIsInter[uiArrayAddr] = true;
    5058             puhInterDirNeighbours[uiArrayAddr] = 3;
    5059            
    5060             TComMv cMvPred = pcMvFieldNeighbours[(i<<1)+j].getMv();
    5061             TComMv rcMv;
    5062 
    5063             rcMv.set(-1*cMvPred.getHor(), -1*cMvPred.getVer());
    5064 
    5065             if (j==0)
    5066             {
    5067               pcMvFieldNeighbours[uiArrayAddr << 1].setMvField(pcMvFieldNeighbours[(i<<1)].getMv(), pcMvFieldNeighbours[(i<<1)].getRefIdx());
    5068               pcMvFieldNeighbours[( uiArrayAddr << 1 ) + 1].setMvField(rcMv, pcMvFieldNeighbours[(i<<1)].getRefIdx());
    5069             }
    5070             else
    5071             {
    5072               pcMvFieldNeighbours[uiArrayAddr << 1].setMvField(rcMv, pcMvFieldNeighbours[(i<<1)+1].getRefIdx());
    5073               pcMvFieldNeighbours[( uiArrayAddr << 1 ) + 1].setMvField(pcMvFieldNeighbours[(i<<1)+1].getMv(), pcMvFieldNeighbours[(i<<1)+1].getRefIdx());
    5074             }
    5075 
    5076             uiArrayAddr++;
    5077             iScaledCount++;
    5078           }
    5079         }
    5080       }
    5081     }
    5082 #endif
    50834589  }
    50844590
     
    52584764  }
    52594765}
    5260 #if PARALLEL_MERGE
    52614766/** Check whether the current PU and a spatial neighboring PU are in a same ME region.
    52624767 * \param xN, xN   location of the upper-left corner pixel of a neighboring PU
     
    53454850}
    53464851
    5347 #endif
    53484852AMVP_MODE TComDataCU::getAMVPMode(UInt uiIdx)
    53494853{
     
    53674871
    53684872  UInt uiIdx = 0;
    5369 #if MVP_AT_ENTROPYSLICE_BOUNDARY
    53704873    pcTmpCU = getPULeft(uiIdx, uiPartIdxLB, true, false);
    5371 #else
    5372     pcTmpCU = getPULeft(uiIdx, uiPartIdxLB);
    5373 #endif
    53744874  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) )
    53754875#if MERL_VSP_C0152
     
    53954895    }
    53964896  }
    5397 #if MVP_AT_ENTROPYSLICE_BOUNDARY
    53984897      pcTmpCU = getPUAbove(uiIdx, uiPartIdxRT, true, false, true);
    5399 #else
    5400     pcTmpCU = getPUAbove(uiIdx, uiPartIdxRT);
    5401 #endif
    54024898
    54034899  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ))
     
    54254921  }
    54264922
    5427 #if MVP_AT_ENTROPYSLICE_BOUNDARY
    54284923      pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true, false, true);
    5429 #else
    5430       pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true, true, true);
    5431 #endif
    54324924  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) )
    54334925#if MERL_VSP_C0152
     
    54534945    }
    54544946  }
    5455 #if MVP_AT_ENTROPYSLICE_BOUNDARY
    54564947      pcTmpCU = getPUBelowLeft(uiIdx, uiPartIdxLB, true, false);
    5457 #else
    5458       pcTmpCU = getPUBelowLeft(uiIdx, uiPartIdxLB);
    5459 #endif
    54604948  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ))
    54614949#if MERL_VSP_C0152
     
    54834971
    54844972  // Above predictor search
    5485 #if MVP_AT_ENTROPYSLICE_BOUNDARY
    54864973      pcTmpCU = getPUAboveLeft(uiIdx, (m_uiAbsIdxInLCU + uiPartAddr), true, false, true);
    54874974    assert(uiPartIdxLT == (m_uiAbsIdxInLCU + uiPartAddr));
    5488 #else
    5489       pcTmpCU = getPUAboveLeft(uiIdx, uiPartIdxLT, true, true, true);
    5490 #endif
    54914975  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ))
    54924976#if MERL_VSP_C0152
     
    59935477#endif
    59945478  UInt uiIdx = 0;
    5995 #if MVP_AT_ENTROPYSLICE_BOUNDARY
    59965479  pcTmpCU = getPULeft(uiIdx, uiPartIdxLB, true, false);
    5997 #else
    5998   pcTmpCU = getPULeft(uiIdx, uiPartIdxLB);
    5999 #endif
    60005480  if ( uiPartIdx == 1 && (eCUMode == SIZE_Nx2N || eCUMode == SIZE_nLx2N || eCUMode == SIZE_nRx2N) )
    60015481  {
     
    60785558  }
    60795559
    6080 #if MVP_AT_ENTROPYSLICE_BOUNDARY
    60815560  pcTmpCU = getPUAbove(uiIdx, uiPartIdxRT, true, false, true);
    6082 #else
    6083   pcTmpCU = getPUAbove(uiIdx, uiPartIdxRT);
    6084 #endif
    60855561  if ( uiPartIdx == 1 && (eCUMode == SIZE_2NxN || eCUMode == SIZE_2NxnU || eCUMode == SIZE_2NxnD) )
    60865562  {
     
    61645640  }
    61655641
    6166 #if MVP_AT_ENTROPYSLICE_BOUNDARY
    61675642  pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true, false, true);
    6168 #else
    6169   pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true, true, true);
    6170 #endif
    61715643
    61725644  if (pcTmpCU && bParMerge)
     
    62465718  }
    62475719
    6248 #if MVP_AT_ENTROPYSLICE_BOUNDARY
    62495720  pcTmpCU = getPUBelowLeft(uiIdx, uiPartIdxLB, true, false);
    6250 #else
    6251   pcTmpCU = getPUBelowLeft(uiIdx, uiPartIdxLB);
    6252 #endif
    62535721
    62545722  if (pcTmpCU && bParMerge)
     
    63285796
    63295797  // Above predictor search
    6330 #if MVP_AT_ENTROPYSLICE_BOUNDARY
    63315798  pcTmpCU = getPUAboveLeft(uiIdx, (m_uiAbsIdxInLCU + uiPartAddr), true, false, true);
    63325799  assert(uiPartIdxLT == (m_uiAbsIdxInLCU + uiPartAddr));
    6333 #else
    6334   pcTmpCU = getPUAboveLeft(uiIdx, uiPartIdxLT, true, true, true);
    6335 #endif
    63365800
    63375801  if (pcTmpCU && bParMerge)
     
    67416205  TComDataCU* tmpCU = NULL;
    67426206  UInt idx;
    6743 #if MVP_AT_ENTROPYSLICE_BOUNDARY
    67446207  tmpCU = getPUBelowLeft(idx, uiPartIdxLB, true, false);
    6745 #else
    6746   tmpCU = getPUBelowLeft(idx, uiPartIdxLB);
    6747 #endif
    67486208  bAddedSmvp = (tmpCU != NULL) && (tmpCU->getPredictionMode(idx) != MODE_INTRA);
    67496209
    67506210  if (!bAddedSmvp)
    67516211  {
    6752 #if MVP_AT_ENTROPYSLICE_BOUNDARY
    67536212    tmpCU = getPULeft(idx, uiPartIdxLB, true, false);
    6754 #else
    6755     tmpCU = getPULeft(idx, uiPartIdxLB);
    6756 #endif
    67576213    bAddedSmvp = (tmpCU != NULL) && (tmpCU->getPredictionMode(idx) != MODE_INTRA);
    67586214  }
     
    68116267
    68126268
    6813 #if AMVP_PRUNING_SIMPLIFICATION
    68146269  if ( pInfo->iN == 2 )
    68156270  {
     
    68226277    }
    68236278  }
    6824 #endif
    68256279
    68266280  if ( getSlice()->getPPS()->getEnableTMVPFlag() )
     
    68946348  }
    68956349
    6896 #if !AMVP_PRUNING_SIMPLIFICATION
    6897   // Check No MV Candidate
    6898   xUniqueMVPCand( pInfo );
    6899 #endif
    69006350
    69016351  if (pInfo->iN > AMVP_MAX_NUM_CANDS)
     
    69056355  else if (pInfo->iN < AMVP_MAX_NUM_CANDS)
    69066356  {
    6907 #if !AMVP_ZERO_CHECKING_REMOVAL
    6908     int j;
    6909     for (j=0; j<pInfo->iN; j++)
    6910     {
    6911       if (pInfo->m_acMvCand[j].getHor() == 0 && pInfo->m_acMvCand[j].getVer() == 0)
    6912       {
    6913         break;
    6914       }
    6915     }
    6916     if (j == pInfo->iN)
    6917     {
    6918 #endif
    69196357      pInfo->m_acMvCand[pInfo->iN].set(0,0);
    69206358      pInfo->iN++;
    6921 #if !AMVP_ZERO_CHECKING_REMOVAL
    6922     }
    6923 #endif
    69246359  }
    69256360  return ;
     
    70116446    case MD_LEFT:
    70126447    {
    7013 #if MVP_AT_ENTROPYSLICE_BOUNDARY
    70146448      pcTmpCU = getPULeft(uiIdx, uiPartUnitIdx, true, false);
    7015 #else
    7016       pcTmpCU = getPULeft(uiIdx, uiPartUnitIdx);
    7017 #endif
    70186449      break;
    70196450    }
    70206451    case MD_ABOVE:
    70216452    {
    7022 #if MVP_AT_ENTROPYSLICE_BOUNDARY
    70236453      pcTmpCU = getPUAbove(uiIdx, uiPartUnitIdx, true, false, true);
    7024 #else
    7025       pcTmpCU = getPUAbove(uiIdx, uiPartUnitIdx, true, true, true);
    7026 #endif
    70276454      break;
    70286455    }
    70296456    case MD_ABOVE_RIGHT:
    70306457    {
    7031 #if MVP_AT_ENTROPYSLICE_BOUNDARY
    70326458      pcTmpCU = getPUAboveRight(uiIdx, uiPartUnitIdx, true, false, true);
    7033 #else
    7034       pcTmpCU = getPUAboveRight(uiIdx, uiPartUnitIdx, true, true, true);
    7035 #endif
    70366459      break;
    70376460    }
    70386461    case MD_BELOW_LEFT:
    70396462    {
    7040 #if MVP_AT_ENTROPYSLICE_BOUNDARY
    70416463      pcTmpCU = getPUBelowLeft(uiIdx, uiPartUnitIdx, true, false);
    7042 #else
    7043       pcTmpCU = getPUBelowLeft(uiIdx, uiPartUnitIdx);
    7044 #endif
    70456464      break;
    70466465    }
    70476466    case MD_ABOVE_LEFT:
    70486467    {
    7049 #if MVP_AT_ENTROPYSLICE_BOUNDARY
    70506468      pcTmpCU = getPUAboveLeft(uiIdx, uiPartUnitIdx, true, false, true);
    7051 #else
    7052       pcTmpCU = getPUAboveLeft(uiIdx, uiPartUnitIdx, true, true, true);
    7053 #endif
    70546469      break;
    70556470    }
     
    71246539}
    71256540
    7126 #if !AMVP_PRUNING_SIMPLIFICATION
    7127 /**
    7128  * Reduce list of motion vector predictors to a set of unique predictors
    7129  * \param pInfo list of motion vector predictors
    7130  */
    7131 Void TComDataCU::xUniqueMVPCand(AMVPInfo* pInfo)
    7132 {
    7133   Int n = 1;
    7134   if ( pInfo->iN == 0 )
    7135   {
    7136 #if AMVP_ZERO_CHECKING_REMOVAL
    7137     return;
    7138 #else
    7139     // Add a zero candidate is none is available
    7140     pInfo->m_acMvCand[ 0 ].setZero();
    7141 #endif
    7142   }
    7143   else
    7144   {
    7145     for (Int i = 1; i < pInfo->iN; i++)
    7146     {
    7147       Int j;
    7148       for (j = n - 1; j >= 0; j--)
    7149       {
    7150         if ( pInfo->m_acMvCand[ i ] == pInfo->m_acMvCand[ j ] )
    7151         {
    7152           break;
    7153         }
    7154       }
    7155       if ( j < 0 )
    7156       {
    7157         pInfo->m_acMvCand[ n++ ] = pInfo->m_acMvCand[ i ];
    7158       }
    7159     }
    7160   }
    7161   pInfo->iN = n;
    7162 }
    7163 #endif
    71646541
    71656542/**
     
    71806557  case MD_LEFT:
    71816558    {
    7182 #if MVP_AT_ENTROPYSLICE_BOUNDARY
    71836559      pcTmpCU = getPULeft(uiIdx, uiPartUnitIdx, true, false);
    7184 #else
    7185       pcTmpCU = getPULeft(uiIdx, uiPartUnitIdx);
    7186 #endif
    71876560      break;
    71886561    }
    71896562  case MD_ABOVE:
    71906563    {
    7191 #if MVP_AT_ENTROPYSLICE_BOUNDARY
    71926564      pcTmpCU = getPUAbove(uiIdx, uiPartUnitIdx, true, false, true);
    7193 #else
    7194       pcTmpCU = getPUAbove(uiIdx, uiPartUnitIdx, true, true, true);
    7195 #endif
    71966565      break;
    71976566    }
    71986567  case MD_ABOVE_RIGHT:
    71996568    {
    7200 #if MVP_AT_ENTROPYSLICE_BOUNDARY
    72016569      pcTmpCU = getPUAboveRight(uiIdx, uiPartUnitIdx, true, false, true);
    7202 #else
    7203       pcTmpCU = getPUAboveRight(uiIdx, uiPartUnitIdx, true, true, true);
    7204 #endif
    72056570      break;
    72066571    }
    72076572  case MD_BELOW_LEFT:
    72086573    {
    7209 #if MVP_AT_ENTROPYSLICE_BOUNDARY
    72106574      pcTmpCU = getPUBelowLeft(uiIdx, uiPartUnitIdx, true, false);
    7211 #else
    7212       pcTmpCU = getPUBelowLeft(uiIdx, uiPartUnitIdx);
    7213 #endif
    72146575      break;
    72156576    }
    72166577  case MD_ABOVE_LEFT:
    72176578    {
    7218 #if MVP_AT_ENTROPYSLICE_BOUNDARY
    72196579      pcTmpCU = getPUAboveLeft(uiIdx, uiPartUnitIdx, true, false, true);
    7220 #else
    7221       pcTmpCU = getPUAboveLeft(uiIdx, uiPartUnitIdx, true, true, true);
    7222 #endif
    72236580      break;
    72246581    }
     
    77817138UInt TComDataCU::getCoefScanIdx(UInt uiAbsPartIdx, UInt uiWidth, Bool bIsLuma, Bool bIsIntra)
    77827139{
    7783 #if !LOGI_INTRA_NAME_3MPM 
    7784   static const UChar aucIntraDirToScanIdx[MAX_CU_DEPTH][NUM_INTRA_MODE] =
    7785   {
    7786     {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0