Changeset 213 in 3DVCSoftware


Ignore:
Timestamp:
31 Dec 2012, 18:33:14 (12 years ago)
Author:
mitsubishi-htm
Message:

A final release, as planned

  • Migrate to HTM 5.1
  • For VC project files, only VC9 file is updated
  • To be used as an additional anchor for CE1.h for 3rd JCTVC meeting at Geneva
Location:
branches/HTM-4.0.1-VSP-dev0
Files:
91 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-4.0.1-VSP-dev0/CommonTestConditionsCfgs/baseCfg_2view+depth.cfg

    r193 r213  
    157157SignHideFlag                   : 1                                 # sign hiding
    158158SignHideThreshold              : 4                                 # sign hiding threshold
    159 
     159IlluCompEnable                 : 1                                 # illumination compensation (0: OFF, 1: ON)
    160160
    161161#============ PCM ================
     
    195195InterViewSkip             : 0                                      # interview SKIP mode
    196196InterViewSkipLambdaScale  : 8                                      # lambda scale for inter-view skip mode
     197DisparitySearchRangeRestriction : 0                                # 0: No disparity restriction 1: Use disparity restriction
     198VerticalDisparitySearchRange    : 56                               # vertical disparity search range (in luma samples)
     199FCO                        : 0                                     # Flexible coding order flag in 3DV
     200FCOCodingOrder             : T0D0D1T1                              # Coding order for Flexible coding order in 3DV
    197201
    198202
     
    201205MVI                       : 1                                      # motion parameter inheritance
    202206VSO                       : 1                                      # use of view synthesis optimization for depth coding
    203 
     207QTLPC                     : 1                                      # use of quadtree limitation + predictive coding of the quadtree for depth coding
     208SDC                       : 1                                      # use simplified depth coding tree
     209DLT                       : 1                                      # use depth lookup table
    204210
    205211#========== texture coding tools based on depth ==========
     
    209215#========== view synthesis optimization (VSO) ==========
    210216VSOConfig                 : [cx0 B(cc1) I(s0.25 s0.5 s0.75)][cx1 B(oo0) I(s0.25 s0.5 s0.75)]  # VSO configuration string
    211 WVSO                      : 0
    212 VSOWeight                 : 10
    213 VSDWeight                 : 1
    214 DWeight                   : 1
    215 
    216 #========== Non-normative encoder techniques ==========
    217 DPL                       : 0
     217#VSOConfig                 : [ox0 B(cc1) I(s0.25 s0.5 s0.75)][cx1 B(oo0) I(s0.25 s0.5 s0.75)]  # VSO configuration string
     218WVSO                      : 1                                    # use of WVSO (Depth distortion metric with a weighted depth fidelity term)
     219VSOWeight                 : 10                                   # weight of VSO ( in SAD case, cf. squared in SSE case )
     220VSDWeight                 : 1                                    # weight of VSD ( in SAD case, cf. squared in SSE case )
     221DWeight                   : 1                                    # weight of depth distortion itself ( in SAD case, cf. squared in SSE case )
    218222
    219223#============ Misc. ================
  • branches/HTM-4.0.1-VSP-dev0/CommonTestConditionsCfgs/baseCfg_2view.cfg

    r133 r213  
    151151SignHideFlag                   : 1                                 # sign hiding
    152152SignHideThreshold              : 4                                 # sign hiding threshold
    153 
     153IlluCompEnable                 : 1                                 # illumination compensation (0: OFF, 1: ON)
    154154
    155155#============ PCM ================
     
    189189InterViewSkip             : 0                                      # interview SKIP mode
    190190InterViewSkipLambdaScale  : 8                                      # lambda scale for inter-view skip mode
    191 
     191DisparitySearchRangeRestriction : 0                                # 0: No disparity restriction 1: Use disparity restriction
     192VerticalDisparitySearchRange    : 56                               # vertical disparity search range (in luma samples)
    192193
    193194#========== depth coding tools ==========
  • branches/HTM-4.0.1-VSP-dev0/CommonTestConditionsCfgs/baseCfg_3view+depth.cfg

    r193 r213  
    1 
    21#========== file i/o ==========
    32InputFile_0               : org_0.yuv                              # video input file for view 0
     
    161160SignHideFlag                   : 1                                 # sign hiding
    162161SignHideThreshold              : 4                                 # sign hiding threshold
    163 
     162IlluCompEnable                 : 1                                 # illumination compensation (0: OFF, 1: ON)
    164163
    165164#============ PCM ================
     
    199198InterViewSkip             : 0                                      # interview SKIP mode
    200199InterViewSkipLambdaScale  : 8                                      # lambda scale for inter-view skip mode
     200DisparitySearchRangeRestriction : 0                                # 0: No disparity restriction 1: Use disparity restriction
     201VerticalDisparitySearchRange    : 56                               # vertical disparity search range (in luma samples)
     202FCO                        : 0                                      # Flexible coding order flag in 3DV
     203FCOCodingOrder             : T0D0D1D2T1T2                           # Coding order for Flexible coding order in 3DV
    201204
    202205
     
    205208MVI                       : 1                                      # motion parameter inheritance
    206209VSO                       : 1                                      # use of view synthesis optimization for depth coding
     210QTLPC                     : 1                                      # use of quadtree limitation + predictive coding of the quadtree for depth coding
     211SDC                       : 1                                      # use simplified depth coding tree
     212DLT                       : 1                                      # use depth lookup table
    207213
    208214#========== texture coding tools based on depth ==========
     
    212218#========== view synthesis optimization (VSO) ==========
    213219VSOConfig                 : [cx0 B(cc1) I(s0.25 s0.5 s0.75)][cx1 B(oo0) B(oo2) I(s0.25 s0.5 s0.75 s1.25 s1.5 s1.75)][cx2 B(cc1) I(s1.25 s1.5 s1.75)] # VSO configuration string
    214 WVSO                      : 0
    215 VSOWeight                 : 10
    216 VSDWeight                 : 1
    217 DWeight                   : 1
    218 
    219 #========== Non-normative encoder techniques ==========
    220 DPL                       : 0
     220#VSOConfig                 : [ox0 B(cc1) I(s0.25 s0.5 s0.75)][cx1 B(oo0) B(oo2) I(s0.25 s0.5 s0.75 s1.25 s1.5 s1.75)][ox2 B(cc1) I(s1.25 s1.5 s1.75)] # VSO configuration string for FCO = 1
     221WVSO                       : 1                                     # use of WVSO (Depth distortion metric with a weighted depth fidelity term)
     222VSOWeight                  : 10                                    # weight of VSO ( in SAD case, cf. squared in SSE case )
     223VSDWeight                  : 1                                     # weight of VSD ( in SAD case, cf. squared in SSE case )
     224DWeight                    : 1                                     # weight of depth distortion itself ( in SAD case, cf. squared in SSE case )
    221225
    222226#============ Misc. ================
  • branches/HTM-4.0.1-VSP-dev0/CommonTestConditionsCfgs/baseCfg_3view.cfg

    r133 r213  
    153153SignHideFlag                   : 1                                 # sign hiding
    154154SignHideThreshold              : 4                                 # sign hiding threshold
    155 
     155IlluCompEnable                 : 1                                 # illumination compensation (0: OFF, 1: ON)
    156156
    157157#============ PCM ================
     
    191191InterViewSkip             : 0                                      # interview SKIP mode
    192192InterViewSkipLambdaScale  : 8                                      # lambda scale for inter-view skip mode
     193DisparitySearchRangeRestriction : 0                                # 0: No disparity restriction 1: Use disparity restriction
     194VerticalDisparitySearchRange    : 56                               # vertical disparity search range (in luma samples)
    193195
    194196
  • branches/HTM-4.0.1-VSP-dev0/CommonTestConditionsCfgs_CE_on_VSP/baseCfg_3view_a_texture+depth.All.cfg

    r193 r213  
    161161SignHideFlag                   : 1                                 # sign hiding
    162162SignHideThreshold              : 4                                 # sign hiding threshold
    163 
     163IlluCompEnable                 : 1                                 # illumination compensation (0: OFF, 1: ON)
    164164
    165165#============ PCM ================
     
    199199InterViewSkip             : 0                                      # interview SKIP mode
    200200InterViewSkipLambdaScale  : 8                                      # lambda scale for inter-view skip mode
     201DisparitySearchRangeRestriction : 0                                # 0: No disparity restriction 1: Use disparity restriction
     202VerticalDisparitySearchRange    : 56                               # vertical disparity search range (in luma samples)
     203FCO                        : 0                                      # Flexible coding order flag in 3DV
     204FCOCodingOrder             : T0D0D1D2T1T2                           # Coding order for Flexible coding order in 3DV
    201205
    202206
     
    205209MVI                       : 1                                      # motion parameter inheritance
    206210VSO                       : 1                                      # use of view synthesis optimization for depth coding
    207 
     211QTLPC                     : 1                                      # use of quadtree limitation + predictive coding of the quadtree for depth coding
     212SDC                       : 1                                      # use simplified depth coding tree
     213DLT                       : 1                                      # use depth lookup table
    208214
    209215#========== texture coding tools based on depth ==========
     
    214220#========== view synthesis optimization (VSO) ==========
    215221VSOConfig                 : [cx0 B(cc1) I(s0.25 s0.5 s0.75)][cx1 B(oo0) B(oo2) I(s0.25 s0.5 s0.75 s1.25 s1.5 s1.75)][cx2 B(cc1) I(s1.25 s1.5 s1.75)] # VSO configuration string
     222#VSOConfig                 : [ox0 B(cc1) I(s0.25 s0.5 s0.75)][cx1 B(oo0) B(oo2) I(s0.25 s0.5 s0.75 s1.25 s1.5 s1.75)][ox2 B(cc1) I(s1.25 s1.5 s1.75)] # VSO configuration string for FCO = 1
     223WVSO                       : 1                                     # use of WVSO (Depth distortion metric with a weighted depth fidelity term)
     224VSOWeight                  : 10                                    # weight of VSO ( in SAD case, cf. squared in SSE case )
     225VSDWeight                  : 1                                     # weight of VSD ( in SAD case, cf. squared in SSE case )
     226DWeight                    : 1                                     # weight of depth distortion itself ( in SAD case, cf. squared in SSE case )
    216227
    217228#============ Misc. ================
  • branches/HTM-4.0.1-VSP-dev0/CommonTestConditionsCfgs_CE_on_VSP/baseCfg_3view_b_texture+depth.RefOnly.cfg

    r193 r213  
    161161SignHideFlag                   : 1                                 # sign hiding
    162162SignHideThreshold              : 4                                 # sign hiding threshold
    163 
     163IlluCompEnable                 : 1                                 # illumination compensation (0: OFF, 1: ON)
    164164
    165165#============ PCM ================
     
    199199InterViewSkip             : 0                                      # interview SKIP mode
    200200InterViewSkipLambdaScale  : 8                                      # lambda scale for inter-view skip mode
     201DisparitySearchRangeRestriction : 0                                # 0: No disparity restriction 1: Use disparity restriction
     202VerticalDisparitySearchRange    : 56                               # vertical disparity search range (in luma samples)
     203FCO                        : 0                                      # Flexible coding order flag in 3DV
     204FCOCodingOrder             : T0D0D1D2T1T2                           # Coding order for Flexible coding order in 3DV
    201205
    202206
     
    205209MVI                       : 1                                      # motion parameter inheritance
    206210VSO                       : 1                                      # use of view synthesis optimization for depth coding
    207 
     211QTLPC                     : 1                                      # use of quadtree limitation + predictive coding of the quadtree for depth coding
     212SDC                       : 1                                      # use simplified depth coding tree
     213DLT                       : 1                                      # use depth lookup table
    208214
    209215#========== texture coding tools based on depth ==========
     
    214220#========== view synthesis optimization (VSO) ==========
    215221VSOConfig                 : [cx0 B(cc1) I(s0.25 s0.5 s0.75)][cx1 B(oo0) B(oo2) I(s0.25 s0.5 s0.75 s1.25 s1.5 s1.75)][cx2 B(cc1) I(s1.25 s1.5 s1.75)] # VSO configuration string
     222#VSOConfig                 : [ox0 B(cc1) I(s0.25 s0.5 s0.75)][cx1 B(oo0) B(oo2) I(s0.25 s0.5 s0.75 s1.25 s1.5 s1.75)][ox2 B(cc1) I(s1.25 s1.5 s1.75)] # VSO configuration string for FCO = 1
     223WVSO                       : 1                                     # use of WVSO (Depth distortion metric with a weighted depth fidelity term)
     224VSOWeight                  : 10                                    # weight of VSO ( in SAD case, cf. squared in SSE case )
     225VSDWeight                  : 1                                     # weight of VSD ( in SAD case, cf. squared in SSE case )
     226DWeight                    : 1                                     # weight of depth distortion itself ( in SAD case, cf. squared in SSE case )
    216227
    217228#============ Misc. ================
  • branches/HTM-4.0.1-VSP-dev0/CommonTestConditionsCfgs_CE_on_VSP/baseCfg_3view_c_textureOnly.All.cfg

    r193 r213  
    161161SignHideFlag                   : 1                                 # sign hiding
    162162SignHideThreshold              : 4                                 # sign hiding threshold
    163 
     163IlluCompEnable                 : 1                                 # illumination compensation (0: OFF, 1: ON)
    164164
    165165#============ PCM ================
     
    199199InterViewSkip             : 0                                      # interview SKIP mode
    200200InterViewSkipLambdaScale  : 8                                      # lambda scale for inter-view skip mode
     201DisparitySearchRangeRestriction : 0                                # 0: No disparity restriction 1: Use disparity restriction
     202VerticalDisparitySearchRange    : 56                               # vertical disparity search range (in luma samples)
     203FCO                        : 0                                      # Flexible coding order flag in 3DV
     204FCOCodingOrder             : T0D0D1D2T1T2                           # Coding order for Flexible coding order in 3DV
    201205
    202206
     
    205209MVI                       : 1                                      # motion parameter inheritance
    206210VSO                       : 1                                      # use of view synthesis optimization for depth coding
    207 
     211QTLPC                     : 1                                      # use of quadtree limitation + predictive coding of the quadtree for depth coding
     212SDC                       : 1                                      # use simplified depth coding tree
     213DLT                       : 1                                      # use depth lookup table
    208214
    209215#========== texture coding tools based on depth ==========
    210216VSP                       : 1
    211 VSPDepthDisable           : 1
    212 
     217VSPDepthDisable           : 0
    213218
    214219#========== view synthesis optimization (VSO) ==========
    215220VSOConfig                 : [cx0 B(cc1) I(s0.25 s0.5 s0.75)][cx1 B(oo0) B(oo2) I(s0.25 s0.5 s0.75 s1.25 s1.5 s1.75)][cx2 B(cc1) I(s1.25 s1.5 s1.75)] # VSO configuration string
     221#VSOConfig                 : [ox0 B(cc1) I(s0.25 s0.5 s0.75)][cx1 B(oo0) B(oo2) I(s0.25 s0.5 s0.75 s1.25 s1.5 s1.75)][ox2 B(cc1) I(s1.25 s1.5 s1.75)] # VSO configuration string for FCO = 1
     222WVSO                       : 1                                     # use of WVSO (Depth distortion metric with a weighted depth fidelity term)
     223VSOWeight                  : 10                                    # weight of VSO ( in SAD case, cf. squared in SSE case )
     224VSDWeight                  : 1                                     # weight of VSD ( in SAD case, cf. squared in SSE case )
     225DWeight                    : 1                                     # weight of depth distortion itself ( in SAD case, cf. squared in SSE case )
    216226
    217227#============ Misc. ================
  • branches/HTM-4.0.1-VSP-dev0/CommonTestConditionsCfgs_CE_on_VSP/baseCfg_3view_d_textureOnly.RefOnly.cfg

    r193 r213  
    161161SignHideFlag                   : 1                                 # sign hiding
    162162SignHideThreshold              : 4                                 # sign hiding threshold
    163 
     163IlluCompEnable                 : 1                                 # illumination compensation (0: OFF, 1: ON)
    164164
    165165#============ PCM ================
     
    199199InterViewSkip             : 0                                      # interview SKIP mode
    200200InterViewSkipLambdaScale  : 8                                      # lambda scale for inter-view skip mode
     201DisparitySearchRangeRestriction : 0                                # 0: No disparity restriction 1: Use disparity restriction
     202VerticalDisparitySearchRange    : 56                               # vertical disparity search range (in luma samples)
     203FCO                        : 0                                      # Flexible coding order flag in 3DV
     204FCOCodingOrder             : T0D0D1D2T1T2                           # Coding order for Flexible coding order in 3DV
    201205
    202206
     
    205209MVI                       : 1                                      # motion parameter inheritance
    206210VSO                       : 1                                      # use of view synthesis optimization for depth coding
    207 
     211QTLPC                     : 1                                      # use of quadtree limitation + predictive coding of the quadtree for depth coding
     212SDC                       : 1                                      # use simplified depth coding tree
     213DLT                       : 1                                      # use depth lookup table
    208214
    209215#========== texture coding tools based on depth ==========
    210216VSP                       : 1
    211 VSPDepthDisable           : 1
    212 
     217VSPDepthDisable           : 0
    213218
    214219#========== view synthesis optimization (VSO) ==========
    215220VSOConfig                 : [cx0 B(cc1) I(s0.25 s0.5 s0.75)][cx1 B(oo0) B(oo2) I(s0.25 s0.5 s0.75 s1.25 s1.5 s1.75)][cx2 B(cc1) I(s1.25 s1.5 s1.75)] # VSO configuration string
     221#VSOConfig                 : [ox0 B(cc1) I(s0.25 s0.5 s0.75)][cx1 B(oo0) B(oo2) I(s0.25 s0.5 s0.75 s1.25 s1.5 s1.75)][ox2 B(cc1) I(s1.25 s1.5 s1.75)] # VSO configuration string for FCO = 1
     222WVSO                       : 1                                     # use of WVSO (Depth distortion metric with a weighted depth fidelity term)
     223VSOWeight                  : 10                                    # weight of VSO ( in SAD case, cf. squared in SSE case )
     224VSDWeight                  : 1                                     # weight of VSD ( in SAD case, cf. squared in SSE case )
     225DWeight                    : 1                                     # weight of depth distortion itself ( in SAD case, cf. squared in SSE case )
    216226
    217227#============ Misc. ================
  • branches/HTM-4.0.1-VSP-dev0/cfg/encoder_mvd.cfg

    r133 r213  
    138138DeblockingFilterControlPresent: 1           # Dbl control params present (0=not present, 1=present)
    139139LoopFilterOffsetInAPS         : 0           # Dbl params in APS or SliceHeader (0=SliceHeader, 1=APS)
    140 LoopFilterDisable              : 0 1                               # disable deblocking filter
     140LoopFilterDisable             : 0 1                               # disable deblocking filter
    141141LoopFilterBetaOffset_div2     : 0           # Range: -13 ~ 13
    142142LoopFilterTcOffset_div2       : 0           # Range: -13 ~ 13
     
    160160SignHideFlag                   : 1                                 # sign hiding
    161161SignHideThreshold              : 4                                 # sign hiding threshold
    162 
     162IlluCompEnable                 : 1                                 # illumination compensation (0: OFF, 1: ON)
    163163
    164164#============ PCM ================
     
    198198InterViewSkip             : 0                                      # interview SKIP mode
    199199InterViewSkipLambdaScale  : 8                                      # lambda scale for inter-view skip mode
     200DisparitySearchRangeRestriction : 0                                # 0: No disparity restriction 1: Use disparity restriction
     201VerticalDisparitySearchRange    : 56                               # vertical disparity search range (in luma samples)
     202FCO                        : 0                                     # Flexible coding order flag in 3DV
     203FCOCodingOrder             : T0D0D1T1D2T2                              # Coding order for Flexible coding order in 3DV
    200204
    201205
     
    204208MVI                       : 1                                      # motion parameter inheritance
    205209VSO                       : 1                                      # use of view synthesis optimization for depth coding
    206 
     210QTLPC                     : 1                                      # use of quadtree limitation + predictive coding of the quadtree for depth coding
     211SDC                       : 1                                      # use simplified depth coding tree
     212DLT                       : 1                                      # use depth lookup table
    207213
    208214#========== view synthesis optimization (VSO) ==========
    209215VSOConfig                 : [cx0 B(cc1) I(s0.25 s0.5 s0.75)][cx1 B(oo0) B(oo2) I(s0.25 s0.5 s0.75 s1.25 s1.5 s1.75)][cx2 B(cc1) I(s1.25 s1.5 s1.75)] # VSO configuration string (3 view)
    210216VSOConfig                 : [cx0 B(cc1) I(s0.25 s0.5 s0.75)][cx1 B(oo0)        I(s0.25 s0.5 s0.75)]                                                   # VSO configuration string (2 view)
     217#VSOConfig                 : [ox0 B(cc1) I(s0.25 s0.5 s0.75)][cx1 B(oo0) B(oo2) I(s0.25 s0.5 s0.75 s1.25 s1.5 s1.75)][ox2 B(cc1) I(s1.25 s1.5 s1.75)] # VSO configuration string
     218#VSOConfig                 : [ox0 B(cc1) I(s0.25 s0.5 s0.75)][cx1 B(oo0) I(s0.25 s0.5 s0.75)]  # VSO configuration string
     219WVSO                      : 1                                    # use of WVSO (Depth distortion metric with a weighted depth fidelity term)
     220VSOWeight                 : 10                                   # weight of VSO ( in SAD case, cf. squared in SSE case )
     221VSDWeight                 : 1                                    # weight of VSD ( in SAD case, cf. squared in SSE case )
     222DWeight                   : 1                                    # weight of depth distortion itself ( in SAD case, cf. squared in SSE case )
     223
    211224
    212225
  • branches/HTM-4.0.1-VSP-dev0/source/App/TAppDecoder/TAppDecTop.cpp

    r193 r213  
    8282Void TAppDecTop::decode()
    8383{
    84 #if VIDYO_VPS_INTEGRATION
     84#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    8585  increaseNumberOfViews( 0, 0, 0 );
    8686#else
     
    8888#endif
    8989 
     90#if FLEX_CODING_ORDER_M23723
     91  Int iDepthViewIdx = 0;
     92  Int iTextureViewIdx=0;
     93  Bool firstFrame=1;
     94  Bool viewIdZero=true;
     95  Int fcoIndex=0;  //when the current frame is not first frame,use FCO_index stand for viewDepth.
     96#endif
     97
    9098#if SONY_COLPIC_AVAILABILITY
    9199  m_tDecTop[0]->setViewOrderIdx(0);
     
    102110    pcListPic[i] = NULL;
    103111    newPicture[i] = false;
     112#if FLEX_CODING_ORDER_M23723
     113#if  FIX_FCO_COMP_WARNING
     114    m_fcoOrder[i] = ' ';
     115#else
     116    m_fcoOrder[i]=NULL;
     117#endif
     118#endif
     119
    104120  }
    105121
     
    145161    {
    146162      read(nalu, nalUnit);
     163#if QC_MVHEVC_B0046
     164    viewDepthId = nalu.m_layerId;
     165    Int depth = 0;
     166    Int viewId = viewDepthId;
     167#else
    147168#if VIDYO_VPS_INTEGRATION
    148169      Int viewId = 0;
     
    156177        depth = getVPSAccess()->getActiveVPS()->getDepthFlag(nalu.m_layerId);
    157178      }
     179#if FLEX_CODING_ORDER_M23723
     180      if (viewId>0)
     181      {
     182        viewIdZero=false;
     183      }
     184      if (viewIdZero==false&&viewId==0)
     185      {
     186        firstFrame=0; //if viewId has been more than zero and now it set to zero again, we can see that it is not the first view
     187      }
     188      if (firstFrame)
     189      { // if the current view is first frame, we set the viewDepthId as texture plus depth and get the FCO order
     190        viewDepthId = iDepthViewIdx+iTextureViewIdx;
     191        m_fcoViewDepthId=viewDepthId;
     192      }
     193      else
     194      {//if current view is not first frame, we set the viewDepthId depended on the FCO order
     195        viewDepthId=0;
     196        if (depth)
     197        {
     198          for (fcoIndex=0;fcoIndex<2*MAX_VIEW_NUM;fcoIndex++ )
     199          {
     200            if (m_fcoOrder[fcoIndex]=='D')
     201            {
     202              if (viewId==viewDepthId)
     203                break;
     204              else
     205                viewDepthId++;
     206            }
     207          }
     208        }
     209        else
     210        {
     211          for (fcoIndex=0;fcoIndex<2*MAX_VIEW_NUM;fcoIndex++ )
     212          {
     213            if (m_fcoOrder[fcoIndex]=='T')
     214            {
     215              if (viewId==viewDepthId)
     216                break;
     217              else
     218                viewDepthId++;
     219            }
     220          }
     221        }
     222
     223        viewDepthId=fcoIndex;
     224
     225      }
     226
     227
     228#else
    158229      viewDepthId = nalu.m_layerId;   // coding order T0D0T1D1T2D2
     230#endif
     231   
    159232#else
    160233      Int viewId = nalu.m_viewId;
    161234      Int depth = nalu.m_isDepth ? 1 : 0;
     235#if FLEX_CODING_ORDER_M23723
     236      if (viewId>0)
     237      {
     238        viewIdZero=false;
     239      }
     240      if (viewIdZero==false&&viewId==0)
     241      {
     242        firstFrame=0;
     243      }
     244      if (firstFrame)
     245      {
     246        viewDepthId = iDepthViewIdx+iTextureViewIdx;
     247        m_fcoViewDepthId=viewDepthId;
     248      }
     249      else
     250      {
     251        viewDepthId=0;
     252        if (depth)
     253        {
     254          for (fcoIndex=0;fcoIndex<2*MAX_VIEW_NUM;fcoIndex++ )
     255          {
     256            if (m_fcoOrder[fcoIndex]=='D')
     257            {
     258              if (viewId==viewDepthId)
     259                break;
     260              else
     261                viewDepthId++;
     262            }
     263          }
     264        }
     265        else
     266        {
     267          for (fcoIndex=0;fcoIndex<2*MAX_VIEW_NUM;fcoIndex++ )
     268          {
     269            if (m_fcoOrder[fcoIndex]=='T')
     270            {
     271              if (viewId==viewDepthId)
     272                break;
     273              else
     274                viewDepthId++;
     275            }
     276          }
     277        }
     278        viewDepthId=fcoIndex;
     279      }
     280#else
    162281      viewDepthId = viewId * 2 + depth;   // coding order T0D0T1D1T2D2
    163282#endif
    164      
     283#endif
     284#endif
    165285      newPicture[viewDepthId] = false;
    166286      if( viewDepthId >= m_tDecTop.size() )     
    167287      {
    168 #if VIDYO_VPS_INTEGRATION
     288#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    169289        increaseNumberOfViews( viewDepthId, viewId, depth );
    170290#else
     
    195315      if( !(m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) )
    196316      {
     317#if QC_MVHEVC_B0046
     318        if(viewDepthId && m_tDecTop[viewDepthId]->m_bFirstNal== false)
     319        {
     320          m_tDecTop[viewDepthId]->m_bFirstNal = true;
     321          ParameterSetManagerDecoder* pDecV0 = m_tDecTop[0]->xGetParaSetDec();
     322          m_tDecTop[viewDepthId]->xCopyVPS(pDecV0->getPrefetchedVPS(0));
     323          m_tDecTop[viewDepthId]->xCopySPS(pDecV0->getPrefetchedSPS(0));
     324          m_tDecTop[viewDepthId]->xCopyPPS(pDecV0->getPrefetchedPPS(0));
     325        }
     326#endif
    197327        newPicture[viewDepthId] = m_tDecTop[viewDepthId]->decode(nalu, m_iSkipFrame, m_pocLastDisplay[viewDepthId]);
    198328        if (newPicture[viewDepthId])
     
    209339        {
    210340          previousPictureDecoded = true;
     341#if FLEX_CODING_ORDER_M23723
     342        if (firstFrame)
     343        {
     344            if (depth)
     345            {
     346                iDepthViewIdx++;
     347                m_fcoOrder[viewDepthId]='D';
     348            }
     349            else
     350           {
     351                iTextureViewIdx++;
     352                m_fcoOrder[viewDepthId]='T';
     353           }
     354          }
     355
     356#endif
    211357        }
    212358      }
     
    218364    if( pcListPic[viewDepthId] )
    219365    {
     366#if QC_REM_IDV_B0046
     367      Int iviewId = m_tDecTop[viewDepthId]->getViewId();
     368      if( newPicture[viewDepthId] && (nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR || ((nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR && iviewId) && m_tDecTop[viewDepthId]->getNalUnitTypeBaseView() == NAL_UNIT_CODED_SLICE_IDR)) )
     369#else
    220370      if( newPicture[viewDepthId] && (nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR || (nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDV && m_tDecTop[viewDepthId]->getNalUnitTypeBaseView() == NAL_UNIT_CODED_SLICE_IDR)) )
     371#endif
    221372      {
    222373        xFlushOutput( pcListPic[viewDepthId], viewDepthId );
     
    275426        m_tDecTop[viewDepthIdx]->destroy() ;
    276427      }
     428#if QC_MVHEVC_B0046
     429      if(viewDepthIdx)
     430      {
     431         //Call clear function to remove the record, which has been freed during viewDepthIdx = 0 case.
     432        m_tDecTop[viewDepthIdx]->xGetParaSetDec()->clearSPS();
     433        m_tDecTop[viewDepthIdx]->xGetParaSetDec()->clearVPS();
     434        m_tDecTop[viewDepthIdx]->xGetParaSetDec()->clearPPS();
     435      }
     436#endif
    277437      delete m_tDecTop[viewDepthIdx] ;
    278438      m_tDecTop[viewDepthIdx] = NULL ;
     
    416576  m_pocLastDisplay[viewDepthId] = -MAX_INT;
    417577}
    418 #if VIDYO_VPS_INTEGRATION
     578#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    419579Void  TAppDecTop::increaseNumberOfViews  ( UInt layerId, UInt viewId, UInt isDepth )
    420580#else
     
    422582#endif
    423583{
    424 #if VIDYO_VPS_INTEGRATION
     584#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    425585  Int newNumberOfViewDepth = layerId + 1;
    426586#endif
     
    429589    m_outputBitDepth = g_uiBitDepth + g_uiBitIncrement;
    430590  }
    431 #if !VIDYO_VPS_INTEGRATION
     591#if !VIDYO_VPS_INTEGRATION&!QC_MVHEVC_B0046
    432592  Int viewId = (newNumberOfViewDepth-1)>>1;   // coding order T0D0T1D1T2D2
    433593  Bool isDepth = ((newNumberOfViewDepth % 2) == 0);  // coding order T0D0T1D1T2D2
     
    436596    m_useDepth = true;
    437597
    438 #if FIX_DECODING_WO_WRITING
    439598  if ( m_pchReconFile )
    440599  {
    441 #endif
    442600    while( m_tVideoIOYuvReconFile.size() < newNumberOfViewDepth)
    443601    {
    444602      m_tVideoIOYuvReconFile.push_back(new TVideoIOYuv);
    445603      Char buffer[4];
    446 #if VIDYO_VPS_INTEGRATION
     604#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    447605      sprintf(buffer,"_%i", viewId );
    448606#else
     
    450608#endif
    451609      Char* nextFilename = NULL;
    452 #if VIDYO_VPS_INTEGRATION
     610#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    453611      if( isDepth)
    454612#else
     
    465623        xAppendToFileNameEnd( m_pchReconFile, buffer, nextFilename);
    466624      }
    467 #if !VIDYO_VPS_INTEGRATION
     625#if !VIDYO_VPS_INTEGRATION&!QC_MVHEVC_B0046
    468626      if( isDepth || ( !isDepth && (m_tVideoIOYuvReconFile.size() % 2) == 1 ) )
    469627#endif
     
    473631      free ( nextFilename );
    474632    }
    475 #if FIX_DECODING_WO_WRITING
    476   }
    477 #endif
     633  }
    478634
    479635  while( m_pocLastDisplay.size() < newNumberOfViewDepth )
     
    484640  {
    485641    m_tDecTop.push_back(new TDecTop);
    486 #if !VIDYO_VPS_INTEGRATION
     642#if !VIDYO_VPS_INTEGRATION&!QC_MVHEVC_B0046
    487643    if( isDepth || ( !isDepth && (m_tVideoIOYuvReconFile.size() % 2) == 1 ) )
    488644    {
     
    494650      m_tDecTop.back()->setPictureDigestEnabled(m_pictureDigestEnabled);
    495651      m_tDecTop.back()->setCamParsCollector( &m_cCamParsCollector );
    496 #if !VIDYO_VPS_INTEGRATION
     652#if !VIDYO_VPS_INTEGRATION&!QC_MVHEVC_B0046
    497653    }
    498654#endif
     
    502658TDecTop* TAppDecTop::getTDecTop( Int viewId, Bool isDepth )
    503659{
     660#if FLEX_CODING_ORDER_M23723
     661  Int viewnumber=0;
     662  Int i=0;
     663  Bool fcoFlag=0;
     664  if (viewId>m_fcoViewDepthId)
     665  {
     666    return NULL;
     667  }
     668  else
     669  {
     670    if (isDepth)
     671   {
     672      for ( i=0; i<=m_fcoViewDepthId;i++)
     673      {
     674         if (m_fcoOrder[i]=='D')
     675         {
     676           if (viewnumber==viewId)
     677           {
     678             fcoFlag=1;
     679             break;
     680           }
     681           else
     682             viewnumber++;
     683         }
     684      }
     685    }
     686    else
     687    {
     688      for ( i=0; i<=m_fcoViewDepthId;i++)
     689      {
     690        if (m_fcoOrder[i]=='T')
     691        {
     692          if (viewnumber==viewId)
     693          {
     694            fcoFlag=1;
     695            break;
     696          }
     697          else
     698            viewnumber++;
     699        }
     700      }
     701    }
     702    if (fcoFlag)
     703    {
     704      return m_tDecTop[i];
     705    }
     706    else
     707      return NULL;
     708   
     709  }
     710
     711    // coding order T0D0T1D1T2D2
     712#else
    504713  return m_tDecTop[(isDepth ? 1 : 0) + viewId * 2];  // coding order T0D0T1D1T2D2
     714#endif
     715 
    505716}
    506717
     
    521732  assert( ( viewId >= 0 ) );
    522733
     734#if FLEX_CODING_ORDER_M23723
     735if (getTDecTop(viewId,isDepth))
     736{
    523737  TComList<TComPic*>* apcListPic = getTDecTop( viewId, isDepth )->getListPic();
    524738  TComPic* pcPic = NULL;
     
    532746  }
    533747  return pcPic;
     748}
     749else
     750  return NULL;
     751#else
     752
     753  TComList<TComPic*>* apcListPic = getTDecTop( viewId, isDepth )->getListPic();
     754  TComPic* pcPic = NULL;
     755  for( TComList<TComPic*>::iterator it=apcListPic->begin(); it!=apcListPic->end(); it++ )
     756  {
     757    if( (*it)->getPOC() == poc )
     758    {
     759      pcPic = *it;
     760      break;
     761    }
     762  }
     763  return pcPic;
     764#endif
    534765}
    535766
     
    557788  AOF(pcPicYuvAvail);
    558789
    559   TComPic* pcPic = getPicFromView( iCodedViewIdx, iCurPoc, bDepth );
     790  //TComPic* pcPic = getPicFromView( iCodedViewIdx, iCurPoc, bDepth );
     791  TComPic* pcPic = NULL;
     792  for( Int i=0; i<m_tDecTop.size() && pcPic==NULL; i++)
     793  {
     794    if( iCodedViewIdx == m_tDecTop[i]->getViewId() && bDepth == m_tDecTop[i]->getIsDepth() )
     795    {
     796
     797       TComList<TComPic*>* apcListPic = m_tDecTop[i]->getListPic();
     798       for( TComList<TComPic*>::iterator it=apcListPic->begin(); it!=apcListPic->end(); it++ )
     799       {
     800         if( (*it)->getPOC() == iCurPoc )
     801         {
     802           pcPic = *it;
     803           break;
     804         }
     805       }
     806
     807    }
     808  }
    560809  pcPic->setPicYuvSynth( pcPicYuvVSP );
    561810  pcPic->setPicYuvAvail( pcPicYuvAvail );
  • branches/HTM-4.0.1-VSP-dev0/source/App/TAppDecoder/TAppDecTop.h

    r193 r213  
    7474  Bool                            m_useDepth;
    7575
     76#if FLEX_CODING_ORDER_M23723
     77  Int  m_fcoViewDepthId;
     78  Char m_fcoOrder[MAX_VIEW_NUM*2];
     79#endif
     80
    7681  FILE*                           m_pScaleOffsetFile;
    7782  CamParsCollector                m_cCamParsCollector;
    7883#if DEPTH_MAP_GENERATION
    79 #if VIDYO_VPS_INTEGRATION
     84#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    8085  TComVPSAccess                   m_cVPSAccess;
    8186#endif
     
    95100  Void  destroy           (); ///< destroy internal members
    96101  Void  decode            (); ///< main decoding function
    97 #if VIDYO_VPS_INTEGRATION
     102#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    98103  Void  increaseNumberOfViews  (UInt layerId, UInt viewId, UInt isDepth);
    99104#else
  • branches/HTM-4.0.1-VSP-dev0/source/App/TAppEncoder/TAppEncCfg.cpp

    r193 r213  
    7474{
    7575  m_aidQP = NULL;
    76 #if FIXES
    7776  m_aidQPdepth = NULL;
    78 #endif
    7977}
    8078
     
    8684  }
    8785
    88 #if FIXES
    8986  if ( m_aidQPdepth )
    9087  {
    9188    delete[] m_aidQPdepth; m_aidQPdepth = NULL;
    9289  }
    93 #endif
    9490
    9591  for(Int i = 0; i< m_pchInputFileList.size(); i++ )
     
    115111  if (m_pchBitstreamFile != NULL)
    116112    free (m_pchBitstreamFile) ;
     113#if FLEX_CODING_ORDER_M23723
     114  if (m_pchMVCJointCodingOrder != NULL)
     115  {
     116    free(m_pchMVCJointCodingOrder) ;
     117  }
     118#endif
    117119#if HHI_VSO
    118120  if (  m_pchVSOConfig != NULL)
     
    120122#endif
    121123
    122 #if FIX_MEM_LEAKS
    123124 if ( m_pchCameraParameterFile != NULL )
    124125   free ( m_pchCameraParameterFile );
     
    139140   free ( m_scalingListFile );
    140141
    141 #endif   
    142142
    143143}
     
    225225  string cfg_RowHeight;
    226226  string cfg_ScalingListFile;
     227
     228 #if FLEX_CODING_ORDER_M23723
     229  string cfg_JointCodingOrdering;
     230#endif
     231
    227232  po::Options opts;
    228233  opts.addOptions()
     
    268273 
    269274  ("NumberOfViews",         m_iNumberOfViews,    0, "Number of views")
     275#if FLEX_CODING_ORDER_M23723
     276  ("FCO",               m_b3DVFlexOrder,   false, "flexible coding order flag" )
     277  ("FCOCodingOrder",   cfg_JointCodingOrdering,  string(""), "The coding order for joint texture-depth coding")
     278#endif
    270279  /* Unit definition parameters */
    271280  ("MaxCUWidth",          m_uiMaxCUWidth,  64u)
     
    298307  ("FastSearch", m_iFastSearch, 1, "0:Full search  1:Diamond  2:PMVFAST")
    299308  ("SearchRange,-sr",m_iSearchRange, 96, "motion search range")
     309#if DV_V_RESTRICTION_B0037
     310  ("DisparitySearchRangeRestriction",m_bUseDisparitySearchRangeRestriction, false, "restrict disparity search range")
     311  ("VerticalDisparitySearchRange",m_iVerticalDisparitySearchRange, 56, "vertical disparity search range")
     312#endif
    300313  ("BipredSearchRange", m_bipredSearchRange, 4, "motion search range for bipred refinement")
    301314  ("HadamardME", m_bUseHADME, true, "hadamard ME for fractional-pel")
     
    342355  ("LoopFilterBetaOffset_div2", m_loopFilterBetaOffsetDiv2, 0 )
    343356  ("LoopFilterTcOffset_div2", m_loopFilterTcOffsetDiv2, 0 )
     357#if LGE_ILLUCOMP_B0045
     358  ("IlluCompEnable",                  m_bUseIC                  , true         , "Use illumination compensation for inter-view prediction" )
     359#endif
    344360#if DBL_CONTROL
    345 #if FIX_DBL_CONTROL_DEFAULT
    346361  ("DeblockingFilterControlPresent", m_DeblockingFilterControlPresent, true)
    347 #else
    348   ("DeblockingFilterControlPresent", m_DeblockingFilterControlPresent, false)
    349 #endif
    350362#endif
    351363
    352364  /* Camera Paremetes */
    353365  ("CameraParameterFile,cpf", m_pchCameraParameterFile,    (Char *) 0, "Camera Parameter File Name")
     366#if QC_MVHEVC_B0046
     367  ("BaseViewCameraNumbers" ,  m_aiVId,     std::vector<Int>(1, MAX_VIEW_NUM), "Numbers of base views")
     368#endif
    354369  ("BaseViewCameraNumbers" ,  m_pchBaseViewCameraNumbers,  (Char *) 0, "Numbers of base views")
    355370
     
    362377  ("LambdaScaleVSO",                  m_dLambdaScaleVSO         , (Double) 1    , "Lambda Scaling for VSO")
    363378
    364 #if HHI_VSO_LS_TABLE
     379#if HHI_VSO_LS_TABLE_M23714
    365380  ("VSOLSTable",                      m_bVSOLSTable             , true          , "Depth QP dependent video/depth rate allocation by Lagrange multiplier" )   
    366381#endif
     
    377392#endif
    378393#if LGE_WVSO_A0119
    379   ("WVSO",                            m_bUseWVSO                , false         , "Use depth fidelity term for VSO" )
     394  ("WVSO",                            m_bUseWVSO                , true          , "Use depth fidelity term for VSO" )
    380395  ("VSOWeight",                       m_iVSOWeight              , 10            , "Synthesized View Distortion Change weight" )
    381396  ("VSDWeight",                       m_iVSDWeight              , 1             , "View Synthesis Distortion estimate weight" )
     
    383398#endif
    384399
    385 #if OL_DEPTHLIMIT_A0044
    386   ("DPL",                             m_bDepthPartitionLimiting , false         , "Use DepthPartitionLimiting" )
    387 #endif
     400#if OL_QTLIMIT_PREDCODING_B0068
     401  ("QTLPC",                           m_bUseQTLPC               , true         , "Use depth Quadtree Limitation + Predictive Coding" )
     402#endif
     403
    388404#endif
    389405
     
    474490                                              "\t0: disable")
    475491
     492#if TMVP_DEPTH_SWITCH
     493  ("TMVP", m_enableTMVP, std::vector<Bool>(1,true), "Enable TMVP" )
     494#else
    476495  ("TMVP", m_enableTMVP, true, "Enable TMVP" )
     496#endif
    477497
    478498  ("FEN", m_bUseFastEnc, false, "fast encoder setting")
     
    493513#if HHI_MPI
    494514  ("MVI", m_bUseMVI, false, "use motion vector inheritance for depth map coding")
     515#endif
     516#if RWTH_SDC_DLT_B0036
     517  ("DLT", m_bUseDLT, true, "use depth lookup table for depth map coding")
     518  ("SDC", m_bUseSDC, true, "use simplified depth coding tree")
    495519#endif
    496520  ;
     
    545569  m_pchBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str());
    546570  m_pchdQPFile = cfg_dQPFile.empty() ? NULL : strdup(cfg_dQPFile.c_str());
    547  
     571#if FLEX_CODING_ORDER_M23723
     572  m_pchMVCJointCodingOrder= cfg_JointCodingOrdering.empty()?NULL:strdup(cfg_JointCodingOrdering.c_str());
     573  // If flexible order is enabled and if depth comes before the texture for a view, disable VSO
     574#if HHI_VSO && DISABLE_FCO_FOR_VSO
     575  Bool depthComesFirst = false;
     576  int iter = 0;
     577  if ( m_b3DVFlexOrder )
     578  {
     579    for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++)
     580    {
     581      iter = 0;
     582      for ( Int ii=1; ii<12; ii+=2 )
     583      {
     584        Int iViewIdxCfg = (Int)(m_pchMVCJointCodingOrder[ii]-'0');
     585        if ( iViewIdxCfg == iViewIdx )
     586        {
     587          iter ++;
     588          if ( m_pchMVCJointCodingOrder[ii-1]=='D' ) // depth comes first for this view
     589          {
     590            if(iter == 1)
     591           {
     592            depthComesFirst = true;
     593            break;
     594           }
     595          }
     596          else
     597          {
     598            assert(m_pchMVCJointCodingOrder[ii-1]=='T');
     599          }
     600        }
     601      }
     602    }
     603  }
     604  if (depthComesFirst)
     605  {
     606    m_bUseVSO = false;
     607  }
     608#endif
     609#endif
    548610  m_pchColumnWidth = cfg_ColumnWidth.empty() ? NULL: strdup(cfg_ColumnWidth.c_str());
    549611  m_pchRowHeight = cfg_RowHeight.empty() ? NULL : strdup(cfg_RowHeight.c_str());
     
    704766  xCleanUpVectors();
    705767
     768
     769#if TMVP_DEPTH_SWITCH
     770  if ( m_enableTMVP.size() < 2)
     771  {
     772    m_enableTMVP.push_back( m_enableTMVP[0]  );
     773  }
     774#endif
     775 
     776
    706777#if HHI_VSO
    707778  if ( m_abUseALF .size() < 2)
     
    732803#if HHI_VSO
    733804
    734 #if HHI_VSO_LS_TABLE
     805#if HHI_VSO_LS_TABLE_M23714
    735806  // Q&D
    736807  Double adLambdaScaleTable[] =
     
    796867}
    797868#else
     869#if !QC_MVHEVC_B0046
    798870  m_cCameraData     .init     ( (UInt)m_iNumberOfViews,
    799871    m_uiInputBitDepth,
     
    807879    LOG2_DISP_PREC_LUT );
    808880#endif
     881#endif
    809882
    810883
    811884  // check validity of input parameters
    812885  xCheckParameter();
     886#if !QC_MVHEVC_B0046
    813887  m_cCameraData.check( false, true );
    814  
     888#endif
    815889  // print-out parameters
    816890  xPrintParameter();
     
    860934  xConfirmPara( m_iFastSearch < 0 || m_iFastSearch > 2,                                     "Fast Search Mode is not supported value (0:Full search  1:Diamond  2:PMVFAST)" );
    861935  xConfirmPara( m_iSearchRange < 0 ,                                                        "Search Range must be more than 0" );
     936#if DV_V_RESTRICTION_B0037
     937  xConfirmPara( m_iVerticalDisparitySearchRange <= 0 ,                                      "Vertical Disparity Search Range must be more than 0" );
     938#endif
    862939  xConfirmPara( m_bipredSearchRange < 0 ,                                                   "Search Range must be more than 0" );
    863940  xConfirmPara( m_iMaxDeltaQP > 7,                                                          "Absolute Delta QP exceeds supported range (0 to 7)" );
     
    16501727  printf("Min PCM size                 : %d\n", 1 << m_uiPCMLog2MinSize);
    16511728  printf("Motion search range          : %d\n", m_iSearchRange );
     1729#if DV_V_RESTRICTION_B0037
     1730  printf("Disp search range restriction: %d\n", m_bUseDisparitySearchRangeRestriction );
     1731  printf("Vertical disp search range   : %d\n", m_iVerticalDisparitySearchRange );
     1732#endif
    16521733  printf("Intra period                 : %d\n", m_iIntraPeriod );
    16531734  printf("Decoding refresh type        : %d\n", m_iDecodingRefreshType );
     
    16851766    printf("VSO Negative Distortion      : %d\n",    m_bAllowNegDist ? 1 : 0);
    16861767#endif
    1687 #if HHI_VSO_LS_TABLE
     1768#if HHI_VSO_LS_TABLE_M23714
    16881769    printf("VSO LS Table                 : %d\n",    m_bVSOLSTable ? 1 : 0);   
    16891770#endif
     
    17691850  printf(" ScalingList:%d ", m_useScalingListId );
    17701851
     1852#if !TMVP_DEPTH_SWITCH
    17711853  printf("TMVP:%d ", m_enableTMVP     );
     1854#endif
    17721855
    17731856#if ADAPTIVE_QP_SELECTION
     
    17831866  printf("SAO:%d ", (m_abUseSAO [0] ? 1 : 0));
    17841867  printf("RDQ:%d ", (m_abUseRDOQ[0] ? 1 : 0) );
     1868#if TMVP_DEPTH_SWITCH
     1869  printf("TMVP:%d ", (m_enableTMVP[0] ? 1 : 0) );
     1870#endif
     1871#if LGE_ILLUCOMP_B0045
     1872  printf("IlluCompEnable: %d ", m_bUseIC);
     1873#endif
     1874
    17851875  printf("\n");
    17861876
     
    17891879  printf("SAO:%d ", (m_abUseSAO [1] ? 1 : 0));
    17901880  printf("RDQ:%d ", (m_abUseRDOQ[1] ? 1 : 0));
     1881#if TMVP_DEPTH_SWITCH
     1882  printf("TMVP:%d ", (m_enableTMVP[1] ? 1 : 0) );
     1883#endif
     1884#if FLEX_CODING_ORDER_M23723
     1885  printf("FCO:%d ",   (m_b3DVFlexOrder ? 1: 0));
     1886
     1887  if(m_b3DVFlexOrder)
     1888  {
     1889    printf("CodingOrder: %s ", m_pchMVCJointCodingOrder);
     1890  }
     1891#endif
    17911892#if HHI_VSO
    17921893  printf("VSO:%d ", m_bUseVSO             );
     
    17951896  printf("WVSO:%d ", m_bUseWVSO );
    17961897#endif
    1797 #if OL_DEPTHLIMIT_A0044
    1798   printf("DPL:%d ", m_bDepthPartitionLimiting);
     1898#if OL_QTLIMIT_PREDCODING_B0068
     1899  printf("QTLPC:%d ", m_bUseQTLPC);
    17991900#endif
    18001901#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     
    18041905  printf("MVI:%d ", m_bUseMVI ? 1 : 0 );
    18051906#endif
     1907#if RWTH_SDC_DLT_B0036
     1908  printf("SDC:%d ", m_bUseSDC ? 1 : 0 );
     1909  printf("DLT:%d ", m_bUseDLT ? 1 : 0 );
     1910#endif
    18061911#if LGE_WVSO_A0119
    1807   printf("\nVSO : VSD : SAD weight = %d : %d : %d ", m_iVSOWeight, m_iVSDWeight, m_iDWeight );
     1912  if ( m_bUseWVSO )
     1913    printf("\nVSO : VSD : SAD weight = %d : %d : %d ", m_iVSOWeight, m_iVSDWeight, m_iDWeight );
    18081914#endif
    18091915  printf("\n\n");
  • branches/HTM-4.0.1-VSP-dev0/source/App/TAppEncoder/TAppEncCfg.h

    r193 r213  
    8888  Int       m_iNumberOfViews;                                 ///< number Views to Encode
    8989  Bool      m_bUsingDepthMaps;
     90 
     91#if FLEX_CODING_ORDER_M23723
     92  Char*  m_pchMVCJointCodingOrder;      ///<  texture-depth coding order
     93  Bool    m_b3DVFlexOrder;    ///<  flexible coding order flag
     94#endif
     95
    9096  // coding structure
    9197  Int       m_iIntraPeriod;                                   ///< period of I-slice (random access period)
     
    109115  std::vector<Double>  m_adQP;                                ///< QP value of key-picture (floating point) [0] video, [1] depth
    110116  std::vector<Int>     m_aiQP;                                ///< QP value of key-picture (integer) [0] video, [1] depth
     117#if QC_MVHEVC_B0046
     118  std::vector<Int>     m_aiVId;                                ///< view id
     119#endif
    111120  Int       m_aiTLayerQPOffset[MAX_TLAYER];                   ///< QP offset corresponding to temporal layer depth
    112121  char*     m_pchdQPFile;                                     ///< QP offset for each slice (initialized from external file)
     
    160169#endif
    161170  vector<Bool> m_abUseSAO;
     171#if LGE_ILLUCOMP_B0045
     172  Bool      m_bUseIC;                                     ///< flag for using illumination compensation for inter-view prediction
     173#endif
    162174#if SAO_UNIT_INTERLEAVING
    163175  Int       m_maxNumOffsetsPerPic;                            ///< SAO maximun number of offset per picture
     
    197209  Int       m_iFastSearch;                                    ///< ME mode, 0 = full, 1 = diamond, 2 = PMVFAST
    198210  Int       m_iSearchRange;                                   ///< ME search range
     211#if DV_V_RESTRICTION_B0037
     212  Bool      m_bUseDisparitySearchRangeRestriction;            ///< restrict vertical search range for inter-view prediction
     213  Int       m_iVerticalDisparitySearchRange;                  ///< ME vertical search range for inter-view prediction
     214#endif
    199215  Int       m_bipredSearchRange;                              ///< ME search range for bipred refinement
    200216  Bool      m_bUseFastEnc;                                    ///< flag for using fast encoder setting
     
    258274  UInt      m_uiBiPredIdc;                                    ///< Use of Bi-Directional Weighting Prediction (B_SLICE): explicit(1) or implicit(2)
    259275
     276#if TMVP_DEPTH_SWITCH
     277  vector<Bool> m_enableTMVP;                                  ///< Enable TMVP [0] video, [1] depth
     278#else
    260279  Bool      m_enableTMVP;
     280#endif
     281
    261282#if MULTIBITS_DATA_HIDING
    262283  Int       m_signHideFlag;
     
    266287  Bool      m_bUseMVI;  ///< flag for using Motion Vector Inheritance for depth map coding
    267288#endif
     289#if RWTH_SDC_DLT_B0036
     290  Bool      m_bUseDLT;
     291  Bool      m_bUseSDC;
     292#endif
    268293
    269294  Int       m_useScalingListId;                               ///< using quantization matrix
     
    273298  Char*     m_pchCameraParameterFile;                         ///< camera parameter file
    274299  Char*     m_pchBaseViewCameraNumbers;
     300#if !QC_MVHEVC_B0046
    275301  TAppComCamPara m_cCameraData;
    276 
     302#endif
    277303  Int       m_iCodedCamParPrecision;                          ///< precision for coding of camera parameters
    278304
     
    280306  Char*     m_pchVSOConfig;
    281307  Bool      m_bUseVSO;                                    ///< flag for using View Synthesis Optimization
    282 #if HHI_VSO_LS_TABLE
     308#if HHI_VSO_LS_TABLE_M23714
    283309  Bool      m_bVSOLSTable;                                ///< Depth QP dependent Lagrange parameter optimization (m23714)
    284310#endif
     
    313339#endif
    314340
    315 #if OL_DEPTHLIMIT_A0044
    316   Bool      m_bDepthPartitionLimiting;
     341#if OL_QTLIMIT_PREDCODING_B0068
     342  Bool      m_bUseQTLPC;                                      ///< flag for using depth QuadTree Limitation + Predictive Coding
    317343#endif
    318344
  • branches/HTM-4.0.1-VSP-dev0/source/App/TAppEncoder/TAppEncTop.cpp

    r193 r213  
    6767Void TAppEncTop::xInitLibCfg()
    6868{
    69 #if VIDYO_VPS_INTEGRATION
     69#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
     70#if !QC_MVHEVC_B0046
    7071  UInt layerId = 0;
     72#endif
    7173  // TODO: fix the assumption here that the temporal structures are all equal across all layers???
    7274  m_cVPS.setMaxTLayers( m_maxTempLayer[0] );
     75#if QC_MVHEVC_B0046
     76  m_cVPS.setMaxLayers( m_iNumberOfViews );
     77#else
    7378  m_cVPS.setMaxLayers( m_iNumberOfViews * (m_bUsingDepthMaps ? 2:1) );
     79#endif
    7480  for(Int i = 0; i < MAX_TLAYER; i++)
    7581  {
     
    8187  for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++)
    8288  {
     89#if VSP_N
     90#if FLEX_CODING_ORDER_M23723
     91      Bool isTextureFirst = false;
     92      if ( m_b3DVFlexOrder )
     93      {
     94        for ( Int ii=1; ii<12; ii+=2 )
     95        {
     96          Int iViewIdxCfg = (Int)(m_pchMVCJointCodingOrder[ii]-'0');
     97          if ( iViewIdxCfg == iViewIdx )
     98          {
     99            if ( m_pchMVCJointCodingOrder[ii-1]=='T' )
     100            {
     101              isTextureFirst = true;
     102            }
     103            else
     104            {
     105              assert(m_pchMVCJointCodingOrder[ii-1]=='D');
     106            }
     107            break;
     108          }
     109        }
     110      }
     111      else
     112      {
     113        isTextureFirst = true;
     114      }
     115#endif
     116#endif
    83117    m_frameRcvd.push_back(0);
    84118    m_acTEncTopList.push_back(new TEncTop);
     
    101135    m_acTEncTopList[iViewIdx]->setViewId                       ( iViewIdx );
    102136    m_acTEncTopList[iViewIdx]->setIsDepth                      ( false );
     137#if QC_MVHEVC_B0046
     138    m_acTEncTopList[iViewIdx]->setLayerId                      ( iViewIdx );
     139    m_cVPS.setViewId                                           ( m_aiVId[ iViewIdx ], iViewIdx );
     140#else
    103141    m_acTEncTopList[iViewIdx]->setViewOrderIdx                 ( m_cCameraData.getViewOrderIndex()[ iViewIdx ] );
    104142#if VIDYO_VPS_INTEGRATION
     
    113151#endif
    114152   
     153#if VSP_N
    115154    m_acTEncTopList[iViewIdx]->setCamParPrecision              ( m_cCameraData.getCamParsCodedPrecision  () );
    116155    m_acTEncTopList[iViewIdx]->setCamParInSliceHeader          ( m_cCameraData.getVaryingCameraParameters() );
    117156    m_acTEncTopList[iViewIdx]->setCodedScale                   ( m_cCameraData.getCodedScale             () );
    118157    m_acTEncTopList[iViewIdx]->setCodedOffset                  ( m_cCameraData.getCodedOffset            () );
     158#else
     159    m_acTEncTopList[iViewIdx]->setCamParPrecision              ( 0 );
     160    m_acTEncTopList[iViewIdx]->setCamParInSliceHeader          ( false );
     161    m_acTEncTopList[iViewIdx]->setCodedScale                   ( 0 );
     162    m_acTEncTopList[iViewIdx]->setCodedOffset                  ( 0 );
     163#endif
     164#endif   
    119165
    120166  //====== Coding Structure ========
     
    170216    m_acTEncTopList[iViewIdx]->setSearchRange                  ( m_iSearchRange );
    171217    m_acTEncTopList[iViewIdx]->setBipredSearchRange            ( m_bipredSearchRange );
    172 
     218#if DV_V_RESTRICTION_B0037
     219    m_acTEncTopList[iViewIdx]->setUseDisparitySearchRangeRestriction ( m_bUseDisparitySearchRangeRestriction );
     220    m_acTEncTopList[iViewIdx]->setVerticalDisparitySearchRange( m_iVerticalDisparitySearchRange );
     221#endif
    173222  //====== Quality control ========
    174223    m_acTEncTopList[iViewIdx]->setMaxDeltaQP                   ( m_iMaxDeltaQP  );
     
    300349    m_acTEncTopList[iViewIdx]->setLFCrossSliceBoundaryFlag( m_bLFCrossSliceBoundaryFlag );
    301350    m_acTEncTopList[iViewIdx]->setUseSAO               ( m_abUseSAO[0]     );
     351#if LGE_ILLUCOMP_B0045
     352    m_acTEncTopList[iViewIdx]->setUseIC                ( m_bUseIC          );
     353#endif
    302354#if SAO_UNIT_INTERLEAVING
    303355    m_acTEncTopList[iViewIdx]->setMaxNumOffsetsPerPic (m_maxNumOffsetsPerPic);
     
    342394    m_acTEncTopList[iViewIdx]->setWaveFrontFlush             ( m_iWaveFrontFlush );
    343395    m_acTEncTopList[iViewIdx]->setWaveFrontSubstreams        ( m_iWaveFrontSubstreams );
     396#if TMVP_DEPTH_SWITCH
     397    m_acTEncTopList[iViewIdx]->setEnableTMVP                 ( m_enableTMVP[0] );
     398#else
    344399    m_acTEncTopList[iViewIdx]->setEnableTMVP ( m_enableTMVP );
     400#endif
    345401    m_acTEncTopList[iViewIdx]->setUseScalingListId           ( m_useScalingListId  );
    346402    m_acTEncTopList[iViewIdx]->setScalingListFile            ( m_scalingListFile   );
     
    364420    m_acTEncTopList[iViewIdx]->setUseDMM                     ( false );
    365421#endif
    366 #if OL_DEPTHLIMIT_A0044
    367     m_acTEncTopList[iViewIdx]->setUseDPL                     ( false );
     422#if OL_QTLIMIT_PREDCODING_B0068
     423    m_acTEncTopList[iViewIdx]->setUseQTLPC                   ( false );
    368424#endif
    369425#if HHI_MPI
    370426    m_acTEncTopList[iViewIdx]->setUseMVI( false );
     427#endif
     428#if RWTH_SDC_DLT_B0036
     429    m_acTEncTopList[iViewIdx]->setUseDLT                      ( false );
     430    m_acTEncTopList[iViewIdx]->setUseSDC                      ( false );
    371431#endif
    372432
     
    374434    m_acTEncTopList[iViewIdx]->setUseVSP( m_bUseVSP );
    375435    m_acTEncTopList[iViewIdx]->setVSPDepthDisable( m_bVSPDepthDisable );
     436#if FLEX_CODING_ORDER_M23723
     437    m_acTEncTopList[iViewIdx]->setIsFirstInView( isTextureFirst );
     438#else
     439    m_acTEncTopList[iViewIdx]->setIsFirstInView( true );
     440#endif
    376441#endif
    377442  }
     
    380445    for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++)
    381446    {
     447
     448#if FLEX_CODING_ORDER_M23723
     449      // Detect whether depth comes before than texture for this view
     450      Bool isDepthFirst = false;
     451      if ( m_b3DVFlexOrder )
     452      {
     453        for ( Int ii=1; ii<12; ii+=2 )
     454        {
     455          Int iViewIdxCfg = (Int)(m_pchMVCJointCodingOrder[ii]-'0');
     456          if ( iViewIdxCfg == iViewIdx )
     457          {
     458            if ( m_pchMVCJointCodingOrder[ii-1]=='D' ) // depth comes first for this view
     459            {
     460              isDepthFirst = true;
     461            }
     462            else
     463            {
     464              assert(m_pchMVCJointCodingOrder[ii-1]=='T');
     465            }
     466            break;
     467          }
     468        }
     469      }
     470#endif
     471
    382472      m_depthFrameRcvd.push_back(0);
    383473      m_acTEncDepthTopList.push_back(new TEncTop);
     
    400490      m_acTEncDepthTopList[iViewIdx]->setViewId                       ( iViewIdx );
    401491      m_acTEncDepthTopList[iViewIdx]->setIsDepth                      ( true );
     492#if QC_MVHEVC_B0046
     493      m_acTEncDepthTopList[iViewIdx]->setLayerId                      ( iViewIdx );
     494#else
    402495      m_acTEncDepthTopList[iViewIdx]->setViewOrderIdx                 ( m_cCameraData.getViewOrderIndex()[ iViewIdx ] );
     496#endif
    403497#if VIDYO_VPS_INTEGRATION
    404498      layerId = iViewIdx * 2 + 1;
     
    410504      m_cVPS.setDependentLayer                                        ( layerId-1, layerId);
    411505#endif
     506
     507#if VSP_N
     508      m_acTEncDepthTopList[iViewIdx]->setCamParPrecision              ( m_cCameraData.getCamParsCodedPrecision  () );
     509      m_acTEncDepthTopList[iViewIdx]->setCamParInSliceHeader          ( m_cCameraData.getVaryingCameraParameters() );
     510      m_acTEncDepthTopList[iViewIdx]->setCodedScale                   ( m_cCameraData.getCodedScale             () );
     511      m_acTEncDepthTopList[iViewIdx]->setCodedOffset                  ( m_cCameraData.getCodedOffset            () );
     512#else
    412513      m_acTEncDepthTopList[iViewIdx]->setCamParPrecision              ( 0 );
    413514      m_acTEncDepthTopList[iViewIdx]->setCamParInSliceHeader          ( false );
    414515      m_acTEncDepthTopList[iViewIdx]->setCodedScale                   ( 0 );
    415516      m_acTEncDepthTopList[iViewIdx]->setCodedOffset                  ( 0 );
     517#endif
    416518
    417519      //====== Coding Structure ========
     
    467569      m_acTEncDepthTopList[iViewIdx]->setSearchRange                  ( m_iSearchRange );
    468570      m_acTEncDepthTopList[iViewIdx]->setBipredSearchRange            ( m_bipredSearchRange );
    469 
     571#if DV_V_RESTRICTION_B0037
     572      m_acTEncDepthTopList[iViewIdx]->setUseDisparitySearchRangeRestriction ( m_bUseDisparitySearchRangeRestriction );
     573      m_acTEncDepthTopList[iViewIdx]->setVerticalDisparitySearchRange( m_iVerticalDisparitySearchRange );
     574#endif
    470575      //====== Quality control ========
    471576      m_acTEncDepthTopList[iViewIdx]->setMaxDeltaQP                   ( m_iMaxDeltaQP  );
     
    584689      m_acTEncDepthTopList[iViewIdx]->setLFCrossSliceBoundaryFlag( m_bLFCrossSliceBoundaryFlag );
    585690      m_acTEncDepthTopList[iViewIdx]->setUseSAO               ( m_abUseSAO[1]     );
     691#if LGE_ILLUCOMP_B0045
     692      m_acTEncDepthTopList[iViewIdx]->setUseIC                ( false     );
     693#endif
    586694#if SAO_UNIT_INTERLEAVING
    587695      m_acTEncDepthTopList[iViewIdx]->setMaxNumOffsetsPerPic (m_maxNumOffsetsPerPic);
     
    626734      m_acTEncDepthTopList[iViewIdx]->setWaveFrontFlush             ( m_iWaveFrontFlush );
    627735      m_acTEncDepthTopList[iViewIdx]->setWaveFrontSubstreams        ( m_iWaveFrontSubstreams );
     736#if TMVP_DEPTH_SWITCH
     737      m_acTEncDepthTopList[iViewIdx]->setEnableTMVP                 ( m_enableTMVP[1] );
     738#else
    628739      m_acTEncDepthTopList[iViewIdx]->setEnableTMVP ( m_enableTMVP );
     740#endif
    629741      m_acTEncDepthTopList[iViewIdx]->setUseScalingListId           ( m_useScalingListId  );
    630742      m_acTEncDepthTopList[iViewIdx]->setScalingListFile            ( m_scalingListFile   );
     
    648760    m_acTEncDepthTopList[iViewIdx]->setUseDMM                     ( m_bUseDMM );
    649761#endif
    650 #if OL_DEPTHLIMIT_A0044
    651     m_acTEncDepthTopList[iViewIdx]->setUseDPL                      (m_bDepthPartitionLimiting);
     762#if FLEX_CODING_ORDER_M23723 && HHI_DMM_PRED_TEX
     763    m_acTEncDepthTopList[iViewIdx]->setUseDMM34( (m_b3DVFlexOrder && isDepthFirst) ? false : m_bUseDMM );
     764#endif
     765
     766#if OL_QTLIMIT_PREDCODING_B0068
     767    m_acTEncDepthTopList[iViewIdx]->setUseQTLPC                   (m_bUseQTLPC);
    652768#endif
    653769#if HHI_MPI
    654      m_acTEncDepthTopList[iViewIdx]->setUseMVI( m_bUseMVI );
     770#if FLEX_CODING_ORDER_M23723
     771    m_acTEncDepthTopList[iViewIdx]->setUseMVI( (m_b3DVFlexOrder && isDepthFirst) ? false : m_bUseMVI );
     772#else
     773    m_acTEncDepthTopList[iViewIdx]->setUseMVI( m_bUseMVI );
     774#endif
     775#endif
     776#if RWTH_SDC_DLT_B0036
     777      m_acTEncDepthTopList[iViewIdx]->setUseDLT                   ( m_bUseDLT );
     778      m_acTEncDepthTopList[iViewIdx]->setUseSDC                   ( m_bUseSDC );
    655779#endif
    656780
     
    658782      m_acTEncDepthTopList[iViewIdx]->setUseVSP( m_bUseVSP );
    659783      m_acTEncDepthTopList[iViewIdx]->setVSPDepthDisable( m_bVSPDepthDisable );
     784#if FLEX_CODING_ORDER_M23723
     785      m_acTEncDepthTopList[iViewIdx]->setIsFirstInView( isDepthFirst );
     786#else
     787      m_acTEncDepthTopList[iViewIdx]->setIsFirstInView( false );
     788#endif
    660789#endif
    661790    }
     
    677806    if ( m_uiVSOMode == 4 )
    678807    {
    679 #if HHI_VSO_SPEEDUP_A0033
    680808#if LGE_VSO_EARLY_SKIP_A0093
    681809      m_cRendererModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, g_uiMaxCUHeight , LOG2_DISP_PREC_LUT, 0, m_bVSOEarlySkip );
    682810#else
    683811      m_cRendererModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, g_uiMaxCUHeight , LOG2_DISP_PREC_LUT, 0 );
    684 #endif
    685 #else
    686       m_cRendererModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, m_iSourceHeight, LOG2_DISP_PREC_LUT, 0 );
    687812#endif
    688813
     
    820945  {
    821946    m_acTEncTopList[iViewIdx]->init( this );
     947#if QC_MVHEVC_B0046
     948  //set setNumDirectRefLayer
     949  Int iNumDirectRef = m_acTEncTopList[iViewIdx]->getSPS()->getNumberOfUsableInterViewRefs();
     950  m_acTEncTopList[iViewIdx]->getEncTop()->getVPS()->setNumDirectRefLayer(iNumDirectRef, iViewIdx);
     951  for(Int iNumIvRef = 0; iNumIvRef < iNumDirectRef; iNumIvRef ++)
     952  {
     953    Int iLayerId = m_acTEncTopList[iViewIdx]->getSPS()->getUsableInterViewRef(iNumIvRef);
     954    m_acTEncTopList[iViewIdx]->getEncTop()->getVPS()->setDirectRefLayerId( iLayerId + iViewIdx, iViewIdx, iNumIvRef);
     955  }
     956#endif
    822957  }
    823958  for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++)
     
    861996  TComPicYuv*       pcPicYuvOrg = new TComPicYuv;
    862997  TComPicYuv*       pcDepthPicYuvOrg = new TComPicYuv;
     998#if !QC_MVHEVC_B0046
    863999  TComPicYuv*       pcPdmDepthOrg    = new TComPicYuv;
     1000#endif
    8641001  TComPicYuv*       pcPicYuvRec = NULL;
    8651002  TComPicYuv*       pcDepthPicYuvRec = NULL;
    866 
     1003 
    8671004  // initialize internal class & member variables
    8681005  xInitLibCfg();
     
    8841021    eos.push_back( false );
    8851022    depthEos.push_back( false );
     1023   
     1024#if RWTH_SDC_DLT_B0036
     1025    if( m_bUsingDepthMaps && m_bUseDLT )
     1026      xAnalyzeInputBaseDepth(iViewIdx, m_iIntraPeriod);
     1027#endif
    8861028  }
    8871029
     
    9571099    {
    9581100      Int  iNumEncoded = 0;
     1101#if !QC_MVHEVC_B0046
    9591102      UInt iNextPoc = m_acTEncTopList[0] -> getFrameId( gopId );
    9601103      if ( iNextPoc < m_iFrameToBeEncoded )
     
    9621105        m_cCameraData.update( iNextPoc );
    9631106      }
     1107#endif
     1108
     1109#if FLEX_CODING_ORDER_M23723
     1110      if (m_b3DVFlexOrder)
     1111      {
     1112        Int  iNumDepthEncoded = 0;
     1113        iNumEncoded = 0;
     1114        Int i=0;
     1115        Int iViewIdx=0;
     1116        Int iNumberofDepthViews = m_bUsingDepthMaps?m_iNumberOfViews:0;
     1117        for (Int j=0; j < (m_iNumberOfViews+ iNumberofDepthViews); j++ )
     1118        {
     1119          if (m_pchMVCJointCodingOrder[i]=='T')
     1120          {
     1121
     1122            i++;
     1123            assert(isdigit(m_pchMVCJointCodingOrder[i]));
     1124            iViewIdx = (Int)(m_pchMVCJointCodingOrder[i]-'0');
     1125
     1126#if VSP_SLICE_HEADER && !VSP_CFG
     1127            if( m_acTEncTopList[iViewIdx]->getUseVSP() ) m_acTEncTopList[iViewIdx]->setUseVSP( (gopId%VSP_FRAME_INTERVAL==0) );
     1128#endif
     1129
     1130#if VSP_N
     1131#if VSP_SLICE_HEADER
     1132            if( m_acTEncTopList[iViewIdx]->getUseVSP() )
     1133#endif
     1134            if( m_bUsingDepthMaps )
     1135            {
     1136              // Forward Warping
     1137              xStoreVSPInBuffer( m_acTEncTopList[iViewIdx]->getVSPBuf(), m_acTEncTopList[iViewIdx]->getVSPAvailBuf(), iViewIdx, false, gopId );
     1138            }
     1139#endif
     1140
     1141            m_acTEncTopList[iViewIdx]->encode( eos[iViewIdx], pcPicYuvOrg, *m_picYuvRec[iViewIdx], outputAccessUnits, iNumEncoded, gopId );
     1142            xWriteOutput(bitstreamFile, iNumEncoded, outputAccessUnits, iViewIdx, false);
     1143            outputAccessUnits.clear();
     1144            i++;
     1145          }
     1146          else if ( m_pchMVCJointCodingOrder[i] == 'D')
     1147          {
     1148
     1149            i++;
     1150            if( m_bUsingDepthMaps )
     1151            {
     1152              assert(isdigit(m_pchMVCJointCodingOrder[i]));
     1153              iViewIdx = (Int)(m_pchMVCJointCodingOrder[i]-'0');
     1154#if SAIT_VSO_EST_A0033
     1155              if( m_bUseVSO && iNextPoc < m_iFrameToBeEncoded )
     1156              {
     1157                m_cCameraData.xSetDispCoeff( iNextPoc, iViewIdx );
     1158                m_acTEncDepthTopList[iViewIdx]->setDispCoeff( m_cCameraData.getDispCoeff() );
     1159              }
     1160#endif
     1161
     1162#if VSP_SLICE_HEADER && !VSP_CFG
     1163              if( m_acTEncDepthTopList[iViewIdx]->getUseVSP() ) m_acTEncDepthTopList[iViewIdx]->setUseVSP( (gopId%VSP_FRAME_INTERVAL==0) );
     1164#endif
     1165
     1166#if VSP_N
     1167#if VSP_SLICE_HEADER
     1168              if( m_acTEncDepthTopList[iViewIdx]->getUseVSP() )
     1169              if( !m_acTEncDepthTopList[iViewIdx]->getVSPDepthDisable() )
     1170#endif
     1171                xStoreVSPInBuffer( m_acTEncDepthTopList[iViewIdx]->getVSPBuf(), m_acTEncDepthTopList[iViewIdx]->getVSPAvailBuf(), iViewIdx, true, gopId );
     1172#endif
     1173
     1174              m_acTEncDepthTopList[iViewIdx]->encode( depthEos[iViewIdx], pcDepthPicYuvOrg, *m_picYuvDepthRec[iViewIdx], outputAccessUnits, iNumDepthEncoded, gopId );
     1175              xWriteOutput(bitstreamFile, iNumDepthEncoded, outputAccessUnits, iViewIdx, true);
     1176              outputAccessUnits.clear();
     1177              i++;
     1178            }
     1179          }
     1180        }
     1181      }
     1182      else
     1183      {
     1184
     1185#endif
    9641186      for(Int iViewIdx=0; iViewIdx < m_iNumberOfViews; iViewIdx++ )
    9651187      {
     
    10081230        }
    10091231      }
     1232 
     1233#if FLEX_CODING_ORDER_M23723
     1234      }
     1235#endif
     1236
    10101237#if HHI_INTERVIEW_SKIP || HHI_INTER_VIEW_MOTION_PRED || HHI_INTER_VIEW_RESIDUAL_PRED
    10111238      for( Int iViewIdx = 0; iViewIdx < m_iNumberOfViews; iViewIdx++ )
     
    10401267  pcDepthPicYuvOrg = NULL;
    10411268 
    1042 #if FIX_MEM_LEAKS
     1269#if !QC_MVHEVC_B0046
     1270#if FIX_DEL_NULLPTR
     1271  if ( pcPdmDepthOrg != NULL && m_uiMultiviewMvRegMode )
     1272#else
    10431273  if ( pcPdmDepthOrg != NULL )
     1274#endif
    10441275  {
    10451276    pcPdmDepthOrg->destroy();
     
    10481279  };
    10491280#endif
    1050 
    10511281 
    10521282  for(Int iViewIdx=0; iViewIdx < m_iNumberOfViews; iViewIdx++ )
     
    12521482    case NAL_UNIT_CODED_SLICE:
    12531483#if H0566_TLA
     1484#if !QC_REM_IDV_B0046
    12541485    case NAL_UNIT_CODED_SLICE_IDV:
     1486#endif
    12551487    case NAL_UNIT_CODED_SLICE_TLA:
    12561488    case NAL_UNIT_CODED_SLICE_CRA:
     
    13061538#endif
    13071539#if HHI_VSO
    1308 #if HHI_VSO_SPEEDUP_A0033
    13091540Void TAppEncTop::setupRenModel( Int iPoc, Int iEncViewIdx, Int iEncContent, Int iHorOffset )
    13101541{
    1311 #if FIX_VSO_SETUP
    13121542  m_cRendererModel.setupPart( iHorOffset, Min( g_uiMaxCUHeight, m_iSourceHeight - iHorOffset ) );
    1313 #else
    1314   m_cRendererModel.setHorOffset( iHorOffset );
    1315 #endif
    1316 #else
    1317 Void TAppEncTop::setupRenModel( Int iPoc, Int iEncViewIdx, Int iEncContent )
    1318 {
    1319 #endif
    13201543  Int iEncViewSIdx = m_cCameraData.getBaseId2SortedId()[ iEncViewIdx ];
    13211544
     
    14551678  return pcPic;
    14561679};
     1680 
     1681#if RWTH_SDC_DLT_B0036
     1682Void TAppEncTop::xAnalyzeInputBaseDepth(Int iViewIdx, UInt uiNumFrames)
     1683{
     1684  TComPicYuv*       pcDepthPicYuvOrg = new TComPicYuv;
     1685  // allocate original YUV buffer
     1686  pcDepthPicYuvOrg->create( m_iSourceWidth, m_iSourceHeight, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth );
     1687 
     1688  TVideoIOYuv* depthVideoFile = new TVideoIOYuv;
     1689 
     1690  UInt uiMaxDepthValue = g_uiIBDI_MAX;
     1691 
     1692  Bool abValidDepths[256];
     1693 
     1694  depthVideoFile->open( m_pchDepthInputFileList[iViewIdx], false, m_uiInputBitDepth, m_uiInternalBitDepth );  // read  mode
     1695 
     1696  // initialize boolean array
     1697  for(Int p=0; p<=uiMaxDepthValue; p++)
     1698    abValidDepths[p] = false;
     1699 
     1700  Int iHeight   = pcDepthPicYuvOrg->getHeight();
     1701  Int iWidth    = pcDepthPicYuvOrg->getWidth();
     1702  Int iStride   = pcDepthPicYuvOrg->getStride();
     1703 
     1704  Pel* pInDM    = pcDepthPicYuvOrg->getLumaAddr();
     1705 
     1706  for(Int uiFrame=0; uiFrame < uiNumFrames; uiFrame++ )
     1707  {
     1708    depthVideoFile->read( pcDepthPicYuvOrg, m_aiPad, false );
     1709   
     1710    // check all pixel values
     1711    for (Int i=0; i<iHeight; i++)
     1712    {
     1713      Int rowOffset = i*iStride;
     1714     
     1715      for (Int j=0; j<iWidth; j++)
     1716      {
     1717        Pel depthValue = pInDM[rowOffset+j];
     1718        abValidDepths[depthValue] = true;
     1719      }
     1720    }
     1721  }
     1722 
     1723  depthVideoFile->close();
     1724 
     1725  pcDepthPicYuvOrg->destroy();
     1726  delete pcDepthPicYuvOrg;
     1727 
     1728  // convert boolean array to idx2Depth LUT
     1729  UInt* auiIdx2DepthValue = (UInt*) calloc(uiMaxDepthValue, sizeof(UInt));
     1730  UInt uiNumDepthValues = 0;
     1731  for(UInt p=0; p<=uiMaxDepthValue; p++)
     1732  {
     1733    if( abValidDepths[p] == true)
     1734    {
     1735      auiIdx2DepthValue[uiNumDepthValues++] = p;
     1736    }
     1737  }
     1738 
     1739  if( uiNumFrames == 0 || ceil(Log2(uiNumDepthValues)) == ceil(Log2(g_uiIBDI_MAX)) )
     1740  {
     1741    // don't use DLT
     1742    m_acTEncDepthTopList[iViewIdx]->setUseDLT(false);
     1743    m_acTEncDepthTopList[iViewIdx]->getSPS()->setUseDLT(false);
     1744  }
     1745 
     1746  // assign LUT
     1747  if( m_acTEncDepthTopList[iViewIdx]->getUseDLT() )
     1748    m_acTEncDepthTopList[iViewIdx]->getSPS()->setDepthLUTs(auiIdx2DepthValue, uiNumDepthValues);
     1749  else
     1750    m_acTEncDepthTopList[iViewIdx]->getSPS()->setDepthLUTs();
     1751 
     1752  // free temporary memory
     1753  free(auiIdx2DepthValue);
     1754}
     1755#endif
    14571756
    14581757#if VSP_N
  • branches/HTM-4.0.1-VSP-dev0/source/App/TAppEncoder/TAppEncTop.h

    r166 r213  
    8787#endif
    8888
    89 #if VIDYO_VPS_INTEGRATION
     89#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    9090  TComVPS                     m_cVPS;
    9191#endif
     
    141141#endif
    142142#if HHI_VSO
    143 #if HHI_VSO_SPEEDUP_A0033
    144143  Void                  setupRenModel    ( Int iPoc, Int iEncViewIdx, Int iEncContent, Int iHorOffset );
    145 #else
    146   Void                  setupRenModel    ( Int iPoc, Int iEncViewIdx, Int iEncContent );
    147 #endif
    148144#endif
    149145 
     146#if QC_MVHEVC_B0046
     147  TComVPS*          getVPS()  { return &m_cVPS; }
     148#endif
    150149#if VIDYO_VPS_INTEGRATION
    151150  TComVPS*          getVPS()  { return &m_cVPS; }
     
    166165  Void  xStoreVSORefPicsInBuffer();                                                   ///< read in External Ref pic from file and store in buffer
    167166#endif
     167 
     168#if RWTH_SDC_DLT_B0036
     169  Void  xAnalyzeInputBaseDepth(Int iViewIdx, UInt uiNumFrames);
     170#endif
    168171
    169172#if VSP_N
  • branches/HTM-4.0.1-VSP-dev0/source/App/TAppRenderer/RendererMain.cpp

    r100 r213  
    4343int main(int argc, char* argv[])
    4444  {
     45#if !QC_MVHEVC_B0046
    4546  TAppRendererTop  cTAppRendererTop;
    4647
     
    7879
    7980  return 0;
     81#endif
    8082}
    8183
  • branches/HTM-4.0.1-VSP-dev0/source/App/TAppRenderer/TAppRendererCfg.cpp

    r100 r213  
    5959// Constructor / destructor / initialization / destroy
    6060// ====================================================================================================================
    61 
     61#if !QC_MVHEVC_B0046
    6262TAppRendererCfg::TAppRendererCfg()
    6363{
     
    120120
    121121    /* File I/O */
    122     ("VideoInputFileBaseName",  m_pchVideoInputFileBaseName,  (Char*) 0, "Basename to generate video input file names")
    123     ("DepthInputFileBaseName",  m_pchDepthInputFileBaseName,  (Char*) 0, "Basename to generate depth input file names")
    124     ("SynthOutputFileBaseName", m_pchSynthOutputFileBaseName, (Char*) 0, "Basename to generate synthesized output file names")
     122    ("VideoInputFileBaseName,v",  m_pchVideoInputFileBaseName,  (Char*) 0, "Basename to generate video input file names")
     123    ("DepthInputFileBaseName,d",  m_pchDepthInputFileBaseName,  (Char*) 0, "Basename to generate depth input file names")
     124    ("SynthOutputFileBaseName,s", m_pchSynthOutputFileBaseName, (Char*) 0, "Basename to generate synthesized output file names")
    125125    ("ContOutputFileNumbering", m_bContOutputFileNumbering  ,  false   , "Continuous Output File Numbering")
    126126    ("Sweep"                  , m_bSweep                    ,  false   , "Store all views in first Output File")
     
    137137
    138138    /* Camera Specification */
    139     ("CameraParameterFile,cpf", m_pchCameraParameterFile,          (Char *) 0, "Camera Parameter File Name")
     139    ("CameraParameterFile,-cpf", m_pchCameraParameterFile,          (Char *) 0, "Camera Parameter File Name")
    140140    ("BaseViewCameraNumbers"  , m_pchBaseViewCameraNumbers,        (Char *) 0, "Numbers of base views")
    141141    ("SynthViewCameraNumbers" , m_pchSynthViewCameraNumbers,       (Char *) 0, "Numbers of views to synthesis")
     
    516516  g_uiIBDI_MAX     = ((1<<(g_uiBitDepth+g_uiBitIncrement))-1);
    517517}
     518#endif
  • branches/HTM-4.0.1-VSP-dev0/source/App/TAppRenderer/TAppRendererCfg.h

    r100 r213  
    5050#include <string>
    5151#include <vector>
    52 
     52#if !QC_MVHEVC_B0046
    5353// ====================================================================================================================
    5454// Class definition
     
    134134
    135135
    136 
     136#endif
    137137#endif // __TAppRENDERERCFG__
    138138
  • branches/HTM-4.0.1-VSP-dev0/source/App/TAppRenderer/TAppRendererTop.cpp

    r193 r213  
    4545// Constructor / destructor / initialization / destroy
    4646// ====================================================================================================================
    47 
     47#if !QC_MVHEVC_B0046
    4848TAppRendererTop::TAppRendererTop()
    4949{
     
    532532#endif
    533533
    534 #if HHI_VSO_SPEEDUP_A0033
    535 #if FIX_VSO_SETUP
    536534    cCurModel.setupPart( 0, m_iSourceHeight  );
    537 #else
    538     cCurModel.setHorOffset( 0 );
    539 #endif
    540 #endif
    541535
    542536    for ( Int iViewIdx = 0; iViewIdx < m_iNumberOfInputViews; iViewIdx++ )
     
    713707
    714708  AOT( m_iLog2SamplingFactor != 0 );
    715 #if HHI_VSO_SPEEDUP_A0033
    716 #if FIX_VSO_SETUP
    717709  cCurModel.setupPart( 0, m_iSourceHeight  );
    718 #else
    719   cCurModel.setHorOffset( 0 );
    720 #endif
    721 #endif
    722710#if LGE_VSO_EARLY_SKIP_A0093
    723711  cCurModel.create( m_iNumberOfInputViews, m_iNumberOfOutputViews, m_iSourceWidth, m_iSourceHeight, m_iShiftPrecision, m_iBlendHoleMargin, false );
     
    10461034
    10471035}
     1036#endif
  • branches/HTM-4.0.1-VSP-dev0/source/App/TAppRenderer/TAppRendererTop.h

    r100 r213  
    5050#include "../../Lib/TLibRenderer/TRenModel.h"
    5151
    52 
     52#if !QC_MVHEVC_B0046
    5353// ====================================================================================================================
    5454// Class definition
     
    8787};// END CLASS DEFINITION TAppRendererTop
    8888
    89 #endif // __TAppRendererTOP__
     89#endif
    9090
     91#endif
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/CommonDef.h

    r193 r213  
    5858
    5959#define HM_VERSION        "6.1"
    60 #define NV_VERSION        "4.1"                  ///< Current software version
     60#define NV_VERSION        "5.1"                  ///< Current software version
    6161
    6262// ====================================================================================================================
     
    144144#define PDM_NO_INTER_UPDATE               1         // no update for inter (but not inter-view) predicted blocks
    145145#define PDM_MERGE_POS                     0         // position of pdm in merge list (0..4)
    146 #if SAIT_IMPROV_MOTION_PRED_M24829&!QC_MULTI_DIS_CAN
     146
     147#if QC_MRG_CANS_B0048
     148#if OL_DISMV_POS_B0069
     149#define DMV_MERGE_POS                     4
     150#else
     151#define DMV_MERGE_POS                     1
     152#endif
     153#endif
     154
     155#if SAIT_IMPROV_MOTION_PRED_M24829&!QC_MULTI_DIS_CAN_A0097
    147156#define PDM_AMVP_POS                      0         // position of pdm in amvp list  (0..3)
    148157#else
     
    181190// VPS constants
    182191// ====================================================================================================================
     192#if QC_MVHEVC_B0046
     193#define MAX_LAYER_NUM                     MAX_VIEW_NUM
     194#endif
    183195#if VIDYO_VPS_INTEGRATION
    184196#define MAX_LAYER_NUM                     MAX_VIEW_NUM
     
    476488  NAL_UNIT_CODED_SLICE,
    477489#if H0566_TLA
     490#if QC_REM_IDV_B0046
     491  NAL_UNIT_RESERVED,
     492#else
    478493  NAL_UNIT_CODED_SLICE_IDV,
     494#endif
    479495  NAL_UNIT_CODED_SLICE_TLA,
    480496  NAL_UNIT_CODED_SLICE_CRA,
     
    504520  NAL_UNIT_RESERVED_23,
    505521  NAL_UNIT_UNSPECIFIED_24,
    506 #if VIDYO_VPS_INTEGRATION
     522#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    507523  NAL_UNIT_VPS,
    508524#else
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/ContextTables.h

    r100 r213  
    5252#define NUM_SKIP_FLAG_CTX             3       ///< number of context models for skip flag
    5353
     54#if LGE_ILLUCOMP_B0045
     55#define NUM_IC_FLAG_CTX               3       ///< number of context models for illumination compensation flag
     56#endif
     57
    5458#define NUM_MERGE_FLAG_EXT_CTX        1       ///< number of context models for merge flag of merge extended
    5559#if MRG_IDX_CTX_RED
     
    152156#endif
    153157
    154 #if LGE_EDGE_INTRA
     158#if LGE_EDGE_INTRA_A0070
    155159#define NUM_EDGE_INTRA_CTX            1
    156160#if LGE_EDGE_INTRA_DELTA_DC
     
    159163#endif
    160164
     165#if RWTH_SDC_DLT_B0036
     166#define SDC_NUM_FLAG_CTX                 3
     167#define SDC_NUM_RESIDUAL_FLAG_CTX        1
     168#define SDC_NUM_SIGN_FLAG_CTX            1
     169#define SDC_NUM_RESIDUAL_CTX             10
     170
     171#define SDC_NUM_PRED_MODE_CTX            5
     172#endif
     173
    161174// ====================================================================================================================
    162175// Tables
     
    180193  { 197,  185,  201, },
    181194};
     195
     196#if LGE_ILLUCOMP_B0045
     197static const UChar
     198INIT_IC_FLAG[3][NUM_IC_FLAG_CTX] = 
     199{
     200  { CNU,  CNU,  CNU, },
     201  { 197,  185,  201, },
     202  { 197,  185,  201, },
     203};
     204#endif
    182205
    183206static const UChar
     
    12801303};
    12811304
    1282 #if LGE_EDGE_INTRA
     1305#if LGE_EDGE_INTRA_A0070
    12831306static const Short
    12841307INIT_EDGE_INTRA[3][NUM_EDGE_INTRA_CTX] =
     
    13141337#endif
    13151338
     1339#if RWTH_SDC_DLT_B0036
     1340static const Short INIT_SDC_FLAG[3][SDC_NUM_FLAG_CTX][2] =
     1341{
     1342  {
     1343    {    0,   64 }, {    0,   64 }, {    0,   64 }
     1344  },
     1345  {
     1346    {    0,   64 }, {    0,   64 }, {    0,   64 }
     1347  },
     1348  {
     1349    {    0,   64 }, {    0,   64 }, {    0,   64 }
     1350  }
     1351};
     1352
     1353static const Short INIT_SDC_RESIDUAL_FLAG[3][3*SDC_NUM_RESIDUAL_FLAG_CTX][2] =
     1354{
     1355  {
     1356    { -5, 35 },
     1357    { -0, 56 },
     1358    { -0, 56 }
     1359   
     1360  },
     1361  {
     1362    { -5, 35 },
     1363    { -0, 56 },
     1364    { -0, 56 }
     1365  },
     1366  {
     1367    { -5, 35 },
     1368    { -0, 56 },
     1369    { -0, 56 }
     1370  }
     1371};
     1372
     1373static const Short INIT_SDC_SIGN_FLAG[3][3*SDC_NUM_SIGN_FLAG_CTX][2] =
     1374{
     1375  {
     1376    { -1, 56 },
     1377    { -4, 55 },
     1378    { -4, 55 }
     1379  },
     1380  {
     1381    { -1, 56 },
     1382    { -4, 55 },
     1383    { -4, 55 }
     1384  },
     1385  {
     1386    { -1, 56 },
     1387    { -4, 55 },
     1388    { -4, 55 }
     1389  }
     1390};
     1391
     1392static const Short INIT_SDC_RESIDUAL[3][3*SDC_NUM_RESIDUAL_CTX][2] =
     1393{
     1394  {
     1395    { -1, 64 }, {  2, 64 }, {  6, 67 }, {  8, 61 }, {  7, 47 }, { 10, 33 }, { 12, 14 }, { 33, -13 }, { 12, 14 }, { 33, -13 },
     1396    {  2, 66 }, { -0, 63 }, {  1, 64 }, {  6, 65 }, {  7, 59 }, { 12, 50 }, { 14, 27 }, { -0, -17 }, { 14, 27 }, { -0, -17 },
     1397    {  2, 66 }, { -0, 63 }, {  1, 64 }, {  6, 65 }, {  7, 59 }, { 12, 50 }, { 14, 27 }, { -0, -17 }, { 14, 27 }, { -0, -17 }
     1398  },
     1399  {
     1400    { -1, 64 }, {  2, 64 }, {  6, 67 }, {  8, 61 }, {  7, 47 }, { 10, 33 }, { 12, 14 }, { 33, -13 }, { 12, 14 }, { 33, -13 },
     1401    {  2, 66 }, { -0, 63 }, {  1, 64 }, {  6, 65 }, {  7, 59 }, { 12, 50 }, { 14, 27 }, { -0, -17 }, { 14, 27 }, { -0, -17 },
     1402    {  2, 66 }, { -0, 63 }, {  1, 64 }, {  6, 65 }, {  7, 59 }, { 12, 50 }, { 14, 27 }, { -0, -17 }, { 14, 27 }, { -0, -17 }
     1403  },
     1404  {
     1405    { -1, 64 }, {  2, 64 }, {  6, 67 }, {  8, 61 }, {  7, 47 }, { 10, 33 }, { 12, 14 }, { 33, -13 }, { 12, 14 }, { 33, -13 },
     1406    {  2, 66 }, { -0, 63 }, {  1, 64 }, {  6, 65 }, {  7, 59 }, { 12, 50 }, { 14, 27 }, { -0, -17 }, { 14, 27 }, { -0, -17 },
     1407    {  2, 66 }, { -0, 63 }, {  1, 64 }, {  6, 65 }, {  7, 59 }, { 12, 50 }, { 14, 27 }, { -0, -17 }, { 14, 27 }, { -0, -17 }
     1408  }
     1409};
     1410
     1411static const Short INIT_SDC_PRED_MODE[3][3*SDC_NUM_PRED_MODE_CTX][2] =
     1412{
     1413  {
     1414    {  9, 85 }, { -4, 60 }, {  4, 70 }, {  4, 70 }, {  4, 70 },
     1415    {  9, 85 }, { -4, 60 }, {  4, 70 }, {  4, 70 }, {  4, 70 },
     1416    {  9, 85 }, { -4, 60 }, {  4, 70 }, {  4, 70 }, {  4, 70 }
     1417  },
     1418  {
     1419    {  9, 85 }, { -4, 60 }, {  4, 70 }, {  4, 70 }, {  4, 70 },
     1420    {  9, 85 }, { -4, 60 }, {  4, 70 }, {  4, 70 }, {  4, 70 },
     1421    {  9, 85 }, { -4, 60 }, {  4, 70 }, {  4, 70 }, {  4, 70 }
     1422  },
     1423  {
     1424    {  9, 85 }, { -4, 60 }, {  4, 70 }, {  4, 70 }, {  4, 70 },
     1425    {  9, 85 }, { -4, 60 }, {  4, 70 }, {  4, 70 }, {  4, 70 },
     1426    {  9, 85 }, { -4, 60 }, {  4, 70 }, {  4, 70 }, {  4, 70 }
     1427  }
     1428};
     1429#endif
     1430
    13161431//! \}
    13171432
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/NAL.h

    r165 r213  
    5151  NalRefIdc   m_nalRefIDC;   ///< nal_ref_idc
    5252#endif
    53 #if VIDYO_VPS_INTEGRATION
     53#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    5454  unsigned    m_layerId;
    5555  unsigned    m_temporalId;  ///< temporal_id
     
    6969    NalUnitType nalUnitType,
    7070    Bool        nalRefFlag,
    71 #if !VIDYO_VPS_INTEGRATION    
     71#if !VIDYO_VPS_INTEGRATION & !QC_MVHEVC_B0046    
    7272    Int         viewId,
    7373    Bool        isDepth,
     
    7878    :m_nalUnitType (nalUnitType)
    7979    ,m_nalRefFlag  (nalRefFlag)
    80 #if !VIDYO_VPS_INTEGRATION
     80#if !VIDYO_VPS_INTEGRATION & !QC_MVHEVC_B0046
    8181    ,m_viewId      (viewId)
    8282    ,m_isDepth     (isDepth)
     
    139139    return m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR
    140140#if H0566_TLA
     141#if !QC_REM_IDV_B0046   
    141142        || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDV
     143#endif
    142144        || m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA
    143145        || m_nalUnitType == NAL_UNIT_CODED_SLICE_TLA
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComDataCU.cpp

    r193 r213  
    137137  m_phQP               = NULL;
    138138  m_pbMergeFlag        = NULL;
     139#if LGE_ILLUCOMP_B0045
     140  m_pbICFlag           = NULL;
     141#endif
    139142  m_puhMergeIndex      = NULL;
    140143  m_puhLumaIntraDir    = NULL;
     
    152155  m_pcTrCoeffCr        = NULL;
    153156#if ADAPTIVE_QP_SELECTION 
    154 #if FIX_MEM_LEAKS
    155157  m_ArlCoeffIsAliasedAllocation = false;
    156158  m_pcArlCoeffY        = NULL;
     
    158160  m_pcArlCoeffCr       = NULL;
    159161#endif
    160 #endif
    161162 
    162163  m_pbIPCMFlag         = NULL;
     
    206207  m_pbResPredFlag      = NULL;
    207208#endif
    208 #if LGE_EDGE_INTRA
     209#if LGE_EDGE_INTRA_A0070
    209210  m_pucEdgeCode         = NULL;
    210211  m_pucEdgeNumber       = NULL;
     
    217218#endif
    218219#endif
    219 #if OL_DEPTHLIMIT_A0044
    220   //add a variable to store the partition information
    221   //a 2D array in part_symbol, uidepth format
    222   //initialize m_partInfo to OL_END_CU
    223   for (Int i=0; i < OL_PART_BUF_SIZE; i++)
    224   {
    225     for (Int j=0; j < 2; j++)
    226     {
    227       m_uiPartInfo[i][j] = OL_END_CU;
    228     }
    229   }
     220#if RWTH_SDC_DLT_B0036
     221  m_pbSDCFlag           = NULL;
     222  m_apSegmentDCOffset[0] = NULL;
     223  m_apSegmentDCOffset[1] = NULL;
    230224#endif
    231225}
     
    268262    m_pePredMode         = new Char[ uiNumPartition ];
    269263   
     264#if RWTH_SDC_DLT_B0036
     265    m_pbSDCFlag          = (Bool*  )xMalloc(Bool,   uiNumPartition);
     266    m_apSegmentDCOffset[0] = (Pel*)xMalloc(Pel, uiNumPartition);
     267    m_apSegmentDCOffset[1] = (Pel*)xMalloc(Pel, uiNumPartition);
     268#endif
     269   
    270270    m_puiAlfCtrlFlag     = new Bool[ uiNumPartition ];
    271271   
    272272    m_pbMergeFlag        = (Bool*  )xMalloc(Bool,   uiNumPartition);
     273#if LGE_ILLUCOMP_B0045
     274    m_pbICFlag           = (Bool*  )xMalloc(Bool,   uiNumPartition);
     275#endif
    273276    m_puhMergeIndex      = (UChar* )xMalloc(UChar,  uiNumPartition);
    274277#if HHI_INTER_VIEW_RESIDUAL_PRED
     
    312315      m_pcArlCoeffCb       = m_pcGlbArlCoeffCb;
    313316      m_pcArlCoeffCr       = m_pcGlbArlCoeffCr;
    314 #if FIX_MEM_LEAKS
    315317      m_ArlCoeffIsAliasedAllocation = true;
    316 #endif
    317318    }
    318319    else
     
    350351    m_piContourPredTexDeltaDC2 = (Int* )xMalloc(Int,  uiNumPartition);
    351352#endif
    352 #if LGE_EDGE_INTRA
     353#if LGE_EDGE_INTRA_A0070
    353354    m_pucEdgeCode       = (UChar*)xMalloc(UChar, uiNumPartition * LGE_EDGE_INTRA_MAX_EDGE_NUM_PER_4x4);
    354355    m_pucEdgeNumber     = (UChar*)xMalloc(UChar, uiNumPartition);
     
    411412#endif
    412413    if ( m_pePredMode         ) { delete[] m_pePredMode;        m_pePredMode        = NULL; }
     414#if RWTH_SDC_DLT_B0036
     415    if ( m_pbSDCFlag          ) { xFree(m_pbSDCFlag);      m_pbSDCFlag    = NULL; }
     416    if ( m_apSegmentDCOffset[0]          ) { xFree(m_apSegmentDCOffset[0]);      m_apSegmentDCOffset[0]    = NULL; }
     417    if ( m_apSegmentDCOffset[1]          ) { xFree(m_apSegmentDCOffset[1]);      m_apSegmentDCOffset[1]    = NULL; }
     418#endif
    413419    if ( m_puhCbf[0]          ) { xFree(m_puhCbf[0]);           m_puhCbf[0]         = NULL; }
    414420    if ( m_puhCbf[1]          ) { xFree(m_puhCbf[1]);           m_puhCbf[1]         = NULL; }
     
    417423    if ( m_puhInterDir        ) { xFree(m_puhInterDir);         m_puhInterDir       = NULL; }
    418424    if ( m_pbMergeFlag        ) { xFree(m_pbMergeFlag);         m_pbMergeFlag       = NULL; }
     425#if LGE_ILLUCOMP_B0045
     426    if ( m_pbICFlag           ) { xFree(m_pbICFlag);            m_pbICFlag          = NULL; }
     427#endif
    419428    if ( m_puhMergeIndex      ) { xFree(m_puhMergeIndex);       m_puhMergeIndex     = NULL; }
    420429#if HHI_INTER_VIEW_RESIDUAL_PRED
     
    430439    if ( m_pcTrCoeffCr        ) { xFree(m_pcTrCoeffCr);         m_pcTrCoeffCr       = NULL; }
    431440#if ADAPTIVE_QP_SELECTION
    432 #if FIX_MEM_LEAKS
    433441    if (!m_ArlCoeffIsAliasedAllocation)
    434442    {
     
    437445      xFree(m_pcArlCoeffCr); m_pcArlCoeffCr = 0;
    438446    }
    439 #endif
    440447    if ( m_pcGlbArlCoeffY     ) { xFree(m_pcGlbArlCoeffY);      m_pcGlbArlCoeffY    = NULL; }
    441448    if ( m_pcGlbArlCoeffCb    ) { xFree(m_pcGlbArlCoeffCb);     m_pcGlbArlCoeffCb   = NULL; }
     
    469476    if ( m_piContourPredTexDeltaDC2 ) { xFree(m_piContourPredTexDeltaDC2); m_piContourPredTexDeltaDC2 = NULL; }
    470477#endif   
    471 #if LGE_EDGE_INTRA
     478#if LGE_EDGE_INTRA_A0070
    472479  if ( m_pbEdgeLeftFirst  ) { xFree(m_pbEdgeLeftFirst);   m_pbEdgeLeftFirst = NULL; }
    473480  if ( m_pucEdgeStartPos  ) { xFree(m_pucEdgeStartPos);   m_pucEdgeStartPos = NULL; }
     
    544551Void TComDataCU::initCU( TComPic* pcPic, UInt iCUAddr )
    545552{
    546 #if OL_DEPTHLIMIT_A0044
    547   TComDataCU* pcCU     = pcPic->getCU(iCUAddr);
    548 #endif
    549 
    550553  m_pcPic              = pcPic;
    551554  m_pcSlice            = pcPic->getSlice(pcPic->getCurrSliceIdx());
     
    599602    m_piTextureModeDepth[ui] = pcFrom->getTextureModeDepth(ui);
    600603#endif
     604#if RWTH_SDC_DLT_B0036
     605    m_pbSDCFlag[ui] = pcFrom->getSDCFlag(ui);
     606#endif
    601607    m_puhWidth  [ui] = pcFrom->getWidth(ui);
    602608    m_puhHeight [ui] = pcFrom->getHeight(ui);
     
    610616    m_puiAlfCtrlFlag[ui]=pcFrom->m_puiAlfCtrlFlag[ui];
    611617    m_pbMergeFlag[ui]=pcFrom->m_pbMergeFlag[ui];
     618#if LGE_ILLUCOMP_B0045
     619    m_pbICFlag[ui]=pcFrom->m_pbICFlag[ui];
     620#endif
    612621    m_puhMergeIndex[ui]=pcFrom->m_puhMergeIndex[ui];
    613622    m_puhLumaIntraDir[ui]=pcFrom->m_puhLumaIntraDir[ui];
     
    630639#if HHI_MPI
    631640    memset( m_piTextureModeDepth+ firstElement,-1,                        numElements * sizeof( *m_piTextureModeDepth ) );
     641#endif
     642#if RWTH_SDC_DLT_B0036
     643    memset( m_pbSDCFlag        + firstElement,     0,                     numElements * sizeof( *m_pbSDCFlag ) );
     644    memset( m_apSegmentDCOffset[0]        + firstElement,     0,                     numElements * sizeof( *m_apSegmentDCOffset[0] ) );
     645    memset( m_apSegmentDCOffset[1]        + firstElement,     0,                     numElements * sizeof( *m_apSegmentDCOffset[1] ) );
    632646#endif
    633647    memset( m_puhTrIdx          + firstElement, 0,                        numElements * sizeof( *m_puhTrIdx ) );
     
    642656    memset( m_puiAlfCtrlFlag    + firstElement, false,                    numElements * sizeof( *m_puiAlfCtrlFlag ) );
    643657    memset( m_pbMergeFlag       + firstElement, false,                    numElements * sizeof( *m_pbMergeFlag ) );
     658#if LGE_ILLUCOMP_B0045
     659    memset( m_pbICFlag          + firstElement, false,                    numElements * sizeof( *m_pbICFlag ) );
     660#endif
    644661    memset( m_puhMergeIndex     + firstElement, 0,                        numElements * sizeof( *m_puhMergeIndex ) );
    645662    memset( m_puhLumaIntraDir   + firstElement, 2,                        numElements * sizeof( *m_puhLumaIntraDir ) );
     
    763780    m_apcCUColocated[1] = getSlice()->getRefPic( REF_PIC_LIST_1, 0)->getCU( m_uiCUAddr );
    764781  }
    765 #if OL_DEPTHLIMIT_A0044
    766   setPartDumpFlag (pcCU->getPartDumpFlag());
    767 #endif
    768782}
    769783
     
    825839      m_puiAlfCtrlFlag[ui]= false;
    826840      m_pbMergeFlag[ui] = 0;
     841#if LGE_ILLUCOMP_B0045
     842      m_pbICFlag[ui]    = false;
     843#endif
    827844      m_puhMergeIndex[ui] = 0;
    828845#if HHI_INTER_VIEW_RESIDUAL_PRED
     
    854871    m_piContourPredTexDeltaDC2[ui] = 0;
    855872#endif
     873#if RWTH_SDC_DLT_B0036
     874    m_pbSDCFlag[ui] = false;
     875    m_apSegmentDCOffset[0][ui] = 0;
     876    m_apSegmentDCOffset[1][ui] = 0;
     877#endif
    856878    }
    857879  }
     
    926948  memset( m_puiAlfCtrlFlag,     0, iSizeInBool );
    927949  memset( m_pbMergeFlag,        0, iSizeInBool  );
     950#if LGE_ILLUCOMP_B0045
     951  memset( m_pbICFlag,           0, iSizeInBool  );
     952#endif
    928953#if HHI_INTERVIEW_SKIP
    929954  memset( m_pbRenderable,        0, iSizeInBool  );
     
    963988  memset( m_piContourPredTexDeltaDC1, 0, sizeof( Int  ) * m_uiNumPartition );
    964989  memset( m_piContourPredTexDeltaDC2, 0, sizeof( Int  ) * m_uiNumPartition );
    965 #endif   
     990#endif   
     991#if RWTH_SDC_DLT_B0036
     992  memset( m_pbSDCFlag,     0, sizeof(Bool) * m_uiNumPartition  );
     993  memset( m_apSegmentDCOffset[0],     0, sizeof(Pel) * m_uiNumPartition);
     994  memset( m_apSegmentDCOffset[1],     0, sizeof(Pel) * m_uiNumPartition);
     995#endif
    966996
    967997  UChar uhWidth  = g_uiMaxCUWidth  >> uiDepth;
     
    10011031      m_puiAlfCtrlFlag[ui]=pcCU->m_puiAlfCtrlFlag[uiPartOffset+ui];
    10021032      m_pbMergeFlag[ui]=pcCU->m_pbMergeFlag[uiPartOffset+ui];
     1033#if LGE_ILLUCOMP_B0045
     1034      m_pbICFlag[ui]=pcCU->m_pbICFlag[uiPartOffset+ui];
     1035#endif
    10031036      m_puhMergeIndex[ui]=pcCU->m_puhMergeIndex[uiPartOffset+ui];
    10041037      m_puhLumaIntraDir[ui]=pcCU->m_puhLumaIntraDir[uiPartOffset+ui];
     
    10301063      m_pbResPredAvailable[ui] = pcCU->m_pbResPredAvailable[ uiPartOffset + ui ];
    10311064      m_pbResPredFlag     [ui] = pcCU->m_pbResPredFlag     [ uiPartOffset + ui ];
     1065#endif
     1066#if RWTH_SDC_DLT_B0036
     1067      m_pbSDCFlag         [ui] = pcCU->m_pbSDCFlag         [ uiPartOffset + ui ];
     1068      m_apSegmentDCOffset[0][ui] = pcCU->m_apSegmentDCOffset[0][ uiPartOffset + ui ];
     1069      m_apSegmentDCOffset[1][ui] = pcCU->m_apSegmentDCOffset[1][ uiPartOffset + ui ];
    10321070#endif
    10331071    }
     
    10951133  memcpy(m_uiSliceStartCU,pcCU->m_uiSliceStartCU+uiPartOffset,sizeof(UInt)*m_uiNumPartition);
    10961134  memcpy(m_uiEntropySliceStartCU,pcCU->m_uiEntropySliceStartCU+uiPartOffset,sizeof(UInt)*m_uiNumPartition);
    1097 #if OL_DEPTHLIMIT_A0044
    1098   setPartDumpFlag (pcCU->getPartDumpFlag());
    1099 #endif
    11001135}
    11011136
     
    11401175 
    11411176  m_pbMergeFlag         = pcCU->getMergeFlag()        + uiPart;
     1177#if LGE_ILLUCOMP_B0045
     1178  m_pbICFlag            = pcCU->getICFlag()           + uiPart;
     1179#endif
    11421180  m_puhMergeIndex       = pcCU->getMergeIndex()       + uiPart;
    11431181#if HHI_INTER_VIEW_RESIDUAL_PRED
     
    12231261  m_piContourPredTexDeltaDC2 = pcCU->getContourPredTexDeltaDC2() + uiPart;   
    12241262#endif
    1225 #if LGE_EDGE_INTRA
     1263#if LGE_EDGE_INTRA_A0070
    12261264  if( pcCU->getSlice()->getSPS()->isDepth() )
    12271265  {
     
    12371275  }
    12381276#endif
     1277#if RWTH_SDC_DLT_B0036
     1278  m_pbSDCFlag               = pcCU->getSDCFlag()            + uiPart;
     1279  m_apSegmentDCOffset[0]    = pcCU->getSDCSegmentDCOffset(0) + uiPart;
     1280  m_apSegmentDCOffset[1]    = pcCU->getSDCSegmentDCOffset(1) + uiPart;
     1281#endif
    12391282}
    12401283
     
    12721315 
    12731316  m_pbMergeFlag        = pcCU->getMergeFlag()             + uiAbsPartIdx;
     1317#if LGE_ILLUCOMP_B0045
     1318  m_pbICFlag           = pcCU->getICFlag()                + uiAbsPartIdx;
     1319#endif
    12741320  m_puhMergeIndex      = pcCU->getMergeIndex()            + uiAbsPartIdx;
    12751321#if HHI_INTER_VIEW_RESIDUAL_PRED
     
    13181364  memcpy( m_puiAlfCtrlFlag      + uiOffset, pcCU->getAlfCtrlFlag(),       iSizeInBool  );
    13191365  memcpy( m_pbMergeFlag         + uiOffset, pcCU->getMergeFlag(),         iSizeInBool  );
     1366#if LGE_ILLUCOMP_B0045
     1367  memcpy( m_pbICFlag            + uiOffset, pcCU->getICFlag(),            iSizeInBool );
     1368#endif
    13201369  memcpy( m_puhMergeIndex       + uiOffset, pcCU->getMergeIndex(),        iSizeInUchar );
    13211370#if HHI_INTER_VIEW_RESIDUAL_PRED
     
    13951444#endif
    13961445
    1397 #if LGE_EDGE_INTRA
     1446#if LGE_EDGE_INTRA_A0070
    13981447  if( getSlice()->getSPS()->isDepth() )
    13991448  {
     
    14131462  memcpy( m_piTextureModeDepth + uiOffset, pcCU->getTextureModeDepth(), sizeof( Int ) * uiNumPartition );
    14141463#endif
     1464#if RWTH_SDC_DLT_B0036
     1465  memcpy( m_pbSDCFlag     + uiOffset, pcCU->getSDCFlag(),      iSizeInBool  );
     1466  memcpy( m_apSegmentDCOffset[0]     + uiOffset, pcCU->getSDCSegmentDCOffset(0), sizeof( Pel ) * uiNumPartition);
     1467  memcpy( m_apSegmentDCOffset[1]     + uiOffset, pcCU->getSDCSegmentDCOffset(1), sizeof( Pel ) * uiNumPartition);
     1468#endif
    14151469}
    14161470
     
    14441498 
    14451499  memcpy( rpcCU->getMergeFlag()         + m_uiAbsIdxInLCU, m_pbMergeFlag,         iSizeInBool  );
     1500#if LGE_ILLUCOMP_B0045
     1501  memcpy( rpcCU->getICFlag()            + m_uiAbsIdxInLCU, m_pbICFlag,            iSizeInBool );
     1502#endif
    14461503  memcpy( rpcCU->getMergeIndex()        + m_uiAbsIdxInLCU, m_puhMergeIndex,       iSizeInUchar );
    14471504#if HHI_INTER_VIEW_RESIDUAL_PRED
     
    15131570#endif
    15141571
    1515 #if LGE_EDGE_INTRA
     1572#if LGE_EDGE_INTRA_A0070
    15161573  if( rpcCU->getSlice()->getSPS()->isDepth() )
    15171574  {
     
    15311588  memcpy( rpcCU->getTextureModeDepth() + m_uiAbsIdxInLCU, m_piTextureModeDepth, sizeof( Int ) * m_uiNumPartition );
    15321589#endif
     1590#if RWTH_SDC_DLT_B0036
     1591  memcpy( rpcCU->getSDCFlag() + m_uiAbsIdxInLCU, m_pbSDCFlag,      iSizeInBool  );
     1592  memcpy( rpcCU->getSDCSegmentDCOffset(0) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[0], sizeof( Pel ) * m_uiNumPartition);
     1593  memcpy( rpcCU->getSDCSegmentDCOffset(1) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[1], sizeof( Pel ) * m_uiNumPartition);
     1594#endif
    15331595}
    15341596
     
    15621624  memcpy( rpcCU->getAlfCtrlFlag()       + uiPartOffset, m_puiAlfCtrlFlag,      iSizeInBool  );
    15631625  memcpy( rpcCU->getMergeFlag()         + uiPartOffset, m_pbMergeFlag,         iSizeInBool  );
     1626#if LGE_ILLUCOMP_B0045
     1627  memcpy( rpcCU->getICFlag()            + uiPartOffset, m_pbICFlag,            iSizeInBool );
     1628#endif
    15641629  memcpy( rpcCU->getMergeIndex()        + uiPartOffset, m_puhMergeIndex,       iSizeInUchar );
    15651630#if HHI_INTER_VIEW_RESIDUAL_PRED
     
    16321697#endif
    16331698
    1634 #if LGE_EDGE_INTRA
     1699#if LGE_EDGE_INTRA_A0070
    16351700  if( rpcCU->getSlice()->getSPS()->isDepth() )
    16361701  {
     
    16491714#if HHI_MPI
    16501715  memcpy( rpcCU->getTextureModeDepth() + uiPartOffset, m_piTextureModeDepth, sizeof( Int ) * uiQNumPart  );
     1716#endif
     1717#if RWTH_SDC_DLT_B0036
     1718  memcpy( rpcCU->getSDCFlag() + uiPartOffset, m_pbSDCFlag,      iSizeInBool  );
     1719  memcpy( rpcCU->getSDCSegmentDCOffset(0) + uiPartOffset, m_apSegmentDCOffset[0], sizeof( Pel ) * uiQNumPart);
     1720  memcpy( rpcCU->getSDCSegmentDCOffset(1) + uiPartOffset, m_apSegmentDCOffset[1], sizeof( Pel ) * uiQNumPart);
    16511721#endif
    16521722}
     
    23832453#if H0204_QP_PREDICTION
    23842454  UInt        lPartIdx, aPartIdx;
    2385 #if FIX_COMP_WARNING_INIT
    23862455  lPartIdx = 0;
    23872456  aPartIdx = 0;
    2388 #endif
    23892457  TComDataCU* cULeft  = getQpMinCuLeft ( lPartIdx, m_uiAbsIdxInLCU + uiCurrAbsIdxInLCU );
    23902458  TComDataCU* cUAbove = getQpMinCuAbove( aPartIdx, m_uiAbsIdxInLCU + uiCurrAbsIdxInLCU );
     
    25282596  mapDMMtoIntraMode( iLeftIntraDir );
    25292597#endif
    2530 #if LGE_EDGE_INTRA
     2598#if LGE_EDGE_INTRA_A0070
    25312599  mapEdgeIntratoDC( iLeftIntraDir );
    25322600#endif
     
    25432611  mapDMMtoIntraMode( iAboveIntraDir );
    25442612#endif
    2545 #if LGE_EDGE_INTRA
     2613#if LGE_EDGE_INTRA_A0070
    25462614  mapEdgeIntratoDC( iAboveIntraDir );
    25472615#endif
     
    26292697}
    26302698
    2631 #if LGE_EDGE_INTRA
     2699#if LGE_EDGE_INTRA_A0070
    26322700UInt TComDataCU::getCtxEdgeIntra( UInt uiAbsPartIdx )
    26332701{
     
    27402808  return uiCtx;
    27412809}
     2810
     2811#if LGE_ILLUCOMP_B0045
     2812UInt TComDataCU::getCtxICFlag( UInt uiAbsPartIdx )
     2813{
     2814  UInt        uiCtx = 0;
     2815
     2816  return uiCtx;
     2817}
     2818#endif
    27422819
    27432820UInt TComDataCU::getCtxInterDir( UInt uiAbsPartIdx )
     
    29703047}
    29713048
     3049#if RWTH_SDC_DLT_B0036
     3050Void TComDataCU::setSDCFlagSubParts ( Bool bSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
     3051{
     3052  setSubPart( bSDCFlag, m_pbSDCFlag, uiAbsPartIdx, uiDepth, uiPartIdx );
     3053}
     3054
     3055UInt TComDataCU::getCtxSDCFlag( UInt uiAbsPartIdx )
     3056{
     3057  TComDataCU* pcTempCU;
     3058  UInt        uiTempPartIdx;
     3059  UInt        uiCtx = 0;
     3060 
     3061  // left PU
     3062  pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx, true, false );
     3063  uiCtx    = ( pcTempCU ) ? pcTempCU->getSDCFlag( uiTempPartIdx ) : 0;
     3064 
     3065  // above PU
     3066  pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx, true, false );
     3067  uiCtx   += ( pcTempCU ) ? pcTempCU->getSDCFlag( uiTempPartIdx ) : 0;
     3068 
     3069  return uiCtx;
     3070}
     3071
     3072Bool TComDataCU::getSDCAvailable( UInt uiAbsPartIdx )
     3073{
     3074  if( !getSlice()->getSPS()->isDepth() || getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N )
     3075    return false;
     3076 
     3077  UInt uiLumaPredMode = getLumaIntraDir( uiAbsPartIdx );
     3078 
     3079  if(!isIntra(uiAbsPartIdx))
     3080    return false;
     3081 
     3082  for(UInt ui=0; ui<RWTH_SDC_NUM_PRED_MODES; ui++)
     3083  {
     3084    if( g_auiSDCPredModes[ui] == uiLumaPredMode )
     3085      return true;
     3086  }
     3087  // else
     3088  return false;
     3089}
     3090#endif
     3091
    29723092Void TComDataCU::setMergeIndexSubParts ( UInt uiMergeIndex, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
    29733093{
     
    29983118  setSubPart<UChar>( uiDir, m_puhInterDir, uiAbsPartIdx, uiDepth, uiPartIdx );
    29993119}
     3120
     3121#if LGE_ILLUCOMP_B0045
     3122Void TComDataCU::setICFlagSubParts( Bool bICFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
     3123{
     3124  memset( m_pbICFlag + uiAbsPartIdx, bICFlag, (m_pcPic->getNumPartInCU() >> ( 2 * uiDepth ))*sizeof(Bool) );
     3125}
     3126
     3127Bool TComDataCU::isICFlagRequired(UInt uiAbsPartIdx)
     3128{
     3129  UInt uiPartAddr;
     3130  UInt iNumbPart;
     3131  Int iWidth, iHeight;
     3132
     3133  UInt uiPartMode = getPartitionSize(uiAbsPartIdx);
     3134
     3135  iNumbPart = (uiPartMode == SIZE_2Nx2N ? 1 : (uiPartMode == SIZE_NxN ? 4 : 2) );
     3136
     3137  for(UInt i = 0; i < iNumbPart; i++)
     3138  {
     3139    getPartIndexAndSize(i, uiPartAddr, iWidth, iHeight, uiAbsPartIdx, true);
     3140    uiPartAddr += uiAbsPartIdx;
     3141
     3142    for(UInt uiRefIdx = 0; uiRefIdx < 2; uiRefIdx++)
     3143    {
     3144      RefPicList eRefList = uiRefIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0;
     3145      Int iBestRefIdx = getCUMvField(eRefList)->getRefIdx(uiPartAddr);
     3146
     3147#if VSP_AIC
     3148      if((getInterDir(uiPartAddr) & (uiRefIdx+1)) && iBestRefIdx >= 0 && getSlice()->getPOC() == getSlice()->getRefPOC(eRefList, iBestRefIdx))
     3149#else
     3150      if((getInterDir(uiPartAddr) & (uiRefIdx+1)) && iBestRefIdx >= 0 && getSlice()->getViewId() != getSlice()->getRefViewId(eRefList, iBestRefIdx))
     3151#endif
     3152      {
     3153        return true;
     3154      }
     3155    }
     3156  }
     3157  return false;
     3158}
     3159#endif
    30003160
    30013161Void TComDataCU::setMVPIdxSubParts( Int iMVPIdx, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
     
    35703730
    35713731  //===== add merge with predicted depth maps =====
     3732#if QC_MRG_CANS_B0048
     3733  TComMv  acPdmMv       [4];
     3734  Int     aiPdmRefIdx   [4] = {-1, -1, -1, -1};
     3735  Bool    bLeftAvai         = false;
     3736#if OL_DISMV_POS_B0069
     3737  Int     iPosLeftAbove[2]  = {-1, -1};
     3738#endif
     3739#else
    35723740  TComMv  acPdmMv       [2];
    35733741  Int     aiPdmRefIdx   [2] = {-1, -1};
    3574 
    3575 #if LGE_DVMCP
     3742#endif
     3743
     3744#if LGE_DVMCP_A0126
     3745#if QC_MRG_CANS_B0048
     3746  acPdmMv[0].m_bDvMcp = acPdmMv[1].m_bDvMcp = acPdmMv[2].m_bDvMcp = acPdmMv[3].m_bDvMcp = false;
     3747#else
    35763748  acPdmMv[0].m_bDvMcp = acPdmMv[1].m_bDvMcp = false;
    35773749#endif
    3578 
    3579 #if QC_MULTI_DIS_CAN
     3750#endif
     3751
     3752#if QC_MULTI_DIS_CAN_A0097
    35803753  DisInfo cDisInfo;
    35813754  cDisInfo.iN = 0;
    35823755  if(!bNoPdmMerge)
    35833756  {
    3584 #if LGE_DVMCP
    3585     getDisMvpCand2(uiPUIdx, uiAbsPartIdx, &cDisInfo, true );
     3757#if LGE_DVMCP_A0126
     3758#if LGE_IVMP_PARALLEL_MERGE_B0136 && !QC_SIMPLE_NBDV_B0047
     3759    getDisMvpCand2(uiPUIdx, uiAbsPartIdx, &cDisInfo, true, REF_PIC_LIST_X, -1, true );
     3760#else
     3761    getDisMvpCand2(uiPUIdx, uiAbsPartIdx, &cDisInfo
     3762#if LGE_IVMP_PARALLEL_MERGE_B0136==QC_SIMPLE_NBDV_B0047
     3763,
     3764true
     3765#endif
     3766);
     3767#endif
    35863768#else
    35873769    getDisMvpCand (uiPUIdx, uiAbsPartIdx, &cDisInfo );
     
    35953777    cDisInfo.m_aVIdxCan[0] = 0;
    35963778  }
    3597   Int     iPdmInterDir      = cDisInfo.iN==0? 0:getPdmMergeCandidateDisCan ( uiPUIdx, aiPdmRefIdx, acPdmMv, &cDisInfo  );
     3779#if QC_MRG_CANS_B0048
     3780  Int iPdmDir[2] = {0, 0};
     3781#endif
     3782  Int     iPdmInterDir      = cDisInfo.iN==0? 0:getPdmMergeCandidateDisCan ( uiPUIdx, aiPdmRefIdx, acPdmMv, &cDisInfo 
     3783#if QC_MRG_CANS_B0048
     3784    , iPdmDir
     3785#endif
     3786    );
    35983787#else
    35993788  Int     iPdmInterDir      = getPdmMergeCandidate( uiPUIdx, aiPdmRefIdx, acPdmMv );
    36003789#endif
    3601 
     3790#if QC_MRG_CANS_B0048
     3791  if( iPdmDir[0] && !bNoPdmMerge && PDM_MERGE_POS == 0 )
     3792#else
    36023793  if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 0 )
     3794#endif
    36033795  {
    36043796    abCandIsInter        [ iCount ] = true;
     3797#if QC_MRG_CANS_B0048
     3798    puhInterDirNeighbours[ iCount ] = iPdmDir[0];
     3799    iPdmInterDir                    = iPdmDir[0];
     3800#else
    36053801    puhInterDirNeighbours[ iCount ] = iPdmInterDir;
     3802#endif
    36063803    if( ( iPdmInterDir & 1 ) == 1 )
    36073804    {
    36083805      pcMvFieldNeighbours[ iCount<<1    ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] );
    36093806    }
     3807#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     3808    else
     3809    {
     3810      pcMvFieldNeighbours[ iCount<<1    ].setMvField( TComMv(0,0), NOT_VALID );
     3811    }
     3812#endif
    36103813    if( ( iPdmInterDir & 2 ) == 2 )
    36113814    {
    36123815      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] );
    36133816    }
     3817#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     3818    else
     3819    {
     3820      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );
     3821    }
     3822#endif
    36143823#if SIMP_MRG_PRUN
    36153824    if ( mrgCandIdx == iCount )
     
    36193828#endif
    36203829    iCount ++;
     3830  }
     3831#endif
     3832
     3833#if QC_MRG_CANS_B0048
     3834  if(extraMergeCand)
     3835  {
     3836    if(!bNoPdmMerge && iPdmDir[1] && DMV_MERGE_POS == 1)
     3837    {
     3838      assert(iCount < MRG_MAX_NUM_CANDS_MEM);
     3839      abCandIsInter        [ iCount ] = true;
     3840      puhInterDirNeighbours[ iCount ] = iPdmDir[1];
     3841      if( ( iPdmDir[1] & 1 ) == 1 )
     3842      {
     3843        pcMvFieldNeighbours[ iCount<<1    ].setMvField( acPdmMv[ 2 ], aiPdmRefIdx[ 2 ] );
     3844      }
     3845      if( ( iPdmDir[1] & 2 ) == 2 )
     3846      {
     3847        pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 3 ], aiPdmRefIdx[ 3 ] );
     3848      }
     3849#if LGE_DVMCP_A0126
     3850      pcMvFieldNeighbours[iCount<<1    ].getMv().m_bDvMcp = false;
     3851      pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false;
     3852#endif
     3853#if SIMP_MRG_PRUN
     3854      if ( mrgCandIdx == iCount )
     3855          return;
     3856#endif
     3857      iCount ++;
     3858    }   
    36213859  }
    36223860#endif
     
    36633901      pcCULeft->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
    36643902    }
    3665 #if LGE_DVMCP
     3903#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     3904    else
     3905    {
     3906      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );
     3907    }
     3908#endif
     3909#if QC_MRG_CANS_B0048
     3910    Bool bRemoveSpa = false; //prunign to inter-view candidates
     3911    Int  iCnloop    = iCount - 1;
     3912    for(; iCnloop >= 0; iCnloop --)
     3913    {
     3914      if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])
     3915      {
     3916        bRemoveSpa                      = true;
     3917        abCandIsInter        [ iCount ] = false;
     3918#if FIX_MISUSE_REFINDEX
     3919        //reset to the default value for IC, MC
     3920        puhInterDirNeighbours[iCount]   = 0;
     3921        TComMv  cZeroMv;
     3922        pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID );
     3923        pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );
     3924        break;
     3925#endif
     3926      }
     3927    }
     3928    if(!bRemoveSpa)
     3929    {
     3930      bLeftAvai = true;
     3931#if OL_DISMV_POS_B0069
     3932      iPosLeftAbove[0] = iCount;
     3933#endif
     3934#endif
     3935#if LGE_DVMCP_A0126
    36663936    pcMvFieldNeighbours[iCount<<1    ].getMv().m_bDvMcp = false;
    36673937    pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false;
     
    36773947#endif
    36783948    iCount ++;
     3949#if QC_MRG_CANS_B0048
     3950      }
     3951#endif
    36793952  }
    36803953  }
    36813954
    36823955#if HHI_INTER_VIEW_MOTION_PRED
     3956#if QC_MRG_CANS_B0048
     3957  if( iPdmDir[0]   && !bNoPdmMerge && PDM_MERGE_POS == 1 )
     3958#else
    36833959  if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 1 )
     3960#endif
    36843961  {
    36853962    abCandIsInter        [ iCount ] = true;
     
    36893966      pcMvFieldNeighbours[ iCount<<1    ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] );
    36903967    }
     3968#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     3969    else
     3970    {
     3971      pcMvFieldNeighbours[ iCount<<1 ].setMvField( TComMv(0,0), NOT_VALID );
     3972    }
     3973#endif
    36913974    if( ( iPdmInterDir & 2 ) == 2 )
    36923975    {
    36933976      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] );
    36943977    }
     3978#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     3979    else
     3980    {
     3981      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );
     3982    }
     3983#endif
    36953984#if SIMP_MRG_PRUN
    36963985    if ( mrgCandIdx == iCount )
     
    37514040      pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
    37524041    }
    3753 #if LGE_DVMCP
     4042#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     4043    else
     4044    {
     4045      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );
     4046    }
     4047#endif
     4048#if QC_MRG_CANS_B0048
     4049    Bool bRemoveSpa = false; //prunign to inter-view candidates
     4050    Int  iCnloop    = bLeftAvai? (iCount-2): (iCount-1);
     4051    for(; iCnloop >= 0; iCnloop --)
     4052    {
     4053      if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])
     4054      {
     4055        bRemoveSpa                      = true;
     4056        abCandIsInter        [ iCount ] = false;
     4057#if FIX_MISUSE_REFINDEX
     4058        //reset to the default value for IC, MC
     4059        puhInterDirNeighbours[iCount]   = 0;
     4060        TComMv  cZeroMv;
     4061        pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID );
     4062        pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );
     4063        break;
     4064#endif
     4065      }
     4066    }
     4067    if(!bRemoveSpa)
     4068    {
     4069#if OL_DISMV_POS_B0069
     4070      iPosLeftAbove[1] = iCount;
     4071#endif
     4072#endif
     4073#if LGE_DVMCP_A0126
    37544074    pcMvFieldNeighbours[iCount<<1    ].getMv().m_bDvMcp = false;
    37554075    pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false;
     
    37654085#endif
    37664086    iCount ++;
     4087#if QC_MRG_CANS_B0048
     4088    }
     4089#endif
    37674090  }
    37684091#if !SIMP_MRG_PRUN
     
    37714094
    37724095#if HHI_INTER_VIEW_MOTION_PRED
     4096#if QC_MRG_CANS_B0048
     4097  if( iPdmDir[0]   && !bNoPdmMerge && PDM_MERGE_POS == 2 )
     4098#else
    37734099  if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 2 )
     4100#endif
    37744101  {
    37754102    abCandIsInter        [ iCount ] = true;
     
    37794106      pcMvFieldNeighbours[ iCount<<1    ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] );
    37804107    }
     4108#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     4109    else
     4110    {
     4111      pcMvFieldNeighbours[ iCount<<1 ].setMvField( TComMv(0,0), NOT_VALID );
     4112    }
     4113#endif
    37814114    if( ( iPdmInterDir & 2 ) == 2 )
    37824115    {
    37834116      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] );
    37844117    }
     4118#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     4119    else
     4120    {
     4121      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );
     4122    }
     4123#endif
    37854124#if SIMP_MRG_PRUN
    37864125    if ( mrgCandIdx == iCount )
     
    38354174      pcCUAboveRight->getMvField( pcCUAboveRight, uiAboveRightPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
    38364175    }
    3837 #if LGE_DVMCP
     4176#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     4177    else
     4178    {
     4179      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );
     4180    }
     4181#endif
     4182#if LGE_DVMCP_A0126
    38384183    pcMvFieldNeighbours[iCount<<1    ].getMv().m_bDvMcp = false;
    38394184    pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false;
     
    38524197
    38534198#if HHI_INTER_VIEW_MOTION_PRED
     4199#if QC_MRG_CANS_B0048
     4200  if( iPdmDir[0]   && !bNoPdmMerge && PDM_MERGE_POS == 3 )
     4201#else
    38544202  if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 3 )
     4203#endif
    38554204  {
    38564205    abCandIsInter        [ iCount ] = true;
     
    38604209      pcMvFieldNeighbours[ iCount<<1    ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] );
    38614210    }
     4211#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     4212    else
     4213    {
     4214      pcMvFieldNeighbours[ iCount<<1 ].setMvField( TComMv(0,0), NOT_VALID );
     4215    }
     4216#endif
    38624217    if( ( iPdmInterDir & 2 ) == 2 )
    38634218    {
    38644219      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] );
    38654220    }
     4221#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     4222    else
     4223    {
     4224      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );
     4225    }
     4226#endif
    38664227#if SIMP_MRG_PRUN
    38674228    if ( mrgCandIdx == iCount )
     
    38714232#endif
    38724233    iCount ++;
     4234  }
     4235#endif
     4236
     4237#if OL_DISMV_POS_B0069
     4238  if(extraMergeCand)
     4239  {
     4240    if(!bNoPdmMerge && iPdmDir[1] && DMV_MERGE_POS == 4)
     4241    {
     4242      assert(iCount < MRG_MAX_NUM_CANDS_MEM);
     4243      Bool bRemoveSpa = false; //prunign to A1, B1
     4244      abCandIsInter        [ iCount ] = true;
     4245      puhInterDirNeighbours[ iCount ] = iPdmDir[1];
     4246      if( ( iPdmDir[1] & 1 ) == 1 )
     4247      {
     4248        pcMvFieldNeighbours[ iCount<<1    ].setMvField( acPdmMv[ 2 ], aiPdmRefIdx[ 2 ] );
     4249      }
     4250      if( ( iPdmDir[1] & 2 ) == 2 )
     4251      {
     4252        pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 3 ], aiPdmRefIdx[ 3 ] );
     4253      }
     4254      for(Int i = 0; i < 2; i ++)
     4255      {
     4256        Int iCnloop = iPosLeftAbove[i];
     4257        if(iCnloop == -1)
     4258          continue;
     4259        if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])
     4260        {
     4261          bRemoveSpa                      = true;
     4262          abCandIsInter        [ iCount ] = false;
     4263#if FIX_MISUSE_REFINDEX
     4264          //reset to the default value for IC, MC
     4265          puhInterDirNeighbours[iCount]   = 0;
     4266          TComMv  cZeroMv;
     4267          pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID );
     4268          pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );
     4269          break;
     4270#endif
     4271        }
     4272      }
     4273      if(!bRemoveSpa)
     4274      {
     4275#if LGE_DVMCP_A0126
     4276        pcMvFieldNeighbours[iCount<<1    ].getMv().m_bDvMcp = false;
     4277        pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false;
     4278#endif
     4279#if SIMP_MRG_PRUN
     4280        if ( mrgCandIdx == iCount )
     4281          return;
     4282#endif
     4283        iCount ++;
     4284      }
     4285    }   
    38734286  }
    38744287#endif
     
    39244337      pcCULeftBottom->getMvField( pcCULeftBottom, uiLeftBottomPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
    39254338    }
    3926 #if LGE_DVMCP
     4339#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     4340    else
     4341    {
     4342      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );
     4343    }
     4344#endif
     4345#if LGE_DVMCP_A0126
    39274346    pcMvFieldNeighbours[iCount<<1    ].getMv().m_bDvMcp = false;
    39284347    pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false;
     
    39444363
    39454364#if HHI_INTER_VIEW_MOTION_PRED
     4365#if QC_MRG_CANS_B0048
     4366  if( iPdmDir[0]   && !bNoPdmMerge && PDM_MERGE_POS == 4 )
     4367#else
    39464368  if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 4 )
     4369#endif
    39474370  {
    39484371    abCandIsInter        [ iCount ] = true;
     
    39524375      pcMvFieldNeighbours[ iCount<<1    ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] );
    39534376    }
     4377#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     4378    else
     4379    {
     4380      pcMvFieldNeighbours[ iCount<<1 ].setMvField( TComMv(0,0), NOT_VALID );
     4381    }
     4382#endif
    39544383    if( ( iPdmInterDir & 2 ) == 2 )
    39554384    {
    39564385      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] );
    39574386    }
     4387#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     4388    else
     4389    {
     4390      pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );
     4391    }
     4392#endif
    39584393#if SIMP_MRG_PRUN
    39594394    if ( mrgCandIdx == iCount )
     
    40194454        pcCUAboveLeft->getMvField( pcCUAboveLeft, uiAboveLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
    40204455      }
    4021 #if LGE_DVMCP
     4456#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     4457      else
     4458      {
     4459        pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );
     4460      }
     4461#endif
     4462#if LGE_DVMCP_A0126
    40224463      pcMvFieldNeighbours[iCount<<1    ].getMv().m_bDvMcp = false;
    40234464      pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false;
     
    40494490#endif
    40504491
    4051   if ( getSlice()->getPPS()->getEnableTMVPFlag() )
     4492  if ( getSlice()->getPPS()->getEnableTMVPFlag()
     4493#if QC_MRG_CANS_B0048
     4494       && iCount < (MRG_MAX_NUM_CANDS_SIGNALED + extraMergeCand)
     4495#endif
     4496  )
    40524497  {
    40534498    // col [2]
     4499#if !QC_TMVP_IDX_MOD_B0046
    40544500    Int iRefIdxSkip[2] = {-1, -1};
    40554501    for (Int i=0; i<2; i++)
     
    40714517      iRefIdxSkip[i] = (iRefIdxTmp != -1) ? iRefIdxTmp : 0;
    40724518    }
     4519#endif
    40734520    //>> MTK colocated-RightBottom
    40744521    UInt uiPartIdxRB;
     
    40824529
    40834530    TComMv cColMv;
     4531#if QC_TMVP_IDX_MOD_B0046
     4532    Int iRefIdx = 0;
     4533#else
    40844534    Int iRefIdx;
    4085 
     4535#endif
    40864536    if      ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getSPS()->getPicWidthInLumaSamples() )  // image boundary check
    40874537    {
     
    41164566      }
    41174567    }
     4568#if !QC_TMVP_IDX_MOD_B0046
    41184569    iRefIdx = iRefIdxSkip[0];
    4119 
     4570#else
     4571    iRefIdx = 0;
     4572#endif
    41204573    Bool bExistMV = false;
    41214574    UInt uiPartIdxCenter;
     
    41354588      if ( getSlice()->isInterB() )
    41364589      {       
     4590#if !QC_TMVP_IDX_MOD_B0046
    41374591        iRefIdx = iRefIdxSkip[1];
     4592#else
     4593        iRefIdx = 0;
     4594#endif
    41384595        bExistMV = uiLCUIdx >= 0 && xGetColMVP( REF_PIC_LIST_1, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx);
    41394596        if( bExistMV == false )
     
    41494606        {
    41504607          puhInterDirNeighbours[uiArrayAddr] = 1;
     4608#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     4609          pcMvFieldNeighbours[ ( uiArrayAddr << 1 ) + 1 ].setMvField( TComMv(0,0), NOT_VALID );
     4610#endif
    41514611        }
    41524612      }
     
    41544614      {
    41554615        puhInterDirNeighbours[uiArrayAddr] = 1;
    4156       }
    4157 #if LGE_DVMCP
     4616#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     4617        pcMvFieldNeighbours[ ( uiArrayAddr << 1 ) + 1 ].setMvField( TComMv(0,0), NOT_VALID );
     4618#endif
     4619      }
     4620#if LGE_DVMCP_A0126
    41584621      pcMvFieldNeighbours[uiArrayAddr<<1    ].getMv().m_bDvMcp = false;
    41594622      pcMvFieldNeighbours[(uiArrayAddr<<1)+1].getMv().m_bDvMcp = false;
     
    43914854      pcMvFieldNeighbours[(uiArrayAddr << 1) + 1].setMvField(TComMv(0, 0), r);
    43924855    }
     4856#if FIX_CU_BASED_MRG_CAND_LIST_B0136
     4857    else
     4858    {
     4859      pcMvFieldNeighbours[ ( uiArrayAddr << 1 ) + 1 ].setMvField( TComMv(0,0), NOT_VALID );
     4860    }
     4861#endif
    43934862    uiArrayAddr++;
    43944863  }
     
    46365105  return m_pcSlice->getSPS()->getAMVPMode(m_puhDepth[uiIdx]);
    46375106}
    4638 #if QC_MULTI_DIS_CAN
     5107#if QC_MULTI_DIS_CAN_A0097
    46395108/** construct a list of disparity motion vectors from the neighbouring PUs **/
    46405109Void TComDataCU::getDisMvpCand ( UInt uiPartIdx, UInt uiPartAddr,DisInfo* pDInfo )
     
    46675136      {
    46685137        Int refViewIdx  = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId);
    4669 #if VSP_N & VSP_BUGFIX
    4670         Int refPOC = pcTmpCU->getSlice()->getRefPOC( eRefPicList, refId);
    4671         //if( !pcTmpCU->isVspRef( eRefPicList, refId ) )
    4672         if ( refViewIdx!= m_pcSlice->getViewId() || refPOC != m_pcSlice->getPOC())
    4673 #else
    46745138        if (refViewIdx!= m_pcSlice->getViewId())
    4675 #endif
    46765139        {
    46775140           TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
     
    46995162      {
    47005163        Int refViewIdx  = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId);
    4701 #if VSP_N & VSP_BUGFIX
    4702         Int refPOC = pcTmpCU->getSlice()->getRefPOC( eRefPicList, refId);
    4703         //if( !pcTmpCU->isVspRef( eRefPicList, refId ) )
    4704         if ( refViewIdx!= m_pcSlice->getViewId() || refPOC != m_pcSlice->getPOC())
    4705 #else
    47065164        if (refViewIdx!= m_pcSlice->getViewId())
    4707 #endif
    47085165        {
    47095166           TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
     
    47315188      {
    47325189        Int refViewIdx  = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId);
    4733 #if VSP_N & VSP_BUGFIX
    4734         Int refPOC = pcTmpCU->getSlice()->getRefPOC( eRefPicList, refId);
    4735         //if( !pcTmpCU->isVspRef( eRefPicList, refId ) )
    4736         if ( refViewIdx!= m_pcSlice->getViewId() || refPOC != m_pcSlice->getPOC())
    4737 #else
    47385190        if (refViewIdx!= m_pcSlice->getViewId())
    4739 #endif
    47405191        {
    47415192           TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
     
    47625213      {
    47635214        Int refViewIdx  = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId);
    4764 #if VSP_N & VSP_BUGFIX
    4765         Int refPOC = pcTmpCU->getSlice()->getRefPOC( eRefPicList, refId);
    4766         //if( !pcTmpCU->isVspRef( eRefPicList, refId ) )
    4767         if ( refViewIdx!= m_pcSlice->getViewId() || refPOC != m_pcSlice->getPOC())
    4768 #else
    47695215        if (refViewIdx!= m_pcSlice->getViewId())
    4770 #endif
    47715216        {
    47725217           TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
     
    47965241      {
    47975242        Int refViewIdx  = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId);
    4798 #if VSP_N & VSP_BUGFIX
    4799         Int refPOC = pcTmpCU->getSlice()->getRefPOC( eRefPicList, refId);
    4800         //if( !pcTmpCU->isVspRef( eRefPicList, refId ) )
    4801         if ( refViewIdx!= m_pcSlice->getViewId() || refPOC != m_pcSlice->getPOC())
    4802 #else
    48035243        if (refViewIdx!= m_pcSlice->getViewId())
    4804 #endif
    48055244        {
    48065245           TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
     
    49925431}
    49935432
    4994 #if LGE_DVMCP
    4995 Void TComDataCU::getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr,DisInfo* pDInfo, Bool bMerge, RefPicList eRefPicList0, Int iRefIdx0 )
     5433#if LGE_DVMCP_A0126
     5434#if QC_SIMPLE_NBDV_B0047
     5435Void TComDataCU::getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr,DisInfo* pDInfo
     5436#if LGE_IVMP_PARALLEL_MERGE_B0136
     5437                                , Bool bParMerge
     5438#endif
     5439#else
     5440Void TComDataCU::getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr,DisInfo* pDInfo, Bool bMerge, RefPicList eRefPicList0, Int iRefIdx0
     5441#if LGE_IVMP_PARALLEL_MERGE_B0136
     5442                                , Bool bParMerge
     5443#endif
     5444#endif
     5445                                )
    49965446{
    49975447  PartSize eCUMode = getPartitionSize( uiPartAddr );
    49985448  TComDataCU* pcTmpCU = NULL;
     5449#if !QC_SIMPLE_NBDV_B0047
    49995450  TComDataCU* pcCULeft = NULL;
     5451#endif
    50005452  pDInfo->iN = 0;
    50015453
     
    50055457  UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth();
    50065458
    5007   Int   aiDvMcpDvCand[2][7] = {{0,},    {0,}}; // dummy, 5 spatial + 1 temporal, DV-MCP ÁÖº¯ ºúÓ°¿¡¼­ »ç¿EÈ DV¸¦ ÀúÀE
     5459#if QC_SIMPLE_NBDV_B0047
     5460  const Int iNumofDvMCP = 7;
     5461  Int   aiDvMcpDvCand[2][iNumofDvMCP] = {{0,},    {0,}}; // dummy, 5 spatial + 1 temporal
     5462  Bool  abDvMcpFlag  [2][iNumofDvMCP] = {{false,},{false,}};
     5463#else
     5464  Int   aiDvMcpDvCand[2][7] = {{0,},    {0,}}; // dummy, 5 spatial + 1 temporal
    50085465  Bool  abDvMcpFlag  [2][7] = {{false,},{false,}};
    50095466  //Int   aiRefPOC     [2][7] = {{-1,},{-1}}; // debug
     5467#endif
    50105468  TComMv cTmpMvPred, cMv;
    50115469  Bool  bTmpIsSkipped = false;
    50125470  Bool  bDvMcpIsFound = false;
     5471#if LGE_DVMCP_MEM_REDUCTION_B0135
     5472  Int iLCUAddrDiff = 0;
     5473#endif
     5474
     5475#if LGE_IVMP_PARALLEL_MERGE_B0136
     5476  Int xP, yP, nPSW, nPSH;
     5477  if( bParMerge)
     5478    this->getPartPosition(uiPartIdx, xP, yP, nPSW, nPSH);
     5479#endif
    50135480
    50145481  deriveLeftRightTopIdxGeneral( eCUMode, uiPartAddr, uiPartIdx, uiPartIdxLT, uiPartIdxRT );
     
    50215488  pcTmpCU = getPULeft(uiIdx, uiPartIdxLB);
    50225489#endif
    5023 
     5490#if DV_DERIVATION_PARALLEL_B0096
     5491  if ( uiPartIdx == 1 && (eCUMode == SIZE_Nx2N || eCUMode == SIZE_nLx2N || eCUMode == SIZE_nRx2N) )
     5492  {
     5493    pcTmpCU = NULL;
     5494  }
     5495#endif
     5496#if LGE_IVMP_PARALLEL_MERGE_B0136
     5497  if (pcTmpCU && bParMerge)
     5498  {
     5499    if (!pcTmpCU->isDiffMER(xP -1, yP+nPSH-1, xP, yP))
     5500    {
     5501      pcTmpCU = NULL;
     5502    }
     5503  }
     5504#endif
     5505
     5506#if !QC_SIMPLE_NBDV_B0047
    50245507  pcCULeft = pcTmpCU;
    50255508  UInt uiLeftPartIdx = uiIdx;
     5509#endif
     5510
    50265511  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) )
    50275512  {
     
    50425527          return;
    50435528        }
     5529        else // MCP
     5530        {
    50445531#if VSP_N & VSP_BUGFIX
    5045         else if (pcTmpCU->getSlice()->getRefPOC( eRefPicList, refId) != m_pcSlice->getPOC()) // MCP
    5046 #else
    5047         else // MCP
    5048 #endif
    5049         {
     5532          if (pcTmpCU->getSlice()->getRefPOC( eRefPicList, refId) != m_pcSlice->getPOC())
     5533          {
     5534#endif
    50505535          cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
    50515536          if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped )
     
    50555540            bDvMcpIsFound = true;
    50565541          }
     5542#if VSP_N & VSP_BUGFIX
     5543          }
     5544#endif
    50575545        }
    50585546      }
     
    50655553  pcTmpCU = getPUAbove(uiIdx, uiPartIdxRT);
    50665554#endif
     5555#if DV_DERIVATION_PARALLEL_B0096
     5556  if ( uiPartIdx == 1 && (eCUMode == SIZE_2NxN || eCUMode == SIZE_2NxnU || eCUMode == SIZE_2NxnD) )
     5557  {
     5558    pcTmpCU = NULL;
     5559  }
     5560#endif
     5561#if LGE_IVMP_PARALLEL_MERGE_B0136
     5562  if (pcTmpCU && bParMerge)
     5563  {
     5564    if (!pcTmpCU->isDiffMER(xP+nPSW-1, yP-1, xP, yP))
     5565    {
     5566      pcTmpCU = NULL;
     5567    }
     5568  }
     5569#endif
    50675570
    50685571  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ))
    50695572  {
     5573#if LGE_DVMCP_MEM_REDUCTION_B0135
     5574    iLCUAddrDiff = getAddr() - pcTmpCU->getAddr();
     5575#endif
    50705576    bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx );
    50715577    for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)
     
    50845590          return;
    50855591        }
     5592#if LGE_DVMCP_MEM_REDUCTION_B0135
     5593        else if(iLCUAddrDiff == 0) //MCP, within same LCU
     5594#else
     5595        else // MCP
     5596#endif
     5597        {
    50865598#if VSP_N & VSP_BUGFIX
    5087         else if (pcTmpCU->getSlice()->getRefPOC( eRefPicList, refId) != m_pcSlice->getPOC()) // MCP
    5088 #else
    5089         else // MCP
    5090 #endif
    5091         {
     5599          if(pcTmpCU->getSlice()->getRefPOC( eRefPicList, refId) != m_pcSlice->getPOC())
     5600          {
     5601#endif
    50925602          cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
    50935603          if( cTmpMvPred.m_bDvMcp  && bTmpIsSkipped )
     
    50975607            bDvMcpIsFound = true;
    50985608          }
     5609#if VSP_N & VSP_BUGFIX
     5610          }
     5611#endif
    50995612        }
    51005613      }
     
    51075620  pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true, true, true);
    51085621#endif
     5622#if LGE_IVMP_PARALLEL_MERGE_B0136
     5623  if (pcTmpCU && bParMerge)
     5624  {
     5625    if (!pcTmpCU->isDiffMER(xP+nPSW, yP-1, xP, yP))
     5626    {
     5627      pcTmpCU = NULL;
     5628    }
     5629  }
     5630#endif
     5631
    51095632  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) )
    51105633  {
     5634#if LGE_DVMCP_MEM_REDUCTION_B0135
     5635    iLCUAddrDiff = getAddr() - pcTmpCU->getAddr();
     5636#endif
    51115637    bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx );
    51125638    for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)
     
    51255651          return;
    51265652        }
     5653#if LGE_DVMCP_MEM_REDUCTION_B0135
     5654        else if(iLCUAddrDiff == 0)
     5655#else
     5656        else  // MCP
     5657#endif
     5658        {
    51275659#if VSP_N & VSP_BUGFIX
    5128         else if (pcTmpCU->getSlice()->getRefPOC( eRefPicList, refId) != m_pcSlice->getPOC()) // MCP
    5129 #else
    5130         else // MCP
    5131 #endif
    5132         {
     5660          if (pcTmpCU->getSlice()->getRefPOC( eRefPicList, refId) != m_pcSlice->getPOC())
     5661          {
     5662#endif
    51335663          cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
    51345664          if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped )
     
    51385668            bDvMcpIsFound = true;
    51395669          }
     5670#if VSP_N & VSP_BUGFIX
     5671          }
     5672#endif
    51405673        }
    51415674      }
     
    51475680#else
    51485681  pcTmpCU = getPUBelowLeft(uiIdx, uiPartIdxLB);
     5682#endif
     5683#if LGE_IVMP_PARALLEL_MERGE_B0136
     5684  if (pcTmpCU && bParMerge)
     5685  {
     5686    if (!pcTmpCU->isDiffMER(xP-1, yP+nPSH, xP, yP))
     5687    {
     5688      pcTmpCU = NULL;
     5689    }
     5690  }
    51495691#endif
    51505692  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ))
     
    51665708          return;
    51675709        }
     5710        else // MCP
     5711        {
    51685712#if VSP_N & VSP_BUGFIX
    5169         else if (pcTmpCU->getSlice()->getRefPOC( eRefPicList, refId) != m_pcSlice->getPOC()) // MCP
    5170 #else
    5171         else // MCP
    5172 #endif
    5173         {
     5713          if (pcTmpCU->getSlice()->getRefPOC( eRefPicList, refId) != m_pcSlice->getPOC())
     5714          {
     5715#endif
    51745716          cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
    51755717          if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped )
     
    51795721            bDvMcpIsFound = true;
    51805722          }
     5723#if VSP_N & VSP_BUGFIX
     5724          }
     5725#endif
    51815726        }
    51825727      }
     
    51915736  pcTmpCU = getPUAboveLeft(uiIdx, uiPartIdxLT, true, true, true);
    51925737#endif
     5738#if LGE_IVMP_PARALLEL_MERGE_B0136
     5739  if (pcTmpCU && bParMerge)
     5740  {
     5741    if (!pcTmpCU->isDiffMER(xP-1, yP-1, xP, yP))
     5742    {
     5743      pcTmpCU = NULL;
     5744    }
     5745  }
     5746#endif
     5747
    51935748  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ))
    51945749  {
     5750#if LGE_DVMCP_MEM_REDUCTION_B0135
     5751    iLCUAddrDiff = getAddr() - pcTmpCU->getAddr();
     5752#endif
    51955753    bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx );
    51965754    for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)
     
    52095767          return;
    52105768        }
     5769#if LGE_DVMCP_MEM_REDUCTION_B0135
     5770        else if(iLCUAddrDiff <= 1)
     5771#else
     5772        else // MCP
     5773#endif
     5774        {
    52115775#if VSP_N & VSP_BUGFIX
    5212         else if (pcTmpCU->getSlice()->getRefPOC( eRefPicList, refId) != m_pcSlice->getPOC()) // MCP
    5213 #else
    5214         else // MCP
    5215 #endif
    5216         {
     5776          if (pcTmpCU->getSlice()->getRefPOC( eRefPicList, refId) != m_pcSlice->getPOC())
     5777          {
     5778#endif
    52175779          cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
    52185780          if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped )
     
    52225784            bDvMcpIsFound = true;
    52235785          }
     5786#if VSP_N & VSP_BUGFIX
     5787          }
     5788#endif
    52245789        }
    52255790      }
     
    52305795  if ( getSlice()->getPPS()->getEnableTMVPFlag() )
    52315796  {
     5797#if !QC_SIMPLE_NBDV_B0047
    52325798    UInt uiPUIdx = uiPartIdx;
    52335799    UInt uiAbsPartAddr = uiPartAddr;
     
    53875953      }
    53885954    }
     5955#else
     5956    TComMv cColMv;
     5957    Int iTargetViewIdx = 0;
     5958    Int iTStartViewIdx = 0;
     5959    UInt uiPartIdxRB, uiBRIdx;
     5960    Int uiViewIdxCurr= getSlice()->getViewId();
     5961    UInt uiPartIdxCenter;
     5962    xDeriveCenterIdx( eCUMode, uiPartIdx, uiPartIdxCenter );
     5963
     5964    Int uiLCUIdx = getAddr();
     5965    Int uiLCUnew = uiLCUIdx;
     5966    eCUMode = getPartitionSize( 0 );
     5967    deriveRightBottomIdx( eCUMode, uiPartIdx, uiPartIdxRB ); 
     5968    uiBRIdx = uiPartIdxLT;
     5969    UInt uiAbsPartIdxTmp = g_auiZscanToRaster[uiPartIdxRB];
     5970    if ( (( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() ) < m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) &&(( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() ) < m_pcSlice->getSPS()->getPicHeightInLumaSamples() ))  // image boundary check
     5971    {
     5972      if ( ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) &&           // is not at the last column of LCU
     5973      ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) ) // is not at the last row    of LCU
     5974      {
     5975        uiBRIdx = g_auiRasterToZscan[ uiAbsPartIdxTmp + uiNumPartInCUWidth + 1 ];
     5976      }
     5977      else if ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 )           // is not at the last column of LCU But is last row of LCU
     5978      {
     5979        uiBRIdx = g_auiRasterToZscan[ (uiAbsPartIdxTmp + uiNumPartInCUWidth + 1) % m_pcPic->getNumPartInCU() ];
     5980        uiLCUnew = uiLCUIdx + m_pcPic->getFrameWidthInCU();
     5981      }
     5982      else if ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) // is not at the last row of LCU But is last column of LCU
     5983      {
     5984        uiBRIdx = g_auiRasterToZscan[ uiAbsPartIdxTmp + 1 ];
     5985        uiLCUnew = uiLCUIdx + 1;
     5986      }
     5987      else //is the right bottom corner of LCU                       
     5988      {
     5989        uiBRIdx = 0;
     5990        uiLCUnew = uiLCUIdx + m_pcPic->getFrameWidthInCU() + 1;
     5991      }
     5992    }
     5993    const Int iNumofCandPic = 2;
     5994    for(Int i =0; i < iNumofCandPic; i++)
     5995    {
     5996      Int lpRef=0;
     5997      if(i == 0)
     5998      {   //check the col-located picture
     5999        eRefPicList = RefPicList(getSlice()->isInterB() ? getSlice()->getColDir() : 0);
     6000#if COLLOCATED_REF_IDX
     6001        lpRef = getSlice()->getColRefIdx();
     6002#else
     6003        Int lpRef = 0;
     6004#endif
     6005      }
     6006      else
     6007      {
     6008        if(!(getPic()->getRapbCheck()))
     6009          break;
     6010        eRefPicList=getPic()->getRapRefList();
     6011        lpRef=getPic()->getRapRefIdx();
     6012      }
     6013
     6014      if( m_pcSlice->getViewId() == getSlice()->getRefPic( eRefPicList, lpRef)->getViewId() )
     6015      {
     6016        if (uiViewIdxCurr > 1) 
     6017        {
     6018          if( (uiLCUnew >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUnew, uiBRIdx, cColMv, iTargetViewIdx, iTStartViewIdx)) )
     6019          {
     6020            clipMv(cColMv);
     6021            pDInfo->m_acMvCand[pDInfo->iN] = cColMv;
     6022            pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx;
     6023            return ;
     6024          }
     6025        }
     6026
     6027        if(xGetColDisMV( eRefPicList, lpRef, uiLCUIdx, uiPartIdxCenter,  cColMv, iTargetViewIdx, iTStartViewIdx ))
     6028        {
     6029          clipMv(cColMv);
     6030          pDInfo->m_acMvCand[pDInfo->iN] = cColMv;
     6031          pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx;
     6032          return ;
     6033        }
     6034        if(uiViewIdxCurr == 1) 
     6035        {
     6036          if( (uiLCUnew >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUnew, uiBRIdx, cColMv, iTargetViewIdx, iTStartViewIdx)) )
     6037          {
     6038            clipMv(cColMv);
     6039            pDInfo->m_acMvCand[pDInfo->iN] = cColMv;
     6040            pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx;
     6041            return ;
     6042          }
     6043        }
     6044      }
     6045    }
     6046#endif
    53896047  } // if TMVP Flag
    53906048
    53916049  if( bDvMcpIsFound ) // skip dvmcp
    53926050  {
     6051#if QC_SIMPLE_NBDV_B0047
     6052    for( Int i=1 ; i<iNumofDvMCP-1 ; i++ ) // 5 spatial
     6053#else
    53936054    for( Int i=1 ; i<7 ; i++ ) // 5 spatial + 1 temporal
     6055#endif
    53946056    {
    53956057      for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)
     
    54076069    }
    54086070  }
    5409 
    54106071  return;
    5411 
    5412 }
    5413 #endif
    5414 
     6072}
     6073#endif
    54156074#endif
    54166075
     
    54226081 * \param pInfo
    54236082 */
     6083#if SHARP_INTERVIEW_DECOUPLE_B0111
     6084Void TComDataCU::fillMvpCand ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo, Int iMVPIdx)
     6085{
     6086  if (!m_pcSlice->getSPS()->getViewId() || !m_pcSlice->getSPS()->getMultiviewMvPredMode())
     6087  {
     6088    // HEVC
     6089    fillMvpCandBase(uiPartIdx, uiPartAddr, eRefPicList, iRefIdx, pInfo);
     6090  }
     6091  else
     6092  {
     6093    if (iMVPIdx!=0)
     6094    {
     6095      // HEVC part
     6096      fillMvpCandBase(uiPartIdx, uiPartAddr, eRefPicList, iRefIdx, pInfo);
     6097      if (iRefIdx < 0)
     6098      {
     6099        return;
     6100      }
     6101      for (Int j = AMVP_MAX_NUM_CANDS - 1; j >= 0; j--)
     6102      {
     6103        pInfo->m_acMvCand[j+1] = pInfo->m_acMvCand[j];
     6104      }
     6105      pInfo->iN++;
     6106    }
     6107    if (iMVPIdx<=0)
     6108    {
     6109      // extention part
     6110      DisInfo cDisInfo;
     6111      cDisInfo.iN = 0;
     6112#if LGE_DVMCP_A0126
     6113#if QC_SIMPLE_NBDV_B0047
     6114#if FIX_LGE_IVMP_PARALLEL_MERGE_B0136
     6115      getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo, false);
     6116#else
     6117      getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo);
     6118#endif
     6119#else
     6120      getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo, false, eRefPicList, iRefIdx );
     6121#endif
     6122#else
     6123      getDisMvpCand (uiPartIdx, uiPartAddr, &cDisInfo );
     6124#endif
     6125      if(cDisInfo.iN==0)
     6126      {
     6127        cDisInfo.iN = 1;
     6128        cDisInfo.m_acMvCand[0].setHor(0);
     6129        cDisInfo.m_acMvCand[0].setVer(0);
     6130        cDisInfo.m_aVIdxCan[0] = 0;
     6131      }
     6132      TComMv  cPdmMvPred;
     6133#if QC_MULTI_DIS_CAN_A0097
     6134      if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) )
     6135#else
     6136      if( getPdmMvPred( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred ) )
     6137#endif
     6138      {
     6139        clipMv( cPdmMvPred );
     6140        pInfo->m_acMvCand[0] = cPdmMvPred;
     6141      }
     6142      else
     6143      {
     6144        pInfo->m_acMvCand[0].set(0,0);
     6145      }
     6146    }
     6147  }
     6148}
     6149
     6150
     6151Void TComDataCU::fillMvpCandBase( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo )
     6152#else
    54246153Void TComDataCU::fillMvpCand ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo )
     6154#endif
    54256155{
    54266156  PartSize eCUMode = getPartitionSize( 0 );
     
    54356165  }
    54366166 
    5437 #if QC_MULTI_DIS_CAN
     6167#if QC_MULTI_DIS_CAN_A0097 && !SHARP_INTERVIEW_DECOUPLE_B0111
    54386168  DisInfo cDisInfo;
    54396169  cDisInfo.iN = 0;
    54406170  if(m_pcSlice->getSPS()->getViewId() && m_pcSlice->getSPS()->getMultiviewMvPredMode())
    54416171  {
    5442 #if LGE_DVMCP
     6172#if LGE_DVMCP_A0126
     6173#if QC_SIMPLE_NBDV_B0047
     6174#if FIX_LGE_IVMP_PARALLEL_MERGE_B0136
     6175    getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo, false);
     6176#else
     6177    getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo);
     6178#endif
     6179#else
    54436180    getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo, false, eRefPicList, iRefIdx );
     6181#endif
    54446182#else
    54456183    getDisMvpCand (uiPartIdx, uiPartAddr, &cDisInfo );
     
    54546192  }
    54556193#endif
    5456 #if HHI_INTER_VIEW_MOTION_PRED
     6194#if HHI_INTER_VIEW_MOTION_PRED && !SHARP_INTERVIEW_DECOUPLE_B0111
    54576195#if ( PDM_AMVP_POS == 0 )
    54586196  // get inter-view mv predictor (at position 0)
    54596197  TComMv  cPdmMvPred;
    5460 #if QC_MULTI_DIS_CAN
     6198#if QC_MULTI_DIS_CAN_A0097
    54616199  if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) )
    54626200#else
     
    55136251  }
    55146252
    5515 #if HHI_INTER_VIEW_MOTION_PRED
     6253#if HHI_INTER_VIEW_MOTION_PRED && !SHARP_INTERVIEW_DECOUPLE_B0111
    55166254#if ( PDM_AMVP_POS == 1 )
    55176255  // get inter-view mv predictor (at position 1)
    55186256  TComMv  cPdmMvPred;
    5519 #if QC_MULTI_DIS_CAN
     6257#if QC_MULTI_DIS_CAN_A0097
    55206258  if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) )
    55216259#else
     
    55656303  }
    55666304
    5567 #if HHI_INTER_VIEW_MOTION_PRED
     6305#if HHI_INTER_VIEW_MOTION_PRED && !SHARP_INTERVIEW_DECOUPLE_B0111
    55686306#if ( PDM_AMVP_POS == 2 )
    55696307  // get inter-view mv predictor (at position 2)
    55706308  TComMv  cPdmMvPred;
    5571 #if QC_MULTI_DIS_CAN
     6309#if QC_MULTI_DIS_CAN_A0097
    55726310  if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) )
    55736311#else
     
    55876325    {
    55886326      pInfo->iN = 1;
    5589     }
    5590   }
    5591 #if  QC_MULTI_DIS_CAN
     6327#if FIX_MISUSE_REFINDEX
     6328      pInfo->m_acMvCand[ 1 ].set(0, 0);
     6329#endif
     6330    }
     6331  }
     6332#if QC_MULTI_DIS_CAN_A0097 && !SHARP_INTERVIEW_DECOUPLE_B0111
    55926333  if ( getSlice()->getViewId()!=0 && pInfo->iN == 3 )
    55936334  {
     
    56636404    if ( uiLCUIdx >= 0 && xGetColMVP( eRefPicList, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx_Col ) )
    56646405    {
     6406#if FIX_LGE_DVMCP_B0133
     6407      cColMv.m_bDvMcp = false;
     6408#endif
    56656409      pInfo->m_acMvCand[pInfo->iN++] = cColMv;
    56666410    }
     
    56726416      if (xGetColMVP( eRefPicList, uiCurLCUIdx, uiPartIdxCenter,  cColMv, iRefIdx_Col ))
    56736417      {
     6418#if FIX_LGE_DVMCP_B0133
     6419        cColMv.m_bDvMcp = false;
     6420#endif
    56746421        pInfo->m_acMvCand[pInfo->iN++] = cColMv;
    56756422      }
     
    56786425  }
    56796426
    5680 #if HHI_INTER_VIEW_MOTION_PRED
     6427#if HHI_INTER_VIEW_MOTION_PRED && !SHARP_INTERVIEW_DECOUPLE_B0111
    56816428#if ( PDM_AMVP_POS == 3 )
    56826429  // get inter-view mv predictor (at position 3)
    56836430  TComMv  cPdmMvPred;
    5684 #if QC_MULTI_DIS_CAN
     6431#if QC_MULTI_DIS_CAN_A0097
    56856432  if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) )
    56866433#else
     
    56996446#endif
    57006447
    5701 #if HHI_INTER_VIEW_MOTION_PRED
     6448#if HHI_INTER_VIEW_MOTION_PRED && !SHARP_INTERVIEW_DECOUPLE_B0111
    57026449  const Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 );
    57036450  if (pInfo->iN > iNumAMVPCands)
     
    59536700  {
    59546701    TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
    5955 #if LGE_DVMCP
     6702#if LGE_DVMCP_A0126
    59566703    cMvPred.m_bDvMcp = false;
    59576704#endif
     
    59826729  if( pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) >= 0 )
    59836730  {
    5984     if( pcTmpCU->getSlice()->getRefViewId( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) ) != m_pcSlice->getRefViewId( eRefPicList, iRefIdx ) )
    5985     {
    5986       return false;
    5987     }
    59886731#if VSP_N ///
    59896732    if( pcTmpCU->isVspRef( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) ) )
    59906733      return false;
    59916734#endif
     6735#if QC_IV_AS_LT_B0046
     6736    Bool bIsCurrRefLongTerm = m_pcSlice->getRefPic( eRefPicList, iRefIdx)->getIsLongTerm();
     6737    Bool bIsNeibRefLongTerm = m_pcSlice->getRefPic( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx))->getIsLongTerm();
     6738    iNeibRefPOC = pcTmpCU->getSlice()->getRefPOC( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) );
     6739    if ( (bIsCurrRefLongTerm == bIsNeibRefLongTerm) && (iNeibRefPOC == iCurrRefPOC) )
     6740#else
     6741    if( pcTmpCU->getSlice()->getRefViewId( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) ) != m_pcSlice->getRefViewId( eRefPicList, iRefIdx ) )
     6742    {
     6743      return false;
     6744    }
    59926745    iNeibRefPOC = pcTmpCU->getSlice()->getRefPOC( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) );
    59936746    if( iNeibRefPOC == iCurrRefPOC ) // Same Reference Frame But Diff List//
     6747#endif
    59946748    {
    59956749      TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList2nd)->getMv(uiIdx);
    5996 #if LGE_DVMCP
     6750#if LGE_DVMCP_A0126
    59976751      cMvPred.m_bDvMcp = false;
    59986752#endif
     
    61386892  Int iNeibRefPOC;
    61396893
     6894#if QC_IV_AS_LT_B0046
     6895  Bool bIsCurrRefLongTerm = m_pcSlice->getRefPic( eRefPicList, iRefIdx)->getIsLongTerm();
     6896  Bool bIsNeibRefLongTerm = false;
     6897#endif
    61406898  if( pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) >= 0 )
    61416899  {
    6142     iNeibRefPOC = pcTmpCU->getSlice()->getRefPOC( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) );
    6143     if( pcTmpCU->getSlice()->getRefViewId( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) ) != m_pcSlice->getRefViewId( eRefPicList, iRefIdx ) )
    6144       return false;
    61456900#if VSP_N ///
    61466901    if( pcTmpCU->isVspRef( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) ) )
    61476902      return false;
    61486903#endif
     6904    iNeibRefPOC = pcTmpCU->getSlice()->getRefPOC( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) );
     6905#if QC_IV_AS_LT_B0046
     6906    bIsNeibRefLongTerm = m_pcSlice->getRefPic( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx))->getIsLongTerm() ;
     6907    if ( (bIsCurrRefLongTerm == bIsNeibRefLongTerm) && (iNeibRefPOC == iCurrRefPOC) )
     6908#else
     6909    if( pcTmpCU->getSlice()->getRefViewId( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) ) != m_pcSlice->getRefViewId( eRefPicList, iRefIdx ) )
     6910      return false;
    61496911    if( iNeibRefPOC == iCurrRefPOC ) // Same Reference Frame But Diff List//
     6912#endif
    61506913    {
    61516914      TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList2nd)->getMv(uiIdx);
    6152 #if LGE_DVMCP
     6915#if LGE_DVMCP_A0126
    61536916      cMvPred.m_bDvMcp = false;
    61546917#endif
     
    61656928    TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
    61666929    TComMv rcMv;
    6167 
     6930#if QC_IV_AS_LT_B0046
     6931    bIsNeibRefLongTerm = m_pcSlice->getRefPic( eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx))->getIsLongTerm();
     6932    if ( bIsCurrRefLongTerm == bIsNeibRefLongTerm )
     6933    {
     6934#else
    61686935    if( pcTmpCU->getSlice()->getRefViewId( eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ) != m_pcSlice->getRefViewId( eRefPicList, iRefIdx ) )
    61696936    {
    61706937      return false;
    61716938    }
     6939#endif
    61726940#if VSP_N ///
    61736941    if( pcTmpCU->isVspRef( eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ) )
     
    61926960      rcMv = cMvPred.scaleMv( iScale );
    61936961    }
    6194 #if LGE_DVMCP
     6962#if LGE_DVMCP_A0126
    61956963    rcMv.m_bDvMcp = false;
    61966964#endif
    61976965    pInfo->m_acMvCand[ pInfo->iN++] = rcMv;
    61986966    return true;
     6967#if QC_IV_AS_LT_B0046
     6968    }
     6969#endif
    61996970  }
    62006971  //---------------------- V2(END) --------------------//
     
    62046975    TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList2nd)->getMv(uiIdx);
    62056976    TComMv rcMv;
    6206 
     6977#if QC_IV_AS_LT_B0046
     6978    bIsNeibRefLongTerm = m_pcSlice->getRefPic( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx))->getIsLongTerm(); ;
     6979    if ( bIsCurrRefLongTerm == bIsNeibRefLongTerm )
     6980    {
     6981#else
    62076982    if( pcTmpCU->getSlice()->getRefViewId( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) ) != m_pcSlice->getRefViewId( eRefPicList, iRefIdx ) )
    62086983    {
    62096984      return false;
    62106985    }
     6986#endif
    62116987#if VSP_N ///
    62126988    if( pcTmpCU->isVspRef( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) ) )
     
    62317007      rcMv = cMvPred.scaleMv( iScale );
    62327008    }
    6233 #if LGE_DVMCP
     7009#if LGE_DVMCP_A0126
    62347010    rcMv.m_bDvMcp = false;
    62357011#endif
    62367012    pInfo->m_acMvCand[ pInfo->iN++] = rcMv;
    62377013    return true;
     7014#if QC_IV_AS_LT_B0046
     7015  }
     7016#endif
    62387017  }
    62397018  //---------------------- V3(END) --------------------//
     
    62417020}
    62427021
    6243 #if QC_MULTI_DIS_CAN
     7022#if QC_MULTI_DIS_CAN_A0097
    62447023Bool TComDataCU::xGetColDisMV( RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv , Int & iTargetViewIdx, Int & iStartViewIdx )
    62457024{
    6246 #if LGE_DVMCP
     7025#if LGE_DVMCP_A0126 && !QC_SIMPLE_NBDV_B0047
    62477026  Int  iDvMcpDispX[2] = {-1,};
    62487027  Bool bDvMcpFlag [2] = { false, };
     
    62697048    return false;
    62707049  }
    6271 #if LGE_DVMCP
     7050#if LGE_DVMCP_A0126 && !QC_SIMPLE_NBDV_B0047
    62727051  Bool bColIsSkipped = pColCU->isSkipped( uiAbsPartAddr );
    62737052#endif
     
    62997078    if ( iColViewIdx    == iColRefViewIdx ) // temporal vector
    63007079    {
    6301 #if LGE_DVMCP
     7080#if LGE_DVMCP_A0126 && !QC_SIMPLE_NBDV_B0047
    63027081      if( iColViewIdx >0 )
    63037082      {
     
    63177096    {
    63187097      rcMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiAbsPartAddr);
    6319 #if LGE_DVMCP
     7098#if LGE_DVMCP_A0126
    63207099      rcMv.m_bDvMcp = false;
    63217100#endif
     
    63267105  }
    63277106
    6328 #if LGE_DVMCP
     7107#if LGE_DVMCP_A0126 && !QC_SIMPLE_NBDV_B0047
    63297108  for( Int ilist=0 ; ilist<2 ; ilist++ )
    63307109  {
     
    63577136  RefPicList  eColRefPicList;
    63587137  Int iColPOC, iColRefPOC, iCurrPOC, iCurrRefPOC, iScale;
    6359 #if SONY_COLPIC_AVAILABILITY
     7138#if SONY_COLPIC_AVAILABILITY || VSP_N
     7139#if QC_IV_AS_LT_B0046
     7140  Int iColViewOrderIdx, iCurrViewOrderIdx, iCurrRefViewOrderIdx;
     7141#else
    63607142  Int iColViewOrderIdx, iColRefViewOrderIdx, iCurrViewOrderIdx, iCurrRefViewOrderIdx;
    63617143#endif
     7144#endif
    63627145  TComMv cColMv;
    63637146
    6364 #if SONY_COLPIC_AVAILABILITY
    6365   iCurrViewOrderIdx    = m_pcSlice->getViewOrderIdx();
    6366   iCurrRefViewOrderIdx = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewOrderIdx();
    6367 #endif
    63687147  // use coldir.
    63697148#if COLLOCATED_REF_IDX
     
    63797158  iCurrPOC = m_pcSlice->getPOC();   
    63807159  iCurrRefPOC = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getPOC();
    6381   iColPOC = pColCU->getSlice()->getPOC(); 
    6382 #if SONY_COLPIC_AVAILABILITY
     7160  iColPOC = pColCU->getSlice()->getPOC();
     7161
     7162#if SONY_COLPIC_AVAILABILITY || VSP_N
     7163  iCurrViewOrderIdx    = m_pcSlice->getViewOrderIdx();
     7164  iCurrRefViewOrderIdx = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewOrderIdx();
    63837165  iColViewOrderIdx = pColCU->getSlice()->getViewOrderIdx();
    63847166#endif
     
    63897171  }
    63907172
    6391 #if !SONY_COLPIC_AVAILABILITY
     7173#if !SONY_COLPIC_AVAILABILITY&!QC_IV_AS_LT_B0046
    63927174  if( m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewId() != m_pcSlice->getViewId() )
    63937175    return false;
     
    64137195    }
    64147196  }
     7197 
     7198
     7199#if VSP_N
     7200  Bool bIsCurrRefVsp = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getIsVsp();
     7201  Bool bIsColRefVsp  = pColCU->getSlice()->getRefPic( eColRefPicList,pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getIsVsp();
     7202
     7203  if(bIsCurrRefVsp)
     7204  {
     7205#if (VSP_TMVP==0)
     7206    rcMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiAbsPartAddr);
     7207#elif (VSP_TMVP==1 || VSP_TMVP==2)
     7208#if !VSP_TMVP_ENABLE
     7209    if(!bIsColRefVsp) return false;
     7210#endif
     7211    rcMv.setZero();
     7212#if !VSP_MV_ZERO
     7213    if( bIsColRefVsp ) rcMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiAbsPartAddr);
     7214#endif
     7215#endif // (VSP_TMVP==1 || VSP_TMVP==2)
     7216    return true;
     7217  }
     7218  if(bIsColRefVsp)
     7219#if (VSP_TMVP==0)
     7220  {
     7221    if(iCurrPOC != iCurrRefPOC)
     7222      return false;
     7223    else
     7224    {
     7225      Int iColRefViewOrderIdx = pColCU->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewOrderIdx();
     7226      iScale = xGetDistScaleFactor(iCurrViewOrderIdx, iCurrRefViewOrderIdx, iColViewOrderIdx, iColRefViewOrderIdx);
     7227      cColMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiAbsPartAddr);
     7228      if ( iScale == 4096 )
     7229        rcMv = cColMv;
     7230      else
     7231        rcMv = cColMv.scaleMv( iScale );
     7232      return true;
     7233    }
     7234  }
     7235#elif (VSP_TMVP==1)
     7236    return false;
     7237#elif (VSP_TMVP==2)
     7238  {
     7239    for(Int i=0; i < m_pcSlice->getNumRefIdx(eRefPicList); i++)
     7240    {
     7241      if( m_pcSlice->getRefPic(eRefPicList, i)->getIsVsp() )
     7242      {
     7243        riRefIdx = i;
     7244#if VSP_MV_ZERO
     7245        rcMv.setZero();
     7246#else
     7247        rcMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiAbsPartAddr);
     7248#endif
     7249        return true;
     7250      }
     7251    }
     7252    return false;
     7253  }
     7254#endif // VSP_TMVP
     7255#endif // VSP_N
     7256
    64157257
    64167258  // Scale the vector.
    64177259  iColRefPOC = pColCU->getSlice()->getRefPOC(eColRefPicList, iColRefIdx);
    64187260
     7261#if !QC_IV_AS_LT_B0046
    64197262#if SONY_COLPIC_AVAILABILITY
    64207263  iColRefViewOrderIdx = pColCU->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewOrderIdx();
     
    64257268  }
    64267269#endif
     7270#else
     7271  Bool bIsCurrRefLongTerm = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getIsLongTerm();
     7272  Bool bIsColRefLongTerm = pColCU->getSlice()->getWasLongTerm(eColRefPicList, iColRefIdx);
     7273  if(bIsCurrRefLongTerm != bIsColRefLongTerm)
     7274  {
     7275    assert( ((iColPOC == iColRefPOC)&&(iCurrPOC != iCurrRefPOC))||((iColPOC != iColRefPOC)&&(iCurrPOC == iCurrRefPOC)));
     7276    return false;
     7277  }
     7278#endif
    64277279
    64287280  cColMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiAbsPartAddr);
    64297281
    6430   iCurrRefPOC = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getPOC();
     7282#if QC_IV_AS_LT_B0046
     7283  {
     7284    assert( ((iColPOC != iColRefPOC)&&(iCurrPOC != iCurrRefPOC))||((iColPOC == iColRefPOC)&&(iCurrPOC == iCurrRefPOC)));
     7285    if(!bIsCurrRefLongTerm)  //short-term
     7286    {
     7287      iScale = xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iColPOC, iColRefPOC);
     7288      if ( iScale == 4096 )
     7289      {
     7290        rcMv = cColMv;
     7291      }
     7292      else
     7293      {
     7294        rcMv = cColMv.scaleMv( iScale );
     7295      }
     7296    }else
     7297#if QC_MVHEVC_B0046
     7298      rcMv = cColMv; //inter-view
     7299#else
     7300    {
     7301#if SONY_COLPIC_AVAILABILITY
     7302      Int iColRefViewOrderIdx = pColCU->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewOrderIdx();
     7303      iScale = xGetDistScaleFactor(iCurrViewOrderIdx, iCurrRefViewOrderIdx, iColViewOrderIdx, iColRefViewOrderIdx);
     7304      if ( iScale == 4096 )
     7305      {
     7306        rcMv = cColMv;
     7307      }
     7308      else
     7309      {
     7310        rcMv = cColMv.scaleMv( iScale );
     7311      }
     7312#else
     7313      return false;
     7314#endif
     7315    }
     7316#endif
     7317  }
     7318#else
    64317319#if SONY_COLPIC_AVAILABILITY
    64327320  iScale = 0;
    6433   iCurrRefViewOrderIdx = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewOrderIdx();
    6434 #if VSP_N
    6435 //  UInt uiColRefViewId = pColCU->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewId();
    6436   UInt uiCurRefViewId = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewId();
    6437   if( uiCurRefViewId == m_pcSlice->getViewId() && m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getPOC() == m_pcSlice->getPOC() )
    6438     iScale = 4096;
    6439   else
    6440 #endif
     7321//  iCurrRefViewOrderIdx = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewOrderIdx();
    64417322  if((iColPOC != iColRefPOC)&&(iCurrPOC != iCurrRefPOC))
    64427323    iScale = xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iColPOC, iColRefPOC);
     
    64447325    iScale = xGetDistScaleFactor(iCurrViewOrderIdx, iCurrRefViewOrderIdx, iColViewOrderIdx, iColRefViewOrderIdx);
    64457326  else
    6446     return false;
    6447 
     7327    return false;
    64487328#else
    64497329  iScale = xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iColPOC, iColRefPOC);
     
    64517331  if ( iScale == 4096 )
    64527332  {
    6453 #if VSP_MV_ZERO
    6454     if( uiCurRefViewId == m_pcSlice->getViewId() && m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getPOC() == m_pcSlice->getPOC() )
    6455       rcMv.setZero();
    6456     else
    6457 #endif
    64587333    rcMv = cColMv;
    64597334  }
     
    64627337    rcMv = cColMv.scaleMv( iScale );
    64637338  }
    6464 
     7339#endif
    64657340  return true;
    64667341}
     
    73918266  memcpy( m_puhInterDir + uiAbsPartIdxDst, pcCU->getInterDir() + uiAbsPartIdxSrc,       sizeof( m_puhInterDir[0] ) * uiNumPartition );
    73928267
     8268#if !MTK_UNCONSTRAINED_MVI_B0083
    73938269  memcpy( m_apiMVPIdx[0] + uiAbsPartIdxDst, pcCU->getMVPIdx(REF_PIC_LIST_0) + uiAbsPartIdxSrc, sizeof(*m_apiMVPIdx[0]) * uiNumPartition );
    73948270  memcpy( m_apiMVPIdx[1] + uiAbsPartIdxDst, pcCU->getMVPIdx(REF_PIC_LIST_1) + uiAbsPartIdxSrc, sizeof(*m_apiMVPIdx[0]) * uiNumPartition );
    73958271  memcpy( m_apiMVPNum[0] + uiAbsPartIdxDst, pcCU->getMVPNum(REF_PIC_LIST_0) + uiAbsPartIdxSrc, sizeof(*m_apiMVPNum[0]) * uiNumPartition );
    73968272  memcpy( m_apiMVPNum[1] + uiAbsPartIdxDst, pcCU->getMVPNum(REF_PIC_LIST_1) + uiAbsPartIdxSrc, sizeof(*m_apiMVPNum[0]) * uiNumPartition );
     8273#endif
    73978274
    73988275  pcCU->getCUMvField( REF_PIC_LIST_0 )->copyTo( &m_acCUMvField[0], -Int(uiAbsPartIdxSrc) + uiAbsPartIdxDst, uiAbsPartIdxSrc, uiNumPartition );
    73998276  pcCU->getCUMvField( REF_PIC_LIST_1 )->copyTo( &m_acCUMvField[1], -Int(uiAbsPartIdxSrc) + uiAbsPartIdxDst, uiAbsPartIdxSrc, uiNumPartition );
     8277
     8278#if MTK_UNCONSTRAINED_MVI_B0083
     8279  if( pcCU->getSlice()->getSliceType() == P_SLICE)
     8280  {
     8281#if NTT_FIX_UNCONSTRAINED_MVI
     8282    m_acCUMvField[0].setUndefinedMv( uiAbsPartIdxDst, uiNumPartition, m_pePredMode, m_puhInterDir,  0, 1, getSlice()->getNumRefIdx( RefPicList(0) ) );
     8283    m_acCUMvField[1].setUndefinedMv( uiAbsPartIdxDst, uiNumPartition, m_pePredMode, m_puhInterDir, -1, 1, getSlice()->getNumRefIdx( RefPicList(1) ) );
     8284#else
     8285    m_acCUMvField[0].setUndefinedMv( uiAbsPartIdxDst, uiNumPartition, m_pePredMode, m_puhInterDir,  0, 1);
     8286    m_acCUMvField[1].setUndefinedMv( uiAbsPartIdxDst, uiNumPartition, m_pePredMode, m_puhInterDir, -1, 1);
     8287#endif
     8288  }
     8289  else
     8290  {
     8291#if NTT_FIX_UNCONSTRAINED_MVI
     8292    m_acCUMvField[0].setUndefinedMv( uiAbsPartIdxDst, uiNumPartition, m_pePredMode, m_puhInterDir,  0, 3, getSlice()->getNumRefIdx( RefPicList(0) ) );
     8293    m_acCUMvField[1].setUndefinedMv( uiAbsPartIdxDst, uiNumPartition, m_pePredMode, m_puhInterDir,  0, 3, getSlice()->getNumRefIdx( RefPicList(1) ) );
     8294#else
     8295    m_acCUMvField[0].setUndefinedMv( uiAbsPartIdxDst, uiNumPartition, m_pePredMode, m_puhInterDir,  0, 3);
     8296    m_acCUMvField[1].setUndefinedMv( uiAbsPartIdxDst, uiNumPartition, m_pePredMode, m_puhInterDir,  0, 3);
     8297#endif
     8298  }
     8299#endif
     8300
    74008301
    74018302#if HHI_FULL_PEL_DEPTH_MAP_MV_ACC
     
    74108311// -------------------------------------------------------------------------------------------------------------------
    74118312#if HHI_INTER_VIEW_MOTION_PRED
    7412 #if !QC_MULTI_DIS_CAN
     8313#if !QC_MULTI_DIS_CAN_A0097
    74138314Int
    74148315TComDataCU::getPdmMergeCandidate( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv )
     
    74298330#else
    74308331Int
    7431 TComDataCU::getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo )
     8332TComDataCU::getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo
     8333#if QC_MRG_CANS_B0048
     8334  , Int* iPdm
     8335#endif
     8336)
    74328337{
    74338338  TComDepthMapGenerator* pcDepthMapGenerator = m_pcSlice->getSPS()->getDepthMapGenerator();
    74348339  ROFRS( pcDepthMapGenerator, 0 );
    7435   return pcDepthMapGenerator->getPdmMergeCandidate( this, uiPartIdx, paiPdmRefIdx, pacPdmMv, pDInfo );
     8340  return pcDepthMapGenerator->getPdmMergeCandidate( this, uiPartIdx, paiPdmRefIdx, pacPdmMv, pDInfo
     8341#if QC_MRG_CANS_B0048
     8342    , iPdm
     8343#endif
     8344    );
    74368345}
    74378346Bool
     
    74668375  TComResidualGenerator*  pcResidualGenerator = m_pcSlice->getSPS()->getResidualGenerator();
    74678376  ROFRS( pcResidualGenerator, false );
    7468 #if QC_MULTI_DIS_CAN
     8377#if QC_MULTI_DIS_CAN_A0097
    74698378  DisInfo cDisInfo;
    74708379  cDisInfo.iN = 0;
    74718380  PartSize m_peSaved =  getPartitionSize( 0 );
    74728381  m_pePartSize[0] =  SIZE_2Nx2N;
    7473 #if LGE_DVMCP
     8382#if LGE_DVMCP_A0126
     8383#if QC_SIMPLE_NBDV_B0047
     8384#if FIX_LGE_IVMP_PARALLEL_MERGE_B0136
     8385  getDisMvpCand2( 0, 0,  &cDisInfo, false);
     8386#else
     8387  getDisMvpCand2( 0, 0,  &cDisInfo);
     8388#endif
     8389#else
    74748390  getDisMvpCand2( 0, 0,  &cDisInfo, true );
     8391#endif
    74758392#else
    74768393  getDisMvpCand        ( 0, 0,  &cDisInfo );
     
    75018418#endif
    75028419
    7503 #if LGE_EDGE_INTRA
     8420#if LGE_EDGE_INTRA_A0070
    75048421Void TComDataCU::reconPartition( UInt uiAbsPartIdx, UInt uiDepth, Bool bLeft, UChar ucStartPos, UChar ucNumEdge, UChar* pucEdgeCode, Bool* pbRegion )
    75058422{
     
    81259042
    81269043//! \}
    8127 
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComDataCU.h

    r193 r213  
    159159  Int*          m_pcArlCoeffCb;       ///< ARL coefficient buffer (Cb)
    160160  Int*          m_pcArlCoeffCr;       ///< ARL coefficient buffer (Cr)
    161 #if FIX_MEM_LEAKS
    162161  Bool          m_ArlCoeffIsAliasedAllocation; ///< ARL coefficient buffer is an alias of the global buffer and must not be free()'d
    163 #endif
    164162
    165163  static Int*   m_pcGlbArlCoeffY;     ///< ARL coefficient buffer (Y)
    166164  static Int*   m_pcGlbArlCoeffCb;    ///< ARL coefficient buffer (Cb)
    167165  static Int*   m_pcGlbArlCoeffCr;    ///< ARL coefficient buffer (Cr)
     166
    168167#endif
    169168 
     
    194193 
    195194  Bool*         m_pbMergeFlag;        ///< array of merge flags
     195#if LGE_ILLUCOMP_B0045
     196  Bool*         m_pbICFlag;           ///< array of IC flags
     197#endif
    196198  UChar*        m_puhMergeIndex;      ///< array of merge candidate indices
    197199#if AMP_MRG
     
    217219#endif
    218220
    219 #if LGE_EDGE_INTRA
     221#if LGE_EDGE_INTRA_A0070
    220222  UChar*        m_pucEdgeCode;          ///< array of edge code
    221223  UChar*        m_pucEdgeNumber;        ///< total number of edge
     
    235237  Bool          m_bDecSubCu;          ///< indicates decoder-mode
    236238  Double        m_dTotalCost;         ///< sum of partition RD costs
     239#if FIX_RDO_NEGDIST
     240  Dist          m_uiTotalDistortion;  ///< sum of partition distortion
     241#else
    237242  UInt          m_uiTotalDistortion;  ///< sum of partition distortion
     243#endif
    238244  UInt          m_uiTotalBits;        ///< sum of partition bits
    239245  UInt          m_uiTotalBins;       ///< sum of partition bins
    240246  UInt*         m_uiSliceStartCU;    ///< Start CU address of current slice
    241247  UInt*         m_uiEntropySliceStartCU; ///< Start CU address of current slice
    242 
    243 #if OL_DEPTHLIMIT_A0044
    244   //add a variable to store the partition information
    245   //a 2D array in uidepth, part_symbol format
    246   UInt          m_uiPartInfo[OL_PART_BUF_SIZE][2];
    247   UInt          m_uiPartNum;
    248   Bool          m_dumpPartInfo;
    249 #endif
    250248 
    251249  // -------------------------------------------------------------------------------------------------------------------
     
    269267  Int*          m_piContourPredTexDeltaDC1;
    270268  Int*          m_piContourPredTexDeltaDC2;
     269#endif
     270 
     271#if RWTH_SDC_DLT_B0036
     272  Bool*         m_pbSDCFlag;
     273  Pel*          m_apSegmentDCOffset[2];
    271274#endif
    272275
     
    283286  Void          deriveRightBottomIdx        ( PartSize eCUMode, UInt uiPartIdx, UInt& ruiPartIdxRB );
    284287  Bool          xGetColMVP( RefPicList eRefPicList, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx );
    285 #if QC_MULTI_DIS_CAN
     288#if QC_MULTI_DIS_CAN_A0097
    286289  Bool          xGetColDisMV( RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx );
    287290#endif
     
    475478  Void          setSubPart            ( T bParameter, T* pbBaseLCU, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx );
    476479
     480#if LGE_ILLUCOMP_B0045
     481  Bool*         getICFlag             ()                        { return m_pbICFlag;               }
     482  Bool          getICFlag             ( UInt uiIdx )            { return m_pbICFlag[uiIdx];        }
     483  Void          setICFlag             ( UInt uiIdx, Bool  uh )  { m_pbICFlag[uiIdx] = uh;          }
     484  Void          setICFlagSubParts     ( Bool bICFlag,  UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
     485  Bool          isICFlagRequired      (UInt uiAbsPartIdx);
     486#endif
     487
    477488#if AMP_MRG
    478489  Void          setMergeAMP( Bool b )      { m_bIsMergeAMP = b; }
     
    533544
    534545#if HHI_INTER_VIEW_MOTION_PRED
    535 #if !QC_MULTI_DIS_CAN
     546#if !QC_MULTI_DIS_CAN_A0097
    536547  Int           getPdmMergeCandidate( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv );
    537548  Bool          getPdmMvPred( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, Bool bMerge = false );
    538549#else
    539550  Bool          getPdmMvPredDisCan( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge = false );
    540   Int           getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo );
     551  Int           getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo
     552#if QC_MRG_CANS_B0048
     553    , Int* iPdm
     554#endif
     555  );
    541556  Void          getDisMvpCand        ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo );
    542 #if LGE_DVMCP
    543   Void          getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo, Bool bMerge=false, RefPicList eRefPicList=REF_PIC_LIST_X, Int iRefIdx=-1 );
     557#if LGE_DVMCP_A0126
     558#if QC_SIMPLE_NBDV_B0047
     559  Void          getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo
     560#if LGE_IVMP_PARALLEL_MERGE_B0136
     561    , Bool bParMerg = false
     562#endif
     563    );
     564#else
     565  Void          getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo, Bool bMerge=false, RefPicList eRefPicList=REF_PIC_LIST_X, Int iRefIdx=-1
     566#if LGE_IVMP_PARALLEL_MERGE_B0136
     567    , Bool bParMerg = false
     568#endif
     569    );
     570#endif
    544571#endif
    545572
     
    589616 
    590617  AMVP_MODE     getAMVPMode           ( UInt uiIdx );
     618#if SHARP_INTERVIEW_DECOUPLE_B0111
     619  Void          fillMvpCandBase       ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo );
     620  Void          fillMvpCand           ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo , Int iMVPIdx=-1);
     621#else
    591622  Void          fillMvpCand           ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo );
     623#endif
    592624#if PARALLEL_MERGE
    593625  Bool          isDiffMER             ( Int xN, Int yN, Int xP, Int yP);
     
    611643 
    612644  Void          compressMV            ();
    613 
    614 #if OL_DEPTHLIMIT_A0044
    615   Void        resetPartInfo     () {m_uiPartNum = 0;};
    616   Void        incrementPartInfo () {m_uiPartNum ++;};
    617   Void        updatePartInfo(UInt uiSymbol, UInt uiDepth) { m_uiPartInfo[m_uiPartNum][0] = uiSymbol; m_uiPartInfo[m_uiPartNum][1] = uiDepth;};
    618   UInt*       readPartInfo()                              { return (UInt*)m_uiPartInfo;};
    619   Void        setPartDumpFlag(Bool flag)                  { m_dumpPartInfo = flag; };
    620   Bool        getPartDumpFlag()                           { return m_dumpPartInfo; };
    621 #endif
    622645 
    623646  // -------------------------------------------------------------------------------------------------------------------
     
    706729
    707730  UInt          getCtxSkipFlag                  ( UInt   uiAbsPartIdx                                 );
     731#if LGE_ILLUCOMP_B0045
     732  UInt          getCtxICFlag                    ( UInt   uiAbsPartIdx                                 );
     733#endif
    708734  UInt          getCtxInterDir                  ( UInt   uiAbsPartIdx                                 );
    709735
     
    716742  UInt&         getTotalBins            ()                            { return m_uiTotalBins;                                                                                                  }
    717743
    718 #if LGE_EDGE_INTRA
     744#if LGE_EDGE_INTRA_A0070
    719745  UInt          getCtxEdgeIntra ( UInt uiAbsPartIdx );
    720746#endif
     
    725751 
    726752  Double&       getTotalCost()                  { return m_dTotalCost;        }
     753#if FIX_RDO_NEGDIST
     754  Dist&         getTotalDistortion()            { return m_uiTotalDistortion; }
     755#else
    727756  UInt&         getTotalDistortion()            { return m_uiTotalDistortion; }
     757#endif
    728758  UInt&         getTotalBits()                  { return m_uiTotalBits;       }
    729759  UInt&         getTotalNumPart()               { return m_uiNumPartition;    }
     
    796826#endif
    797827
    798 #if LGE_EDGE_INTRA
     828#if LGE_EDGE_INTRA_A0070
    799829  UChar*        getEdgeCode( UInt uiIdx )                 { return &m_pucEdgeCode[uiIdx * LGE_EDGE_INTRA_MAX_EDGE_NUM_PER_4x4]; }
    800830  UChar*        getEdgeNumber( )                          { return m_pucEdgeNumber;           }
     
    818848  Void          setEdgeDeltaDC1( UInt uiIdx, Int val )      { m_piEdgeDeltaDC1[uiIdx] = val;  }
    819849#endif
     850#endif
     851 
     852#if RWTH_SDC_DLT_B0036
     853  Bool*         getSDCFlag          ()                        { return m_pbSDCFlag;               }
     854  Bool          getSDCFlag          ( UInt uiIdx )            { return m_pbSDCFlag[uiIdx];        }
     855  Void          setSDCFlagSubParts  ( Bool bSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
     856 
     857  UInt          getCtxSDCFlag              ( UInt uiAbsPartIdx );
     858 
     859  Bool          getSDCAvailable             ( UInt uiAbsPartIdx );
     860 
     861  Pel*          getSDCSegmentDCOffset( UInt uiSeg ) { return m_apSegmentDCOffset[uiSeg]; }
     862  Pel           getSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentDCOffset[uiSeg][uiPartIdx]; }
     863  Void          setSDCSegmentDCOffset( Pel pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentDCOffset[uiSeg][uiPartIdx] = pOffset; }
    820864#endif
    821865};
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComDepthMapGenerator.cpp

    r193 r213  
    7878  m_uiSubSampExpX       = uiSubSampExpX;
    7979  m_uiSubSampExpY       = uiSubSampExpY;
    80 #if !QC_MULTI_DIS_CAN
     80#if !QC_MULTI_DIS_CAN_A0097
    8181  m_ppcYuv              = new TComYuv*    [ m_uiMaxDepth ];
    8282  m_ppcCU               = new TComDataCU* [ m_uiMaxDepth ];
     
    102102  {
    103103    m_bCreated    = false;
    104 #if !QC_MULTI_DIS_CAN
     104#if !QC_MULTI_DIS_CAN_A0097
    105105    for( UInt uiDepth = 0; uiDepth < m_uiMaxDepth; uiDepth++ )
    106106    {
     
    377377}
    378378
    379 #if !QC_MULTI_DIS_CAN
     379#if !QC_MULTI_DIS_CAN_A0097
    380380Bool
    381381TComDepthMapGenerator::predictDepthMap( TComPic* pcPic )
     
    613613
    614614#if HHI_INTER_VIEW_MOTION_PRED
    615 #if QC_MULTI_DIS_CAN
     615#if QC_MULTI_DIS_CAN_A0097
    616616Int
    617 TComDepthMapGenerator::getPdmMergeCandidate( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo )
     617TComDepthMapGenerator::getPdmMergeCandidate( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo
     618#if QC_MRG_CANS_B0048
     619  , Int* iPdm
     620#endif
     621)
    618622#else
    619623Int
     
    624628  AOF  ( m_bCreated && m_bInit );
    625629
    626 #if !QC_MULTI_DIS_CAN
     630#if !QC_MULTI_DIS_CAN_A0097
    627631  ROFRS( m_bPDMAvailable, 0 );
    628632#endif
     
    634638  ROTRS( !bPdmMerge, 0 );
    635639
     640#if QC_MRG_CANS_B0048
     641  Bool abPdmAvailable[4] = {false, false, false, false};
     642#else
    636643  Bool abPdmAvailable[2] = {false,false};
     644#endif
    637645
    638646  Int iValid = 0;
     
    665673  TComPicYuv* pcBaseRec   = pcBasePic->getPicYuvRec   ();
    666674
    667 #if QC_MULTI_DIS_CAN
     675#if QC_MULTI_DIS_CAN_A0097
    668676  Int  iCurrPosX, iCurrPosY;
    669677  UInt          uiPartAddr;
     
    719727              paiPdmRefIdx  [ uiBaseRefListId ] = iPdmRefIdx;
    720728              TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer());
    721 #if LGE_DVMCP
     729#if LGE_DVMCP_A0126
    722730              cMv.m_bDvMcp = true;
    723731              cMv.m_iDvMcpDispX = pDInfo->m_acMvCand[0].getHor();
     
    733741  }
    734742  Int iPdmInterDir = ( abPdmAvailable[0] ? 1 : 0 ) + ( abPdmAvailable[1] ? 2 : 0 );
    735 
     743#if QC_MRG_CANS_B0048
     744  iPdm[0] = iPdmInterDir;
     745#else
    736746  if (iPdmInterDir == 0)
    737747  {
     748#endif
    738749    for( Int iRefListId = 0; iRefListId < 2 ; iRefListId++ )
    739750    {
     
    747758        if( pcSlice->getRefPOC( eRefPicList, iPdmRefIdx ) == pcSlice->getPOC())
    748759        {
     760#if QC_MRG_CANS_B0048
     761          abPdmAvailable[ iRefListId+2 ] = true;
     762          paiPdmRefIdx  [ iRefListId+2 ] = iPdmRefIdx;
     763#else
    749764          abPdmAvailable[ iRefListId ] = true;
    750765          paiPdmRefIdx  [ iRefListId ] = iPdmRefIdx;
    751 #if QC_MULTI_DIS_CAN
     766#endif
     767#if QC_MULTI_DIS_CAN_A0097
    752768          TComMv cMv = pDInfo->m_acMvCand[0];
    753769          cMv.setVer(0);
     
    756772#endif
    757773          pcCU->clipMv( cMv );
     774#if QC_MRG_CANS_B0048
     775          pacPdmMv      [ iRefListId + 2] = cMv;
     776#else
    758777          pacPdmMv      [ iRefListId ] = cMv;
     778#endif
    759779          break;
    760780        }
    761781      }
    762782    }
     783#if QC_MRG_CANS_B0048
     784    iPdmInterDir = ( abPdmAvailable[2] ? 1 : 0 ) + ( abPdmAvailable[3] ? 2 : 0 ) ;
     785    iPdm[1] = iPdmInterDir;
     786#else
    763787    iPdmInterDir = ( abPdmAvailable[0] ? 1 : 0 ) + ( abPdmAvailable[1] ? 2 : 0 ) ;
    764788  }
     789#endif
    765790
    766791  return iPdmInterDir;
     
    781806      if( pcCU->getSlice()->getRefPOC( eRefPicList, iPdmRefIdx ) != pcCU->getSlice()->getPOC() )
    782807      {
    783 #if QC_MULTI_DIS_CAN
     808#if QC_MULTI_DIS_CAN_A0097
    784809        if( getDisCanPdmMvPred (pcCU, uiPartIdx, eRefPicList, iPdmRefIdx, cMv, pDInfo, true ) )       
    785810#else
     
    807832      for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ )
    808833      {
    809 #if QC_MULTI_DIS_CAN
     834#if QC_MULTI_DIS_CAN_A0097
    810835        if ( getDisCanPdmMvPred (pcCU, uiPartIdx, eRefPicList, iPdmRefIdx, cMv, pDInfo, true ) )
    811836#else
     
    827852}
    828853
    829 #if QC_MULTI_DIS_CAN
     854#if QC_MULTI_DIS_CAN_A0097
    830855Bool
    831856TComDepthMapGenerator::getDisCanPdmMvPred    ( TComDataCU*   pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge )
    832857{
    833 #if LGE_DVMCP
     858#if LGE_DVMCP_A0126
    834859  rcMv.m_bDvMcp = false;
    835860#endif
     
    910935      {
    911936        rcMv.set( cBaseMvField.getHor(), cBaseMvField.getVer() );
    912 #if LGE_DVMCP
     937#if LGE_DVMCP_A0126
    913938        // save disparity vector when a merge candidate for IVMP is set as DV-MCP
    914939        if( bMerge )
     
    10691094
    10701095
    1071 #if !QC_MULTI_DIS_CAN
     1096#if !QC_MULTI_DIS_CAN_A0097
    10721097/*=======================================================*
    10731098 *=====                                             =====*
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComDepthMapGenerator.h

    r166 r213  
    136136
    137137  Void  initViewComponent     ( TComPic*      pcPic );
    138 #if !QC_MULTI_DIS_CAN
     138#if !QC_MULTI_DIS_CAN_A0097
    139139  Bool  predictDepthMap       ( TComPic*      pcPic );
    140140  Void  updateDepthMap        ( TComPic*      pcPic );
     
    154154  Int   getDisparity          ( TComPic*      pcPic, Int iPosX, Int iPosY, UInt uiRefViewId );
    155155#if HHI_INTER_VIEW_MOTION_PRED
    156 #if QC_MULTI_DIS_CAN
    157   Int   getPdmMergeCandidate ( TComDataCU*   pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo );
     156#if QC_MULTI_DIS_CAN_A0097
     157  Int   getPdmMergeCandidate ( TComDataCU*   pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo
     158#if QC_MRG_CANS_B0048
     159    , Int* iPdm
     160#endif
     161    );
     162
    158163  Bool  getPdmMvPredDisCan    ( TComDataCU*   pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge );
    159164  Bool  getDisCanPdmMvPred    ( TComDataCU*   pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge );
     
    174179private:
    175180  // picture operations
    176 #if !QC_MULTI_DIS_CAN
     181#if !QC_MULTI_DIS_CAN_A0097
    177182  Bool  xConvertDepthMapCurr2Ref  ( TComPic*    pcRef, TComPic* pcCur );
    178183  Bool  xConvertDepthMapRef2Curr  ( TComPic*    pcCur, TComPic* pcRef );
     
    237242  Bool              m_bDecoder;
    238243  TComPrediction*   m_pcPrediction;
    239 #if VIDYO_VPS_INTEGRATION
     244#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    240245  TComVPSAccess*    m_pcVPSAccess;
    241246#endif
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComMotionInfo.cpp

    r56 r213  
    374374}
    375375#endif
     376
     377
     378
     379#if MTK_UNCONSTRAINED_MVI_B0083
     380Void TComCUMvField::setUndefinedMv( Int iPartAddr, Int iNumPart, Char* pePredMode, UChar* puhInterDir, Int refIdx, Int InterDir
     381#if NTT_FIX_UNCONSTRAINED_MVI
     382                                  , Int iNumRefIdx
     383#endif
     384                                   )
     385{
     386  PredMode predMode = MODE_INTRA;
     387  TComMv cMv(0,0);
     388
     389  for ( Int i = 0; i < iNumPart; i++ )
     390  {
     391    predMode = static_cast<PredMode>( pePredMode[ iPartAddr+i ] );
     392#if NTT_FIX_UNCONSTRAINED_MVI
     393    if( predMode==MODE_INTRA || m_piRefIdx[iPartAddr+i] >= iNumRefIdx )
     394#else
     395    if( predMode==MODE_INTRA  )
     396#endif
     397    {
     398      m_pcMv[iPartAddr+i] = cMv;
     399      puhInterDir[iPartAddr+i] = InterDir;
     400      m_piRefIdx[iPartAddr+i] = refIdx;
     401    }
     402  }
     403}
     404#endif
     405
    376406//! \}
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComMotionInfo.h

    r100 r213  
    4343#include "CommonDef.h"
    4444#include "TComMv.h"
     45#if VSP_N
     46#include "TComSlice.h"
     47#endif
    4548
    4649//! \ingroup TLibCommon
     
    5962
    6063// ====================================================================================================================
    61 #if QC_MULTI_DIS_CAN
     64#if QC_MULTI_DIS_CAN_A0097
    6265typedef struct _DisCand
    6366{
     
    9497  Int getHor   () const { return  m_acMv.getHor(); }
    9598  Int getVer   () const { return  m_acMv.getVer(); }
     99#if QC_MRG_CANS_B0048
     100  Bool operator== ( const TComMvField& rcMv ) const
     101  {
     102    return (m_acMv.getHor()==rcMv.getHor() && m_acMv.getVer()==rcMv.getVer() && m_iRefIdx == rcMv.getRefIdx());
     103  }
     104#endif
    96105};
    97106
     
    169178  Void decreaseMvAccuracy( Int iPartAddr, Int iNumPart, Int iShift );
    170179#endif
     180
     181#if MTK_UNCONSTRAINED_MVI_B0083
     182  Void setUndefinedMv( Int iPartAddr, Int iNumPart, Char* pePredMode, UChar* puhInterDir, Int refIdx, Int InterDir
     183#if NTT_FIX_UNCONSTRAINED_MVI
     184                     , Int iNumRefIdx
     185#endif
     186    );
     187#endif
    171188};
    172189
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComMv.h

    r100 r213  
    5757public:
    5858 
    59 #if LGE_DVMCP
     59#if LGE_DVMCP_A0126
    6060  Bool  m_bDvMcp;       // is dv-mcp ?
    6161  Int   m_iDvMcpDispX;  // disparity for dv-mcp
     
    6969  m_iHor(0),
    7070  m_iVer(0)
    71 #if LGE_DVMCP
     71#if LGE_DVMCP_A0126
    7272  , m_bDvMcp(false)
    7373  , m_iDvMcpDispX(0)
     
    7979  m_iHor(iHor),
    8080  m_iVer(iVer)
    81 #if LGE_DVMCP
     81#if LGE_DVMCP_A0126
    8282  , m_bDvMcp(false)
    8383  , m_iDvMcpDispX(0)
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComPattern.cpp

    r100 r213  
    675675{
    676676  Int* piSrc;
    677 #if LGE_EDGE_INTRA
     677#if LGE_EDGE_INTRA_A0070
    678678  mapEdgeIntratoDC( uiDirMode );
    679679#endif
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComPattern.h

    r56 r213  
    111111  TComPatternParam  m_cPatternCr;
    112112 
     113#if LGE_ILLUCOMP_B0045
     114  Bool              m_bICFlag;
     115#endif
     116
    113117#if LOGI_INTRA_NAME_3MPM
    114118  static const UChar m_aucIntraFilter[5];
     
    124128  Int   getROIYHeight()           { return m_cPatternY.m_iROIHeight;      }
    125129  Int   getPatternLStride()       { return m_cPatternY.m_iPatternStride;  }
     130
     131#if LGE_ILLUCOMP_B0045
     132  Bool  getICFlag()               { return m_bICFlag; }
     133  Void  setICFlag(Bool bICFlag)   { m_bICFlag = bICFlag; }
     134#endif
    126135
    127136  // access functions of ADI buffers
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComPic.cpp

    r193 r213  
    5656  m_apcPicYuvAvail     = NULL;
    5757  m_apcPicYuvSynth     = NULL;
     58  m_bIsVsp             = false;
    5859#endif
    5960#if DEPTH_MAP_GENERATION
     
    8586  m_aaiCodedScale     = 0;
    8687  m_aaiCodedOffset    = 0;
     88#if OL_QTLIMIT_PREDCODING_B0068
     89  m_bReduceBitsQTL    = 0;
     90#endif
     91#if QC_SIMPLE_NBDV_B0047
     92  m_bRapCheck = false;
     93  m_eRapRefList = REF_PIC_LIST_0;
     94  m_uiRapRefIdx = 0;
     95#endif
     96
    8797}
    8898
     
    484494  }
    485495}
     496#if QC_SIMPLE_NBDV_B0047
     497Bool TComPic::getDisCandRefPictures(Int iColPOC)
     498{
     499  UInt uiTempLayerCurr=7;
     500  TComSlice* currSlice = getCurrSlice();
     501  UInt iPOCCurr=currSlice->getPOC();
     502  UInt iPOCDiff = 255;
     503  Bool  bRAP=false;
     504  Bool bCheck = false;
     505  Int MaxRef = currSlice->getNumRefIdx(RefPicList(0));
     506  RefPicList eRefPicList = REF_PIC_LIST_0 ;
     507  if(currSlice->isInterB())
     508  {
     509    if(currSlice->getNumRefIdx(RefPicList(0))< currSlice->getNumRefIdx(RefPicList(1)))
     510      MaxRef = currSlice->getNumRefIdx(RefPicList(1));
     511  }
     512  for(Int lpRef = 0; lpRef < MaxRef; lpRef++)
     513  {
     514    for(Int lpNr = 0; lpNr < (currSlice->isInterB() ? 2: 1); lpNr ++)
     515    {
     516      eRefPicList = RefPicList(0);
     517      if(currSlice->isInterB())
     518        eRefPicList = RefPicList(lpNr==0 ? (currSlice->getColDir()): (1-currSlice->getColDir()));
     519      if(iColPOC == currSlice->getRefPOC(eRefPicList, lpRef))
     520        continue;
     521      if(lpRef >= currSlice->getNumRefIdx(eRefPicList)||(currSlice->getViewId() != currSlice->getRefPic( eRefPicList, lpRef)->getViewId()))
     522        continue;
     523      Int iTempPoc = currSlice->getRefPic(eRefPicList, lpRef)->getPOC();
     524      UInt uiTempLayer = currSlice->getRefPic(eRefPicList, lpRef)->getCurrSlice()->getTLayer();
     525      Int iTempDiff = (iTempPoc > iPOCCurr) ? (iTempPoc - iPOCCurr): (iPOCCurr - iTempPoc);
     526#if QC_REM_IDV_B0046
     527      TComSlice* refSlice = currSlice->getRefPic(eRefPicList, lpRef)->getCurrSlice();
     528      bRAP = (refSlice->getSPS()->getViewId() && (refSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || refSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA))? 1: 0;     
     529#else
     530      bRAP = (currSlice->getRefPic(eRefPicList, lpRef)->getCurrSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDV? 1:0);
     531#endif
     532      if( bRAP)
     533      {
     534         bCheck = true;
     535         this->setRapRefIdx(lpRef);
     536         this->setRapRefList(eRefPicList);
     537         return bCheck;
     538      }
     539      if(uiTempLayerCurr > uiTempLayer)
     540      {
     541        bCheck = true;
     542        if(uiTempLayerCurr == uiTempLayer)
     543        {
     544          if(iPOCDiff > iTempDiff)
     545          {
     546            iPOCDiff=iTempDiff;
     547            if(iPOCDiff < 255)
     548            {
     549              this->setRapRefIdx(lpRef);
     550              this->setRapRefList(eRefPicList);
     551            }
     552          }
     553        }
     554        else
     555        {
     556          iPOCDiff=iTempDiff;
     557          uiTempLayerCurr = uiTempLayer;
     558          this->setRapRefIdx(lpRef);
     559          this->setRapRefList(eRefPicList);
     560        }
     561      }
     562    }
     563  }
     564  return bCheck;
     565}
     566#endif
    486567
    487568#if HHI_INTERVIEW_SKIP
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComPic.h

    r193 r213  
    6868  TComPicYuv*           m_apcPicYuvAvail;         //  Availability Map - Does the given pixel can be synthesised in receiver
    6969  TComPicYuv*           m_apcPicYuvSynth;         //  Sythesied image
     70  Bool                  m_bIsVsp;
    7071#endif
    7172
     
    7879#endif
    7980
    80 #if LG_ZEROINTRADEPTHRESI_M26039
     81#if LG_ZEROINTRADEPTHRESI_A0087
    8182  Int                   m_uiIntraPeriod;
    8283#endif
     
    8485#if HHI_INTER_VIEW_MOTION_PRED
    8586  TComPicYuv*           m_pcOrgDepthMap;          //  original depth map
    86 #if QC_MULTI_DIS_CAN
     87#if QC_MULTI_DIS_CAN_A0097
    8788  Bool          m_checked;
     89#endif
     90#if QC_SIMPLE_NBDV_B0047
     91  UInt        m_uiRapRefIdx;
     92  RefPicList  m_eRapRefList;
     93  Bool        m_bRapCheck;
    8894#endif
    8995#endif
     
    112118  TComPicYuv*           m_pcUsedPelsMap;
    113119#endif
    114 #if SONY_COLPIC_AVAILABILITY
     120#if SONY_COLPIC_AVAILABILITY || VSP_N
    115121  Int                   m_iViewOrderIdx;
    116122#endif
     
    118124  Int**                 m_aaiCodedOffset;
    119125
    120 #if OL_DEPTHLIMIT_A0044
    121   UInt*                 m_texPartInfo;
    122   UInt                  m_uiTexPartIndex;
     126#if OL_QTLIMIT_PREDCODING_B0068
     127  Bool                  m_bReduceBitsQTL;
    123128#endif
    124129
     
    141146  TComSlice*    getSlice(Int i)       { return  m_apcPicSym->getSlice(i);  }
    142147  TComSlice*    getCurrSlice()        { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx);  }
    143 #if VIDYO_VPS_INTEGRATION
     148#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    144149  TComVPS*      getVPS()              { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getVPS();  }
    145150#endif
    146 #if LG_ZEROINTRADEPTHRESI_M26039
     151#if LG_ZEROINTRADEPTHRESI_A0087
    147152  Int           getIntraPeriod()                           { return  m_uiIntraPeriod; }
    148153  Void          setIntraPeriod(Int uiIntraPeriod)          { m_uiIntraPeriod = uiIntraPeriod; }
     
    161166  TComPicYuv*   getPicYuvSynth()      { return  m_apcPicYuvSynth; }
    162167  Void          checkSynthesisAvailability(  /*TComDataCU*& rpcBestCU, */UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth, Bool *&rpbCUSynthesied);
     168  Void          setIsVsp( Bool b )    { m_bIsVsp = b; }
     169  Bool          getIsVsp()            { return m_bIsVsp; }
    163170#endif
    164171#if HHI_INTERVIEW_SKIP
     
    177184#if HHI_INTER_VIEW_MOTION_PRED
    178185  TComPicYuv*   getOrgDepthMap()      { return  m_pcOrgDepthMap; }
    179 #if QC_MULTI_DIS_CAN
     186#if QC_MULTI_DIS_CAN_A0097
    180187  Void          setCandPicCheckedFlag (Bool bchecked)   { m_checked = bchecked; }
    181188  Bool          getCandPicCheckedFlag ()                { return m_checked;}
     
    186193  TComPicYuv*   getResidual()         { return  m_pcResidual; }
    187194#endif
    188 
    189 #if SONY_COLPIC_AVAILABILITY
     195#if QC_SIMPLE_NBDV_B0047
     196  UInt          getRapRefIdx()                         {return m_uiRapRefIdx;}
     197  RefPicList    getRapRefList()                        {return m_eRapRefList;}
     198  Void          setRapRefIdx(UInt uiRapRefIdx)         {m_uiRapRefIdx = uiRapRefIdx;}
     199  Void          setRapRefList(RefPicList eRefPicList)  {m_eRapRefList = eRefPicList;}
     200  Bool          getRapbCheck()                         {return m_bRapCheck;}
     201  Void          setRapbCheck(Bool bCheck)              {m_bRapCheck = bCheck;}
     202  Bool          getDisCandRefPictures(Int iColPOC);
     203#endif
     204
     205#if SONY_COLPIC_AVAILABILITY || VSP_N
    190206  Void          setViewOrderIdx(Int i)                        { m_iViewOrderIdx = i; }
    191207  Int           getViewOrderIdx()                             { return m_iViewOrderIdx; }
    192208#endif
     209
     210#if OL_QTLIMIT_PREDCODING_B0068
     211  Bool          getReduceBitsFlag ()             { return m_bReduceBitsQTL;     }
     212  Void          setReduceBitsFlag ( Bool bFlag ) { m_bReduceBitsQTL = bFlag;    }
     213#endif
     214
    193215  Void          setScaleOffset( Int** pS, Int** pO )  { m_aaiCodedScale = pS; m_aaiCodedOffset = pO; }
    194216  Int**         getCodedScale ()                      { return m_aaiCodedScale;  }
     
    261283#endif
    262284
    263 #if OL_DEPTHLIMIT_A0044
    264   UInt        accessPartInfo        ( UInt count )   { return m_texPartInfo[m_uiTexPartIndex + count]; };
    265   Void        incrementTexPartIndex (            )   { m_uiTexPartIndex += 2;    };
    266   UInt        getTexPartIndex       ()               { return m_uiTexPartIndex;  };
    267   Void        setTexPartIndex       ( UInt idx   )   { m_uiTexPartIndex = idx; };
    268   Void        setPartInfo           ( UInt* texPart) { m_texPartInfo    = texPart;  };
    269 #endif
    270 
    271285  Bool          getValidSlice                                  (Int sliceID)  {return m_pbValidSlice[sliceID];}
    272286  Int           getSliceGranularityForNDBFilter                ()             {return m_sliceGranularityForNDBFilter;}
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComPicSym.cpp

    r193 r213  
    127127
    128128
    129 #if FIX_MEM_LEAKS
    130129  if( m_apcTComTile )
    131130  {
     
    135134    }
    136135  }
    137 #endif
    138136
    139137  delete [] m_apcTComTile;
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComPrediction.cpp

    r100 r213  
    4646// ====================================================================================================================
    4747
    48 #if LGE_EDGE_INTRA
     48#if LGE_EDGE_INTRA_A0070
    4949#define MAX_DISTANCE_EDGEINTRA 255
    5050#endif
     
    423423}
    424424
    425 #if LGE_EDGE_INTRA
     425#if LGE_EDGE_INTRA_A0070
    426426Void TComPrediction::predIntraLumaEdge ( TComDataCU* pcCU, TComPattern* pcTComPattern, UInt uiAbsPartIdx, Int iWidth, Int iHeight, Pel* piPred, UInt uiStride, Bool bDelta )
    427427{
     
    628628    if ( eRefPicList != REF_PIC_LIST_X )
    629629    {
     630#if LGE_ILLUCOMP_B0045
     631      if( pcCU->getSlice()->getPPS()->getUseWP() && !pcCU->getICFlag(uiPartAddr))
     632#else
    630633      if( pcCU->getSlice()->getPPS()->getUseWP())
     634#endif
    631635      {
    632636#if DEPTH_MAP_GENERATION
     
    644648#endif
    645649      }
     650#if LGE_ILLUCOMP_B0045
     651      if( pcCU->getSlice()->getPPS()->getUseWP() && !pcCU->getICFlag(uiPartAddr) )
     652#else
    646653      if ( pcCU->getSlice()->getPPS()->getUseWP() )
     654#endif
    647655      {
    648656        xWeightedPredictionUni( pcCU, pcYuvPred, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx );
     
    689697    if ( eRefPicList != REF_PIC_LIST_X )
    690698    {
     699#if LGE_ILLUCOMP_B0045
     700      if( pcCU->getSlice()->getPPS()->getUseWP() && !pcCU->getICFlag(uiPartAddr))
     701#else
    691702      if( pcCU->getSlice()->getPPS()->getUseWP())
     703#endif
    692704      {
    693705#if DEPTH_MAP_GENERATION
     
    710722      xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, false );
    711723#endif 
     724#if LGE_ILLUCOMP_B0045
     725      if( pcCU->getSlice()->getPPS()->getUseWP() && !pcCU->getICFlag(uiPartAddr))
     726#else
    712727      if ( pcCU->getSlice()->getPPS()->getUseWP() )
     728#endif
    713729      {
    714730        xWeightedPredictionUni( pcCU, pcYuvPred, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx );
     
    779795  {
    780796#endif
     797#if LGE_ILLUCOMP_B0045
     798#if VSP_AIC
     799    Bool bICFlag = pcCU->getICFlag(uiPartAddr) && (pcCU->getSlice()->getRefPOC( eRefPicList, iRefIdx ) == pcCU->getSlice()->getPOC());
     800#else
     801    Bool bICFlag = pcCU->getICFlag(uiPartAddr) && (pcCU->getSlice()->getRefViewId( eRefPicList, iRefIdx ) != pcCU->getSlice()->getViewId());
     802#endif
     803
     804    xPredInterLumaBlk  ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi, bICFlag);
     805#else
    781806  xPredInterLumaBlk  ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi );
     807#endif
    782808#if HHI_FULL_PEL_DEPTH_MAP_MV_ACC
    783809  }
    784810#endif
     811#if LGE_ILLUCOMP_B0045
     812#if VSP_AIC
     813  Bool bICFlag = pcCU->getICFlag(uiPartAddr) && (pcCU->getSlice()->getRefPOC( eRefPicList, iRefIdx ) == pcCU->getSlice()->getPOC());
     814#else
     815  Bool bICFlag = pcCU->getICFlag(uiPartAddr) && (pcCU->getSlice()->getRefViewId( eRefPicList, iRefIdx ) != pcCU->getSlice()->getViewId());
     816#endif
     817
     818  xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi, bICFlag );
     819#else
    785820  xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi );
     821#endif
    786822}
    787823
     
    896932}
    897933#endif
     934#if !QC_MVHEVC_B0046
    898935  Int     ixFrac      = iHor & 0x3;
    899936  Int     iyFrac      = iVer & 0x3;
     937#endif
    900938  Int     iRefOffset  = ( iHor >> 2 ) + ( iVer >> 2 ) * iRefStride;
    901939#endif
     
    926964 * \param bi       Flag indicating whether bipred is used
    927965 */
     966#if LGE_ILLUCOMP_B0045
     967Void TComPrediction::xPredInterLumaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi, Bool bICFlag)
     968#else
    928969Void TComPrediction::xPredInterLumaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi )
     970#endif
    929971{
    930972  Int refStride = refPic->getStride(); 
     
    9611003    m_if.filterVerLuma(tmp + (halfFilterSize-1)*tmpStride, tmpStride, dst, dstStride, width, height,              yFrac, false, !bi);   
    9621004  }
     1005
     1006#if LGE_ILLUCOMP_B0045
     1007  if(bICFlag)
     1008  {
     1009    Int a, b, iShift, i, j;
     1010
     1011    xGetLLSICPrediction(cu, mv, refPic, a, b, iShift);
     1012
     1013    for (i = 0; i < height; i++)
     1014    {
     1015      for (j = 0; j < width; j++)
     1016      {
     1017        if(bi)
     1018        {
     1019          Int iIFshift = IF_INTERNAL_PREC - ( g_uiBitDepth + g_uiBitIncrement );
     1020          dst[j] = ( (a*dst[j]+a*IF_INTERNAL_OFFS) >> iShift ) + b*(1<<iIFshift) - IF_INTERNAL_OFFS;
     1021        }
     1022        else
     1023          dst[j] = Clip( ( (a*dst[j]) >> iShift ) + b );
     1024      }
     1025      dst += dstStride;
     1026    }
     1027  }
     1028#endif
    9631029}
    9641030
     
    9751041 * \param bi       Flag indicating whether bipred is used
    9761042 */
     1043#if LGE_ILLUCOMP_B0045
     1044Void TComPrediction::xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi, Bool bICFlag )
     1045#else
    9771046Void TComPrediction::xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi )
     1047#endif
    9781048{
    9791049  Int     refStride  = refPic->getCStride();
     
    10181088    m_if.filterVerChroma(extY  + (halfFilterSize-1)*extStride, extStride, dstCr, dstStride, cxWidth, cxHeight  , yFrac, false, !bi);   
    10191089  }
     1090#if LGE_ILLUCOMP_B0045
     1091  if(bICFlag)
     1092  {
     1093    Int a, b, iShift, i, j;
     1094    xGetLLSICPredictionChroma(cu, mv, refPic, a, b, iShift, 0); // Cb
     1095    for (i = 0; i < cxHeight; i++)
     1096    {
     1097      for (j = 0; j < cxWidth; j++)
     1098      {
     1099        if(bi)
     1100        {
     1101          Int iIFshift = IF_INTERNAL_PREC - ( g_uiBitDepth + g_uiBitIncrement );
     1102          dstCb[j] = ( (a*dstCb[j]+a*IF_INTERNAL_OFFS) >> iShift ) + b*(1<<iIFshift) - IF_INTERNAL_OFFS;
     1103        }
     1104        else
     1105          dstCb[j] = Clip3(0, 255, ((a*dstCb[j])>>iShift)+b);
     1106      }
     1107      dstCb += dstStride;
     1108    }
     1109
     1110    xGetLLSICPredictionChroma(cu, mv, refPic, a, b, iShift, 1); // Cr
     1111    for (i = 0; i < cxHeight; i++)
     1112    {
     1113      for (j = 0; j < cxWidth; j++)
     1114      {
     1115        if(bi)
     1116        {
     1117          Int iIFshift = IF_INTERNAL_PREC - ( g_uiBitDepth + g_uiBitIncrement );
     1118          dstCr[j] = ( (a*dstCr[j]+a*IF_INTERNAL_OFFS) >> iShift ) + b*(1<<iIFshift) - IF_INTERNAL_OFFS;
     1119        }
     1120        else
     1121          dstCr[j] = Clip3(0, 255, ((a*dstCr[j])>>iShift)+b);
     1122      }
     1123      dstCr += dstStride;
     1124    }
     1125  }
     1126#endif
    10201127}
    10211128
     
    14431550}
    14441551
     1552
     1553#if LGE_ILLUCOMP_B0045
     1554/** Function for deriving LM illumination compensation.
     1555 */
     1556Void TComPrediction::xGetLLSICPrediction(TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, Int &iShift)
     1557{
     1558  TComPicYuv *pRecPic = pcCU->getPic()->getPicYuvRec();
     1559  Pel *pRec, *pRef;
     1560  UInt uiWidth, uiHeight, uiTmpPartIdx;
     1561  Int iRecStride = pRecPic->getStride(), iRefStride = pRefPic->getStride();
     1562  Int iCUPelX, iCUPelY, iRefX, iRefY, iRefOffset;
     1563
     1564  iCUPelX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]];
     1565  iCUPelY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]];
     1566  iRefX   = iCUPelX + (pMv->getHor() >> 2);
     1567  iRefY   = iCUPelY + (pMv->getVer() >> 2);
     1568  uiWidth = pcCU->getWidth(0);
     1569  uiHeight = pcCU->getHeight(0);
     1570
     1571  Int i, j, iCountShift = 0;
     1572
     1573  // LLS parameters estimation -->
     1574
     1575  Int x = 0, y = 0, xx = 0, xy = 0;
     1576
     1577  if(pcCU->getPUAbove(uiTmpPartIdx, pcCU->getZorderIdxInCU()) && iCUPelY > 0 && iRefY > 0)
     1578  {
     1579    iRefOffset = ( pMv->getHor() >> 2 ) + ( pMv->getVer() >> 2 ) * iRefStride - iRefStride;
     1580    pRef = pRefPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset;
     1581    pRec = pRecPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - iRecStride;
     1582
     1583    for( j = 0; j < uiWidth; j++ )
     1584    {
     1585      x += pRef[j];
     1586      y += pRec[j];
     1587      xx += pRef[j] * pRef[j];
     1588      xy += pRef[j] * pRec[j];
     1589    }
     1590    iCountShift += g_aucConvertToBit[ uiWidth ] + 2;
     1591  }
     1592
     1593
     1594  if(pcCU->getPULeft(uiTmpPartIdx, pcCU->getZorderIdxInCU()) && iCUPelX > 0 && iRefX > 0)
     1595  {
     1596    iRefOffset = ( pMv->getHor() >> 2 ) + ( pMv->getVer() >> 2 ) * iRefStride - 1;
     1597    pRef = pRefPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset;
     1598    pRec = pRecPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - 1;
     1599
     1600    for( i = 0; i < uiHeight; i++ )
     1601    {
     1602      x += pRef[0];
     1603      y += pRec[0];
     1604      xx += pRef[0] * pRef[0];
     1605      xy += pRef[0] * pRec[0];
     1606
     1607      pRef += iRefStride;
     1608      pRec += iRecStride;
     1609    }
     1610    iCountShift += iCountShift > 0 ? 1 : ( g_aucConvertToBit[ uiWidth ] + 2 );
     1611  }
     1612
     1613  Int iTempShift = ( g_uiBitDepth + g_uiBitIncrement ) + g_aucConvertToBit[ uiWidth ] + 3 - 15;
     1614
     1615  if(iTempShift > 0)
     1616  {
     1617    x  = ( x +  ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift;
     1618    y  = ( y +  ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift;
     1619    xx = ( xx + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift;
     1620    xy = ( xy + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift;
     1621    iCountShift -= iTempShift;
     1622  }
     1623
     1624  iShift = 13;
     1625
     1626  if( iCountShift == 0 )
     1627  {
     1628    a = 1;
     1629    b = 0;
     1630    iShift = 0;
     1631  }
     1632  else
     1633  {
     1634    Int a1 = ( xy << iCountShift ) - y * x;
     1635    Int a2 = ( xx << iCountShift ) - x * x;             
     1636
     1637    {
     1638      const Int iShiftA2 = 6;
     1639      const Int iShiftA1 = 15;
     1640      const Int iAccuracyShift = 15;
     1641
     1642      Int iScaleShiftA2 = 0;
     1643      Int iScaleShiftA1 = 0;
     1644      Int a1s = a1;
     1645      Int a2s = a2;
     1646
     1647      iScaleShiftA1 = GetMSB( abs( a1 ) ) - iShiftA1;
     1648      iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2; 
     1649
     1650      if( iScaleShiftA1 < 0 )
     1651      {
     1652        iScaleShiftA1 = 0;
     1653      }
     1654
     1655      if( iScaleShiftA2 < 0 )
     1656      {
     1657        iScaleShiftA2 = 0;
     1658      }
     1659
     1660      Int iScaleShiftA = iScaleShiftA2 + iAccuracyShift - iShift - iScaleShiftA1;
     1661
     1662      a2s = a2 >> iScaleShiftA2;
     1663
     1664      a1s = a1 >> iScaleShiftA1;
     1665
     1666      if (a2s >= 1)
     1667      {
     1668        a = a1s * m_uiaShift[ a2s - 1];
     1669      }
     1670      else
     1671      {
     1672        a = 0;
     1673      }
     1674
     1675      if( iScaleShiftA < 0 )
     1676      {
     1677        a = a << -iScaleShiftA;
     1678      }
     1679      else
     1680      {
     1681        a = a >> iScaleShiftA;
     1682      }
     1683
     1684      a = Clip3(-( 1 << 15 ), ( 1 << 15 ) - 1, a);
     1685
     1686      Int minA = -(1 << (6));
     1687      Int maxA = (1 << 6) - 1;
     1688      if( a <= maxA && a >= minA )
     1689      {
     1690        // do nothing
     1691      }
     1692      else
     1693      {
     1694        Short n = CountLeadingZerosOnes(a);
     1695        a = a >> (9-n);
     1696        iShift -= (9-n);
     1697      }
     1698
     1699      b = (  y - ( ( a * x ) >> iShift ) + ( 1 << ( iCountShift - 1 ) ) ) >> iCountShift;
     1700    }
     1701  }   
     1702}
     1703
     1704Void TComPrediction::xGetLLSICPredictionChroma(TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, Int &iShift, Int iChromaId)
     1705{
     1706  TComPicYuv *pRecPic = pcCU->getPic()->getPicYuvRec();
     1707  Pel *pRec = NULL, *pRef = NULL;
     1708  UInt uiWidth, uiHeight, uiTmpPartIdx;
     1709  Int iRecStride = pRecPic->getCStride(), iRefStride = pRefPic->getCStride();
     1710  Int iCUPelX, iCUPelY, iRefX, iRefY, iRefOffset;
     1711
     1712  iCUPelX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]];
     1713  iCUPelY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]];
     1714  iRefX   = iCUPelX + (pMv->getHor() >> 3);
     1715  iRefY   = iCUPelY + (pMv->getVer() >> 3);
     1716  uiWidth = pcCU->getWidth(0) >> 1;
     1717  uiHeight = pcCU->getHeight(0) >> 1;
     1718
     1719  Int i, j, iCountShift = 0;
     1720
     1721  // LLS parameters estimation -->
     1722
     1723  Int x = 0, y = 0, xx = 0, xy = 0;
     1724
     1725  if(pcCU->getPUAbove(uiTmpPartIdx, pcCU->getZorderIdxInCU()) && iCUPelY > 0 && iRefY > 0)
     1726  {
     1727    iRefOffset = ( pMv->getHor() >> 3 ) + ( pMv->getVer() >> 3 ) * iRefStride - iRefStride;
     1728    if (iChromaId == 0) // Cb
     1729    {
     1730      pRef = pRefPic->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset;
     1731      pRec = pRecPic->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - iRecStride;
     1732    }
     1733    else if (iChromaId == 1) // Cr
     1734    {
     1735      pRef = pRefPic->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset;
     1736      pRec = pRecPic->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - iRecStride;
     1737    }
     1738
     1739    for( j = 0; j < uiWidth; j++ )
     1740    {
     1741      x += pRef[j];
     1742      y += pRec[j];
     1743      xx += pRef[j] * pRef[j];
     1744      xy += pRef[j] * pRec[j];
     1745    }
     1746    iCountShift += g_aucConvertToBit[ uiWidth ] + 2;
     1747  }
     1748
     1749
     1750  if(pcCU->getPULeft(uiTmpPartIdx, pcCU->getZorderIdxInCU()) && iCUPelX > 0 && iRefX > 0)
     1751  {
     1752    iRefOffset = ( pMv->getHor() >> 3 ) + ( pMv->getVer() >> 3 ) * iRefStride - 1;
     1753    if (iChromaId == 0) // Cb
     1754    {
     1755      pRef = pRefPic->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset;
     1756      pRec = pRecPic->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - 1;
     1757    }
     1758    else if (iChromaId == 1) // Cr
     1759    {
     1760      pRef = pRefPic->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset;
     1761      pRec = pRecPic->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - 1;
     1762    }
     1763
     1764    for( i = 0; i < uiHeight; i++ )
     1765    {
     1766      x += pRef[0];
     1767      y += pRec[0];
     1768      xx += pRef[0] * pRef[0];
     1769      xy += pRef[0] * pRec[0];
     1770
     1771      pRef += iRefStride;
     1772      pRec += iRecStride;
     1773    }
     1774    iCountShift += iCountShift > 0 ? 1 : ( g_aucConvertToBit[ uiWidth ] + 2 );
     1775  }
     1776
     1777  Int iTempShift = ( g_uiBitDepth + g_uiBitIncrement ) + g_aucConvertToBit[ uiWidth ] + 3 - 15;
     1778
     1779  if(iTempShift > 0)
     1780  {
     1781    x  = ( x +  ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift;
     1782    y  = ( y +  ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift;
     1783    xx = ( xx + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift;
     1784    xy = ( xy + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift;
     1785    iCountShift -= iTempShift;
     1786  }
     1787
     1788  iShift = 13;
     1789
     1790  if( iCountShift == 0 )
     1791  {
     1792    a = 1;
     1793    b = 0;
     1794    iShift = 0;
     1795  }
     1796  else
     1797  {
     1798    Int a1 = ( xy << iCountShift ) - y * x;
     1799    Int a2 = ( xx << iCountShift ) - x * x;             
     1800
     1801    {
     1802      const Int iShiftA2 = 6;
     1803      const Int iShiftA1 = 15;
     1804      const Int iAccuracyShift = 15;
     1805
     1806      Int iScaleShiftA2 = 0;
     1807      Int iScaleShiftA1 = 0;
     1808      Int a1s = a1;
     1809      Int a2s = a2;
     1810
     1811      iScaleShiftA1 = GetMSB( abs( a1 ) ) - iShiftA1;
     1812      iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2; 
     1813
     1814      if( iScaleShiftA1 < 0 )
     1815      {
     1816        iScaleShiftA1 = 0;
     1817      }
     1818
     1819      if( iScaleShiftA2 < 0 )
     1820      {
     1821        iScaleShiftA2 = 0;
     1822      }
     1823
     1824      Int iScaleShiftA = iScaleShiftA2 + iAccuracyShift - iShift - iScaleShiftA1;
     1825
     1826      a2s = a2 >> iScaleShiftA2;
     1827
     1828      a1s = a1 >> iScaleShiftA1;
     1829
     1830      if (a2s >= 1)
     1831      {
     1832        a = a1s * m_uiaShift[ a2s - 1];
     1833      }
     1834      else
     1835      {
     1836        a = 0;
     1837      }
     1838
     1839      if( iScaleShiftA < 0 )
     1840      {
     1841        a = a << -iScaleShiftA;
     1842      }
     1843      else
     1844      {
     1845        a = a >> iScaleShiftA;
     1846      }
     1847
     1848      a = Clip3(-( 1 << 15 ), ( 1 << 15 ) - 1, a);
     1849
     1850      Int minA = -(1 << (6));
     1851      Int maxA = (1 << 6) - 1;
     1852      if( a <= maxA && a >= minA )
     1853      {
     1854        // do nothing
     1855      }
     1856      else
     1857      {
     1858        Short n = CountLeadingZerosOnes(a);
     1859        a = a >> (9-n);
     1860        iShift -= (9-n);
     1861      }
     1862
     1863      b = (  y - ( ( a * x ) >> iShift ) + ( 1 << ( iCountShift - 1 ) ) ) >> iCountShift;
     1864    }
     1865  }   
     1866}
     1867#endif
    14451868/** Function for filtering intra DC predictor.
    14461869 * \param pSrc pointer to reconstructed sample array
     
    17042127{
    17052128  assert( uiWidth >= DMM_WEDGEMODEL_MIN_SIZE && uiWidth <= DMM_WEDGEMODEL_MAX_SIZE );
    1706   WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[uiWidth])];
    17072129
    17082130  // get copy of co-located texture luma block
     
    17232145  UInt uiPredStride = cPredYuv.getStride();
    17242146
    1725   // regular wedge search
     2147  // wedge search
    17262148  TComWedgeDist cWedgeDist;
    17272149  UInt uiBestDist = MAX_UINT;
     
    17292151  Int  iDC1 = 0;
    17302152  Int  iDC2 = 0;
    1731 
     2153  WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[uiWidth])];
     2154
     2155#if HHIQC_DMMFASTSEARCH_B0039
     2156  TComPic*      pcPicTex = pcCU->getSlice()->getTexturePic();
     2157  TComDataCU* pcColTexCU = pcPicTex->getCU(pcCU->getAddr());
     2158  UInt      uiTexPartIdx = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
     2159  Int   uiColTexIntraDir = pcColTexCU->isIntra( uiTexPartIdx ) ? pcColTexCU->getLumaIntraDir( uiTexPartIdx ) : 255;
     2160
     2161  std::vector< std::vector<UInt> > pauiWdgLstSz = g_aauiWdgLstM3[g_aucConvertToBit[uiWidth]];
     2162  if( uiColTexIntraDir > DC_IDX && uiColTexIntraDir < 35 )
     2163  {
     2164    std::vector<UInt>* pauiWdgLst = &pauiWdgLstSz[uiColTexIntraDir-2];
     2165    for( UInt uiIdxW = 0; uiIdxW < pauiWdgLst->size(); uiIdxW++ )
     2166    {
     2167      UInt uiIdx     =   pauiWdgLst->at(uiIdxW);
     2168      calcWedgeDCs       ( &(pacWedgeList->at(uiIdx)), piRefBlkY, uiWidth,      iDC1, iDC2 );
     2169      assignWedgeDCs2Pred( &(pacWedgeList->at(uiIdx)), piPred,    uiPredStride, iDC1, iDC2 );
     2170
     2171      UInt uiActDist = cWedgeDist.getDistPart( piPred, uiPredStride, piRefBlkY, uiWidth, uiWidth, uiHeight, WedgeDist_SAD );
     2172
     2173      if( uiActDist < uiBestDist || uiBestDist == MAX_UINT )
     2174      {
     2175        uiBestDist   = uiActDist;
     2176        uiBestTabIdx = uiIdx;
     2177      }
     2178    }
     2179  }
     2180  else
     2181  {
     2182    WedgeNodeList* pacWedgeNodeList = &g_aacWedgeNodeLists[(g_aucConvertToBit[uiWidth])];
     2183    UInt uiBestNodeDist = MAX_UINT;
     2184    UInt uiBestNodeId   = 0;
     2185    for( UInt uiNodeId = 0; uiNodeId < pacWedgeNodeList->size(); uiNodeId++ )
     2186    {
     2187      calcWedgeDCs       ( &(pacWedgeList->at(pacWedgeNodeList->at(uiNodeId).getPatternIdx())), piRefBlkY, uiWidth,      iDC1, iDC2 );
     2188      assignWedgeDCs2Pred( &(pacWedgeList->at(pacWedgeNodeList->at(uiNodeId).getPatternIdx())), piPred,    uiPredStride, iDC1, iDC2 );
     2189
     2190      UInt uiActDist = cWedgeDist.getDistPart( piPred, uiPredStride, piRefBlkY, uiWidth, uiWidth, uiHeight, WedgeDist_SAD );
     2191
     2192      if( uiActDist < uiBestNodeDist || uiBestNodeDist == MAX_UINT )
     2193      {
     2194        uiBestNodeDist = uiActDist;
     2195        uiBestNodeId   = uiNodeId;
     2196      }
     2197    }
     2198
     2199    // refinement
     2200    uiBestDist   = uiBestNodeDist;
     2201    uiBestTabIdx = pacWedgeNodeList->at(uiBestNodeId).getPatternIdx();
     2202    for( UInt uiRefId = 0; uiRefId < NUM_WEDGE_REFINES; uiRefId++ )
     2203    {
     2204      if( pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId ) != NO_IDX )
     2205      {
     2206        calcWedgeDCs       ( &(pacWedgeList->at(pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId ))), piRefBlkY, uiWidth,      iDC1, iDC2 );
     2207        assignWedgeDCs2Pred( &(pacWedgeList->at(pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId ))), piPred,    uiPredStride, iDC1, iDC2 );
     2208
     2209        UInt uiActDist = cWedgeDist.getDistPart( piPred, uiPredStride, piRefBlkY, uiWidth, uiWidth, uiHeight, WedgeDist_SAD );
     2210
     2211        if( uiActDist < uiBestDist || uiBestDist == MAX_UINT )
     2212        {
     2213          uiBestDist   = uiActDist;
     2214          uiBestTabIdx = pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId );
     2215        }
     2216      }
     2217    }
     2218  }
     2219#else
    17322220  for( UInt uiIdx = 0; uiIdx < pacWedgeList->size(); uiIdx++ )
    17332221  {
     
    17432231    }
    17442232  }
     2233#endif
    17452234
    17462235  cPredYuv.destroy();
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComPrediction.h

    r193 r213  
    100100#endif
    101101
     102#if LGE_ILLUCOMP_B0045
     103  Void xPredInterLumaBlk  ( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi, Bool bICFlag = false );
     104  Void xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi, Bool bICFlag = false );
     105#else
    102106  Void xPredInterLumaBlk  ( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi );
    103107  Void xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi );
     108#endif
    104109  Void xWeightedAverage         ( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst );
    105 
     110 
    106111  Void xGetLLSPrediction ( TComPattern* pcPattern, Int* pSrc0, Int iSrcStride, Pel* pDst0, Int iDstStride, UInt uiWidth, UInt uiHeight, UInt uiExt0 );
    107 
     112#if LGE_ILLUCOMP_B0045
     113  Void xGetLLSICPrediction(TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, Int &iShift);
     114  Void xGetLLSICPredictionChroma(TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, Int &iShift, Int iChromaId);
     115#endif
    108116  Void xDCPredFiltering( Int* pSrc, Int iSrcStride, Pel*& rpDst, Int iDstStride, Int iWidth, Int iHeight );
    109117  Bool xCheckIdenticalMotion    ( TComDataCU* pcCU, UInt PartAddr);
     
    125133#endif
    126134
    127 #if LGE_EDGE_INTRA
     135#if LGE_EDGE_INTRA_A0070
    128136  Pel  xGetNearestNeighbor  ( Int x, Int y, Int* pSrc, Int srcStride, Int iWidth, Int iHeight, Bool* bpRegion );
    129137  Void xPredIntraEdge       ( TComDataCU* pcCU, UInt uiAbsPartIdx, Int iWidth, Int iHeight, Int* pSrc, Int srcStride, Pel*& rpDst, Int dstStride, Bool bDelta = false );
     
    142150  Void motionCompensation         ( TComDataCU*  pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1 );
    143151#endif
    144 
     152 
    145153  // motion vector prediction
    146154  Void getMvPredAMVP              ( TComDataCU* pcCU, UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMvPred );
     
    175183  Bool  getWedgePatternIdx      ( WedgeRefList* pcWedgeRefList, UInt& ruiTabIdx, UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe );
    176184#endif
    177 #if LGE_EDGE_INTRA
     185#if LGE_EDGE_INTRA_A0070
    178186  Void predIntraLumaEdge          ( TComDataCU* pcCU, TComPattern* pcTComPattern, UInt uiAbsPartIdx, Int iWidth, Int iHeight, Pel* piPred, UInt uiStride, Bool bDelta = false );
    179187#endif
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComRdCost.cpp

    r100 r213  
    543543  cDtParam.uiComp       = 255;    // just for assert: to be sure it was set before use, since only values 0,1 or 2 are allowed.
    544544#endif
     545#if LGE_ILLUCOMP_B0045
     546  cDtParam.bUseIC = false;
     547#endif
    545548  return cDtParam.DistFunc( &cDtParam );
    546549}
     
    565568
    566569#if WEIGHTED_CHROMA_DISTORTION
     570#if LGE_ILLUCOMP_B0045
     571  cDtParam.bUseIC = false;
     572#endif
    567573  if (bWeighted)
    568574  {
     
    598604  cDtParam.uiComp       = 255;    // just for assert: to be sure it was set before use, since only values 0,1 or 2 are allowed.
    599605
     606#if LGE_ILLUCOMP_B0045
     607  cDtParam.bUseIC = false;
     608#endif
    600609  return cDtParam.DistFunc( &cDtParam );
    601610}
    602611#endif
    603612
    604 
    605 // ====================================================================================================================
    606 // Distortion functions
    607 // ====================================================================================================================
    608 
    609 // --------------------------------------------------------------------------------------------------------------------
    610 // SAD
    611 // --------------------------------------------------------------------------------------------------------------------
    612 
    613613UInt TComRdCost::xGetSAD( DistParam* pcDtParam )
    614614{
     
    617617    return xGetSADw( pcDtParam );
    618618  }
     619#if LGE_ILLUCOMP_B0045
     620  if(pcDtParam->bUseIC)
     621  {
     622    return xGetSADic( pcDtParam );
     623  }
     624#endif
    619625  Pel* piOrg   = pcDtParam->pOrg;
    620626  Pel* piCur   = pcDtParam->pCur;
     
    623629  Int  iStrideCur = pcDtParam->iStrideCur;
    624630  Int  iStrideOrg = pcDtParam->iStrideOrg;
    625  
    626   UInt uiSum = 0;
    627  
     631
     632  UInt uiSum = 0;
     633
    628634  for( ; iRows != 0; iRows-- )
    629635  {
     
    635641    piCur += iStrideCur;
    636642  }
    637  
     643
    638644  return ( uiSum >> g_uiBitIncrement );
    639645}
     
    645651    return xGetSADw( pcDtParam );
    646652  }
     653#if LGE_ILLUCOMP_B0045
     654  if(pcDtParam->bUseIC)
     655  {
     656    return xGetSAD4ic( pcDtParam );
     657  }
     658#endif
    647659  Pel* piOrg   = pcDtParam->pOrg;
    648660  Pel* piCur   = pcDtParam->pCur;
     
    652664  Int  iStrideCur = pcDtParam->iStrideCur*iSubStep;
    653665  Int  iStrideOrg = pcDtParam->iStrideOrg*iSubStep;
    654  
    655   UInt uiSum = 0;
    656  
     666
     667  UInt uiSum = 0;
     668
    657669  for( ; iRows != 0; iRows-=iSubStep )
    658670  {
     
    661673    uiSum += abs( piOrg[2] - piCur[2] );
    662674    uiSum += abs( piOrg[3] - piCur[3] );
    663    
    664     piOrg += iStrideOrg;
    665     piCur += iStrideCur;
    666   }
    667  
     675
     676    piOrg += iStrideOrg;
     677    piCur += iStrideCur;
     678  }
     679
    668680  uiSum <<= iSubShift;
    669681  return ( uiSum >> g_uiBitIncrement );
     
    676688    return xGetSADw( pcDtParam );
    677689  }
     690#if LGE_ILLUCOMP_B0045
     691  if(pcDtParam->bUseIC)
     692  {
     693    return xGetSAD8ic( pcDtParam );
     694  }
     695#endif
    678696  Pel* piOrg      = pcDtParam->pOrg;
    679697  Pel* piCur      = pcDtParam->pCur;
     
    683701  Int  iStrideCur = pcDtParam->iStrideCur*iSubStep;
    684702  Int  iStrideOrg = pcDtParam->iStrideOrg*iSubStep;
    685  
    686   UInt uiSum = 0;
    687  
     703
     704  UInt uiSum = 0;
     705
    688706  for( ; iRows != 0; iRows-=iSubStep )
    689707  {
     
    696714    uiSum += abs( piOrg[6] - piCur[6] );
    697715    uiSum += abs( piOrg[7] - piCur[7] );
    698    
    699     piOrg += iStrideOrg;
    700     piCur += iStrideCur;
    701   }
    702  
     716
     717    piOrg += iStrideOrg;
     718    piCur += iStrideCur;
     719  }
     720
    703721  uiSum <<= iSubShift;
    704722  return ( uiSum >> g_uiBitIncrement );
     
    711729    return xGetSADw( pcDtParam );
    712730  }
     731#if LGE_ILLUCOMP_B0045
     732  if(pcDtParam->bUseIC)
     733  {
     734    return xGetSAD16ic( pcDtParam );
     735  }
     736#endif
    713737  Pel* piOrg   = pcDtParam->pOrg;
    714738  Pel* piCur   = pcDtParam->pCur;
     
    718742  Int  iStrideCur = pcDtParam->iStrideCur*iSubStep;
    719743  Int  iStrideOrg = pcDtParam->iStrideOrg*iSubStep;
    720  
    721   UInt uiSum = 0;
    722  
     744
     745  UInt uiSum = 0;
     746
    723747  for( ; iRows != 0; iRows-=iSubStep )
    724748  {
     
    739763    uiSum += abs( piOrg[14] - piCur[14] );
    740764    uiSum += abs( piOrg[15] - piCur[15] );
    741    
    742     piOrg += iStrideOrg;
    743     piCur += iStrideCur;
    744   }
    745  
     765
     766    piOrg += iStrideOrg;
     767    piCur += iStrideCur;
     768  }
     769
    746770  uiSum <<= iSubShift;
    747771  return ( uiSum >> g_uiBitIncrement );
     
    755779    return xGetSADw( pcDtParam );
    756780  }
     781#if LGE_ILLUCOMP_B0045
     782  if(pcDtParam->bUseIC)
     783  {
     784    return xGetSAD12ic( pcDtParam );
     785  }
     786#endif
    757787  Pel* piOrg   = pcDtParam->pOrg;
    758788  Pel* piCur   = pcDtParam->pCur;
     
    762792  Int  iStrideCur = pcDtParam->iStrideCur*iSubStep;
    763793  Int  iStrideOrg = pcDtParam->iStrideOrg*iSubStep;
    764  
    765   UInt uiSum = 0;
    766  
     794
     795  UInt uiSum = 0;
     796
    767797  for( ; iRows != 0; iRows-=iSubStep )
    768798  {
     
    779809    uiSum += abs( piOrg[10] - piCur[10] );
    780810    uiSum += abs( piOrg[11] - piCur[11] );
    781    
    782     piOrg += iStrideOrg;
    783     piCur += iStrideCur;
    784   }
    785  
     811
     812    piOrg += iStrideOrg;
     813    piCur += iStrideCur;
     814  }
     815
    786816  uiSum <<= iSubShift;
    787817  return ( uiSum >> g_uiBitIncrement );
     
    791821UInt TComRdCost::xGetSAD16N( DistParam* pcDtParam )
    792822{
     823#if LGE_ILLUCOMP_B0045
     824  if(pcDtParam->bUseIC)
     825  {
     826    return xGetSAD16Nic( pcDtParam );
     827  }
     828#endif
    793829  Pel* piOrg   = pcDtParam->pOrg;
    794830  Pel* piCur   = pcDtParam->pCur;
     
    799835  Int  iStrideCur = pcDtParam->iStrideCur*iSubStep;
    800836  Int  iStrideOrg = pcDtParam->iStrideOrg*iSubStep;
    801  
    802   UInt uiSum = 0;
    803  
     837
     838  UInt uiSum = 0;
     839
    804840  for( ; iRows != 0; iRows-=iSubStep )
    805841  {
     
    826862    piCur += iStrideCur;
    827863  }
    828  
     864
    829865  uiSum <<= iSubShift;
    830866  return ( uiSum >> g_uiBitIncrement );
     
    837873    return xGetSADw( pcDtParam );
    838874  }
     875#if LGE_ILLUCOMP_B0045
     876  if(pcDtParam->bUseIC)
     877  {
     878    return xGetSAD32ic( pcDtParam );
     879  }
     880#endif
    839881  Pel* piOrg   = pcDtParam->pOrg;
    840882  Pel* piCur   = pcDtParam->pCur;
     
    844886  Int  iStrideCur = pcDtParam->iStrideCur*iSubStep;
    845887  Int  iStrideOrg = pcDtParam->iStrideOrg*iSubStep;
    846  
    847   UInt uiSum = 0;
    848  
     888
     889  UInt uiSum = 0;
     890
    849891  for( ; iRows != 0; iRows-=iSubStep )
    850892  {
     
    881923    uiSum += abs( piOrg[30] - piCur[30] );
    882924    uiSum += abs( piOrg[31] - piCur[31] );
    883    
    884     piOrg += iStrideOrg;
    885     piCur += iStrideCur;
    886   }
    887  
     925
     926    piOrg += iStrideOrg;
     927    piCur += iStrideCur;
     928  }
     929
    888930  uiSum <<= iSubShift;
    889931  return ( uiSum >> g_uiBitIncrement );
     
    897939    return xGetSADw( pcDtParam );
    898940  }
     941#if LGE_ILLUCOMP_B0045
     942  if(pcDtParam->bUseIC)
     943  {
     944    return xGetSAD24ic( pcDtParam );
     945  }
     946#endif
    899947  Pel* piOrg   = pcDtParam->pOrg;
    900948  Pel* piCur   = pcDtParam->pCur;
     
    904952  Int  iStrideCur = pcDtParam->iStrideCur*iSubStep;
    905953  Int  iStrideOrg = pcDtParam->iStrideOrg*iSubStep;
    906  
    907   UInt uiSum = 0;
    908  
     954
     955  UInt uiSum = 0;
     956
    909957  for( ; iRows != 0; iRows-=iSubStep )
    910958  {
     
    933981    uiSum += abs( piOrg[22] - piCur[22] );
    934982    uiSum += abs( piOrg[23] - piCur[23] );
    935    
    936     piOrg += iStrideOrg;
    937     piCur += iStrideCur;
    938   }
    939  
     983
     984    piOrg += iStrideOrg;
     985    piCur += iStrideCur;
     986  }
     987
    940988  uiSum <<= iSubShift;
    941989  return ( uiSum >> g_uiBitIncrement );
     
    950998    return xGetSADw( pcDtParam );
    951999  }
     1000#if LGE_ILLUCOMP_B0045
     1001  if(pcDtParam->bUseIC)
     1002  {
     1003    return xGetSAD64ic( pcDtParam );
     1004  }
     1005#endif
    9521006  Pel* piOrg   = pcDtParam->pOrg;
    9531007  Pel* piCur   = pcDtParam->pCur;
     
    9571011  Int  iStrideCur = pcDtParam->iStrideCur*iSubStep;
    9581012  Int  iStrideOrg = pcDtParam->iStrideOrg*iSubStep;
    959  
    960   UInt uiSum = 0;
    961  
     1013
     1014  UInt uiSum = 0;
     1015
    9621016  for( ; iRows != 0; iRows-=iSubStep )
    9631017  {
     
    10261080    uiSum += abs( piOrg[62] - piCur[62] );
    10271081    uiSum += abs( piOrg[63] - piCur[63] );
    1028    
    1029     piOrg += iStrideOrg;
    1030     piCur += iStrideCur;
    1031   }
    1032  
     1082
     1083    piOrg += iStrideOrg;
     1084    piCur += iStrideCur;
     1085  }
     1086
    10331087  uiSum <<= iSubShift;
    10341088  return ( uiSum >> g_uiBitIncrement );
     
    10421096    return xGetSADw( pcDtParam );
    10431097  }
     1098#if LGE_ILLUCOMP_B0045
     1099  if(pcDtParam->bUseIC)
     1100  {
     1101    return xGetSAD48ic( pcDtParam );
     1102  }
     1103#endif
    10441104  Pel* piOrg   = pcDtParam->pOrg;
    10451105  Pel* piCur   = pcDtParam->pCur;
     
    10491109  Int  iStrideCur = pcDtParam->iStrideCur*iSubStep;
    10501110  Int  iStrideOrg = pcDtParam->iStrideOrg*iSubStep;
    1051  
    1052   UInt uiSum = 0;
    1053  
     1111
     1112  UInt uiSum = 0;
     1113
    10541114  for( ; iRows != 0; iRows-=iSubStep )
    10551115  {
     
    11021162    uiSum += abs( piOrg[46] - piCur[46] );
    11031163    uiSum += abs( piOrg[47] - piCur[47] );
    1104    
    1105     piOrg += iStrideOrg;
    1106     piCur += iStrideCur;
    1107   }
    1108  
     1164
     1165    piOrg += iStrideOrg;
     1166    piCur += iStrideCur;
     1167  }
     1168
    11091169  uiSum <<= iSubShift;
    11101170  return ( uiSum >> g_uiBitIncrement );
    11111171}
     1172#endif
     1173
     1174// ====================================================================================================================
     1175// Distortion functions
     1176// ====================================================================================================================
     1177
     1178// --------------------------------------------------------------------------------------------------------------------
     1179// SAD
     1180// --------------------------------------------------------------------------------------------------------------------
     1181#if LGE_ILLUCOMP_B0045
     1182UInt TComRdCost::xGetSADic( DistParam* pcDtParam )
     1183{
     1184  if ( pcDtParam->bApplyWeight )
     1185  {
     1186    return xGetSADw( pcDtParam );
     1187  }
     1188  Pel* piOrg   = pcDtParam->pOrg;
     1189  Pel* piCur   = pcDtParam->pCur;
     1190  Int  iRows   = pcDtParam->iRows;
     1191  Int  iCols   = pcDtParam->iCols;
     1192  Int  iStrideCur = pcDtParam->iStrideCur;
     1193  Int  iStrideOrg = pcDtParam->iStrideOrg;
     1194 
     1195  UInt uiSum = 0;
     1196 
     1197  Int  iOrigAvg = 0, iCurAvg = 0;
     1198  Int  iDeltaC;
     1199
     1200  for( ; iRows != 0; iRows-- )
     1201  {
     1202    for (Int n = 0; n < iCols; n++ )
     1203    {
     1204      iOrigAvg += piOrg[n];
     1205      iCurAvg  += piCur[n];
     1206    }
     1207    piOrg += iStrideOrg;
     1208    piCur += iStrideCur;
     1209  }
     1210
     1211  piOrg   = pcDtParam->pOrg;
     1212  piCur   = pcDtParam->pCur;
     1213  iRows   = pcDtParam->iRows;
     1214
     1215  iDeltaC = (iOrigAvg - iCurAvg)/iCols/iRows;
     1216
     1217  for( ; iRows != 0; iRows-- )
     1218  {
     1219    for (Int n = 0; n < iCols; n++ )
     1220    {
     1221      uiSum += abs( piOrg[n] - piCur[n] - iDeltaC );
     1222    }
     1223    piOrg += iStrideOrg;
     1224    piCur += iStrideCur;
     1225  }
     1226
     1227  return ( uiSum >> g_uiBitIncrement );
     1228}
     1229
     1230UInt TComRdCost::xGetSAD4ic( DistParam* pcDtParam )
     1231{
     1232  if ( pcDtParam->bApplyWeight )
     1233  {
     1234    return xGetSADw( pcDtParam );
     1235  }
     1236  Pel* piOrg   = pcDtParam->pOrg;
     1237  Pel* piCur   = pcDtParam->pCur;
     1238  Int  iRows   = pcDtParam->iRows;
     1239  Int  iSubShift  = pcDtParam->iSubShift;
     1240  Int  iSubStep   = ( 1 << iSubShift );
     1241  Int  iStrideCur = pcDtParam->iStrideCur*iSubStep;
     1242  Int  iStrideOrg = pcDtParam->iStrideOrg*iSubStep;
     1243 
     1244  UInt uiSum = 0;
     1245 
     1246  Int  iOrigAvg = 0, iCurAvg = 0, uiRowCnt = 0;
     1247  Int  iDeltaC;
     1248
     1249  for( ; iRows != 0; iRows-=iSubStep )
     1250  {
     1251    iOrigAvg += piOrg[0];
     1252    iOrigAvg += piOrg[1];
     1253    iOrigAvg += piOrg[2];
     1254    iOrigAvg += piOrg[3];
     1255
     1256    iCurAvg  += piCur[0];
     1257    iCurAvg  += piCur[1];
     1258    iCurAvg  += piCur[2];
     1259    iCurAvg  += piCur[3];
     1260
     1261    piOrg += iStrideOrg;
     1262    piCur += iStrideCur;
     1263    uiRowCnt++;
     1264  }
     1265
     1266  piOrg   = pcDtParam->pOrg;
     1267  piCur   = pcDtParam->pCur;
     1268  iRows   = pcDtParam->iRows;
     1269
     1270  iDeltaC = uiRowCnt ? ((iOrigAvg - iCurAvg)/uiRowCnt/4) : 0;
     1271
     1272  for( ; iRows != 0; iRows-=iSubStep )
     1273  {
     1274    uiSum += abs( piOrg[0] - piCur[0] - iDeltaC );
     1275    uiSum += abs( piOrg[1] - piCur[1] - iDeltaC );
     1276    uiSum += abs( piOrg[2] - piCur[2] - iDeltaC );
     1277    uiSum += abs( piOrg[3] - piCur[3] - iDeltaC );
     1278
     1279    piOrg += iStrideOrg;
     1280    piCur += iStrideCur;
     1281  }
     1282 
     1283  uiSum <<= iSubShift;
     1284  return ( uiSum >> g_uiBitIncrement );
     1285}
     1286
     1287UInt TComRdCost::xGetSAD8ic( DistParam* pcDtParam )
     1288{
     1289  if ( pcDtParam->bApplyWeight )
     1290  {
     1291    return xGetSADw( pcDtParam );
     1292  }
     1293  Pel* piOrg      = pcDtParam->pOrg;
     1294  Pel* piCur      = pcDtParam->pCur;
     1295  Int  iRows      = pcDtParam->iRows;
     1296  Int  iSubShift  = pcDtParam->iSubShift;
     1297  Int  iSubStep   = ( 1 << iSubShift );
     1298  Int  iStrideCur = pcDtParam->iStrideCur*iSubStep;
     1299  Int  iStrideOrg = pcDtParam->iStrideOrg*iSubStep;
     1300 
     1301  UInt uiSum = 0;
     1302 
     1303  Int  iOrigAvg = 0, iCurAvg = 0, uiRowCnt = 0;
     1304  Int  iDeltaC;
     1305
     1306  for( ; iRows != 0; iRows-=iSubStep )
     1307  {
     1308    iOrigAvg += piOrg[0];
     1309    iOrigAvg += piOrg[1];
     1310    iOrigAvg += piOrg[2];
     1311    iOrigAvg += piOrg[3];
     1312    iOrigAvg += piOrg[4];
     1313    iOrigAvg += piOrg[5];
     1314    iOrigAvg += piOrg[6];
     1315    iOrigAvg += piOrg[7];
     1316
     1317    iCurAvg  += piCur[0];
     1318    iCurAvg  += piCur[1];
     1319    iCurAvg  += piCur[2];
     1320    iCurAvg  += piCur[3];
     1321    iCurAvg  += piCur[4];
     1322    iCurAvg  += piCur[5];
     1323    iCurAvg  += piCur[6];
     1324    iCurAvg  += piCur[7];
     1325
     1326    piOrg += iStrideOrg;
     1327    piCur += iStrideCur;
     1328    uiRowCnt++;
     1329  }
     1330
     1331  piOrg   = pcDtParam->pOrg;
     1332  piCur   = pcDtParam->pCur;
     1333  iRows   = pcDtParam->iRows;
     1334
     1335  iDeltaC = uiRowCnt ? ((iOrigAvg - iCurAvg)/uiRowCnt/8) : 0;
     1336
     1337  for( ; iRows != 0; iRows-=iSubStep )
     1338  {
     1339    uiSum += abs( piOrg[0] - piCur[0] - iDeltaC );
     1340    uiSum += abs( piOrg[1] - piCur[1] - iDeltaC );
     1341    uiSum += abs( piOrg[2] - piCur[2] - iDeltaC );
     1342    uiSum += abs( piOrg[3] - piCur[3] - iDeltaC );
     1343    uiSum += abs( piOrg[4] - piCur[4] - iDeltaC );
     1344    uiSum += abs( piOrg[5] - piCur[5] - iDeltaC );
     1345    uiSum += abs( piOrg[6] - piCur[6] - iDeltaC );
     1346    uiSum += abs( piOrg[7] - piCur[7] - iDeltaC );
     1347
     1348    piOrg += iStrideOrg;
     1349    piCur += iStrideCur;
     1350  }
     1351 
     1352  uiSum <<= iSubShift;
     1353  return ( uiSum >> g_uiBitIncrement );
     1354}
     1355
     1356UInt TComRdCost::xGetSAD16ic( DistParam* pcDtParam )
     1357{
     1358  if ( pcDtParam->bApplyWeight )
     1359  {
     1360    return xGetSADw( pcDtParam );
     1361  }
     1362  Pel* piOrg   = pcDtParam->pOrg;
     1363  Pel* piCur   = pcDtParam->pCur;
     1364  Int  iRows   = pcDtParam->iRows;
     1365  Int  iSubShift  = pcDtParam->iSubShift;
     1366  Int  iSubStep   = ( 1 << iSubShift );
     1367  Int  iStrideCur = pcDtParam->iStrideCur*iSubStep;
     1368  Int  iStrideOrg = pcDtParam->iStrideOrg*iSubStep;
     1369 
     1370  UInt uiSum = 0;
     1371 
     1372  Int iOrigAvg = 0, iCurAvg = 0, uiRowCnt = 0;
     1373  Int iDeltaC;
     1374
     1375  for( ; iRows != 0; iRows-=iSubStep )
     1376  {
     1377    iOrigAvg += piOrg[0];
     1378    iOrigAvg += piOrg[1];
     1379    iOrigAvg += piOrg[2];
     1380    iOrigAvg += piOrg[3];
     1381    iOrigAvg += piOrg[4];
     1382    iOrigAvg += piOrg[5];
     1383    iOrigAvg += piOrg[6];
     1384    iOrigAvg += piOrg[7];
     1385    iOrigAvg += piOrg[8];
     1386    iOrigAvg += piOrg[9];
     1387    iOrigAvg += piOrg[10];
     1388    iOrigAvg += piOrg[11];
     1389    iOrigAvg += piOrg[12];
     1390    iOrigAvg += piOrg[13];
     1391    iOrigAvg += piOrg[14];
     1392    iOrigAvg += piOrg[15];
     1393
     1394    iCurAvg  += piCur[0];
     1395    iCurAvg  += piCur[1];
     1396    iCurAvg  += piCur[2];
     1397    iCurAvg  += piCur[3];
     1398    iCurAvg  += piCur[4];
     1399    iCurAvg  += piCur[5];
     1400    iCurAvg  += piCur[6];
     1401    iCurAvg  += piCur[7];
     1402    iCurAvg  += piCur[8];
     1403    iCurAvg  += piCur[9];
     1404    iCurAvg  += piCur[10];
     1405    iCurAvg  += piCur[11];
     1406    iCurAvg  += piCur[12];
     1407    iCurAvg  += piCur[13];
     1408    iCurAvg  += piCur[14];
     1409    iCurAvg  += piCur[15];
     1410
     1411    piOrg += iStrideOrg;
     1412    piCur += iStrideCur;
     1413    uiRowCnt++;
     1414  }
     1415
     1416  piOrg   = pcDtParam->pOrg;
     1417  piCur   = pcDtParam->pCur;
     1418  iRows   = pcDtParam->iRows;
     1419
     1420  iDeltaC = uiRowCnt ? ((iOrigAvg - iCurAvg)/uiRowCnt/16) : 0;
     1421
     1422  for( ; iRows != 0; iRows-=iSubStep )
     1423  {
     1424    uiSum += abs( piOrg[0] - piCur[0] - iDeltaC );
     1425    uiSum += abs( piOrg[1] - piCur[1] - iDeltaC );
     1426    uiSum += abs( piOrg[2] - piCur[2] - iDeltaC );
     1427    uiSum += abs( piOrg[3] - piCur[3] - iDeltaC );
     1428    uiSum += abs( piOrg[4] - piCur[4] - iDeltaC );
     1429    uiSum += abs( piOrg[5] - piCur[5] - iDeltaC );
     1430    uiSum += abs( piOrg[6] - piCur[6] - iDeltaC );
     1431    uiSum += abs( piOrg[7] - piCur[7] - iDeltaC );
     1432    uiSum += abs( piOrg[8] - piCur[8] - iDeltaC );
     1433    uiSum += abs( piOrg[9] - piCur[9] - iDeltaC );
     1434    uiSum += abs( piOrg[10] - piCur[10] - iDeltaC );
     1435    uiSum += abs( piOrg[11] - piCur[11] - iDeltaC );
     1436    uiSum += abs( piOrg[12] - piCur[12] - iDeltaC );
     1437    uiSum += abs( piOrg[13] - piCur[13] - iDeltaC );
     1438    uiSum += abs( piOrg[14] - piCur[14] - iDeltaC );
     1439    uiSum += abs( piOrg[15] - piCur[15] - iDeltaC );
     1440
     1441    piOrg += iStrideOrg;
     1442    piCur += iStrideCur;
     1443  }
     1444 
     1445  uiSum <<= iSubShift;
     1446  return ( uiSum >> g_uiBitIncrement );
     1447}
     1448
     1449#if AMP_SAD
     1450UInt TComRdCost::xGetSAD12ic( DistParam* pcDtParam )
     1451{
     1452  if ( pcDtParam->bApplyWeight )
     1453  {
     1454    return xGetSADw( pcDtParam );
     1455  }
     1456  Pel* piOrg   = pcDtParam->pOrg;
     1457  Pel* piCur   = pcDtParam->pCur;
     1458  Int  iRows   = pcDtParam->iRows;
     1459  Int  iSubShift  = pcDtParam->iSubShift;
     1460  Int  iSubStep   = ( 1 << iSubShift );
     1461  Int  iStrideCur = pcDtParam->iStrideCur*iSubStep;
     1462  Int  iStrideOrg = pcDtParam->iStrideOrg*iSubStep;
     1463 
     1464  UInt uiSum = 0;
     1465 
     1466  Int  iOrigAvg = 0, iCurAvg = 0, uiRowCnt = 0;
     1467  Int  iDeltaC;
     1468
     1469  for( ; iRows != 0; iRows-=iSubStep )
     1470  {
     1471    iOrigAvg += piOrg[0];
     1472    iOrigAvg += piOrg[1];
     1473    iOrigAvg += piOrg[2];
     1474    iOrigAvg += piOrg[3];
     1475    iOrigAvg += piOrg[4];
     1476    iOrigAvg += piOrg[5];
     1477    iOrigAvg += piOrg[6];
     1478    iOrigAvg += piOrg[7];
     1479    iOrigAvg += piOrg[8];
     1480    iOrigAvg += piOrg[9];
     1481    iOrigAvg += piOrg[10];
     1482    iOrigAvg += piOrg[11];
     1483
     1484    iCurAvg  += piCur[0];
     1485    iCurAvg  += piCur[1];
     1486    iCurAvg  += piCur[2];
     1487    iCurAvg  += piCur[3];
     1488    iCurAvg  += piCur[4];
     1489    iCurAvg  += piCur[5];
     1490    iCurAvg  += piCur[6];
     1491    iCurAvg  += piCur[7];
     1492    iCurAvg  += piCur[8];
     1493    iCurAvg  += piCur[9];
     1494    iCurAvg  += piCur[10];
     1495    iCurAvg  += piCur[11];
     1496
     1497    piOrg += iStrideOrg;
     1498    piCur += iStrideCur;
     1499    uiRowCnt++;
     1500  }
     1501
     1502  piOrg   = pcDtParam->pOrg;
     1503  piCur   = pcDtParam->pCur;
     1504  iRows   = pcDtParam->iRows;
     1505
     1506  iDeltaC = uiRowCnt ? ((iOrigAvg - iCurAvg)/uiRowCnt/12) : 0;
     1507
     1508  for( ; iRows != 0; iRows-=iSubStep )
     1509  {
     1510    uiSum += abs( piOrg[0] - piCur[0] - iDeltaC );
     1511    uiSum += abs( piOrg[1] - piCur[1] - iDeltaC );
     1512    uiSum += abs( piOrg[2] - piCur[2] - iDeltaC );
     1513    uiSum += abs( piOrg[3] - piCur[3] - iDeltaC );
     1514    uiSum += abs( piOrg[4] - piCur[4] - iDeltaC );
     1515    uiSum += abs( piOrg[5] - piCur[5] - iDeltaC );
     1516    uiSum += abs( piOrg[6] - piCur[6] - iDeltaC );
     1517    uiSum += abs( piOrg[7] - piCur[7] - iDeltaC );
     1518    uiSum += abs( piOrg[8] - piCur[8] - iDeltaC );
     1519    uiSum += abs( piOrg[9] - piCur[9] - iDeltaC );
     1520    uiSum += abs( piOrg[10] - piCur[10] - iDeltaC );
     1521    uiSum += abs( piOrg[11] - piCur[11] - iDeltaC );
     1522
     1523    piOrg += iStrideOrg;
     1524    piCur += iStrideCur;
     1525  }
     1526 
     1527  uiSum <<= iSubShift;
     1528  return ( uiSum >> g_uiBitIncrement );
     1529}
     1530#endif
     1531
     1532UInt TComRdCost::xGetSAD16Nic( DistParam* pcDtParam )
     1533{
     1534  Pel* piOrg   = pcDtParam->pOrg;
     1535  Pel* piCur   = pcDtParam->pCur;
     1536  Int  iRows   = pcDtParam->iRows;
     1537  Int  iCols   = pcDtParam->iCols;
     1538  Int  iSubShift  = pcDtParam->iSubShift;
     1539  Int  iSubStep   = ( 1 << iSubShift );
     1540  Int  iStrideCur = pcDtParam->iStrideCur*iSubStep;
     1541  Int  iStrideOrg = pcDtParam->iStrideOrg*iSubStep;
     1542 
     1543  UInt uiSum = 0;
     1544
     1545  Int iOrigAvg = 0, iCurAvg = 0, uiRowCnt = 0, uiColCnt = (iCols-1)/16 + 1;
     1546  Int  iDeltaC;
     1547
     1548  for( ; iRows != 0; iRows-=iSubStep )
     1549  {
     1550    for (Int n = 0; n < iCols; n+=16 )
     1551    {
     1552      iOrigAvg += piOrg[n + 0];
     1553      iOrigAvg += piOrg[n + 1];
     1554      iOrigAvg += piOrg[n + 2];
     1555      iOrigAvg += piOrg[n + 3];
     1556      iOrigAvg += piOrg[n + 4];
     1557      iOrigAvg += piOrg[n + 5];
     1558      iOrigAvg += piOrg[n + 6];
     1559      iOrigAvg += piOrg[n + 7];
     1560      iOrigAvg += piOrg[n + 8];
     1561      iOrigAvg += piOrg[n + 9];
     1562      iOrigAvg += piOrg[n + 10];
     1563      iOrigAvg += piOrg[n + 11];
     1564      iOrigAvg += piOrg[n + 12];
     1565      iOrigAvg += piOrg[n + 13];
     1566      iOrigAvg += piOrg[n + 14];
     1567      iOrigAvg += piOrg[n + 15];
     1568
     1569      iCurAvg  += piCur[n + 0];
     1570      iCurAvg  += piCur[n + 1];
     1571      iCurAvg  += piCur[n + 2];
     1572      iCurAvg  += piCur[n + 3];
     1573      iCurAvg  += piCur[n + 4];
     1574      iCurAvg  += piCur[n + 5];
     1575      iCurAvg  += piCur[n + 6];
     1576      iCurAvg  += piCur[n + 7];
     1577      iCurAvg  += piCur[n + 8];
     1578      iCurAvg  += piCur[n + 9];
     1579      iCurAvg  += piCur[n + 10];
     1580      iCurAvg  += piCur[n + 11];
     1581      iCurAvg  += piCur[n + 12];
     1582      iCurAvg  += piCur[n + 13];
     1583      iCurAvg  += piCur[n + 14];
     1584      iCurAvg  += piCur[n + 15];
     1585    }
     1586    piOrg += iStrideOrg;
     1587    piCur += iStrideCur;
     1588    uiRowCnt++;
     1589  }
     1590  piOrg   = pcDtParam->pOrg;
     1591  piCur   = pcDtParam->pCur;
     1592  iRows   = pcDtParam->iRows;
     1593
     1594  iDeltaC = (uiRowCnt && uiColCnt) ? ((iOrigAvg - iCurAvg)/uiRowCnt/uiColCnt/16) : 0;
     1595
     1596  for( ; iRows != 0; iRows-=iSubStep )
     1597  {
     1598    for (Int n = 0; n < iCols; n+=16 )
     1599    {
     1600      uiSum += abs( piOrg[n+ 0] - piCur[n+ 0] - iDeltaC );
     1601      uiSum += abs( piOrg[n+ 1] - piCur[n+ 1] - iDeltaC );
     1602      uiSum += abs( piOrg[n+ 2] - piCur[n+ 2] - iDeltaC );
     1603      uiSum += abs( piOrg[n+ 3] - piCur[n+ 3] - iDeltaC );
     1604      uiSum += abs( piOrg[n+ 4] - piCur[n+ 4] - iDeltaC );
     1605      uiSum += abs( piOrg[n+ 5] - piCur[n+ 5] - iDeltaC );
     1606      uiSum += abs( piOrg[n+ 6] - piCur[n+ 6] - iDeltaC );
     1607      uiSum += abs( piOrg[n+ 7] - piCur[n+ 7] - iDeltaC );
     1608      uiSum += abs( piOrg[n+ 8] - piCur[n+ 8] - iDeltaC );
     1609      uiSum += abs( piOrg[n+ 9] - piCur[n+ 9] - iDeltaC );
     1610      uiSum += abs( piOrg[n+10] - piCur[n+10] - iDeltaC );
     1611      uiSum += abs( piOrg[n+11] - piCur[n+11] - iDeltaC );
     1612      uiSum += abs( piOrg[n+12] - piCur[n+12] - iDeltaC );
     1613      uiSum += abs( piOrg[n+13] - piCur[n+13] - iDeltaC );
     1614      uiSum += abs( piOrg[n+14] - piCur[n+14] - iDeltaC );
     1615      uiSum += abs( piOrg[n+15] - piCur[n+15] - iDeltaC );
     1616    }
     1617    piOrg += iStrideOrg;
     1618    piCur += iStrideCur;
     1619  }
     1620 
     1621  uiSum <<= iSubShift;
     1622  return ( uiSum >> g_uiBitIncrement );
     1623}
     1624
     1625UInt TComRdCost::xGetSAD32ic( DistParam* pcDtParam )
     1626{
     1627  if ( pcDtParam->bApplyWeight )
     1628  {
     1629    return xGetSADw( pcDtParam );
     1630  }
     1631  Pel* piOrg   = pcDtParam->pOrg;
     1632  Pel* piCur   = pcDtParam->pCur;
     1633  Int  iRows   = pcDtParam->iRows;
     1634  Int  iSubShift  = pcDtParam->iSubShift;
     1635  Int  iSubStep   = ( 1 << iSubShift );
     1636  Int  iStrideCur = pcDtParam->iStrideCur*iSubStep;
     1637  Int  iStrideOrg = pcDtParam->iStrideOrg*iSubStep;
     1638 
     1639  UInt uiSum = 0;
     1640 
     1641  Int  iOrigAvg = 0, iCurAvg = 0, uiRowCnt = 0;
     1642  Int  iDeltaC;
     1643
     1644  for( ; iRows != 0; iRows-=iSubStep )
     1645  {
     1646    iOrigAvg += piOrg[0];
     1647    iOrigAvg += piOrg[1];
     1648    iOrigAvg += piOrg[2];
     1649    iOrigAvg += piOrg[3];
     1650    iOrigAvg += piOrg[4];
     1651    iOrigAvg += piOrg[5];
     1652    iOrigAvg += piOrg[6];
     1653    iOrigAvg += piOrg[7];
     1654    iOrigAvg += piOrg[8];
     1655    iOrigAvg += piOrg[9];
     1656    iOrigAvg += piOrg[10];
     1657    iOrigAvg += piOrg[11];
     1658    iOrigAvg += piOrg[12];
     1659    iOrigAvg += piOrg[13];
     1660    iOrigAvg += piOrg[14];
     1661    iOrigAvg += piOrg[15];
     1662    iOrigAvg += piOrg[16];
     1663    iOrigAvg += piOrg[17];
     1664    iOrigAvg += piOrg[18];
     1665    iOrigAvg += piOrg[19];
     1666    iOrigAvg += piOrg[20];
     1667    iOrigAvg += piOrg[21];
     1668    iOrigAvg += piOrg[22];
     1669    iOrigAvg += piOrg[23];
     1670    iOrigAvg += piOrg[24];
     1671    iOrigAvg += piOrg[25];
     1672    iOrigAvg += piOrg[26];
     1673    iOrigAvg += piOrg[27];
     1674    iOrigAvg += piOrg[28];
     1675    iOrigAvg += piOrg[29];
     1676    iOrigAvg += piOrg[30];
     1677    iOrigAvg += piOrg[31];
     1678
     1679    iCurAvg  += piCur[0];
     1680    iCurAvg  += piCur[1];
     1681    iCurAvg  += piCur[2];
     1682    iCurAvg  += piCur[3];
     1683    iCurAvg  += piCur[4];
     1684    iCurAvg  += piCur[5];
     1685    iCurAvg  += piCur[6];
     1686    iCurAvg  += piCur[7];
     1687    iCurAvg  += piCur[8];
     1688    iCurAvg  += piCur[9];
     1689    iCurAvg  += piCur[10];
     1690    iCurAvg  += piCur[11];
     1691    iCurAvg  += piCur[12];
     1692    iCurAvg  += piCur[13];
     1693    iCurAvg  += piCur[14];
     1694    iCurAvg  += piCur[15];
     1695    iCurAvg  += piCur[16];
     1696    iCurAvg  += piCur[17];
     1697    iCurAvg  += piCur[18];
     1698    iCurAvg  += piCur[19];
     1699    iCurAvg  += piCur[20];
     1700    iCurAvg  += piCur[21];
     1701    iCurAvg  += piCur[22];
     1702    iCurAvg  += piCur[23];
     1703    iCurAvg  += piCur[24];
     1704    iCurAvg  += piCur[25];
     1705    iCurAvg  += piCur[26];
     1706    iCurAvg  += piCur[27];
     1707    iCurAvg  += piCur[28];
     1708    iCurAvg  += piCur[29];
     1709    iCurAvg  += piCur[30];
     1710    iCurAvg  += piCur[31];
     1711
     1712    piOrg += iStrideOrg;
     1713    piCur += iStrideCur;
     1714    uiRowCnt++;
     1715  }
     1716
     1717  piOrg   = pcDtParam->pOrg;
     1718  piCur   = pcDtParam->pCur;
     1719  iRows   = pcDtParam->iRows;
     1720
     1721  iDeltaC = uiRowCnt ? ((iOrigAvg - iCurAvg)/uiRowCnt/32) : 0;
     1722
     1723  for( ; iRows != 0; iRows-=iSubStep )
     1724  {
     1725    uiSum += abs( piOrg[0] - piCur[0] - iDeltaC );
     1726    uiSum += abs( piOrg[1] - piCur[1] - iDeltaC );
     1727    uiSum += abs( piOrg[2] - piCur[2] - iDeltaC );
     1728    uiSum += abs( piOrg[3] - piCur[3] - iDeltaC );
     1729    uiSum += abs( piOrg[4] - piCur[4] - iDeltaC );
     1730    uiSum += abs( piOrg[5] - piCur[5] - iDeltaC );
     1731    uiSum += abs( piOrg[6] - piCur[6] - iDeltaC );
     1732    uiSum += abs( piOrg[7] - piCur[7] - iDeltaC );
     1733    uiSum += abs( piOrg[8] - piCur[8] - iDeltaC );
     1734    uiSum += abs( piOrg[9] - piCur[9] - iDeltaC );
     1735    uiSum += abs( piOrg[10] - piCur[10] - iDeltaC );
     1736    uiSum += abs( piOrg[11] - piCur[11] - iDeltaC );
     1737    uiSum += abs( piOrg[12] - piCur[12] - iDeltaC );
     1738    uiSum += abs( piOrg[13] - piCur[13] - iDeltaC );
     1739    uiSum += abs( piOrg[14] - piCur[14] - iDeltaC );
     1740    uiSum += abs( piOrg[15] - piCur[15] - iDeltaC );
     1741    uiSum += abs( piOrg[16] - piCur[16] - iDeltaC );
     1742    uiSum += abs( piOrg[17] - piCur[17] - iDeltaC );
     1743    uiSum += abs( piOrg[18] - piCur[18] - iDeltaC );
     1744    uiSum += abs( piOrg[19] - piCur[19] - iDeltaC );
     1745    uiSum += abs( piOrg[20] - piCur[20] - iDeltaC );
     1746    uiSum += abs( piOrg[21] - piCur[21] - iDeltaC );
     1747    uiSum += abs( piOrg[22] - piCur[22] - iDeltaC );
     1748    uiSum += abs( piOrg[23] - piCur[23] - iDeltaC );
     1749    uiSum += abs( piOrg[24] - piCur[24] - iDeltaC );
     1750    uiSum += abs( piOrg[25] - piCur[25] - iDeltaC );
     1751    uiSum += abs( piOrg[26] - piCur[26] - iDeltaC );
     1752    uiSum += abs( piOrg[27] - piCur[27] - iDeltaC );
     1753    uiSum += abs( piOrg[28] - piCur[28] - iDeltaC );
     1754    uiSum += abs( piOrg[29] - piCur[29] - iDeltaC );
     1755    uiSum += abs( piOrg[30] - piCur[30] - iDeltaC );
     1756    uiSum += abs( piOrg[31] - piCur[31] - iDeltaC );
     1757
     1758    piOrg += iStrideOrg;
     1759    piCur += iStrideCur;
     1760  }
     1761 
     1762  uiSum <<= iSubShift;
     1763  return ( uiSum >> g_uiBitIncrement );
     1764}
     1765
     1766#if AMP_SAD
     1767UInt TComRdCost::xGetSAD24ic( DistParam* pcDtParam )
     1768{
     1769  if ( pcDtParam->bApplyWeight )
     1770  {
     1771    return xGetSADw( pcDtParam );
     1772  }
     1773  Pel* piOrg   = pcDtParam->pOrg;
     1774  Pel* piCur   = pcDtParam->pCur;
     1775  Int  iRows   = pcDtParam->iRows;
     1776  Int  iSubShift  = pcDtParam->iSubShift;
     1777  Int  iSubStep   = ( 1 << iSubShift );
     1778  Int  iStrideCur = pcDtParam->iStrideCur*iSubStep;
     1779  Int  iStrideOrg = pcDtParam->iStrideOrg*iSubStep;
     1780 
     1781  UInt uiSum = 0;
     1782 
     1783  Int  iOrigAvg = 0, iCurAvg = 0, uiRowCnt = 0;
     1784  Int  iDeltaC;
     1785
     1786  for( ; iRows != 0; iRows-=iSubStep )
     1787  {
     1788    iOrigAvg += piOrg[0];
     1789    iOrigAvg += piOrg[1];
     1790    iOrigAvg += piOrg[2];
     1791    iOrigAvg += piOrg[3];
     1792    iOrigAvg += piOrg[4];
     1793    iOrigAvg += piOrg[5];
     1794    iOrigAvg += piOrg[6];
     1795    iOrigAvg += piOrg[7];
     1796    iOrigAvg += piOrg[8];
     1797    iOrigAvg += piOrg[9];
     1798    iOrigAvg += piOrg[10];
     1799    iOrigAvg += piOrg[11];
     1800    iOrigAvg += piOrg[12];
     1801    iOrigAvg += piOrg[13];
     1802    iOrigAvg += piOrg[14];
     1803    iOrigAvg += piOrg[15];
     1804    iOrigAvg += piOrg[16];
     1805    iOrigAvg += piOrg[17];
     1806    iOrigAvg += piOrg[18];
     1807    iOrigAvg += piOrg[19];
     1808    iOrigAvg += piOrg[20];
     1809    iOrigAvg += piOrg[21];
     1810    iOrigAvg += piOrg[22];
     1811    iOrigAvg += piOrg[23];
     1812
     1813    iCurAvg  += piCur[0];
     1814    iCurAvg  += piCur[1];
     1815    iCurAvg  += piCur[2];
     1816    iCurAvg  += piCur[3];
     1817    iCurAvg  += piCur[4];
     1818    iCurAvg  += piCur[5];
     1819    iCurAvg  += piCur[6];
     1820    iCurAvg  += piCur[7];
     1821    iCurAvg  += piCur[8];
     1822    iCurAvg  += piCur[9];
     1823    iCurAvg  += piCur[10];
     1824    iCurAvg  += piCur[11];
     1825    iCurAvg  += piCur[12];
     1826    iCurAvg  += piCur[13];
     1827    iCurAvg  += piCur[14];
     1828    iCurAvg  += piCur[15];
     1829    iCurAvg  += piCur[16];
     1830    iCurAvg  += piCur[17];
     1831    iCurAvg  += piCur[18];
     1832    iCurAvg  += piCur[19];
     1833    iCurAvg  += piCur[20];
     1834    iCurAvg  += piCur[21];
     1835    iCurAvg  += piCur[22];
     1836    iCurAvg  += piCur[23];
     1837
     1838    piOrg += iStrideOrg;
     1839    piCur += iStrideCur;
     1840    uiRowCnt++;
     1841  }
     1842
     1843  piOrg   = pcDtParam->pOrg;
     1844  piCur   = pcDtParam->pCur;
     1845  iRows   = pcDtParam->iRows;
     1846 
     1847  iDeltaC = uiRowCnt ? ((iOrigAvg - iCurAvg)/uiRowCnt/24) : 0;
     1848
     1849  for( ; iRows != 0; iRows-=iSubStep )
     1850  {
     1851    uiSum += abs( piOrg[0] - piCur[0] - iDeltaC );
     1852    uiSum += abs( piOrg[1] - piCur[1] - iDeltaC );
     1853    uiSum += abs( piOrg[2] - piCur[2] - iDeltaC );
     1854    uiSum += abs( piOrg[3] - piCur[3] - iDeltaC );
     1855    uiSum += abs( piOrg[4] - piCur[4] - iDeltaC );
     1856    uiSum += abs( piOrg[5] - piCur[5] - iDeltaC );
     1857    uiSum += abs( piOrg[6] - piCur[6] - iDeltaC );
     1858    uiSum += abs( piOrg[7] - piCur[7] - iDeltaC );
     1859    uiSum += abs( piOrg[8] - piCur[8] - iDeltaC );
     1860    uiSum += abs( piOrg[9] - piCur[9] - iDeltaC );
     1861    uiSum += abs( piOrg[10] - piCur[10] - iDeltaC );
     1862    uiSum += abs( piOrg[11] - piCur[11] - iDeltaC );
     1863    uiSum += abs( piOrg[12] - piCur[12] - iDeltaC );
     1864    uiSum += abs( piOrg[13] - piCur[13] - iDeltaC );
     1865    uiSum += abs( piOrg[14] - piCur[14] - iDeltaC );
     1866    uiSum += abs( piOrg[15] - piCur[15] - iDeltaC );
     1867    uiSum += abs( piOrg[16] - piCur[16] - iDeltaC );
     1868    uiSum += abs( piOrg[17] - piCur[17] - iDeltaC );
     1869    uiSum += abs( piOrg[18] - piCur[18] - iDeltaC );
     1870    uiSum += abs( piOrg[19] - piCur[19] - iDeltaC );
     1871    uiSum += abs( piOrg[20] - piCur[20] - iDeltaC );
     1872    uiSum += abs( piOrg[21] - piCur[21] - iDeltaC );
     1873    uiSum += abs( piOrg[22] - piCur[22] - iDeltaC );
     1874    uiSum += abs( piOrg[23] - piCur[23] - iDeltaC );
     1875
     1876    piOrg += iStrideOrg;
     1877    piCur += iStrideCur;
     1878  }
     1879
     1880  uiSum <<= iSubShift;
     1881  return ( uiSum >> g_uiBitIncrement );
     1882}
     1883#endif
     1884
     1885UInt TComRdCost::xGetSAD64ic( DistParam* pcDtParam )
     1886{
     1887  if ( pcDtParam->bApplyWeight )
     1888  {
     1889    return xGetSADw( pcDtParam );
     1890  }
     1891  Pel* piOrg   = pcDtParam->pOrg;
     1892  Pel* piCur   = pcDtParam->pCur;
     1893  Int  iRows   = pcDtParam->iRows;
     1894  Int  iSubShift  = pcDtParam->iSubShift;
     1895  Int  iSubStep   = ( 1 << iSubShift );
     1896  Int  iStrideCur = pcDtParam->iStrideCur*iSubStep;
     1897  Int  iStrideOrg = pcDtParam->iStrideOrg*iSubStep;
     1898 
     1899  UInt uiSum = 0;
     1900 
     1901  Int  iOrigAvg = 0, iCurAvg = 0, uiRowCnt = 0;
     1902  Int  iDeltaC;
     1903
     1904  for( ; iRows != 0; iRows-=iSubStep )
     1905  {
     1906    iOrigAvg += piOrg[0] ;
     1907    iOrigAvg += piOrg[1] ;
     1908    iOrigAvg += piOrg[2] ;
     1909    iOrigAvg += piOrg[3] ;
     1910    iOrigAvg += piOrg[4] ;
     1911    iOrigAvg += piOrg[5] ;
     1912    iOrigAvg += piOrg[6] ;
     1913    iOrigAvg += piOrg[7] ;
     1914    iOrigAvg += piOrg[8] ;
     1915    iOrigAvg += piOrg[9] ;
     1916    iOrigAvg += piOrg[10] ;
     1917    iOrigAvg += piOrg[11] ;
     1918    iOrigAvg += piOrg[12] ;
     1919    iOrigAvg += piOrg[13] ;
     1920    iOrigAvg += piOrg[14] ;
     1921    iOrigAvg += piOrg[15] ;
     1922    iOrigAvg += piOrg[16] ;
     1923    iOrigAvg += piOrg[17] ;
     1924    iOrigAvg += piOrg[18] ;
     1925    iOrigAvg += piOrg[19] ;
     1926    iOrigAvg += piOrg[20] ;
     1927    iOrigAvg += piOrg[21] ;
     1928    iOrigAvg += piOrg[22] ;
     1929    iOrigAvg += piOrg[23] ;
     1930    iOrigAvg += piOrg[24] ;
     1931    iOrigAvg += piOrg[25] ;
     1932    iOrigAvg += piOrg[26] ;
     1933    iOrigAvg += piOrg[27] ;
     1934    iOrigAvg += piOrg[28] ;
     1935    iOrigAvg += piOrg[29] ;
     1936    iOrigAvg += piOrg[30] ;
     1937    iOrigAvg += piOrg[31] ;
     1938    iOrigAvg += piOrg[32] ;
     1939    iOrigAvg += piOrg[33] ;
     1940    iOrigAvg += piOrg[34] ;
     1941    iOrigAvg += piOrg[35] ;
     1942    iOrigAvg += piOrg[36] ;
     1943    iOrigAvg += piOrg[37] ;
     1944    iOrigAvg += piOrg[38] ;
     1945    iOrigAvg += piOrg[39] ;
     1946    iOrigAvg += piOrg[40] ;
     1947    iOrigAvg += piOrg[41] ;
     1948    iOrigAvg += piOrg[42] ;
     1949    iOrigAvg += piOrg[43] ;
     1950    iOrigAvg += piOrg[44] ;
     1951    iOrigAvg += piOrg[45] ;
     1952    iOrigAvg += piOrg[46] ;
     1953    iOrigAvg += piOrg[47] ;
     1954    iOrigAvg += piOrg[48] ;
     1955    iOrigAvg += piOrg[49] ;
     1956    iOrigAvg += piOrg[50] ;
     1957    iOrigAvg += piOrg[51] ;
     1958    iOrigAvg += piOrg[52] ;
     1959    iOrigAvg += piOrg[53] ;
     1960    iOrigAvg += piOrg[54] ;
     1961    iOrigAvg += piOrg[55] ;
     1962    iOrigAvg += piOrg[56] ;
     1963    iOrigAvg += piOrg[57] ;
     1964    iOrigAvg += piOrg[58] ;
     1965    iOrigAvg += piOrg[59] ;
     1966    iOrigAvg += piOrg[60] ;
     1967    iOrigAvg += piOrg[61] ;
     1968    iOrigAvg += piOrg[62] ;
     1969    iOrigAvg += piOrg[63] ;
     1970
     1971    iCurAvg += piCur[0] ;
     1972    iCurAvg += piCur[1] ;
     1973    iCurAvg += piCur[2] ;
     1974    iCurAvg += piCur[3] ;
     1975    iCurAvg += piCur[4] ;
     1976    iCurAvg += piCur[5] ;
     1977    iCurAvg += piCur[6] ;
     1978    iCurAvg += piCur[7] ;
     1979    iCurAvg += piCur[8] ;
     1980    iCurAvg += piCur[9] ;
     1981    iCurAvg += piCur[10] ;
     1982    iCurAvg += piCur[11] ;
     1983    iCurAvg += piCur[12] ;
     1984    iCurAvg += piCur[13] ;
     1985    iCurAvg += piCur[14] ;
     1986    iCurAvg += piCur[15] ;
     1987    iCurAvg += piCur[16] ;
     1988    iCurAvg += piCur[17] ;
     1989    iCurAvg += piCur[18] ;
     1990    iCurAvg += piCur[19] ;
     1991    iCurAvg += piCur[20] ;
     1992    iCurAvg += piCur[21] ;
     1993    iCurAvg += piCur[22] ;
     1994    iCurAvg += piCur[23] ;
     1995    iCurAvg += piCur[24] ;
     1996    iCurAvg += piCur[25] ;
     1997    iCurAvg += piCur[26] ;
     1998    iCurAvg += piCur[27] ;
     1999    iCurAvg += piCur[28] ;
     2000    iCurAvg += piCur[29] ;
     2001    iCurAvg += piCur[30] ;
     2002    iCurAvg += piCur[31] ;
     2003    iCurAvg += piCur[32] ;
     2004    iCurAvg += piCur[33] ;
     2005    iCurAvg += piCur[34] ;
     2006    iCurAvg += piCur[35] ;
     2007    iCurAvg += piCur[36] ;
     2008    iCurAvg += piCur[37] ;
     2009    iCurAvg += piCur[38] ;
     2010    iCurAvg += piCur[39] ;
     2011    iCurAvg += piCur[40] ;
     2012    iCurAvg += piCur[41] ;
     2013    iCurAvg += piCur[42] ;
     2014    iCurAvg += piCur[43] ;
     2015    iCurAvg += piCur[44] ;
     2016    iCurAvg += piCur[45] ;
     2017    iCurAvg += piCur[46] ;
     2018    iCurAvg += piCur[47] ;
     2019    iCurAvg += piCur[48] ;
     2020    iCurAvg += piCur[49] ;
     2021    iCurAvg += piCur[50] ;
     2022    iCurAvg += piCur[51] ;
     2023    iCurAvg += piCur[52] ;
     2024    iCurAvg += piCur[53] ;
     2025    iCurAvg += piCur[54] ;
     2026    iCurAvg += piCur[55] ;
     2027    iCurAvg += piCur[56] ;
     2028    iCurAvg += piCur[57] ;
     2029    iCurAvg += piCur[58] ;
     2030    iCurAvg += piCur[59] ;
     2031    iCurAvg += piCur[60] ;
     2032    iCurAvg += piCur[61] ;
     2033    iCurAvg += piCur[62] ;
     2034    iCurAvg += piCur[63] ;
     2035
     2036    piOrg += iStrideOrg;
     2037    piCur += iStrideCur;
     2038    uiRowCnt++;
     2039  }
     2040
     2041  piOrg   = pcDtParam->pOrg;
     2042  piCur   = pcDtParam->pCur;
     2043  iRows   = pcDtParam->iRows;
     2044
     2045  iDeltaC = uiRowCnt ? ((iOrigAvg - iCurAvg)/uiRowCnt/64) : 0;
     2046
     2047  for( ; iRows != 0; iRows-=iSubStep )
     2048  {
     2049    uiSum += abs( piOrg[0] - piCur[0] - iDeltaC );
     2050    uiSum += abs( piOrg[1] - piCur[1] - iDeltaC );
     2051    uiSum += abs( piOrg[2] - piCur[2] - iDeltaC );
     2052    uiSum += abs( piOrg[3] - piCur[3] - iDeltaC );
     2053    uiSum += abs( piOrg[4] - piCur[4] - iDeltaC );
     2054    uiSum += abs( piOrg[5] - piCur[5] - iDeltaC );
     2055    uiSum += abs( piOrg[6] - piCur[6] - iDeltaC );
     2056    uiSum += abs( piOrg[7] - piCur[7] - iDeltaC );
     2057    uiSum += abs( piOrg[8] - piCur[8] - iDeltaC );
     2058    uiSum += abs( piOrg[9] - piCur[9] - iDeltaC );
     2059    uiSum += abs( piOrg[10] - piCur[10] - iDeltaC );
     2060    uiSum += abs( piOrg[11] - piCur[11] - iDeltaC );
     2061    uiSum += abs( piOrg[12] - piCur[12] - iDeltaC );
     2062    uiSum += abs( piOrg[13] - piCur[13] - iDeltaC );
     2063    uiSum += abs( piOrg[14] - piCur[14] - iDeltaC );
     2064    uiSum += abs( piOrg[15] - piCur[15] - iDeltaC );
     2065    uiSum += abs( piOrg[16] - piCur[16] - iDeltaC );
     2066    uiSum += abs( piOrg[17] - piCur[17] - iDeltaC );
     2067    uiSum += abs( piOrg[18] - piCur[18] - iDeltaC );
     2068    uiSum += abs( piOrg[19] - piCur[19] - iDeltaC );
     2069    uiSum += abs( piOrg[20] - piCur[20] - iDeltaC );
     2070    uiSum += abs( piOrg[21] - piCur[21] - iDeltaC );
     2071    uiSum += abs( piOrg[22] - piCur[22] - iDeltaC );
     2072    uiSum += abs( piOrg[23] - piCur[23] - iDeltaC );
     2073    uiSum += abs( piOrg[24] - piCur[24] - iDeltaC );
     2074    uiSum += abs( piOrg[25] - piCur[25] - iDeltaC );
     2075    uiSum += abs( piOrg[26] - piCur[26] - iDeltaC );
     2076    uiSum += abs( piOrg[27] - piCur[27] - iDeltaC );
     2077    uiSum += abs( piOrg[28] - piCur[28] - iDeltaC );
     2078    uiSum += abs( piOrg[29] - piCur[29] - iDeltaC );
     2079    uiSum += abs( piOrg[30] - piCur[30] - iDeltaC );
     2080    uiSum += abs( piOrg[31] - piCur[31] - iDeltaC );
     2081    uiSum += abs( piOrg[32] - piCur[32] - iDeltaC );
     2082    uiSum += abs( piOrg[33] - piCur[33] - iDeltaC );
     2083    uiSum += abs( piOrg[34] - piCur[34] - iDeltaC );
     2084    uiSum += abs( piOrg[35] - piCur[35] - iDeltaC );
     2085    uiSum += abs( piOrg[36] - piCur[36] - iDeltaC );
     2086    uiSum += abs( piOrg[37] - piCur[37] - iDeltaC );
     2087    uiSum += abs( piOrg[38] - piCur[38] - iDeltaC );
     2088    uiSum += abs( piOrg[39] - piCur[39] - iDeltaC );
     2089    uiSum += abs( piOrg[40] - piCur[40] - iDeltaC );
     2090    uiSum += abs( piOrg[41] - piCur[41] - iDeltaC );
     2091    uiSum += abs( piOrg[42] - piCur[42] - iDeltaC );
     2092    uiSum += abs( piOrg[43] - piCur[43] - iDeltaC );
     2093    uiSum += abs( piOrg[44] - piCur[44] - iDeltaC );
     2094    uiSum += abs( piOrg[45] - piCur[45] - iDeltaC );
     2095    uiSum += abs( piOrg[46] - piCur[46] - iDeltaC );
     2096    uiSum += abs( piOrg[47] - piCur[47] - iDeltaC );
     2097    uiSum += abs( piOrg[48] - piCur[48] - iDeltaC );
     2098    uiSum += abs( piOrg[49] - piCur[49] - iDeltaC );
     2099    uiSum += abs( piOrg[50] - piCur[50] - iDeltaC );
     2100    uiSum += abs( piOrg[51] - piCur[51] - iDeltaC );
     2101    uiSum += abs( piOrg[52] - piCur[52] - iDeltaC );
     2102    uiSum += abs( piOrg[53] - piCur[53] - iDeltaC );
     2103    uiSum += abs( piOrg[54] - piCur[54] - iDeltaC );
     2104    uiSum += abs( piOrg[55] - piCur[55] - iDeltaC );
     2105    uiSum += abs( piOrg[56] - piCur[56] - iDeltaC );
     2106    uiSum += abs( piOrg[57] - piCur[57] - iDeltaC );
     2107    uiSum += abs( piOrg[58] - piCur[58] - iDeltaC );
     2108    uiSum += abs( piOrg[59] - piCur[59] - iDeltaC );
     2109    uiSum += abs( piOrg[60] - piCur[60] - iDeltaC );
     2110    uiSum += abs( piOrg[61] - piCur[61] - iDeltaC );
     2111    uiSum += abs( piOrg[62] - piCur[62] - iDeltaC );
     2112    uiSum += abs( piOrg[63] - piCur[63] - iDeltaC );
     2113
     2114    piOrg += iStrideOrg;
     2115    piCur += iStrideCur;
     2116  }
     2117 
     2118  uiSum <<= iSubShift;
     2119  return ( uiSum >> g_uiBitIncrement );
     2120}
     2121
     2122#if AMP_SAD
     2123UInt TComRdCost::xGetSAD48ic( DistParam* pcDtParam )
     2124{
     2125  if ( pcDtParam->bApplyWeight )
     2126  {
     2127    return xGetSADw( pcDtParam );
     2128  }
     2129  Pel* piOrg   = pcDtParam->pOrg;
     2130  Pel* piCur   = pcDtParam->pCur;
     2131  Int  iRows   = pcDtParam->iRows;
     2132  Int  iSubShift  = pcDtParam->iSubShift;
     2133  Int  iSubStep   = ( 1 << iSubShift );
     2134  Int  iStrideCur = pcDtParam->iStrideCur*iSubStep;
     2135  Int  iStrideOrg = pcDtParam->iStrideOrg*iSubStep;
     2136 
     2137  UInt uiSum = 0;
     2138 
     2139  Int  iOrigAvg = 0, iCurAvg = 0, uiRowCnt = 0;
     2140  Int  iDeltaC;
     2141
     2142  for( ; iRows != 0; iRows-=iSubStep )
     2143  {
     2144    iOrigAvg += piOrg[0] ;
     2145    iOrigAvg += piOrg[1] ;
     2146    iOrigAvg += piOrg[2] ;
     2147    iOrigAvg += piOrg[3] ;
     2148    iOrigAvg += piOrg[4] ;
     2149    iOrigAvg += piOrg[5] ;
     2150    iOrigAvg += piOrg[6] ;
     2151    iOrigAvg += piOrg[7] ;
     2152    iOrigAvg += piOrg[8] ;
     2153    iOrigAvg += piOrg[9] ;
     2154    iOrigAvg += piOrg[10] ;
     2155    iOrigAvg += piOrg[11] ;
     2156    iOrigAvg += piOrg[12] ;
     2157    iOrigAvg += piOrg[13] ;
     2158    iOrigAvg += piOrg[14] ;
     2159    iOrigAvg += piOrg[15] ;
     2160    iOrigAvg += piOrg[16] ;
     2161    iOrigAvg += piOrg[17] ;
     2162    iOrigAvg += piOrg[18] ;
     2163    iOrigAvg += piOrg[19] ;
     2164    iOrigAvg += piOrg[20] ;
     2165    iOrigAvg += piOrg[21] ;
     2166    iOrigAvg += piOrg[22] ;
     2167    iOrigAvg += piOrg[23] ;
     2168    iOrigAvg += piOrg[24] ;
     2169    iOrigAvg += piOrg[25] ;
     2170    iOrigAvg += piOrg[26] ;
     2171    iOrigAvg += piOrg[27] ;
     2172    iOrigAvg += piOrg[28] ;
     2173    iOrigAvg += piOrg[29] ;
     2174    iOrigAvg += piOrg[30] ;
     2175    iOrigAvg += piOrg[31] ;
     2176    iOrigAvg += piOrg[32] ;
     2177    iOrigAvg += piOrg[33] ;
     2178    iOrigAvg += piOrg[34] ;
     2179    iOrigAvg += piOrg[35] ;
     2180    iOrigAvg += piOrg[36] ;
     2181    iOrigAvg += piOrg[37] ;
     2182    iOrigAvg += piOrg[38] ;
     2183    iOrigAvg += piOrg[39] ;
     2184    iOrigAvg += piOrg[40] ;
     2185    iOrigAvg += piOrg[41] ;
     2186    iOrigAvg += piOrg[42] ;
     2187    iOrigAvg += piOrg[43] ;
     2188    iOrigAvg += piOrg[44] ;
     2189    iOrigAvg += piOrg[45] ;
     2190    iOrigAvg += piOrg[46] ;
     2191    iOrigAvg += piOrg[47] ;
     2192
     2193    iCurAvg += piCur[0] ;
     2194    iCurAvg += piCur[1] ;
     2195    iCurAvg += piCur[2] ;
     2196    iCurAvg += piCur[3] ;
     2197    iCurAvg += piCur[4] ;
     2198    iCurAvg += piCur[5] ;
     2199    iCurAvg += piCur[6] ;
     2200    iCurAvg += piCur[7] ;
     2201    iCurAvg += piCur[8] ;
     2202    iCurAvg += piCur[9] ;
     2203    iCurAvg += piCur[10] ;
     2204    iCurAvg += piCur[11] ;
     2205    iCurAvg += piCur[12] ;
     2206    iCurAvg += piCur[13] ;
     2207    iCurAvg += piCur[14] ;
     2208    iCurAvg += piCur[15] ;
     2209    iCurAvg += piCur[16] ;
     2210    iCurAvg += piCur[17] ;
     2211    iCurAvg += piCur[18] ;
     2212    iCurAvg += piCur[19] ;
     2213    iCurAvg += piCur[20] ;
     2214    iCurAvg += piCur[21] ;
     2215    iCurAvg += piCur[22] ;
     2216    iCurAvg += piCur[23] ;
     2217    iCurAvg += piCur[24] ;
     2218    iCurAvg += piCur[25] ;
     2219    iCurAvg += piCur[26] ;
     2220    iCurAvg += piCur[27] ;
     2221    iCurAvg += piCur[28] ;
     2222    iCurAvg += piCur[29] ;
     2223    iCurAvg += piCur[30] ;
     2224    iCurAvg += piCur[31] ;
     2225    iCurAvg += piCur[32] ;
     2226    iCurAvg += piCur[33] ;
     2227    iCurAvg += piCur[34] ;
     2228    iCurAvg += piCur[35] ;
     2229    iCurAvg += piCur[36] ;
     2230    iCurAvg += piCur[37] ;
     2231    iCurAvg += piCur[38] ;
     2232    iCurAvg += piCur[39] ;
     2233    iCurAvg += piCur[40] ;
     2234    iCurAvg += piCur[41] ;
     2235    iCurAvg += piCur[42] ;
     2236    iCurAvg += piCur[43] ;
     2237    iCurAvg += piCur[44] ;
     2238    iCurAvg += piCur[45] ;
     2239    iCurAvg += piCur[46] ;
     2240    iCurAvg += piCur[47] ;
     2241
     2242    piOrg += iStrideOrg;
     2243    piCur += iStrideCur;
     2244    uiRowCnt++;
     2245  }
     2246
     2247  piOrg   = pcDtParam->pOrg;
     2248  piCur   = pcDtParam->pCur;
     2249  iRows   = pcDtParam->iRows;
     2250
     2251  iDeltaC = uiRowCnt ? ((iOrigAvg - iCurAvg)/uiRowCnt/48) : 0;
     2252
     2253  for( ; iRows != 0; iRows-=iSubStep )
     2254  {
     2255    uiSum += abs( piOrg[0] - piCur[0] - iDeltaC );
     2256    uiSum += abs( piOrg[1] - piCur[1] - iDeltaC );
     2257    uiSum += abs( piOrg[2] - piCur[2] - iDeltaC );
     2258    uiSum += abs( piOrg[3] - piCur[3] - iDeltaC );
     2259    uiSum += abs( piOrg[4] - piCur[4] - iDeltaC );
     2260    uiSum += abs( piOrg[5] - piCur[5] - iDeltaC );
     2261    uiSum += abs( piOrg[6] - piCur[6] - iDeltaC );
     2262    uiSum += abs( piOrg[7] - piCur[7] - iDeltaC );
     2263    uiSum += abs( piOrg[8] - piCur[8] - iDeltaC );
     2264    uiSum += abs( piOrg[9] - piCur[9] - iDeltaC );
     2265    uiSum += abs( piOrg[10] - piCur[10] - iDeltaC );
     2266    uiSum += abs( piOrg[11] - piCur[11] - iDeltaC );
     2267    uiSum += abs( piOrg[12] - piCur[12] - iDeltaC );
     2268    uiSum += abs( piOrg[13] - piCur[13] - iDeltaC );
     2269    uiSum += abs( piOrg[14] - piCur[14] - iDeltaC );
     2270    uiSum += abs( piOrg[15] - piCur[15] - iDeltaC );
     2271    uiSum += abs( piOrg[16] - piCur[16] - iDeltaC );
     2272    uiSum += abs( piOrg[17] - piCur[17] - iDeltaC );
     2273    uiSum += abs( piOrg[18] - piCur[18] - iDeltaC );
     2274    uiSum += abs( piOrg[19] - piCur[19] - iDeltaC );
     2275    uiSum += abs( piOrg[20] - piCur[20] - iDeltaC );
     2276    uiSum += abs( piOrg[21] - piCur[21] - iDeltaC );
     2277    uiSum += abs( piOrg[22] - piCur[22] - iDeltaC );
     2278    uiSum += abs( piOrg[23] - piCur[23] - iDeltaC );
     2279    uiSum += abs( piOrg[24] - piCur[24] - iDeltaC );
     2280    uiSum += abs( piOrg[25] - piCur[25] - iDeltaC );
     2281    uiSum += abs( piOrg[26] - piCur[26] - iDeltaC );
     2282    uiSum += abs( piOrg[27] - piCur[27] - iDeltaC );
     2283    uiSum += abs( piOrg[28] - piCur[28] - iDeltaC );
     2284    uiSum += abs( piOrg[29] - piCur[29] - iDeltaC );
     2285    uiSum += abs( piOrg[30] - piCur[30] - iDeltaC );
     2286    uiSum += abs( piOrg[31] - piCur[31] - iDeltaC );
     2287    uiSum += abs( piOrg[32] - piCur[32] - iDeltaC );
     2288    uiSum += abs( piOrg[33] - piCur[33] - iDeltaC );
     2289    uiSum += abs( piOrg[34] - piCur[34] - iDeltaC );
     2290    uiSum += abs( piOrg[35] - piCur[35] - iDeltaC );
     2291    uiSum += abs( piOrg[36] - piCur[36] - iDeltaC );
     2292    uiSum += abs( piOrg[37] - piCur[37] - iDeltaC );
     2293    uiSum += abs( piOrg[38] - piCur[38] - iDeltaC );
     2294    uiSum += abs( piOrg[39] - piCur[39] - iDeltaC );
     2295    uiSum += abs( piOrg[40] - piCur[40] - iDeltaC );
     2296    uiSum += abs( piOrg[41] - piCur[41] - iDeltaC );
     2297    uiSum += abs( piOrg[42] - piCur[42] - iDeltaC );
     2298    uiSum += abs( piOrg[43] - piCur[43] - iDeltaC );
     2299    uiSum += abs( piOrg[44] - piCur[44] - iDeltaC );
     2300    uiSum += abs( piOrg[45] - piCur[45] - iDeltaC );
     2301    uiSum += abs( piOrg[46] - piCur[46] - iDeltaC );
     2302    uiSum += abs( piOrg[47] - piCur[47] - iDeltaC );
     2303
     2304    piOrg += iStrideOrg;
     2305    piCur += iStrideCur;
     2306  }
     2307 
     2308  uiSum <<= iSubShift;
     2309  return ( uiSum >> g_uiBitIncrement );
     2310}
     2311#endif
    11122312#endif
    11132313
     
    28264026    return xGetHADsw( pcDtParam );
    28274027  }
     4028#if LGE_ILLUCOMP_B0045
     4029  if(pcDtParam->bUseIC)
     4030  {
     4031    return xGetHADsic( pcDtParam );
     4032  }
     4033#endif
    28284034  Pel* piOrg   = pcDtParam->pOrg;
    28294035  Pel* piCur   = pcDtParam->pCur;
     
    28334039  Int  iStrideOrg = pcDtParam->iStrideOrg;
    28344040  Int  iStep  = pcDtParam->iStep;
    2835  
     4041
    28364042  Int  x, y;
    2837  
    2838   UInt uiSum = 0;
    2839  
     4043
     4044  UInt uiSum = 0;
     4045
    28404046#if NS_HAD
    28414047  if( ( ( iRows % 8 == 0) && (iCols % 8 == 0) && ( iRows == iCols ) ) || ( ( iRows % 8 == 0 ) && (iCols % 8 == 0) && !pcDtParam->bUseNSHAD ) )
     
    28904096    Int  iOffsetOrg = iStrideOrg<<2;
    28914097    Int  iOffsetCur = iStrideCur<<2;
    2892    
     4098
    28934099    for ( y=0; y<iRows; y+= 4 )
    28944100    {
     
    29194125    assert(false);
    29204126  }
    2921  
     4127
    29224128  return ( uiSum >> g_uiBitIncrement );
    29234129}
     4130
     4131#if LGE_ILLUCOMP_B0045
     4132UInt TComRdCost::xGetHADsic( DistParam* pcDtParam )
     4133{
     4134  if ( pcDtParam->bApplyWeight )
     4135  {
     4136    return xGetHADsw( pcDtParam );
     4137  }
     4138  Pel* piOrg   = pcDtParam->pOrg;
     4139  Pel* piCur   = pcDtParam->pCur;
     4140  Int  iRows   = pcDtParam->iRows;
     4141  Int  iCols   = pcDtParam->iCols;
     4142  Int  iStrideCur = pcDtParam->iStrideCur;
     4143  Int  iStrideOrg = pcDtParam->iStrideOrg;
     4144  Int  iStep  = pcDtParam->iStep;
     4145 
     4146  Int  x, y;
     4147 
     4148  UInt uiSum = 0;
     4149 
     4150  Int  iOrigAvg = 0, iCurAvg = 0;
     4151  Int  iDeltaC;
     4152
     4153  for ( y=0; y<iRows; y++ )
     4154  {
     4155    for ( x=0; x<iCols; x++ )
     4156    {       
     4157      iOrigAvg += piOrg[x];
     4158      iCurAvg  += piCur[x];
     4159    }
     4160    piOrg += iStrideOrg;
     4161    piCur += iStrideCur;
     4162  }
     4163
     4164  piOrg   = pcDtParam->pOrg;
     4165  piCur   = pcDtParam->pCur;
     4166
     4167  iDeltaC = (iOrigAvg - iCurAvg)/iRows/iCols;
     4168
     4169  for ( y=0; y<iRows; y++ )
     4170  {
     4171    for ( x=0; x<iCols; x++ )
     4172    {       
     4173      piOrg[x] -= iDeltaC;
     4174    }
     4175    piOrg += iStrideOrg;
     4176  }
     4177
     4178  piOrg   = pcDtParam->pOrg;
     4179
     4180#if NS_HAD
     4181  if( ( ( iRows % 8 == 0) && (iCols % 8 == 0) && ( iRows == iCols ) ) || ( ( iRows % 8 == 0 ) && (iCols % 8 == 0) && !pcDtParam->bUseNSHAD ) )
     4182#else
     4183  if( ( iRows % 8 == 0) && (iCols % 8 == 0) )
     4184#endif
     4185  {
     4186    Int  iOffsetOrg = iStrideOrg<<3;
     4187    Int  iOffsetCur = iStrideCur<<3;
     4188    for ( y=0; y<iRows; y+= 8 )
     4189    {
     4190      for ( x=0; x<iCols; x+= 8 )
     4191      {
     4192        uiSum += xCalcHADs8x8( &piOrg[x], &piCur[x*iStep], iStrideOrg, iStrideCur, iStep );
     4193      }
     4194      piOrg += iOffsetOrg;
     4195      piCur += iOffsetCur;
     4196    }
     4197  }
     4198#if NS_HAD
     4199  else if ( ( iCols > 8 ) && ( iCols > iRows ) && pcDtParam->bUseNSHAD )
     4200  {
     4201    Int  iOffsetOrg = iStrideOrg<<2;
     4202    Int  iOffsetCur = iStrideCur<<2;
     4203    for ( y=0; y<iRows; y+= 4 )
     4204    {
     4205      for ( x=0; x<iCols; x+= 16 )
     4206      {
     4207        uiSum += xCalcHADs16x4( &piOrg[x], &piCur[x*iStep], iStrideOrg, iStrideCur, iStep );
     4208      }
     4209      piOrg += iOffsetOrg;
     4210      piCur += iOffsetCur;
     4211    }
     4212  }
     4213  else if ( ( iRows > 8 ) && ( iCols < iRows ) && pcDtParam->bUseNSHAD )
     4214  {
     4215    Int  iOffsetOrg = iStrideOrg<<4;
     4216    Int  iOffsetCur = iStrideCur<<4;
     4217    for ( y=0; y<iRows; y+= 16 )
     4218    {
     4219      for ( x=0; x<iCols; x+= 4 )
     4220      {
     4221        uiSum += xCalcHADs4x16( &piOrg[x], &piCur[x*iStep], iStrideOrg, iStrideCur, iStep );
     4222      }
     4223      piOrg += iOffsetOrg;
     4224      piCur += iOffsetCur;
     4225    }
     4226  }
     4227#endif
     4228  else if( ( iRows % 4 == 0) && (iCols % 4 == 0) )
     4229  {
     4230    Int  iOffsetOrg = iStrideOrg<<2;
     4231    Int  iOffsetCur = iStrideCur<<2;
     4232   
     4233    for ( y=0; y<iRows; y+= 4 )
     4234    {
     4235      for ( x=0; x<iCols; x+= 4 )
     4236      {
     4237        uiSum += xCalcHADs4x4( &piOrg[x], &piCur[x*iStep], iStrideOrg, iStrideCur, iStep );
     4238      }
     4239      piOrg += iOffsetOrg;
     4240      piCur += iOffsetCur;
     4241    }
     4242  }
     4243  else if( ( iRows % 2 == 0) && (iCols % 2 == 0) )
     4244  {
     4245    Int  iOffsetOrg = iStrideOrg<<1;
     4246    Int  iOffsetCur = iStrideCur<<1;
     4247    for ( y=0; y<iRows; y+=2 )
     4248    {
     4249      for ( x=0; x<iCols; x+=2 )
     4250      {
     4251        uiSum += xCalcHADs2x2( &piOrg[x], &piCur[x*iStep], iStrideOrg, iStrideCur, iStep );
     4252      }
     4253      piOrg += iOffsetOrg;
     4254      piCur += iOffsetCur;
     4255    }
     4256  }
     4257  else
     4258  {
     4259    assert(false);
     4260  }
     4261 
     4262  piOrg   = pcDtParam->pOrg;
     4263
     4264  for ( y=0; y<iRows; y++ )
     4265  {
     4266    for ( x=0; x<iCols; x++ )
     4267    {       
     4268      piOrg[x] += iDeltaC;
     4269    }
     4270    piOrg += iStrideOrg;
     4271  }
     4272
     4273  return ( uiSum >> g_uiBitIncrement );
     4274}
     4275#endif
    29244276
    29254277#if HHI_VSO
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComRdCost.h

    r193 r213  
    8888  Int   iCols;
    8989  Int   iStep;
     90#if LGE_ILLUCOMP_B0045
     91  Bool  bUseIC;
     92#endif
    9093  FpDistFunc DistFunc;
    9194
     
    302305private:
    303306 
     307#if LGE_ILLUCOMP_B0045
     308  static UInt xGetSADic         ( DistParam* pcDtParam );
     309  static UInt xGetSAD4ic        ( DistParam* pcDtParam );
     310  static UInt xGetSAD8ic        ( DistParam* pcDtParam );
     311  static UInt xGetSAD16ic       ( DistParam* pcDtParam );
     312  static UInt xGetSAD32ic       ( DistParam* pcDtParam );
     313  static UInt xGetSAD64ic       ( DistParam* pcDtParam );
     314  static UInt xGetSAD16Nic      ( DistParam* pcDtParam );
     315#endif
    304316  static UInt xGetSSE           ( DistParam* pcDtParam );
    305317  static UInt xGetSSE4          ( DistParam* pcDtParam );
     
    329341
    330342#if AMP_SAD
     343#if LGE_ILLUCOMP_B0045
     344  static UInt xGetSAD12ic       ( DistParam* pcDtParam );
     345  static UInt xGetSAD24ic       ( DistParam* pcDtParam );
     346  static UInt xGetSAD48ic       ( DistParam* pcDtParam );
     347#endif
    331348  static UInt xGetSAD12         ( DistParam* pcDtParam );
    332349  static UInt xGetSAD24         ( DistParam* pcDtParam );
    333350  static UInt xGetSAD48         ( DistParam* pcDtParam );
    334 
    335 #endif
    336 
     351#endif
     352
     353#if LGE_ILLUCOMP_B0045
     354  static UInt xGetHADsic          ( DistParam* pcDtParam );
     355#endif
    337356  static UInt xGetHADs4         ( DistParam* pcDtParam );
    338357  static UInt xGetHADs8         ( DistParam* pcDtParam );
    339358  static UInt xGetHADs          ( DistParam* pcDtParam );
     359
    340360  static UInt xCalcHADs2x2      ( Pel *piOrg, Pel *piCurr, Int iStrideOrg, Int iStrideCur, Int iStep );
    341361  static UInt xCalcHADs4x4      ( Pel *piOrg, Pel *piCurr, Int iStrideOrg, Int iStrideCur, Int iStep );
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComResidualGenerator.cpp

    r166 r213  
    219219}
    220220
    221 #if QC_MULTI_DIS_CAN
     221#if QC_MULTI_DIS_CAN_A0097
    222222Bool
    223223TComResidualGenerator::getResidualSamples( TComDataCU* pcCU, UInt uiPUIdx, TComYuv* pcYuv, Int iDisp
     
    243243  iBlkHeight  = pcCU->getHeight ( 0 );
    244244  pcCU->getPic()->getPicYuvRec()->getTopLeftSamplePos( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr, iXPos, iYPos );
    245 #if QC_MULTI_DIS_CAN
     245#if QC_MULTI_DIS_CAN_A0097
    246246  return getResidualSamples( pcCU->getPic(), (UInt)iXPos, (UInt)iYPos, (UInt)iBlkWidth, (UInt)iBlkHeight, pcYuv, iDisp
    247247#if QC_SIMPLIFIEDIVRP_M24938
     
    258258}
    259259 
    260 #if QC_MULTI_DIS_CAN
     260#if QC_MULTI_DIS_CAN_A0097
    261261Bool
    262262TComResidualGenerator::getResidualSamples( TComPic* pcPic, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv, Int iDisp
     
    283283  UInt uiXPosInRefView = uiXPos , uiYPosInRefView = uiYPos;
    284284#endif
    285 #if QC_MULTI_DIS_CAN
     285#if QC_MULTI_DIS_CAN_A0097
    286286  xSetPredResidualBlock( pcPic, uiBaseViewId, uiXPos, uiYPos, uiBlkWidth, uiBlkHeight, pcYuv, iDisp
    287287#if QC_SIMPLIFIEDIVRP_M24938
     
    522522
    523523
    524 #if QC_MULTI_DIS_CAN
     524#if QC_MULTI_DIS_CAN_A0097
    525525Void 
    526526TComResidualGenerator::xSetPredResidualBlock( TComPic* pcPic, UInt uiBaseViewId, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv, Int iDisp
     
    553553
    554554  //===== get disparity =====
    555 #if QC_MULTI_DIS_CAN
     555#if QC_MULTI_DIS_CAN_A0097
    556556  Int iDisparity = iDisp;
    557557#else
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComResidualGenerator.h

    r100 r213  
    6969  Void  setRecResidualPic     ( TComPic*      pcPic );
    7070
    71 #if QC_MULTI_DIS_CAN
     71#if QC_MULTI_DIS_CAN_A0097
    7272  Bool  getResidualSamples    ( TComDataCU*   pcCU,  UInt uiPUIdx, TComYuv* pcYuv, Int iDisp
    7373#if QC_SIMPLIFIEDIVRP_M24938
     
    100100  Void  xClearIntViewResidual ( TComDataCU*   pcCU,  TComYuv* pcCUResidual, UInt uiPartIdx    );
    101101  Void  xClearResidual        (                      TComYuv* pcCUResidual, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight );
    102 #if QC_MULTI_DIS_CAN
     102#if QC_MULTI_DIS_CAN_A0097
    103103  Void  xSetPredResidualBlock ( TComPic*      pcPic, UInt uiBaseViewId, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv, Int iDisp
    104104#if QC_SIMPLIFIEDIVRP_M24938
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComRom.cpp

    r77 r213  
    174174    g_aacWedgeRefLists.clear();
    175175  }
     176#if HHIQC_DMMFASTSEARCH_B0039
     177  if ( !g_aacWedgeNodeLists.empty() )
     178  {
     179    for ( UInt ui = 0; ui < g_aacWedgeNodeLists.size(); ui++ )
     180    {
     181      g_aacWedgeNodeLists[ui].clear();
     182    }
     183    g_aacWedgeNodeLists.clear();
     184  }
     185#endif
    176186#endif
    177187}
     
    295305};
    296306
     307#if RWTH_SDC_DLT_B0036
     308UInt g_auiSDCPredModes[RWTH_SDC_NUM_PRED_MODES] = { DC_IDX, DMM_WEDGE_FULL_IDX, DMM_WEDGE_PREDDIR_IDX, PLANAR_IDX };
     309#endif
    297310
    298311Int g_quantScales[6] =
     
    11701183std::vector< std::vector<TComWedgeRef> > g_aacWedgeRefLists;
    11711184
     1185#if HHIQC_DMMFASTSEARCH_B0039
     1186std::vector< std::vector< std::vector<UInt> > > g_aauiWdgLstM3;
     1187std::vector< std::vector< TComWedgeNode> >      g_aacWedgeNodeLists;
     1188#endif
     1189
    11721190Void initWedgeLists()
    11731191{
     
    11801198    g_aacWedgeLists.push_back( acWedgeList );
    11811199    g_aacWedgeRefLists.push_back( acWedgeRefList );
     1200
     1201#if HHIQC_DMMFASTSEARCH_B0039
     1202    // create WedgeNodeList
     1203    std::vector<TComWedgeNode> acWedgeNodeList;
     1204    for( UInt uiPos = 0; uiPos < acWedgeList.size(); uiPos++ )
     1205    {
     1206      if( acWedgeList[uiPos].getIsCoarse() )
     1207      {
     1208        TComWedgeNode cWedgeNode;
     1209        cWedgeNode.setPatternIdx( uiPos );
     1210
     1211        // set refinement idxs
     1212        UInt uiRefPos = 0;
     1213        for( Int iOffS = -1; iOffS <= 1; iOffS++ )
     1214        {
     1215          for( Int iOffE = -1; iOffE <= 1; iOffE++ )
     1216          {
     1217            if( iOffS == 0 && iOffE == 0 ) { continue; }
     1218
     1219            Int iSx = (Int)acWedgeList[uiPos].getStartX();
     1220            Int iSy = (Int)acWedgeList[uiPos].getStartY();
     1221            Int iEx = (Int)acWedgeList[uiPos].getEndX();
     1222            Int iEy = (Int)acWedgeList[uiPos].getEndY();
     1223
     1224            switch( acWedgeList[uiPos].getOri() )
     1225            {
     1226            case( 0 ): { iSx += iOffS; iEy += iOffE; } break;
     1227            case( 1 ): { iSy += iOffS; iEx -= iOffE; } break;
     1228            case( 2 ): { iSx -= iOffS; iEy -= iOffE; } break;
     1229            case( 3 ): { iSy -= iOffS; iEx += iOffE; } break;
     1230            case( 4 ): { iSx += iOffS; iEx += iOffE; } break;
     1231            case( 5 ): { iSy += iOffS; iEy += iOffE; } break;
     1232            default: assert( 0 );
     1233            }
     1234
     1235            for( UInt k = 0; k < acWedgeRefList.size(); k++ )
     1236            {
     1237              if( iSx == (Int)acWedgeRefList[k].getStartX() &&
     1238                iSy == (Int)acWedgeRefList[k].getStartY() &&
     1239                iEx == (Int)acWedgeRefList[k].getEndX() &&
     1240                iEy == (Int)acWedgeRefList[k].getEndY()    )
     1241              {
     1242                if( acWedgeRefList[k].getRefIdx() != cWedgeNode.getPatternIdx() )
     1243                {
     1244                  Bool bNew = true;
     1245                  for( UInt m = 0; m < uiRefPos; m++ ) { if( acWedgeRefList[k].getRefIdx() == cWedgeNode.getRefineIdx( m ) ) { bNew = false; break; } }
     1246
     1247                  if( bNew )
     1248                  {
     1249                    cWedgeNode.setRefineIdx( acWedgeRefList[k].getRefIdx(), uiRefPos );
     1250                    uiRefPos++;
     1251                    break;
     1252                  }
     1253                }
     1254              }
     1255            }
     1256          }
     1257        }
     1258        acWedgeNodeList.push_back( cWedgeNode );
     1259      }
     1260    }
     1261    g_aacWedgeNodeLists.push_back( acWedgeNodeList );
     1262#endif
    11821263  }
    11831264  return;
     
    12171298      for( Int iL = 0; iL < uiBlockSize; iL++ )
    12181299      {
     1300#if HHIQC_DMMFASTSEARCH_B0039
     1301        cTempWedgelet.setWedgelet( uhStartX + (iK*iStepStartX) , uhStartY + (iK*iStepStartY), uhEndX + (iL*iStepEndX), uhEndY + (iL*iStepEndY), (UChar)uiOri, eWedgeRes, ((iL%2)==0 && (iK%2)==0) );
     1302#else
    12191303        cTempWedgelet.setWedgelet( uhStartX + (iK*iStepStartX) , uhStartY + (iK*iStepStartY), uhEndX + (iL*iStepEndX), uhEndY + (iL*iStepEndY), (UChar)uiOri, eWedgeRes );
     1304#endif
    12201305        addWedgeletToList( cTempWedgelet, racWedgeList, racWedgeRefList );
    12211306      }
    12221307    }
    12231308  }
     1309#if HHIQC_DMMFASTSEARCH_B0039
     1310  UInt uiThrSz = DMM3_SIMPLIFY_TR;
     1311
     1312  std::vector< std::vector<UInt> > auiWdgListSz;
     1313  for( Int idxM=2; idxM<=34 ; idxM++)
     1314  {
     1315    std::vector<UInt> auiWdgList;
     1316    for( Int idxW=0; idxW<racWedgeList.size(); idxW++)
     1317    {
     1318      UInt uiAbsDiff = abs(idxM-(Int)racWedgeList[idxW].getAng());
     1319      if( uiAbsDiff <= uiThrSz )
     1320      {
     1321        auiWdgList.push_back(idxW);
     1322      }
     1323    }
     1324    auiWdgListSz.push_back(auiWdgList);
     1325  }
     1326  g_aauiWdgLstM3.push_back(auiWdgListSz);
     1327#endif
    12241328}
    12251329
     
    12571361  if( bValid )
    12581362  {
     1363#if HHIQC_DMMFASTSEARCH_B0039
     1364  cWedgelet.findClosetAngle();
     1365#endif
    12591366    racWedgeList.push_back( cWedgelet );
    12601367    TComWedgeRef cWedgeRef;
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComRom.h

    r100 r213  
    193193extern       std::vector< std::vector<TComWedgeRef> >  g_aacWedgeRefLists;
    194194
     195#if HHIQC_DMMFASTSEARCH_B0039
     196extern       std::vector< std::vector< std::vector<UInt> > > g_aauiWdgLstM3;
     197extern       std::vector< std::vector<TComWedgeNode> >       g_aacWedgeNodeLists;
     198#endif
     199
     200#if RWTH_SDC_DLT_B0036
     201#define RWTH_SDC_NUM_PRED_MODES 4
     202extern      UInt g_auiSDCPredModes[RWTH_SDC_NUM_PRED_MODES];
     203#endif
     204
    195205Void initWedgeLists();
    196206Void createWedgeList( UInt uiWidth, UInt uiHeight, std::vector<TComWedgelet> &racWedgeList, std::vector<TComWedgeRef> &racWedgeRefList, WedgeResolution eWedgeRes );
     
    206216#endif
    207217
    208 #if LGE_EDGE_INTRA
     218#if LGE_EDGE_INTRA_A0070
    209219__inline Void mapEdgeIntratoDC( UChar& curDir ) { curDir = (curDir >= EDGE_INTRA_IDX) ? DC_IDX : curDir; }
    210220__inline Void mapEdgeIntratoDC(  UInt& curDir ) { curDir = (curDir >= EDGE_INTRA_IDX) ? DC_IDX : curDir; }
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComSlice.cpp

    r193 r213  
    4444
    4545TComSlice::TComSlice()
     46#if QC_MVHEVC_B0046
     47: m_iPPSId                        ( 0  )
     48#else
    4649: m_iPPSId                        ( -1 )
     50#endif
    4751, m_iPOC                          ( 0 )
    4852, m_iLastIDR                      ( 0 )
     
    112116, m_iViewOrderIdx                 ( 0 )
    113117#endif
     118#if LGE_ILLUCOMP_B0045
     119, m_bApplyIC                      ( false )
     120#endif
    114121#if VSP_CFG
    115122, m_uiNumVspRefPics               ( 0 )
     
    146153  resetWpScalingLC(m_weightPredTableLC);
    147154  initWpAcDcParam();
     155#if QC_IV_AS_LT_B0046
     156  for(Int iNumCount = 0; iNumCount < MAX_NUM_REF+1; iNumCount++)
     157  {
     158     m_bWasLongTerm[0][iNumCount] = false;
     159     m_bWasLongTerm[1][iNumCount] = false;
     160  }
     161#endif
    148162
    149163#if VSP_SLICE_HEADER
     
    507521  {
    508522    pcRefPic = xGetInterViewRefPic( rapcInterViewRefPics, getViewId() + m_pcSPS->getUsableInterViewRef(i) );
     523#if QC_IV_AS_LT_B0046
     524    pcRefPic->setIsLongTerm( 1 );
     525#else
    509526    pcRefPic->setIsLongTerm( 0 );
     527#endif
    510528    pcRefPic->getPicYuvRec()->extendPicBorder();
    511529    RefPicSetIvCurr[NumPocIvCurr] = pcRefPic;
     
    590608#endif
    591609    }
     610#if QC_IV_AS_LT_B0046
     611    setWasLongTerm(m_apcRefPicList[0][cIdx]->getIsLongTerm(), REF_PIC_LIST_0, cIdx);
     612#endif
    592613#else
    593614    m_apcRefPicList[0][cIdx] = m_RefPicListModification.getRefPicListModificationFlagL0() ? refPicListTemp0[ m_RefPicListModification.getRefPicSetIdxL0(cIdx) ] : refPicListTemp0[cIdx];
     615#if QC_IV_AS_LT_B0046
     616    setWasLongTerm(m_apcRefPicList[0][cIdx]->getIsLongTerm(), REF_PIC_LIST_0, cIdx);
     617#endif
    594618#endif
    595619  }
     
    630654#endif
    631655      }
     656#if QC_IV_AS_LT_B0046
     657      setWasLongTerm(m_apcRefPicList[1][cIdx]->getIsLongTerm(), REF_PIC_LIST_1, cIdx);
     658#endif
    632659#else
    633660      m_apcRefPicList[1][cIdx] = m_RefPicListModification.getRefPicListModificationFlagL1() ? refPicListTemp1[ m_RefPicListModification.getRefPicSetIdxL1(cIdx) ] : refPicListTemp1[cIdx];
     661#if QC_IV_AS_LT_B0046
     662      setWasLongTerm(m_apcRefPicList[1][cIdx]->getIsLongTerm(), REF_PIC_LIST_1, cIdx);
     663#endif
    634664#endif
    635665    }
     
    9851015    for(i=0;i<pReferencePictureSet->getNumberOfPositivePictures()+pReferencePictureSet->getNumberOfNegativePictures();i++)
    9861016    {
     1017#if QC_IV_AS_LT_B0046
     1018       if( rpcPic->getPicSym()->getSlice(0)->getPOC() == this->getPOC() + pReferencePictureSet->getDeltaPOC(i))
     1019#else
    9871020      if(!rpcPic->getIsLongTerm() && rpcPic->getPicSym()->getSlice(0)->getPOC() == this->getPOC() + pReferencePictureSet->getDeltaPOC(i))
     1021#endif
    9881022      {
    9891023        isReference = 1;
     
    9951029    for(;i<pReferencePictureSet->getNumberOfPictures();i++)
    9961030    {
     1031#if QC_IV_AS_LT_B0046
     1032     if( (rpcPic->getPicSym()->getSlice(0)->getPOC()%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC())) == pReferencePictureSet->getPOC(i)%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC()))
     1033#else
    9971034      if(rpcPic->getIsLongTerm() && (rpcPic->getPicSym()->getSlice(0)->getPOC()%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC())) == pReferencePictureSet->getPOC(i)%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC()))
     1035#endif
    9981036      {
    9991037        isReference = 1;
     
    14171455}
    14181456
     1457#if LGE_ILLUCOMP_B0045
     1458Void TComSlice::xSetApplyIC() // comment (S.Shimizu): better to support multiple inter-view reference frames (= write one flag for each inter-view reference frame including VSP ref)?
     1459{
     1460  Int iMaxPelValue = (1<<g_uiBitDepth);
     1461  Int *aiRefOrgHist;
     1462  Int *aiCurrHist;
     1463  aiRefOrgHist = new Int;
     1464  aiCurrHist   = new Int;
     1465  aiRefOrgHist = (Int *)xMalloc(Int,iMaxPelValue);
     1466  aiCurrHist   = (Int *)xMalloc(Int,iMaxPelValue);
     1467  memset(aiRefOrgHist, 0, iMaxPelValue*sizeof(Int) );
     1468  memset(aiCurrHist, 0, iMaxPelValue*sizeof(Int) );
     1469  // Reference Idx Number
     1470  Int iNumRefIdx = getNumRefIdx( REF_PIC_LIST_0 );
     1471  TComPic* pcCurrPic = NULL;
     1472  TComPic* pcRefPic = NULL;
     1473  TComPicYuv* pcCurrPicYuv = NULL;
     1474  TComPicYuv* pcRefPicYuvOrg = NULL;
     1475  pcCurrPic = getPic();
     1476  pcCurrPicYuv = pcCurrPic->getPicYuvOrg();
     1477  Int iWidth = pcCurrPicYuv->getWidth();
     1478  Int iHeight = pcCurrPicYuv->getHeight();
     1479
     1480
     1481  // Get InterView Reference picture
     1482  // !!!!! Assume only one Interview Reference Picture in L0
     1483  for (Int i = 0; i < iNumRefIdx; i++)
     1484  {
     1485    pcRefPic = getRefPic( REF_PIC_LIST_0, i);
     1486    if (pcRefPic != NULL)
     1487    {
     1488      // Current Picture
     1489      if (pcCurrPic->getViewId() != pcRefPic->getViewId())
     1490      {
     1491        pcRefPicYuvOrg = pcRefPic->getPicYuvOrg();
     1492      }
     1493    }
     1494  }
     1495  if (pcRefPicYuvOrg != NULL)
     1496  {
     1497    Pel* pCurrY = pcCurrPicYuv ->getLumaAddr();
     1498    Pel* pRefOrgY = pcRefPicYuvOrg  ->getLumaAddr();
     1499    Int iCurrStride = pcCurrPicYuv->getStride();
     1500    Int iRefStride = pcRefPicYuvOrg->getStride();
     1501    Int iSumOrgSAD = 0;
     1502    double dThresholdOrgSAD = 0.05;
     1503    // Histogram building - luminance
     1504    for ( Int y = 0; y < iHeight; y++)
     1505    {
     1506      for ( Int x = 0; x < iWidth; x++)
     1507      {
     1508        aiCurrHist[pCurrY[x]]++;
     1509        aiRefOrgHist[pRefOrgY[x]]++;
     1510      }
     1511      pCurrY += iCurrStride;
     1512      pRefOrgY += iRefStride;
     1513    }
     1514    // Calc SAD
     1515    for (Int i = 0; i < iMaxPelValue; i++)
     1516    {
     1517      iSumOrgSAD += abs(aiCurrHist[i] - aiRefOrgHist[i]);
     1518    }
     1519    // Setting
     1520    if ( iSumOrgSAD > Int(dThresholdOrgSAD * iWidth * iHeight) )
     1521    {
     1522      m_bApplyIC = true;
     1523    }
     1524    else
     1525    {
     1526      m_bApplyIC = false;
     1527    }
     1528  }
     1529  xFree(aiCurrHist);
     1530  xFree(aiRefOrgHist);
     1531  aiCurrHist = NULL;
     1532  aiRefOrgHist = NULL;
     1533}
     1534#endif
     1535
    14191536// ------------------------------------------------------------------------------------------------
    14201537// Video parameter set (VPS)
    14211538// ------------------------------------------------------------------------------------------------
     1539#if QC_MVHEVC_B0046
     1540TComVPS::TComVPS()
     1541: m_VPSId                     (  0)
     1542, m_uiMaxTLayers              (  1)
     1543, m_uiMaxLayers               (  1)
     1544, m_bTemporalIdNestingFlag    (false)
     1545, m_uiNumHRDParameter         (  0)
     1546, m_numAddiLayerOperationPoints (2)
     1547, m_numAddiProLevelSets       (  1)
     1548{
     1549  for( Int i = 0; i < MAX_LAYER_NUM; i++)
     1550  {
     1551  m_numOpLayerIdMinus1[i] = 0;
     1552  if(i)
     1553      m_numDirectRefLayer[i] = 1;
     1554  else
     1555    m_numDirectRefLayer[i] = 0;
     1556  for( Int j = 0; j < MAX_LAYER_NUM; j++)
     1557  {
     1558    m_numDirectRefID[i][j] = 0;
     1559    m_numOpLayerId[i][j]   = 0;
     1560  }
     1561    m_uiViewId[i] = 0;
     1562    m_iViewOrderIdx[i] = 0;
     1563  }
     1564 
     1565  for( Int i = 0; i < MAX_TLAYER; i++)
     1566  {
     1567    m_numReorderPics[i] = 0;
     1568    m_uiMaxDecPicBuffering[i] = 0;
     1569    m_uiMaxLatencyIncrease[i] = 0;
     1570  }
     1571}
     1572
     1573TComVPS::~TComVPS()
     1574{
     1575}
     1576#else
    14221577#if VIDYO_VPS_INTEGRATION
    14231578TComVPS::TComVPS()
     
    14521607
    14531608#endif
    1454 
     1609#endif
    14551610
    14561611// ------------------------------------------------------------------------------------------------
     
    14591614
    14601615TComSPS::TComSPS()
    1461 #if VIDYO_VPS_INTEGRATION
     1616#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    14621617: m_VPSId                     (  0)
    14631618, m_SPSId                     (  0)
     
    15111666, m_bLCMod                    (false)
    15121667#if H0412_REF_PIC_LIST_RESTRICTION
     1668#if QC_MVHEVC_B0046
     1669, m_restrictedRefPicListsFlag   (  0)
     1670#else
    15131671, m_restrictedRefPicListsFlag   (  1)
     1672#endif
    15141673, m_listsModificationPresentFlag(  0)
    15151674#endif
     
    15531712, m_bUseDMM                   (false)
    15541713#endif
    1555 #if OL_DEPTHLIMIT_A0044
    1556 , m_bDepthPartitionLimiting   (false)
     1714#if FLEX_CODING_ORDER_M23723 && HHI_DMM_PRED_TEX
     1715, m_bUseDMM34                   (false)
     1716#endif
     1717#if OL_QTLIMIT_PREDCODING_B0068
     1718, m_bUseQTLPC                 (false)
    15571719#endif
    15581720#if VSP_N
     
    15611723, m_bVspDepthPresentFlag      (false)
    15621724#endif
     1725, m_bIsFirstInView            (false)
    15631726#endif
    15641727{
     
    15931756
    15941757  ::memset( m_aiUsableInterViewRefs, 0, sizeof( m_aiUsableInterViewRefs ) );
     1758 
     1759#if RWTH_SDC_DLT_B0036
     1760  m_bUseDLT = false;
     1761 
     1762  m_uiBitsPerDepthValue = g_uiBitDepth;
     1763  m_uiNumDepthmapValues = 0;
     1764  m_uiDepthValue2Idx    = NULL;
     1765  m_uiIdx2DepthValue    = NULL;
     1766#endif
    15951767}
    15961768
     
    16081780  }
    16091781}
     1782
     1783#if RWTH_SDC_DLT_B0036
     1784Void TComSPS::setDepthLUTs(UInt* uidx2DepthValue, UInt uiNumDepthValues)
     1785{
     1786  UInt uiMaxDepthValue = g_uiIBDI_MAX;
     1787 
     1788  // allocate some memory
     1789  if( m_uiNumDepthmapValues == 0 )
     1790  {
     1791    m_uiNumDepthmapValues = uiMaxDepthValue+1;
     1792    m_uiBitsPerDepthValue = (UInt)ceil(Log2(m_uiNumDepthmapValues));
     1793   
     1794    m_uiDepthValue2Idx    = (UInt*) xMalloc(UInt, m_uiNumDepthmapValues);
     1795    m_uiIdx2DepthValue    = (UInt*) xMalloc(UInt, m_uiNumDepthmapValues);
     1796   
     1797    //default mapping
     1798    for (Int i=0; i<m_uiNumDepthmapValues; i++)
     1799    {
     1800      m_uiDepthValue2Idx[i] = i;
     1801      m_uiIdx2DepthValue[i] = i;
     1802    }
     1803  }
     1804 
     1805  if( uidx2DepthValue == NULL || uiNumDepthValues == 0 ) // default mapping only
     1806    return;
     1807 
     1808  // copy idx2DepthValue to internal array
     1809  memcpy(m_uiIdx2DepthValue, uidx2DepthValue, uiNumDepthValues*sizeof(UInt));
     1810 
     1811  for(Int p=0; p<=uiMaxDepthValue; p++)
     1812  {
     1813    Int iIdxDown    = 0;
     1814    Int iIdxUp      = uiNumDepthValues-1;
     1815    Bool bFound     = false;
     1816   
     1817    // iterate over indices to find lower closest depth
     1818    Int i = 1;
     1819    while(!bFound && i<uiNumDepthValues)
     1820    {
     1821      if( m_uiIdx2DepthValue[i] > p )
     1822      {
     1823        iIdxDown  = i-1;
     1824        bFound    = true;
     1825      }
     1826     
     1827      i++;
     1828    }
     1829    // iterate over indices to find upper closest depth
     1830    i = uiNumDepthValues-2;
     1831    bFound = false;
     1832    while(!bFound && i>=0)
     1833    {
     1834      if( m_uiIdx2DepthValue[i] < p )
     1835      {
     1836        iIdxUp  = i+1;
     1837        bFound    = true;
     1838      }
     1839     
     1840      i--;
     1841    }
     1842   
     1843    // assert monotony
     1844    assert(iIdxDown<=iIdxUp);
     1845   
     1846    // assign closer depth value/idx
     1847    if( abs(p-(Int)m_uiIdx2DepthValue[iIdxDown]) < abs(p-(Int)m_uiIdx2DepthValue[iIdxUp]) )
     1848    {
     1849      m_uiDepthValue2Idx[p] = iIdxDown;
     1850    }
     1851    else
     1852    {
     1853      m_uiDepthValue2Idx[p] = iIdxUp;
     1854    }
     1855   
     1856  }
     1857 
     1858  // update globals
     1859  m_uiNumDepthmapValues = uiNumDepthValues;
     1860  m_uiBitsPerDepthValue = (UInt)ceil(Log2(m_uiNumDepthmapValues));
     1861}
     1862#endif
    16101863
    16111864TComPPS::TComPPS()
     
    16501903, m_cabacInitPresentFlag        (false)
    16511904, m_encCABACTableIdx            (0)
    1652 #if POZNAN_CABAC_INIT_FLAG_FIX
     1905#if FIX_POZNAN_CABAC_INIT_FLAG
    16531906, m_encPrevPOC            (0)
    16541907#endif
     
    16801933TComSPS::initMultiviewSPS( UInt uiViewId, Int iViewOrderIdx, UInt uiCamParPrecision, Bool bCamParSlice, Int** aaiScale, Int** aaiOffset )
    16811934{
     1935#if !QC_MVHEVC_B0046
    16821936  AOT( uiViewId == 0 && iViewOrderIdx != 0 );
    16831937  AOT( uiViewId != 0 && iViewOrderIdx == 0 );
    16841938  AOT( uiViewId != 0 && !bCamParSlice && ( aaiScale == 0 || aaiOffset == 0 ) );
    1685 
     1939#endif
    16861940  m_uiViewId              = uiViewId;
    16871941  m_iViewOrderIdx         = iViewOrderIdx;
     
    16911945  ::memset( m_aaiCodedScale,  0x00, sizeof( m_aaiCodedScale  ) );
    16921946  ::memset( m_aaiCodedOffset, 0x00, sizeof( m_aaiCodedOffset ) );
     1947#if !QC_MVHEVC_B0046
    16931948  if( !m_bCamParInSliceHeader )
    16941949  {
     
    17011956    }
    17021957  }
     1958#endif
    17031959}
    17041960
     
    17171973  ::memset( m_aaiCodedOffset, 0x00, sizeof( m_aaiCodedOffset ) );
    17181974}
     1975
     1976#if VSP_N
     1977Void
     1978TComSPS::initMultiviewSPSFlex( UInt uiViewId, Int iViewOrderIdx, Bool bDepth, Bool bPresent, UInt uiCamParPrecision, Bool bCamParSlice, Int** aaiScale, Int** aaiOffset )
     1979{
     1980  AOT( uiViewId == 0 && iViewOrderIdx != 0 );
     1981  AOT( uiViewId != 0 && iViewOrderIdx == 0 );
     1982  //AOT( uiViewId != 0 && !bCamParSlice && ( aaiScale == 0 || aaiOffset == 0 ) );
     1983
     1984  m_uiViewId              = uiViewId;
     1985  m_iViewOrderIdx         = iViewOrderIdx;
     1986  m_bDepth                = bDepth;
     1987  m_uiCamParPrecision     = ( m_uiViewId && bPresent ? uiCamParPrecision : 0 );
     1988  m_bCamParInSliceHeader  = ( m_uiViewId && bPresent ? bCamParSlice  : false );
     1989  if( bPresent && !m_bCamParInSliceHeader )
     1990  {
     1991    for( UInt uiBaseViewId = 0; uiBaseViewId < m_uiViewId; uiBaseViewId++ )
     1992    {
     1993      m_aaiCodedScale [ 0 ][ uiBaseViewId ] = aaiScale [ uiBaseViewId ][   m_uiViewId ];
     1994      m_aaiCodedScale [ 1 ][ uiBaseViewId ] = aaiScale [   m_uiViewId ][ uiBaseViewId ];
     1995      m_aaiCodedOffset[ 0 ][ uiBaseViewId ] = aaiOffset[ uiBaseViewId ][   m_uiViewId ];
     1996      m_aaiCodedOffset[ 1 ][ uiBaseViewId ] = aaiOffset[   m_uiViewId ][ uiBaseViewId ];
     1997    }
     1998  }
     1999}
     2000
     2001Void
     2002TComSPS::copyCameraParameterPre( UInt uiCamParPrecision, Bool bCamParSlice )
     2003{
     2004  m_uiCamParPrecision     = uiCamParPrecision;
     2005  m_bCamParInSliceHeader  = bCamParSlice;
     2006}
     2007Void
     2008TComSPS::copyCameraParameterPost( Int* aiScale0, Int* aiScale1, Int* aiOffset0, Int* aiOffset1 )
     2009{
     2010  if( !m_bCamParInSliceHeader )
     2011  {
     2012    for( UInt uiBaseViewId = 0; uiBaseViewId < m_uiViewId; uiBaseViewId++ )
     2013    {
     2014      m_aaiCodedScale [ 0 ][ uiBaseViewId ] = aiScale0 [ uiBaseViewId ];
     2015      m_aaiCodedScale [ 1 ][ uiBaseViewId ] = aiScale1 [ uiBaseViewId ];
     2016      m_aaiCodedOffset[ 0 ][ uiBaseViewId ] = aiOffset0[ uiBaseViewId ];
     2017      m_aaiCodedOffset[ 1 ][ uiBaseViewId ] = aiOffset1[ uiBaseViewId ];
     2018    }
     2019  }
     2020}
     2021#endif
    17192022
    17202023#if DEPTH_MAP_GENERATION
     
    23202623, m_ppsMap(MAX_NUM_PPS)
    23212624, m_apsMap(MAX_NUM_APS)
    2322 #if VIDYO_VPS_INTEGRATION
     2625#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    23232626, m_vpsMap(MAX_NUM_VPS)
    23242627#endif
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComSlice.h

    r193 r213  
    144144#endif
    145145
    146 #if VIDYO_VPS_INTEGRATION
     146#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    147147/// VPS class
    148148
     
    156156
    157157  UInt        m_uiExtensionType;
    158  
     158#if !QC_MVHEVC_B0046 
    159159  Bool        m_bDependentFlag[MAX_LAYER_NUM];
     160#else
     161  UInt        m_uiNumHRDParameter;
     162  UInt        m_numAddiLayerOperationPoints;
     163  UInt        m_numAddiProLevelSets;
     164  UInt        m_numDirectRefLayer[MAX_LAYER_NUM];
     165  UInt        m_numDirectRefID[MAX_LAYER_NUM][MAX_LAYER_NUM];
     166  UInt        m_numOpLayerIdMinus1[MAX_LAYER_NUM];
     167  UInt        m_numOpLayerId[MAX_LAYER_NUM][MAX_LAYER_NUM];
     168#endif
    160169  UInt        m_uiViewId[MAX_LAYER_NUM];
     170#if !QC_MVHEVC_B0046 
    161171  Bool        m_bDepthFlag[MAX_LAYER_NUM];
     172#endif
    162173  Int         m_iViewOrderIdx[MAX_LAYER_NUM];
     174#if !QC_MVHEVC_B0046 
    163175  UInt        m_uiDependentLayer[MAX_LAYER_NUM];
     176#endif
    164177
    165178  UInt        m_numReorderPics[MAX_TLAYER];
     
    182195  Bool    getTemporalNestingFlag   ()         { return m_uiMaxLayers;   }
    183196  Void    setTemporalNestingFlag   (UInt t)   { m_bTemporalIdNestingFlag = t; }
    184  
     197#if !QC_MVHEVC_B0046
    185198  Void    setExtensionType(UInt v)                     { m_uiExtensionType = v;    }
    186199  UInt    getExtensionType()                             { return m_uiExtensionType; }
     
    188201  Void    setDependentFlag(Bool d, UInt layer)              { m_bDependentFlag[layer] = d;    }
    189202  Bool    getDependentFlag(UInt layer)                      { return m_bDependentFlag[layer]; }
    190 
     203#endif
    191204  Void    setViewId(UInt v, UInt layer)                     { m_uiViewId[layer] = v;    }
    192205  UInt    getViewId(UInt layer)                             { return m_uiViewId[layer]; }
    193  
     206#if !QC_MVHEVC_B0046
    194207  Void    setDepthFlag(Bool d, UInt layer)                  { m_bDepthFlag[layer] = d;    }
    195208  Bool    getDepthFlag(UInt layer)                          { return m_bDepthFlag[layer]; }
    196 
     209#endif
    197210  Void    setViewOrderIdx(Int v, UInt layer)                { m_iViewOrderIdx[layer] = v;    }
    198211  Int     getViewOrderIdx(UInt layer)                       { return m_iViewOrderIdx[layer]; }
    199  
     212#if !QC_MVHEVC_B0046  
    200213  Void    setDependentLayer(UInt v, UInt layer)                     { m_uiDependentLayer[layer] = v;    }
    201214  UInt    getDependentLayer(UInt layer)                             { return m_uiDependentLayer[layer]; }
    202  
     215#endif
    203216  Void    setNumReorderPics(UInt v, UInt tLayer)                { m_numReorderPics[tLayer] = v;    }
    204217  UInt    getNumReorderPics(UInt tLayer)                        { return m_numReorderPics[tLayer]; }
     
    209222  Void    setMaxLatencyIncrease(UInt v, UInt tLayer)                { m_uiMaxLatencyIncrease[tLayer] = v;    }
    210223  UInt    getMaxLatencyIncrease(UInt tLayer)                        { return m_uiMaxLatencyIncrease[tLayer]; }
    211  
     224#if QC_MVHEVC_B0046
     225  Void    setNumHRDParameters(UInt n)                                { m_uiNumHRDParameter = n;    }
     226  UInt    getNumHRDParameters()                                      { return m_uiNumHRDParameter; }
     227  Void    setNumDirectRefLayer(UInt n, UInt layer)                   { m_numDirectRefLayer[layer] = n;        };
     228  UInt    getNumDirectRefLayer(UInt layer)                           { return m_numDirectRefLayer[layer];     };
     229  Void    setDirectRefLayerId (UInt n, UInt layer, UInt refId)       { m_numDirectRefID[layer][refId] = n;   assert(refId < MAX_NUM_REF ); };
     230  UInt    getDirectRefLayerId (        UInt layer, UInt refId)       { return m_numDirectRefID[layer][refId]; };
     231  UInt    getNumAddiLayerOperationPoints(      )               { return m_numAddiLayerOperationPoints;  };
     232  Void    setNumAddiLayerOperationPoints(UInt n)                {  m_numAddiLayerOperationPoints = n;  };
     233  Void    setNumAddiProLevelSets        (UInt n)                     {  m_numAddiProLevelSets = n;}
     234  UInt    getNumAddiProLevelSets        (      )                     { return m_numAddiProLevelSets;}
     235
     236  Void    setNumOpLayerIdMinus1         (UInt n, UInt layer)                     {  m_numOpLayerIdMinus1[layer] = n;}
     237  UInt    getNumOpLayerIdMinus1         (UInt layer      )                       { return m_numOpLayerIdMinus1[layer];}
     238
     239  Void    setNumOpLayerId               (UInt n, UInt layer, UInt OpId)                     {  m_numOpLayerId[layer][OpId] = n;}
     240  UInt    getNumOpLayerId               (UInt layer, UInt OpId        )                     { return m_numOpLayerId[layer][OpId];}
     241 
     242#endif
    212243};
    213244
     
    218249{
    219250private:
    220 #if VIDYO_VPS_INTEGRATION
     251#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    221252  Int          m_VPSId;
    222253#endif
     
    323354  Bool        m_bUseMVI;
    324355#endif
     356 
     357#if RWTH_SDC_DLT_B0036
     358  Bool        m_bUseDLT;
     359 
     360  UInt        m_uiBitsPerDepthValue;
     361  UInt        m_uiNumDepthmapValues;
     362  UInt*       m_uiDepthValue2Idx;
     363  UInt*       m_uiIdx2DepthValue;
     364#endif
    325365
    326366  Bool     m_bLFCrossTileBoundaryFlag;
     
    354394#endif
    355395
    356 #if OL_DEPTHLIMIT_A0044
    357   Bool m_bDepthPartitionLimiting;
     396#if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER_M23723
     397  Bool  m_bUseDMM34;
     398#endif
     399
     400#if OL_QTLIMIT_PREDCODING_B0068
     401  Bool m_bUseQTLPC;
    358402#endif
    359403
     
    384428  Bool  m_bVspDepthPresentFlag;
    385429#endif
     430  Bool  m_bIsFirstInView;
    386431#endif
    387432
     
    389434  TComSPS();
    390435  virtual ~TComSPS();
    391 #if VIDYO_VPS_INTEGRATION
     436#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    392437  Int  getVPSId       ()         { return m_VPSId;          }
    393438  Void setVPSId       (Int i)    { m_VPSId = i;             }
     
    554599  Bool getUseMVI                  ()           {return m_bUseMVI;}
    555600#endif
     601 
     602#if RWTH_SDC_DLT_B0036
     603  Bool getUseDLT      ()          { return m_bUseDLT; }
     604  Void setUseDLT      ( Bool b ) { m_bUseDLT  = b;          }
     605 
     606  UInt getBitsPerDepthValue()       { return m_bUseDLT?m_uiBitsPerDepthValue:g_uiBitDepth; }
     607  UInt getNumDepthValues()          { return m_bUseDLT?m_uiNumDepthmapValues:g_uiIBDI_MAX; }
     608  UInt depthValue2idx(Pel uiValue)  { return m_bUseDLT?m_uiDepthValue2Idx[uiValue]:uiValue; }
     609  Pel  idx2DepthValue(UInt uiIdx)   { return m_bUseDLT?m_uiIdx2DepthValue[uiIdx]:uiIdx; }
     610  Void setDepthLUTs   (UInt* uidx2DepthValue = NULL, UInt uiNumDepthValues = 0);
     611#endif
    556612
    557613  UInt      getMaxTLayers()                           { return m_uiMaxTLayers; }
     
    630686#endif
    631687
    632 #if OL_DEPTHLIMIT_A0044
    633   Void setUseDPL(Bool b) {m_bDepthPartitionLimiting = b; }
    634   Bool getUseDPL()       {return m_bDepthPartitionLimiting;}
     688#if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER_M23723
     689  Bool getUseDMM34()         { return m_bUseDMM34; }
     690  Void setUseDMM34( Bool b ) { m_bUseDMM34 = b;    }
     691#endif
     692
     693#if OL_QTLIMIT_PREDCODING_B0068
     694  Void setUseQTLPC( Bool b ) { m_bUseQTLPC = b;    }
     695  Bool getUseQTLPC()         { return m_bUseQTLPC; }
    635696#endif
    636697
    637698  Void initMultiviewSPS      ( UInt uiViewId, Int iViewOrderIdx = 0, UInt uiCamParPrecision = 0, Bool bCamParSlice = false, Int** aaiScale = 0, Int** aaiOffset = 0 );
    638699  Void initMultiviewSPSDepth ( UInt uiViewId, Int iViewOrderIdx );
     700#if VSP_N
     701  Void initMultiviewSPSFlex  ( UInt uiViewId, Int iViewOrderIdx, Bool bDepth, Bool bPresent = 0, UInt uiCamParPrecision = 0, Bool bCamParSlice = false, Int** aaiScale = 0, Int** aaiOffset = 0 );
     702#endif
    639703
    640704  UInt getViewId             ()  { return m_uiViewId; }
     
    686750  Bool  getVspDepthPresentFlag()         { return m_bVspDepthPresentFlag; }
    687751#endif
     752  Void  setIsFirstInView( Bool b ) { m_bIsFirstInView = b; }
     753  Bool  getIsFirstInView()         { return m_bIsFirstInView; }
     754  Void  copyCameraParameterPre( UInt uiCamParPrecision, Bool bCamParSlice );
     755  Void  copyCameraParameterPost( Int* aiScale0, Int* aiScale1, Int* aiOffset0, Int* aiOffset1 );
    688756#endif
    689757};
     
    879947  Bool     m_cabacInitPresentFlag;
    880948  UInt     m_encCABACTableIdx;           // Used to transmit table selection across slices
    881 #if POZNAN_CABAC_INIT_FLAG_FIX
     949#if FIX_POZNAN_CABAC_INIT_FLAG
    882950  UInt     m_encPrevPOC;
    883951#endif
     
    10141082  Bool     getCabacInitPresentFlag()                { return m_cabacInitPresentFlag;    }
    10151083  UInt     getEncCABACTableIdx()                    { return m_encCABACTableIdx;        }
    1016 #if POZNAN_CABAC_INIT_FLAG_FIX
     1084#if FIX_POZNAN_CABAC_INIT_FLAG
    10171085  Void     setEncPrevPOC(UInt uiPOC)                { m_encPrevPOC = uiPOC;             }
    10181086  UInt     getEncPrevPOC()                          { return m_encPrevPOC;              }
     
    12171285 
    12181286  // access channel
    1219 #if VIDYO_VPS_INTEGRATION
     1287#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    12201288  TComVPS*    m_pcVPS;
     1289#endif
     1290#if QC_IV_AS_LT_B0046
     1291  Bool                  m_bWasLongTerm[2][MAX_NUM_REF+1]; //was long-term picture
    12211292#endif
    12221293  TComSPS*    m_pcSPS;
     
    12931364  Int        m_aaiCodedOffset[2][MAX_VIEW_NUM];
    12941365
    1295 #if SONY_COLPIC_AVAILABILITY
     1366#if SONY_COLPIC_AVAILABILITY|QC_MVHEVC_B0046|VSP_N
    12961367  Int        m_iViewOrderIdx;
     1368#endif
     1369#if LGE_ILLUCOMP_B0045
     1370  Bool        m_bApplyIC;
    12971371#endif
    12981372
     
    13181392  Void      initTiles();
    13191393
    1320 #if VIDYO_VPS_INTEGRATION
     1394#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    13211395  Void      setVPS          ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; }
    13221396  TComVPS*  getVPS          () { return m_pcVPS; }
    13231397#endif
     1398#if QC_IV_AS_LT_B0046
     1399  Void          setWasLongTerm( Bool lt,  RefPicList e, Int iRefIdx ) { m_bWasLongTerm[e][iRefIdx] = lt; }
     1400  Bool          getWasLongTerm( RefPicList e, Int iRefIdx           ) { return m_bWasLongTerm[e][iRefIdx] ; }
     1401#endif
     1402
    13241403  Void      setSPS          ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; }
    13251404  TComSPS*  getSPS          () { return m_pcSPS; }
     
    13891468  Int       getRefViewId        ( RefPicList e, Int iRefIdx)    { return  m_aiRefViewIdList[e][iRefIdx]; }
    13901469  TComPic*  getTexturePic       () const                        { return  m_pcTexturePic; }
    1391 #if SONY_COLPIC_AVAILABILITY
     1470#if SONY_COLPIC_AVAILABILITY || VSP_N
    13921471  Int       getViewOrderIdx     ()                                  { return  m_iViewOrderIdx;              }
    13931472#endif
     
    14411520  Void      setRefViewId        ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefViewIdList[e][iRefIdx] = i; }
    14421521  Void      setTexturePic       ( TComPic *pcTexturePic )       { m_pcTexturePic = pcTexturePic; }
    1443 #if SONY_COLPIC_AVAILABILITY
     1522#if SONY_COLPIC_AVAILABILITY || VSP_N
    14441523  Void      setViewOrderIdx     ( Int i )                       { m_iViewOrderIdx     = i;      }
    14451524#endif
     
    15981677  Void setViewId( Int viewId )       { m_viewId = viewId;   }
    15991678  Int  getViewId()                   { return m_viewId;     }
     1679#if QC_MVHEVC_B0046
     1680  Void    setViewOrderIdx(Int v, UInt layer)                { m_iViewOrderIdx = v;    }
     1681  Int     getViewOrderIdx()                                 { return m_iViewOrderIdx; }
     1682#endif
    16001683  Void setIsDepth( Bool isDepth )    { m_isDepth = isDepth; }
    16011684  Bool getIsDepth()                  { return m_isDepth;    }
     
    16071690  Int*      getInvCodedScale      ()  { return m_aaiCodedScale [1]; }
    16081691  Int*      getInvCodedOffset     ()  { return m_aaiCodedOffset[1]; }
     1692
     1693#if LGE_ILLUCOMP_B0045
     1694  Void      setApplyIC            ( Bool b ) { m_bApplyIC = b; }
     1695  Bool      getApplyIC            ()  { return m_bApplyIC; }
     1696  Void      xSetApplyIC           ();
     1697#endif
    16091698
    16101699#if FORCE_REF_VSP
     
    16791768  }
    16801769
     1770#if QC_MVHEVC_B0046
     1771  Void clearPSList()
     1772  {
     1773    m_paramsetMap.clear();
     1774  }
     1775#endif
    16811776private:
    16821777  std::map<Int,T *> m_paramsetMap;
     
    16891784  ParameterSetManager();
    16901785  virtual ~ParameterSetManager();
    1691 #if VIDYO_VPS_INTEGRATION
     1786#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    16921787  //! store video parameter set and take ownership of it
    16931788  Void storeVPS(TComVPS *vps) { m_vpsMap.storePS( vps->getVPSId(), vps); };
     
    16951790  TComVPS* getVPS(Int vpsId)  { return m_vpsMap.getPS(vpsId); };
    16961791  TComVPS* getFirstVPS()      { return m_vpsMap.getFirstPS(); };
     1792#if QC_MVHEVC_B0046
     1793  Void     clearVPS()         { m_vpsMap.clearPSList(); };
     1794  Void     clearSPS()         { m_spsMap.clearPSList(); };
     1795  Void     clearPPS()         { m_ppsMap.clearPSList(); };
     1796#endif
    16971797#endif
    16981798  //! store sequence parameter set and take ownership of it
     
    17171817  ParameterSetMap<TComPPS> m_ppsMap;
    17181818  ParameterSetMap<TComAPS> m_apsMap;
    1719 #if VIDYO_VPS_INTEGRATION
     1819#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    17201820  ParameterSetMap<TComVPS> m_vpsMap;
    17211821#endif
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComWedgelet.cpp

    r56 r213  
    5252                                                            m_uhOri    ( 0 ),
    5353                                                            m_eWedgeRes( FULL_PEL )
     54#if HHIQC_DMMFASTSEARCH_B0039
     55                                                            , m_bIsCoarse( false )
     56#endif
    5457{
    5558  create( uiWidth, uiHeight );
     
    6265                                                            m_uhOri    ( rcWedge.m_uhOri     ),
    6366                                                            m_eWedgeRes( rcWedge.m_eWedgeRes ),
     67#if HHIQC_DMMFASTSEARCH_B0039
     68                                                            m_bIsCoarse( rcWedge.m_bIsCoarse ),
     69                                                            m_uiAng    ( rcWedge.m_uiAng     ),
     70#endif
    6471                                                            m_uiWidth  ( rcWedge.m_uiWidth   ),
    6572                                                            m_uiHeight ( rcWedge.m_uiHeight  ),
     
    94101}
    95102
     103#if HHIQC_DMMFASTSEARCH_B0039
     104Void TComWedgelet::findClosetAngle()
     105{
     106  UInt uiAng=0,uiOptAng=0;
     107  UInt uiMinD=MAX_UINT;
     108  UInt uiTmpD=0;
     109  Int angTable[9]    = {0,    2,    5,   9,  13,  17,  21,  26,  32};
     110 
     111  UChar uhXs = m_uhXs;
     112  UChar uhYs = m_uhYs;
     113  UChar uhXe = m_uhXe;
     114  UChar uhYe = m_uhYe;
     115
     116  for(uiAng=2; uiAng<=34; uiAng++)
     117  {
     118    Int iSign    = (uiAng<VER_IDX && uiAng>HOR_IDX ) ? -1 : 1;
     119    Int iVer     = uiAng>17 ? 32 : angTable[(uiAng>10) ? (uiAng-10) : (10-uiAng)];
     120    Int iHor     = uiAng<19 ? 32 : angTable[(uiAng>26) ? (uiAng-26) : (26-uiAng)];
     121
     122    uiTmpD  = abs(iVer*iSign*(uhXs-uhXe) - iHor*(uhYe-uhYs));
     123   
     124    if( uiTmpD < uiMinD )
     125    {
     126      uiMinD = uiTmpD;
     127      uiOptAng = uiAng;
     128    }
     129  }
     130  m_uiAng = uiOptAng;
     131}
     132
     133Void TComWedgelet::setWedgelet( UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe, UChar uhOri, WedgeResolution eWedgeRes, Bool bIsCoarse )
     134#else
    96135Void TComWedgelet::setWedgelet( UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe, UChar uhOri, WedgeResolution eWedgeRes )
     136#endif
    97137{
    98138  m_uhXs      = uhXs;
     
    102142  m_uhOri     = uhOri;
    103143  m_eWedgeRes = eWedgeRes;
     144#if HHIQC_DMMFASTSEARCH_B0039
     145  m_bIsCoarse = bIsCoarse;
     146#endif
    104147
    105148  xGenerateWedgePattern();
     
    644687  case( 2 ): { for( UInt iX = uiTempBlockSize-1; iX > uhXs;            iX-- ) { UInt iY = uiTempBlockSize-1; while( pbTempPattern[(iY * iTempStride) + iX] == false ) { pbTempPattern[(iY * iTempStride) + iX] = true; iY--; } } } break;
    645688  case( 3 ): { for( UInt iY = uiTempBlockSize-1; iY > uhYs;            iY-- ) { UInt iX = 0;                 while( pbTempPattern[(iY * iTempStride) + iX] == false ) { pbTempPattern[(iY * iTempStride) + iX] = true; iX++; } } } break;
     689#if HHIQC_DMMFASTSEARCH_B0039
     690  case( 4 ):
     691    {
     692      if( (uhXs+uhXe) < uiTempBlockSize ) { for( UInt iY = 0; iY < uiTempBlockSize; iY++ ) { UInt iX = 0;                 while( pbTempPattern[(iY * iTempStride) + iX] == false ) { pbTempPattern[(iY * iTempStride) + iX] = true; iX++; } } }
     693      else                                { for( UInt iY = 0; iY < uiTempBlockSize; iY++ ) { UInt iX = uiTempBlockSize-1; while( pbTempPattern[(iY * iTempStride) + iX] == false ) { pbTempPattern[(iY * iTempStride) + iX] = true; iX--; } } }
     694    }
     695    break;
     696  case( 5 ):
     697    {
     698      if( (uhYs+uhYe) < uiTempBlockSize ) { for( UInt iX = 0; iX < uiTempBlockSize; iX++ ) { UInt iY = 0;                 while( pbTempPattern[(iY * iTempStride) + iX] == false ) { pbTempPattern[(iY * iTempStride) + iX] = true; iY++; } } }
     699      else                                { for( UInt iX = 0; iX < uiTempBlockSize; iX++ ) { UInt iY = uiTempBlockSize-1; while( pbTempPattern[(iY * iTempStride) + iX] == false ) { pbTempPattern[(iY * iTempStride) + iX] = true; iY--; } } }
     700    }
     701#else
    646702  case( 4 ): { for( UInt iY = 0;               iY < uiTempBlockSize; iY++ ) { UInt iX = 0;                 while( pbTempPattern[(iY * iTempStride) + iX] == false ) { pbTempPattern[(iY * iTempStride) + iX] = true; iX++; } } } break;
    647703  case( 5 ): { for( UInt iX = 0;               iX < uiTempBlockSize; iX++ ) { UInt iY = 0;                 while( pbTempPattern[(iY * iTempStride) + iX] == false ) { pbTempPattern[(iY * iTempStride) + iX] = true; iY++; } } } break;
     704#endif
    648705  }
    649706
     
    664721      case( 2 ): { uiOffX = 1; uiOffY = 1; } break;
    665722      case( 3 ): { uiOffX = 0; uiOffY = 1; } break;
     723#if HHIQC_DMMFASTSEARCH_B0039
     724      case( 4 ):
     725        {
     726          if( (uhXs+uhXe) < uiTempBlockSize ) { uiOffX = 0; uiOffY = 0; }
     727          else                                { uiOffX = 1; uiOffY = 0; }
     728        }
     729        break;
     730      case( 5 ):
     731        {
     732          if( (uhYs+uhYe) < uiTempBlockSize ) { uiOffX = 0; uiOffY = 0; }
     733          else                                { uiOffX = 0; uiOffY = 1; }
     734        }
     735        break;
     736#else
    666737      case( 4 ): { uiOffX = 0; uiOffY = 0; } break;
    667738      case( 5 ): { uiOffX = 0; uiOffY = 0; } break;
     739#endif
    668740      default:   { uiOffX = 0; uiOffY = 0; } break;
    669741      }
     
    732804  }
    733805}
     806
     807#if HHIQC_DMMFASTSEARCH_B0039
     808TComWedgeNode::TComWedgeNode()
     809{
     810  m_uiPatternIdx = NO_IDX;
     811  for( UInt uiPos = 0; uiPos < NUM_WEDGE_REFINES; uiPos++ )
     812  {
     813    m_uiRefineIdx[uiPos] = NO_IDX;
     814  }
     815}
     816
     817UInt TComWedgeNode::getPatternIdx()
     818{
     819  return m_uiPatternIdx;
     820}
     821UInt TComWedgeNode::getRefineIdx( UInt uiPos )
     822{
     823  assert( uiPos < NUM_WEDGE_REFINES );
     824  return m_uiRefineIdx[uiPos];
     825}
     826Void TComWedgeNode::setPatternIdx( UInt uiIdx )
     827{
     828  m_uiPatternIdx = uiIdx;
     829}
     830Void TComWedgeNode::setRefineIdx( UInt uiIdx, UInt uiPos )
     831{
     832  assert( uiPos < NUM_WEDGE_REFINES );
     833  m_uiRefineIdx[uiPos] = uiIdx; 
     834}
     835#endif
    734836
    735837#if HHI_DMM_PRED_TEX
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComWedgelet.h

    r193 r213  
    5050};
    5151
     52#if HHIQC_DMMFASTSEARCH_B0039
     53#define NUM_WEDGE_REFINES 8
     54#define NO_IDX MAX_UINT
     55#endif
     56
    5257// ====================================================================================================================
    5358// Class definition TComWedgelet
     
    6267  UChar           m_uhOri;                      // orientation index
    6368  WedgeResolution m_eWedgeRes;                  // start/end pos resolution
     69#if HHIQC_DMMFASTSEARCH_B0039
     70  Bool            m_bIsCoarse;
     71  UInt            m_uiAng;
     72#endif
    6473
    6574  UInt  m_uiWidth;
     
    9099  UChar           getEndY    () { return m_uhYe; }
    91100  UChar           getOri     () { return m_uhOri; }
    92 
     101#if HHIQC_DMMFASTSEARCH_B0039
     102  Bool            getIsCoarse() { return m_bIsCoarse; }
     103  UInt            getAng     () { return m_uiAng; }
     104  Void            findClosetAngle();
     105
     106  Void  setWedgelet( UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe, UChar uhOri, WedgeResolution eWedgeRes, Bool bIsCoarse = false );
     107#else
    93108  Void  setWedgelet( UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe, UChar uhOri, WedgeResolution eWedgeRes );
     109#endif
    94110
    95111  Bool  checkNotPlain();
     
    136152// type definition wedgelet reference list
    137153typedef std::vector<TComWedgeRef> WedgeRefList;
     154
     155#if HHIQC_DMMFASTSEARCH_B0039
     156// ====================================================================================================================
     157// Class definition TComWedgeNode
     158// ====================================================================================================================
     159class TComWedgeNode
     160{
     161private:
     162  UInt            m_uiPatternIdx;
     163  UInt            m_uiRefineIdx[NUM_WEDGE_REFINES];
     164
     165public:
     166  TComWedgeNode();
     167  virtual ~TComWedgeNode() {}
     168
     169  UInt            getPatternIdx();
     170  UInt            getRefineIdx ( UInt uiPos );
     171
     172  Void            setPatternIdx( UInt uiIdx );
     173  Void            setRefineIdx ( UInt uiIdx, UInt uiPos );
     174};  // END CLASS DEFINITION TComWedgeNode
     175
     176// type definition wedgelet node list
     177typedef std::vector<TComWedgeNode> WedgeNodeList;
     178#endif
    138179
    139180#if HHI_DMM_PRED_TEX
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComYuv.cpp

    r133 r213  
    409409
    410410#if LG_RESTRICTEDRESPRED_M24766
    411 void
     411Void
    412412TComYuv::getPUXYOffset(PartSize uhPartitionSize, Int iWidth, Int iHeight, Int &iXOffset, Int &iYOffset)
    413413{
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TypeDef.h

    r193 r213  
    4343
    4444#define VSP_N                             1
     45
    4546#if VSP_N
    4647#define VSP_BUGFIX                        1
     
    5152#define AMVP_VSP_UNAVAILABLE              1
    5253#endif
     54
    5355#define VSP_MERGE_POS                     5   // position of vsp in merge list (0..5)
    5456#define NTT_SUBPEL                        1
     57
     58#define VSP_SLICE_HEADER                  1
    5559#define VSP_CFG                           1
    56 #endif
    57 
    58 #define VSP_SLICE_HEADER                  1
    5960#if !VSP_CFG
    6061#define VSP_FRAME_INTERVAL                2
    6162#endif
    6263
    63 #define FIXES                             1
    64 #define POZNAN_CABAC_INIT_FLAG_FIX        1
    65 #define FIX_DECODING_WO_WRITING           1
    66 #define FIX_INIT_ROM                      1
    67 #define FIX_VIRT_DESTRUCTOR               1
    68 #define FIX_MEM_LEAKS                     1
    69 #define FIX_VSO_SETUP                     1
    70 #define FIX_COMP_WARNING_INIT             1
    71 #define FIX_RDO_MACRO                     1
     64#define VSP_AIC                           0
     65#define VSP_TMVP                          0
     66#define VSP_TMVP_ENABLE                   0
     67#endif // VSP_N
     68
     69
     70#define NTT_FIX_UNCONSTRAINED_MVI         1
     71
     72#define QC_MVHEVC_B0046                   0   //JCT3V-B0046: disable 3DHEVC tools
     73#define QC_IV_AS_LT_B0046                 1   //JCT3V-B0046: inter-view reference pictures are treated as long-term pictures
     74#define QC_TMVP_IDX_MOD_B0046             1   //JCT3V-B0046: the reference index for temporal merging candidate is set to 0, as defined in HEVC
     75#define QC_REM_IDV_B0046                  1   //JCT3V-B0046: removal of IDV NAL unit type
     76#define FIX_DEL_NULLPTR                   1
     77#define FIX_MISUSE_REFINDEX               1
     78#define FIX_FCO_COMP_WARNING              1
     79#define DV_V_RESTRICTION_B0037            1   // JCT3V-B0037 disparity vector vertical range restriction
     80
     81#if !QC_MVHEVC_B0046
     82///// ***** FIXES *********
     83// A
     84#define FIX_POZNAN_CABAC_INIT_FLAG        1
    7285#define FIX_LG_RESTRICTEDRESPRED_M24766   1
    73 #define FIX_REMOVE_TILE_DEPENDENCE        1
    74 #define FIX_DBL_CONTROL_DEFAULT           1
    75 
    76 
    77 #define LGE_EDGE_INTRA                    1   // JCT2-A0070
    78 #if LGE_EDGE_INTRA
     86
     87// B
     88#define FIX_LGE_IVMP_PARALLEL_MERGE_B0136 1
     89#define FIX_RDO_NEGDIST                   1
     90#define FIX_DMM_NEG_DIST                  1
     91#define FIX_LGE_DVMCP_B0133               1
     92
     93
     94// FCO
     95#define FLEX_CODING_ORDER_M23723          1
     96#if FLEX_CODING_ORDER_M23723
     97  #define DISABLE_FCO_FOR_VSO             0 // Optional compile settings to disable VSO with FCO.
     98#endif
     99
     100///// ***** PATCHES *********
     101#define TMVP_DEPTH_SWITCH                 1   // JCT3V-B0092 additional encoder option only
     102
     103///// ***** DEPTH MODELING MODES *********
     104#define HHI_DMM_WEDGE_INTRA               1   // depth model modes independent on texture (explicit and intra-predicted Wedgelet prediction)
     105#define HHI_DMM_PRED_TEX                  1   // depth model modes dependent on texture (inter-component Wedgelet and Contour prediction )
     106#define LGE_EDGE_INTRA_A0070              1   // JCT3V-A0070
     107#define RWTH_SDC_DLT_B0036                1   // JCT3V-B0036: Simplified Depth Coding + Depth Lookup Table
     108#define HHIQC_DMMFASTSEARCH_B0039         1   // JCT3V-B0039: fast Wedgelet search for DMM modes 1 and 3
     109
     110///// ***** INTERVIEW MOTION VECTOR PREDICTION *********
     111#define HHI_INTER_VIEW_MOTION_PRED        1   // inter-view motion parameter prediction
     112#define SHARP_INTERVIEW_DECOUPLE_B0111    1   // JCT3V-B0111 decoupling inter-view candidate
     113#define QC_MRG_CANS_B0048                 1   // JCT3V-B0048, B0086, B0069
     114#if     QC_MRG_CANS_B0048
     115#define OL_DISMV_POS_B0069                1   // different pos for disparity MV candidate, B0069
     116#endif
     117#define MTK_INTERVIEW_MERGE_A0049         1   // JCT3V-A0049 second part
     118#if HHI_INTER_VIEW_MOTION_PRED         
     119#define SAIT_IMPROV_MOTION_PRED_M24829    1   // improved inter-view motion vector prediction
     120#else                                 
     121#define SAIT_IMPROV_MOTION_PRED_M24829    0   
     122#endif                                 
     123
     124///// ***** INTERVIEW RESIDUAL PREDICTION *********
     125#define HHI_INTER_VIEW_RESIDUAL_PRED      1   // inter-view residual prediction
     126#if HHI_INTER_VIEW_RESIDUAL_PRED       
     127#define LG_RESTRICTEDRESPRED_M24766       1   // restricted inter-view residual prediction
     128#define QC_SIMPLIFIEDIVRP_M24938          1
     129#else                                 
     130#define LG_RESTRICTEDRESPRED_M24766       0
     131#define QC_SIMPLIFIEDIVRP_M24938          0
     132#endif
     133
     134///// ***** DISPARITY VECTOR DERIVATION *********
     135#define QC_MULTI_DIS_CAN_A0097            1   // JCT3V-A0097
     136#define LGE_DVMCP_A0126                   1   // JCT3V-A0126     
     137#define LGE_DVMCP_MEM_REDUCTION_B0135     1   // JCT3V-B0135     
     138#define DV_DERIVATION_PARALLEL_B0096      1   // JCT3V-B0096, enable parallel derivation of disparity vector
     139#define QC_SIMPLE_NBDV_B0047              1   // JCT3V-B0047
     140
     141///// ***** MOTION PARAMETER INHERITANCE  *********
     142#define HHI_MPI                           1   // motion parameter inheritance from texture picture for depth map coding
     143#if HHI_MPI
     144#define FIX_MPI_B0065                     1   // JCT3V-B0065, fix the MPI bug when RQT is off
     145#endif
     146#define MTK_UNCONSTRAINED_MVI_B0083       1    //JCT3V-B0083
     147
     148///// ***** VIEW SYNTHESIS OPTIMIZAION *********
     149#define HHI_VSO                           1
     150#define HHI_VSO_LS_TABLE_M23714           1   // m23714, enable table base Lagrange multiplier optimization
     151#define HHI_VSO_DIST_INT                  1   // Allow negative synthesized view distortion change
     152#define HHI_VSO_COLOR_PLANES              1   // Compute VSO distortion on color planes
     153#define HHI_VSO_RM_ASSERTIONS             0   // Output VSO assertions
     154#define HHI_VSO_SYNTH_DIST_OUT            0   // Output of synthesized view distortion instead of depth distortion in encoder output
     155#define SAIT_VSO_EST_A0033                1   // JCT3V-A0033 modification 3
     156#define LGE_VSO_EARLY_SKIP_A0093          1   // JCT3V-A0093 modification 4
     157#define LGE_WVSO_A0119                    1   // JCT3V-A0119 & JCT3V-B0131 Depth Metric with a weighted depth fidelity term
     158
     159
     160///// ***** ILLUMINATION COMPENSATON *********
     161#define LGE_ILLUCOMP_B0045                1   // JCT2-B0045 Illumination compensation for Luma and Chroma
     162#if LGE_ILLUCOMP_B0045
     163#define LGE_ILLUCOMP_B0045_ENCSIMP        1
     164#endif
     165
     166///// ***** INTERVIEW SKIP *********
     167#define HHI_INTERVIEW_SKIP                1
     168
     169///// ***** QUADTREE LIMITATION *********
     170#define OL_QTLIMIT_PREDCODING_B0068       1    //JCT3V-B0068
     171
     172///// ***** OTHERS *********
     173#define LG_ZEROINTRADEPTHRESI_A0087       1   // JCT2-A0087
     174#define SONY_COLPIC_AVAILABILITY          1
     175#define HHI_FULL_PEL_DEPTH_MAP_MV_ACC     1   // full-pel mv accuracy for depth maps
     176#define VIDYO_VPS_INTEGRATION             1
     177
     178
     179
     180///// ***** DEFINED PARAMETERS *********
     181#if QC_MULTI_DIS_CAN_A0097                   
     182#define DIS_CANS                          1
     183#endif                                 
     184
     185#define HHI_INTERVIEW_SKIP_LAMBDA_SCALE   1
     186
     187#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     188#define DMM_WEDGEMODEL_MIN_SIZE           4
     189#define DMM_WEDGEMODEL_MAX_SIZE          32
     190#define DMM_WEDGE_PREDDIR_DELTAEND_MAX    4
     191#endif
     192
     193#if LGE_EDGE_INTRA_A0070
    79194#define LGE_EDGE_INTRA_MIN_SIZE           4
    80195#define LGE_EDGE_INTRA_MAX_SIZE           32
     
    85200#endif
    86201
    87 #define LG_ZEROINTRADEPTHRESI_M26039      1   // JCT2-A0087
    88                                        
    89 #define SONY_COLPIC_AVAILABILITY          1
    90                                        
    91 #define HHI_INTER_VIEW_MOTION_PRED        1   // inter-view motion parameter prediction
    92 #define HHI_INTER_VIEW_RESIDUAL_PRED      1   // inter-view residual prediction
    93 #define QC_MULTI_DIS_CAN                  1   // JCT2-A0097
    94 #if QC_MULTI_DIS_CAN                   
    95     #define DIS_CANS                      1
    96 #endif                                 
    97                                        
    98 #define MTK_INTERVIEW_MERGE_A0049         1   //  JCT2-A0049 second part
    99                                        
    100 #define LGE_DVMCP                         1   //  JCT2-A0126     
    101 #if LGE_DVMCP                           
     202
     203#if LGE_DVMCP_A0126                           
    102204#define DVFROM_LEFTBELOW                  1
    103205#define DVFROM_LEFT                       2
     
    109211
    110212
    111 #define HHI_VSO                           1
    112 #define HHI_VSO_LS_TABLE                  1 // m23714
    113 #define HHI_VSO_DIST_INT                  1
    114 #define HHI_VSO_SYNTH_DIST_OUT            0
    115 #define HHI_VSO_COLOR_PLANES              1
    116 #define HHI_VSO_SPEEDUP_A0033             1 // JCT2-A0033 modification 1 (changes in classes directly related the renderer model
    117                                             // to are not covered by this define, since nearly the entire class has been changed)
    118 #define HHI_VSO_RM_ASSERTIONS             0 // output VSO assertions
    119 #define HHI_VSO_SET_OPTIM                 1 // remove unnecessary updates (works only with HHI_VSO_FIX 1 properly)
    120 #define SAIT_VSO_EST_A0033                1 // JCT2-A0033 modification 3
    121 #define LGE_VSO_EARLY_SKIP_A0093          1 // JCT2-A0093 modification 4
    122 #define LGE_WVSO_A0119                    1 // JCT2-A0119 Depth Metric with a weighted depth fidelity term
    123 
    124 #define OL_DEPTHLIMIT_A0044               1 //JCT2-A0044
    125 #if OL_DEPTHLIMIT_A0044
    126 #define OL_DO_NOT_LIMIT_INTRA_SLICES_PART 1 //Turn this on to not perform depth limiting for I-SLICES.
    127 #define OL_END_CU                         MAX_INT //Default for initializing the partition information buffer
    128 #define OL_PART_BUF_SIZE                  86 //maximum number of possible partition bits in a CU
    129 #endif
    130 
    131 #define HHI_INTERVIEW_SKIP                1
    132 #define HHI_INTERVIEW_SKIP_LAMBDA_SCALE   1
    133 
    134 #define HHI_DMM_WEDGE_INTRA               1   // depth model modes independent on texture (explicit and intra-predicted Wedgelet prediction)
    135 #define HHI_DMM_PRED_TEX                  1   // depth model modes dependent on texture (inter-component Wedgelet and Contour prediction )
    136 
    137 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    138 #define DMM_WEDGEMODEL_MIN_SIZE           4
    139 #define DMM_WEDGEMODEL_MAX_SIZE          32
    140 #define DMM_WEDGE_PREDDIR_DELTAEND_MAX    4
    141 #endif
    142 
    143 #define HHI_MPI                           1   // motion parameter inheritance from texture picture for depth map coding
     213#if HHIQC_DMMFASTSEARCH_B0039
     214#define DMM3_SIMPLIFY_TR                  1
     215#endif
     216
     217
     218#if RWTH_SDC_DLT_B0036
     219#define Log2( n ) ( log((double)n) / log(2.0) )
     220#endif
     221
    144222#define HHI_MPI_MERGE_POS                 0
    145 #define HHI_FULL_PEL_DEPTH_MAP_MV_ACC     1   // full-pel mv accuracy for depth maps
    146                                        
    147 #if HHI_INTER_VIEW_MOTION_PRED
    148 #define SAIT_IMPROV_MOTION_PRED_M24829    1   // improved inter-view motion vector prediction
    149 #else                                 
    150 #define SAIT_IMPROV_MOTION_PRED_M24829    0   
    151 #endif                                 
    152                                        
    153 #if HHI_INTER_VIEW_RESIDUAL_PRED       
    154 #define LG_RESTRICTEDRESPRED_M24766       1   // restricted inter-view residual prediction
    155 #define QC_SIMPLIFIEDIVRP_M24938          1
    156 #else                                 
    157 #define LG_RESTRICTEDRESPRED_M24766       0
    158 #define QC_SIMPLIFIEDIVRP_M24938          0
    159 #endif
    160 
    161 
     223#endif
     224///// ***** HM 6.1 *********
    162225#define SKIPFRAME_BUGFIX                  1 ///< bug fix to enable skipFrame at decoder
    163226#define START_DECODING_AT_CRA             1 ///< H0496, start decoding at clear random access point
     
    170233
    171234#define PARALLEL_MERGE  1                   //< H0082 parallel merge/skip
     235#define LGE_IVMP_PARALLEL_MERGE_B0136     1 //< B0136 support of parallel merge/skip in disparity vector derivation
    172236#define LOG2_PARALLEL_MERGE_LEVEL_MINUS2  0 //< H0082 parallel merge level 0-> 4x4, 1-> 8x8, 2->16x16, 3->32x32, 4->64x64
     237
    173238#if PARALLEL_MERGE && LOG2_PARALLEL_MERGE_LEVEL_MINUS2
    174239#define CU_BASED_MRG_CAND_LIST            1  //< H0240: single merge candidate list for all PUs inside a 8x8 CU conditioned on LOG2_PARALLEL_MERGE_LEVEL_MINUS2 > 0
    175 #endif
     240#define FIX_CU_BASED_MRG_CAND_LIST_B0136  1  //< B0136 bug fix for CU_BASED_MRG_CAND_LIST
     241#endif
     242
    176243#define MVP_AT_ENTROPYSLICE_BOUNDARY      1  //< H0362 enable motion prediction accross entropy slice boundary
    177244
    178245#define FAST_DECISION_FOR_MRG_RD_COST     1  ////< H0178: Fast Decision for Merge 2Nx2N RDCost
    179246
    180 #define PIC_CROPPING              1 ///< Picture cropping and size constraints
    181 #define NAL_REF_FLAG              1 ///< Change nal_ref_idc to nal_ref_flag (JCTVC-F463)
    182 #define REMOVE_DIV_OPERATION      1 ///< H0238: Simplified intra horizontal and vertical filtering
     247#define PIC_CROPPING              1  ///< Picture cropping and size constraints
     248#define NAL_REF_FLAG              1  ///< Change nal_ref_idc to nal_ref_flag (JCTVC-F463)
     249#define REMOVE_DIV_OPERATION      1  ///< H0238: Simplified intra horizontal and vertical filtering
    183250#define LOGI_INTRA_NAME_3MPM      1  ///< H0407: logical Intra mode naming (sequential angular mode numbering) and 3 MPM mode coding
    184251
     
    191258#define MULTIBITS_DATA_HIDING     1  ///< H0481: multiple sign bit hiding
    192259
    193 #define DEQUANT_CLIPPING           1  ///< H0312/H0541: transformed coefficients clipping before de-quantization
     260#define DEQUANT_CLIPPING          1  ///< H0312/H0541: transformed coefficients clipping before de-quantization
    194261
    195262#define REMOVE_NON_SCALED         1 ///< H0164/H0250: Removal of non-scaled merge candidate
     
    299366#define LOG2_SCAN_SET_SIZE                4
    300367
    301 #if LGE_EDGE_INTRA
     368#if LGE_EDGE_INTRA_A0070
    302369#if LGE_EDGE_INTRA_DELTA_DC
    303370#define FAST_UDI_MAX_RDMODE_NUM               37          ///< maximum number of RD comparison in fast-UDI estimation loop
     
    347414#endif
    348415
    349 #if LGE_EDGE_INTRA
     416#if LGE_EDGE_INTRA_A0070
    350417#if HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX
    351418#define EDGE_INTRA_IDX  (NUM_INTRA_MODE+NUM_DMM_MODE)
     
    372439                            // This is here just to perform timing tests -- OL_FLUSH_ALIGN should be 0 for WPP.
    373440
    374 #define RVM_VCEGAM10_M 4
     441#define RVM_VCEGAM10_M         4
    375442
    376443#define PLANAR_IDX             0
     
    454521// VPS INTEGRATION
    455522// ====================================================================================================================
    456 #define VIDYO_VPS_INTEGRATION       1
     523#if !QC_MVHEVC_B0046
    457524#if VIDYO_VPS_INTEGRATION
    458525#define MAX_NUM_VPS 10
    459526#endif
     527#else
     528#define MAX_NUM_VPS 1
     529#endif
     530
    460531
    461532// ====================================================================================================================
     
    739810};
    740811
    741 #if HHI_VSO_SPEEDUP_A0033
    742812
    743813enum BlenMod
     
    749819    BLEND_GEN   =  3
    750820};
    751 #endif
    752821
    753822/// supported prediction type
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/NALread.cpp

    r165 r213  
    132132#endif
    133133
     134#if QC_MVHEVC_B0046
     135  //nalu.m_layerId    = bs.read(6);
     136  nalu.m_layerId    = bs.read(5);
     137  nalu.m_temporalId = bs.read(3) - 1;
     138#else
    134139#if H0388
    135140  nalu.m_temporalId = bs.read(3);
     
    145150  if ( nalu.m_temporalId )
    146151  {
     152#if QC_REM_IDV_B0046
     153    assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_CRA && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR);
     154#else
    147155    assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_CRA && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDV );
     156#endif
    148157  }
    149158#endif
     
    154163  case NAL_UNIT_CODED_SLICE_IDR:
    155164#if H0566_TLA
     165#if !QC_REM_IDV_B0046
    156166  case NAL_UNIT_CODED_SLICE_IDV:
     167#endif
    157168  case NAL_UNIT_CODED_SLICE_CRA:
    158169  case NAL_UNIT_CODED_SLICE_TLA:
     
    175186      if (nalu.m_temporalId == 0)
    176187      {
     188#if QC_REM_IDV_B0046
     189        assert(nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR);
     190#else
    177191        assert(nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDV );
     192#endif
    178193      }
    179194      else
     
    190205  }
    191206#endif
     207#endif
    192208}
    193209//! \}
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r193 r213  
    13381338  }
    13391339}
    1340 
     1340#if QC_MVHEVC_B0046
     1341Void TDecCavlc::parseVPS(TComVPS* pcVPS)
     1342{
     1343  UInt  uiCode;
     1344  READ_CODE( 4, uiCode,  "video_parameter_set_id"   );       pcVPS->setVPSId( uiCode );
     1345  READ_FLAG( uiCode,     "temporal_id_nesting_flag" );       pcVPS->setTemporalNestingFlag( uiCode ? true:false );
     1346  READ_CODE( 2, uiCode,  "vps_reserved_zero_2bits" );         assert( !uiCode );
     1347  READ_CODE( 6, uiCode,  "vps_max_layers_minus1" );               pcVPS->setMaxLayers( uiCode + 1 );
     1348  READ_CODE( 3, uiCode,  "vps_max_sub_layers_minus1" );      pcVPS->setMaxTLayers( uiCode + 1 );
     1349  READ_CODE( 12, uiCode, "vps_extension_offset"      );      assert( !uiCode );
     1350  for(UInt i = 0; i <= pcVPS->getMaxTLayers()-1; i++)
     1351  {
     1352    READ_UVLC( uiCode,  "max_dec_pic_buffering[i]" );     pcVPS->setMaxDecPicBuffering( uiCode, i );
     1353    READ_UVLC( uiCode,  "num_reorder_pics[i]" );          pcVPS->setNumReorderPics( uiCode, i );
     1354    READ_UVLC( uiCode,  "max_latency_increase[i]" );      pcVPS->setMaxLatencyIncrease( uiCode, i );
     1355  }
     1356  READ_UVLC( uiCode,                 "vps_num_hrd_parameters"   ); pcVPS->setNumHRDParameters(uiCode);
     1357  assert(pcVPS->getNumHRDParameters()==0);
     1358  for ( UInt i = 0; i < pcVPS->getNumHRDParameters(); i ++)
     1359  {
     1360   //   if( i > 0 ) 
     1361    //{
     1362    //  READ_UVLC (0, "op_num_layer_id_values_minus1[ opIdx ]");
     1363    //  for( i = 0; i <= op_num_layer_id_values_minus1[ opIdx ]; i++ ) 
     1364    //    READ_UVLC(0, 6, "op_layer_id[ opIdx ][ i ]");
     1365    //} 
     1366    //hrd_parameters( i  = =  0, vps_max_sub_layers_minus1 ); 
     1367  }
     1368 
     1369  READ_CODE( 1, uiCode, "bit_equal_to_one" );             assert( uiCode );
     1370  //vps_extension_byte_alignment_reserved_one_bit
     1371  xReadVPSAlignOne();
     1372  READ_CODE( 8, uiCode, "num_additional_layer_operation_points" );     pcVPS->setNumAddiLayerOperationPoints( uiCode );
     1373  READ_CODE( 8, uiCode, "num_additional_profile_level_sets"     );     pcVPS->setNumAddiProLevelSets( uiCode);
     1374
     1375
     1376  for(UInt i=0; i <= pcVPS->getMaxLayers()-1; i++)
     1377  {
     1378    READ_CODE( 4,  uiCode,             "num_types_zero_4bits[i]" );   assert( !uiCode );
     1379    READ_CODE( 4,  uiCode,             "type_zero_4bits[i]"      );   assert( !uiCode );
     1380    READ_CODE( 8,  uiCode,             "view_id[i]" );                pcVPS->setViewId(uiCode, i);
     1381    // WRITE_SVLC( pcVPS->getViewOrderIdx(i),                  "view_order_idx[i]" );
     1382    if(i)
     1383    {
     1384      READ_CODE( 6, uiCode,  "num_direct_ref_layers[ i ]" );    pcVPS->setNumDirectRefLayer(uiCode, i);
     1385      for (UInt j = 0; j< pcVPS->getNumDirectRefLayer(i); j++)
     1386      {
     1387        READ_CODE( 6, uiCode, "ref_layer_id[i][j]" );         pcVPS->setDirectRefLayerId (uiCode, i, j);
     1388      }
     1389    }
     1390  }
     1391  for( UInt i=1; i<=pcVPS->getNumAddiProLevelSets(); i++)
     1392  {
     1393    //profile_tier_level
     1394  }
     1395  for( UInt i=1; i<= pcVPS->getNumAddiLayerOperationPoints(); i++)
     1396  {   
     1397    if(pcVPS->getMaxLayers() == 3)
     1398    {
     1399      pcVPS->setNumOpLayerIdMinus1((i < pcVPS->getNumAddiLayerOperationPoints() ? 1: 2), (i-1));
     1400    }
     1401    else if( i==1 )
     1402    {
     1403      assert(pcVPS->getNumAddiLayerOperationPoints()==1);
     1404      pcVPS->setNumOpLayerIdMinus1(pcVPS->getMaxLayers()-1, (i-1));
     1405    }
     1406    READ_UVLC( uiCode,           "op_num_layer_id_values_minus1[ opIdx ]" ); pcVPS->setNumOpLayerIdMinus1(uiCode, i-1);
     1407    for(UInt j = 0; j <= pcVPS->getNumOpLayerIdMinus1(i-1); j++ )
     1408    {
     1409      READ_UVLC( uiCode,           "op_layer_id[ opIdx ][ i ]" ); pcVPS->setNumOpLayerId(uiCode, i-1, j);
     1410    }
     1411    if (pcVPS->getNumAddiProLevelSets())
     1412    {
     1413      //profile_level_idx[ i ]
     1414    }
     1415  }
     1416  return;
     1417}
     1418#else
    13411419#if VIDYO_VPS_INTEGRATION
    13421420Void TDecCavlc::parseVPS(TComVPS* pcVPS)
     
    13891467
    13901468#endif
    1391 
     1469#endif
    13921470#if HHI_MPI
    13931471Void TDecCavlc::parseSPS(TComSPS* pcSPS, Bool bIsDepth)
     
    14011479 
    14021480  UInt  uiCode;
     1481#if !QC_MVHEVC_B0046
    14031482  Int   iCode;
    1404 
     1483#endif
    14051484  READ_CODE( 8,  uiCode, "profile_idc" );                        pcSPS->setProfileIdc( uiCode );
    14061485  READ_CODE( 8,  uiCode, "reserved_zero_8bits" );
     
    16451724#endif
    16461725  READ_FLAG( uiCode, "sps_extension_flag");
     1726#if !QC_MVHEVC_B0046
    16471727  if(uiCode)
    16481728  {
     
    16741754    }
    16751755#endif
    1676 
    1677     READ_FLAG( uiCode, "base_view_flag" );
     1756#if OL_QTLIMIT_PREDCODING_B0068
     1757    if( bIsDepth )
     1758    {
     1759      READ_FLAG( uiCode, "use_qtlpc_flag" );
     1760      pcSPS->setUseQTLPC( uiCode );
     1761    }
     1762#endif
     1763   
     1764#if RWTH_SDC_DLT_B0036
     1765    if( bIsDepth )
     1766    {
     1767      READ_FLAG( uiCode, "use_dlt_flag" );
     1768      pcSPS->setUseDLT( uiCode );
     1769      if( pcSPS->getUseDLT() )
     1770      {
     1771        // decode mapping
     1772        UInt uiNumDepthValues;
     1773        // parse number of values in DLT
     1774        xReadUvlc( uiNumDepthValues );
     1775       
     1776        // parse actual DLT values
     1777        UInt* auiIdx2DepthValue = (UInt*) calloc(uiNumDepthValues, sizeof(UInt));
     1778        for(UInt d=0; d<uiNumDepthValues; d++)
     1779        {
     1780          xReadUvlc( uiCode );
     1781          auiIdx2DepthValue[d] = uiCode;
     1782        }
     1783       
     1784        pcSPS->setDepthLUTs(auiIdx2DepthValue, uiNumDepthValues);
     1785       
     1786        // clean memory
     1787        free(auiIdx2DepthValue);
     1788      }
     1789      else
     1790        pcSPS->setDepthLUTs();
     1791    }
     1792#endif
     1793
     1794    READ_FLAG( uiCode, "base_view_flag" );
    16781795    if( uiCode )
    16791796    { // baseview SPS -> set standard values
     
    16851802    pcSPS->setMultiviewResPredMode  ( 0 );
    16861803#endif
     1804#if VSP_N
     1805    pcSPS->setIsFirstInView( true );
     1806#endif
    16871807    }
    16881808    else
     
    16911811      if( uiCode )
    16921812      {
     1813#if VSP_N
     1814        UInt  uiViewId, uiCamParPrecision = 0, uiCamParPresent = 0;
     1815        Int   iVOI;
     1816        Bool  bCamParSlice = false;
     1817        READ_UVLC( uiViewId, "view_id" );
     1818        READ_SVLC(     iVOI, "view_order_idx" );
     1819        if( uiViewId )
     1820        {
     1821          READ_FLAG( uiCamParPresent, "camera_parameter_present_flag" );
     1822          pcSPS->setIsFirstInView( (Bool)uiCamParPresent );
     1823          if( uiCamParPresent )
     1824          {
     1825            READ_UVLC( uiCamParPrecision, "camera_parameter_precision" );
     1826            READ_FLAG( uiCode, "camera_parameter_in_slice_header" );    bCamParSlice = ( uiCode == 1 );
     1827            if( !bCamParSlice )
     1828            {
     1829              for( UInt uiBaseId = 0; uiBaseId < uiViewId; uiBaseId++ )
     1830              {
     1831                READ_SVLC( iCode, "coded_scale" );   m_aaiTempScale [ uiBaseId ][ uiViewId ] = iCode;
     1832                READ_SVLC( iCode, "coded_offset" );   m_aaiTempOffset[ uiBaseId ][ uiViewId ] = iCode;
     1833                READ_SVLC( iCode, "inverse_coded_scale_plus_coded_scale" );   m_aaiTempScale [ uiViewId ][ uiBaseId ] = iCode - m_aaiTempScale [ uiBaseId ][ uiViewId ];
     1834                READ_SVLC( iCode, "inverse_coded_offset_plus_coded_offset" );   m_aaiTempOffset[ uiViewId ][ uiBaseId ] = iCode - m_aaiTempOffset[ uiBaseId ][ uiViewId ];
     1835              }
     1836            }
     1837            pcSPS->initMultiviewSPSFlex( uiViewId, iVOI, true, (Bool)uiCamParPresent, uiCamParPrecision, bCamParSlice, (uiCamParPresent && !bCamParSlice ? m_aaiTempScale : NULL ), (uiCamParPresent && !bCamParSlice ? m_aaiTempOffset : NULL ) );
     1838          }
     1839          else
     1840          {
     1841            pcSPS->initMultiviewSPSDepth( uiViewId, iVOI );
     1842          }
     1843        }
     1844        else
     1845        {
     1846          pcSPS->initMultiviewSPSDepth( uiViewId, iVOI );
     1847        }
     1848#if DEPTH_MAP_GENERATION
     1849        pcSPS->setPredDepthMapGeneration( uiViewId, true );
     1850#endif
     1851#else
    16931852        READ_UVLC( uiCode, "view_id" );
    16941853        READ_SVLC(  iCode, "view_order_idx" );
     
    16971856        pcSPS->setPredDepthMapGeneration( uiCode, true );
    16981857#endif
     1858#endif
    16991859#if HHI_INTER_VIEW_RESIDUAL_PRED
    17001860      pcSPS->setMultiviewResPredMode  ( 0 );
     
    17031863      else
    17041864      {
    1705         UInt  uiViewId, uiCamParPrecision;
     1865        UInt  uiViewId, uiCamParPrecision = 0, uiCamParPresent = 0;
    17061866        Int   iVOI;
    1707         Bool  bCamParSlice;
     1867        Bool  bCamParSlice = false;
    17081868        READ_UVLC( uiViewId, "view_id" );  uiViewId++;
    17091869        READ_SVLC( iVOI, "view_order_idx" );
     1870#if VSP_N
     1871        READ_FLAG( uiCamParPresent, "camera_parameter_present_flag" );
     1872        pcSPS->setIsFirstInView( (Bool)uiCamParPresent );
     1873        if( uiCamParPresent )
     1874        {
     1875#endif
    17101876        READ_UVLC( uiCamParPrecision, "camera_parameter_precision" );
    17111877        READ_FLAG( uiCode, "camera_parameter_in_slice_header" );    bCamParSlice = ( uiCode == 1 );
     
    17201886          }
    17211887        }
     1888#if VSP_N
     1889          pcSPS->initMultiviewSPS( uiViewId, iVOI, uiCamParPrecision, bCamParSlice, m_aaiTempScale, m_aaiTempOffset );
     1890        }
     1891        else
     1892        {
     1893          pcSPS->initMultiviewSPSFlex( uiViewId, iVOI, false );
     1894        }
     1895#else
    17221896        pcSPS->initMultiviewSPS( uiViewId, iVOI, uiCamParPrecision, bCamParSlice, m_aaiTempScale, m_aaiTempOffset );
     1897#endif
    17231898
    17241899#if DEPTH_MAP_GENERATION
     
    17531928#endif
    17541929#if HHI_INTER_VIEW_RESIDUAL_PRED
    1755       pcSPS->setMultiviewResPredMode  ( uiMultiviewResPredMode );
     1930        pcSPS->setMultiviewResPredMode  ( uiMultiviewResPredMode );
    17561931#endif
    17571932      }
     
    17801955    }
    17811956  }
     1957#endif
    17821958}
    17831959
     
    18201996  UInt address;
    18211997  UInt innerAddress = 0;
     1998
     1999#if LGE_ILLUCOMP_B0045
     2000  // IC flag is on only first_slice_in_pic
     2001  if (uiCode)
     2002  {
     2003    UInt uiCodeTmp = 0;
     2004    if ( rpcSlice->getSPS()->getViewId() && !rpcSlice->getSPS()->isDepth() )
     2005    {
     2006      READ_FLAG (uiCodeTmp, "applying IC flag");
     2007    }
     2008    rpcSlice->setApplyIC(uiCodeTmp);
     2009  }
     2010#endif
     2011
    18222012  if(!uiCode)
    18232013  {
     
    18732063    }
    18742064#endif
     2065#if QC_REM_IDV_B0046
     2066#if !QC_MVHEVC_B0046
     2067  if(rpcSlice->getNalUnitType()==NAL_UNIT_CODED_SLICE_IDR && rpcSlice->getSPS()->getViewId() == 0)
     2068#else
     2069  if(rpcSlice->getNalUnitType()==NAL_UNIT_CODED_SLICE_IDR && rpcSlice->getViewId() == 0)
     2070#endif
     2071#else
    18752072    if(rpcSlice->getNalUnitType()==NAL_UNIT_CODED_SLICE_IDR)
     2073#endif
    18762074    {
    18772075      READ_UVLC( uiCode, "idr_pic_id" );  //ignored
     
    19072105      }
    19082106      rpcSlice->setPOC( iPOCmsb+iPOClsb );
    1909 
     2107#if QC_REM_IDV_B0046
     2108#if !QC_MVHEVC_B0046
     2109      if( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR &&  rpcSlice->getSPS()->getViewId() && rpcSlice->getPOC() == 0 )
     2110#else
     2111      if( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR &&  rpcSlice->getViewId() && rpcSlice->getPOC() == 0 )
     2112#endif
     2113#else
    19102114      if( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDV && rpcSlice->getPOC() == 0 )
     2115#endif
    19112116      {
    19122117        TComReferencePictureSet* rps = rpcSlice->getLocalRPS();
     
    20952300    {
    20962301#if H0412_REF_PIC_LIST_RESTRICTION
     2302#if QC_MVHEVC_B0046
     2303    if( !rpcSlice->getViewId() || !rpcSlice->getSPS()->getListsModificationPresentFlag() )
     2304#else
    20972305      if( !rpcSlice->getSPS()->getListsModificationPresentFlag() )
     2306#endif
    20982307      {
    20992308        refPicListModification->setRefPicListModificationFlagL0( 0 );
     
    21662375    {
    21672376#if H0412_REF_PIC_LIST_RESTRICTION
     2377#if QC_MVHEVC_B0046
     2378    if( !rpcSlice->getViewId() || !rpcSlice->getSPS()->getListsModificationPresentFlag() )
     2379#else
    21682380      if( !rpcSlice->getSPS()->getListsModificationPresentFlag() )
     2381#endif
    21692382      {
    21702383        refPicListModification->setRefPicListModificationFlagL1( 0 );
     
    22552468     
    22562469#if H0412_REF_PIC_LIST_RESTRICTION
    2257       if(rpcSlice->getSPS()->getListsModificationPresentFlag() )
     2470#if QC_MVHEVC_B0046
     2471    if( rpcSlice->getViewId() && rpcSlice->getSPS()->getListsModificationPresentFlag() )
     2472#else
     2473    if(rpcSlice->getSPS()->getListsModificationPresentFlag() )
     2474#endif
    22582475      {
    22592476#endif
     
    26872904}
    26882905
     2906#if LGE_ILLUCOMP_B0045
     2907Void TDecCavlc::parseICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     2908{
     2909  assert(0);
     2910}
     2911#endif
     2912
    26892913#if FORCE_REF_VSP==1
    26902914Void TDecCavlc::parseVspFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     
    28993123#endif
    29003124
     3125#if RWTH_SDC_DLT_B0036
     3126Void TDecCavlc::parseSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     3127{
     3128  assert(0);
     3129}
     3130Void TDecCavlc::parseSDCPredMode    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     3131{
     3132  assert(0);
     3133}
     3134Void TDecCavlc::parseSDCResidualData     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart )
     3135{
     3136  assert(0);
     3137}
     3138#endif
     3139
    29013140// ====================================================================================================================
    29023141// Protected member functions
     
    29643203}
    29653204
     3205#if QC_MVHEVC_B0046
     3206/** Parse VPS alignment one bits.
     3207 * \returns Void
     3208 */
     3209Void TDecCavlc::xReadVPSAlignOne( )
     3210{
     3211  UInt uiNumberOfBits = m_pcBitstream->getNumBitsUntilByteAligned();
     3212
     3213  if(uiNumberOfBits)
     3214  {
     3215    UInt uiBits;
     3216    UInt uiSymbol;
     3217
     3218    for(uiBits = 0; uiBits < uiNumberOfBits; uiBits++)
     3219    {
     3220      xReadFlag( uiSymbol );
     3221
     3222      if(!uiSymbol)
     3223      {
     3224        printf("\nWarning! vps_extension_byte_alignment_reserved_one_bit include a non-zero value.\n");
     3225      }
     3226    }
     3227  }
     3228}
     3229#endif
    29663230/** Parse PCM alignment zero bits.
    29673231 * \returns Void
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecCAVLC.h

    r166 r213  
    7575  Void  xReadFlagTr           (              UInt& rValue, const Char *pSymbolName);
    7676#endif
    77  
     77#if QC_MVHEVC_B0046
     78  Void  xReadVPSAlignOne      ();
     79#endif
    7880  Void  xReadPCMAlignZero     ();
    7981
     
    113115  Void  parseQtRootCbf      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt& uiQtRootCbf );
    114116
    115 #if VIDYO_VPS_INTEGRATION
     117#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    116118  Void  parseVPS            ( TComVPS* pcVPS );
    117119#endif
     
    142144 
    143145  Void  parseSkipFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     146#if LGE_ILLUCOMP_B0045
     147  Void  parseICFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     148#endif
    144149#if FORCE_REF_VSP==1
    145150  Void  parseVspFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     
    178183  Void parseDFFlag         ( UInt& ruiVal, const Char *pSymbolName );
    179184  Void parseDFSvlc         ( Int&  riVal,  const Char *pSymbolName  );
     185#if RWTH_SDC_DLT_B0036
     186  Void parseSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     187  Void parseSDCPredMode    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     188  Void parseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart );
     189#endif
    180190protected:
    181191#if DBL_CONTROL
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecCu.cpp

    r193 r213  
    3838#include "TDecCu.h"
    3939
     40#if RWTH_SDC_DLT_B0036
     41#define GetDepthValue2Idx(val)     (pcCU->getSlice()->getSPS()->depthValue2idx(val))
     42#define GetIdx2DepthValue(val)     (pcCU->getSlice()->getSPS()->idx2DepthValue(val))
     43#endif
     44
    4045//! \ingroup TLibDecoder
    4146//! \{
     
    424429      }
    425430    }
     431#if LGE_ILLUCOMP_B0045
     432    m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
     433#endif
    426434#if HHI_MPI
    427435    }
     
    505513  m_pcEntropyDecoder->decodePredInfo( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth]);
    506514 
     515#if LGE_ILLUCOMP_B0045
     516  m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
     517#endif
     518
    507519#if HHI_INTER_VIEW_RESIDUAL_PRED
    508520  if( !pcCU->isIntra( uiAbsPartIdx ) )
     
    670682      break;
    671683    case MODE_INTRA:
     684#if RWTH_SDC_DLT_B0036
     685      if( m_ppcCU[uiDepth]->getSDCFlag(0) )
     686        xReconIntraSDC( m_ppcCU[uiDepth], 0, uiDepth );
     687      else
     688#endif
    672689      xReconIntraQT( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth );
    673690      break;
     
    694711{
    695712#if HHI_MPI
     713#if FIX_MPI_B0065
     714  if( pcCU->getTextureModeDepth( 0 ) != -1 )
     715  {
     716    TComDataCU *pcTextureCU = pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() );
     717    if( uiDepth == pcTextureCU->getDepth(uiAbsPartIdx))
     718    {
     719      PartSize partSize = pcTextureCU->getPartitionSize(uiAbsPartIdx);
     720      pcCU->setPartSizeSubParts( partSize, 0, uiDepth );
     721    }
     722    else
     723    {
     724      pcCU->setPartSizeSubParts( SIZE_NxN, 0, uiDepth );
     725    }
     726  }
     727#else
    696728  if( pcCU->getTextureModeDepth( 0 ) != -1 )
    697729    pcCU->setPartSizeSubParts( SIZE_NxN, 0, uiDepth );
    698730#endif
     731#endif
    699732 
    700733  // inter prediction
    701734  m_pcPrediction->motionCompensation( pcCU, m_ppcYuvReco[uiDepth] );
    702 
     735 
    703736#if HHI_MPI
    704737  if( pcCU->getTextureModeDepth( 0 ) != -1 )
     
    779812                                     m_pcPrediction->getPredicBufHeight (),
    780813                                     bAboveAvail, bLeftAvail );
    781 #if LGE_EDGE_INTRA
     814#if LGE_EDGE_INTRA_A0070
    782815  if( uiLumaPredMode >= EDGE_INTRA_IDX )
    783816  {
     
    10181051
    10191052}
     1053
     1054#if RWTH_SDC_DLT_B0036
     1055Void TDecCu::xReconIntraSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     1056{
     1057  UInt uiWidth        = pcCU->getWidth  ( 0 );
     1058  UInt uiHeight       = pcCU->getHeight ( 0 );
     1059 
     1060  TComYuv* pcRecoYuv  = m_ppcYuvReco[uiDepth];
     1061  TComYuv* pcPredYuv  = m_ppcYuvReco[uiDepth];
     1062  TComYuv* pcResiYuv  = m_ppcYuvResi[uiDepth];
     1063 
     1064  UInt    uiStride    = pcRecoYuv->getStride  ();
     1065  Pel*    piReco      = pcRecoYuv->getLumaAddr( uiAbsPartIdx );
     1066  Pel*    piPred      = pcPredYuv->getLumaAddr( uiAbsPartIdx );
     1067  Pel*    piResi      = pcResiYuv->getLumaAddr( uiAbsPartIdx );
     1068 
     1069  UInt    uiZOrder          = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
     1070  Pel*    piRecIPred        = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );
     1071  UInt    uiRecIPredStride  = pcCU->getPic()->getPicYuvRec()->getStride  ();
     1072 
     1073  UInt    uiLumaPredMode    = pcCU->getLumaIntraDir     ( uiAbsPartIdx );
     1074 
     1075  AOF( uiWidth == uiHeight );
     1076  AOF( uiAbsPartIdx == 0 );
     1077  AOF( pcCU->getSDCAvailable(uiAbsPartIdx) );
     1078  AOF( pcCU->getSDCFlag(uiAbsPartIdx) );
     1079 
     1080  //===== init availability pattern =====
     1081  Bool  bAboveAvail = false;
     1082  Bool  bLeftAvail  = false;
     1083  pcCU->getPattern()->initPattern   ( pcCU, 0, uiAbsPartIdx );
     1084  pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, 0, m_pcPrediction->getPredicBuf(), m_pcPrediction->getPredicBufWidth(), m_pcPrediction->getPredicBufHeight(), bAboveAvail, bLeftAvail );
     1085 
     1086  //===== get prediction signal =====
     1087#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     1088  if( uiLumaPredMode >= NUM_INTRA_MODE )
     1089  {
     1090    m_pcPrediction->predIntraLumaDMM( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail, false );
     1091  }
     1092  else
     1093  {
     1094#endif
     1095    m_pcPrediction->predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, pcCU, bAboveAvail, bLeftAvail );
     1096#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     1097  }
     1098#endif
     1099 
     1100  // number of segments depends on prediction mode
     1101  UInt uiNumSegments = 1; 
     1102  Bool* pbMask = NULL;
     1103  UInt uiMaskStride = 0;
     1104 
     1105  if( uiLumaPredMode == DMM_WEDGE_FULL_IDX || uiLumaPredMode == DMM_WEDGE_PREDDIR_IDX )
     1106  {
     1107    Int uiTabIdx = (uiLumaPredMode == DMM_WEDGE_FULL_IDX)?pcCU->getWedgeFullTabIdx(uiAbsPartIdx):pcCU->getWedgePredDirTabIdx(uiAbsPartIdx);
     1108   
     1109    WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[uiWidth])];
     1110    TComWedgelet* pcWedgelet = &(pacWedgeList->at( uiTabIdx ));
     1111   
     1112    uiNumSegments = 2;
     1113    pbMask = pcWedgelet->getPattern();
     1114    uiMaskStride = pcWedgelet->getStride();
     1115  }
     1116 
     1117  // get DC prediction for each segment
     1118  Pel apDCPredValues[2];
     1119  xAnalyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride);
     1120 
     1121  // reconstruct residual based on mask + DC residuals
     1122  Pel apDCResiValues[2];
     1123  //Pel apDCRecoValues[2];
     1124  for( UInt ui = 0; ui < uiNumSegments; ui++ )
     1125  {
     1126    Pel   pPredIdx    = GetDepthValue2Idx( apDCPredValues[ui] );
     1127    Pel   pResiIdx    = pcCU->getSDCSegmentDCOffset(ui, uiAbsPartIdx);
     1128    Pel   pRecoValue  = GetIdx2DepthValue( pPredIdx + pResiIdx );
     1129   
     1130    //apDCRecoValues[ui]  = pRecoValue;
     1131    apDCResiValues[ui]  = pRecoValue - apDCPredValues[ui];
     1132  }
     1133 
     1134  //===== reconstruction =====
     1135  Bool*pMask      = pbMask;
     1136  Pel* pPred      = piPred;
     1137  Pel* pResi      = piResi;
     1138  Pel* pReco      = piReco;
     1139  Pel* pRecIPred  = piRecIPred;
     1140 
     1141  for( UInt uiY = 0; uiY < uiHeight; uiY++ )
     1142  {
     1143    for( UInt uiX = 0; uiX < uiWidth; uiX++ )
     1144    {
     1145      UChar ucSegment = pMask?(UChar)pMask[uiX]:0;
     1146      assert( ucSegment < uiNumSegments );
     1147     
     1148      Pel pPredVal= apDCPredValues[ucSegment];
     1149      Pel pResiDC = apDCResiValues[ucSegment];
     1150     
     1151      pReco    [ uiX ] = Clip( pPredVal + pResiDC );
     1152      pRecIPred[ uiX ] = pReco[ uiX ];
     1153    }
     1154    pPred     += uiStride;
     1155    pResi     += uiStride;
     1156    pReco     += uiStride;
     1157    pRecIPred += uiRecIPredStride;
     1158    pMask     += uiMaskStride;
     1159  }
     1160 
     1161  // clear UV
     1162  UInt  uiStrideC     = pcPredYuv->getCStride();
     1163  Pel   *pRecCb       = pcPredYuv->getCbAddr();
     1164  Pel   *pRecCr       = pcPredYuv->getCrAddr();
     1165 
     1166  for (Int y=0; y<uiHeight/2; y++)
     1167  {
     1168    for (Int x=0; x<uiWidth/2; x++)
     1169    {
     1170      pRecCb[x] = (Pel)(128<<g_uiBitIncrement);
     1171      pRecCr[x] = (Pel)(128<<g_uiBitIncrement);
     1172    }
     1173   
     1174    pRecCb += uiStrideC;
     1175    pRecCr += uiStrideC;
     1176  }
     1177}
     1178#endif
    10201179
    10211180/** Function for deriving recontructed PU/CU Luma sample with QTree structure
     
    12831442#endif
    12841443
     1444#if RWTH_SDC_DLT_B0036
     1445Void TDecCu::xAnalyzeSegmentsSDC( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride )
     1446{
     1447  Int iSumDepth[2];
     1448  memset(iSumDepth, 0, sizeof(Int)*2);
     1449  Int iSumPix[2];
     1450  memset(iSumPix, 0, sizeof(Int)*2);
     1451 
     1452  for (Int y=0; y<uiSize; y++)
     1453  {
     1454    for (Int x=0; x<uiSize; x++)
     1455    {
     1456      UChar ucSegment = pMask?(UChar)pMask[x]:0;
     1457      assert( ucSegment < uiNumSegments );
     1458     
     1459      iSumDepth[ucSegment] += pOrig[x];
     1460      iSumPix[ucSegment]   += 1;
     1461    }
     1462   
     1463    pOrig  += uiStride;
     1464    pMask  += uiMaskStride;
     1465  }
     1466 
     1467  // compute mean for each segment
     1468  for( UChar ucSeg = 0; ucSeg < uiNumSegments; ucSeg++ )
     1469  {
     1470    if( iSumPix[ucSeg] > 0 )
     1471      rpSegMeans[ucSeg] = iSumDepth[ucSeg] / iSumPix[ucSeg];
     1472    else
     1473      rpSegMeans[ucSeg] = 0;  // this happens for zero-segments
     1474  }
     1475}
     1476#endif
     1477
    12851478//! \}
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecCu.h

    r193 r213  
    125125  Void xFillPCMBuffer           (TComDataCU* pCU, UInt absPartIdx, UInt depth);
    126126#endif
     127#if RWTH_SDC_DLT_B0036
     128  Void  xAnalyzeSegmentsSDC       ( Pel* pOrig,
     129                                   UInt uiStride,
     130                                   UInt uiSize,
     131                                   Pel* rpSegMeans,
     132                                   UInt uiNumSegments,
     133                                   Bool* pMask,
     134                                   UInt uiMaskStride );
     135 
     136  Void xReconIntraSDC           ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     137#endif
    127138};
    128139
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp

    r193 r213  
    7474}
    7575
     76#if LGE_ILLUCOMP_B0045
     77Void TDecEntropy::decodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     78{
     79  pcCU->setICFlagSubParts( false , uiAbsPartIdx, 0, uiDepth );
     80
     81  if (pcCU->isIntra(uiAbsPartIdx) || (pcCU->getSlice()->getViewId() == 0) || pcCU->getSlice()->getSPS()->isDepth())
     82  {
     83    return;
     84  }
     85
     86  if(!pcCU->getSlice()->getApplyIC())
     87    return;
     88
     89  if(pcCU->isICFlagRequired(uiAbsPartIdx))
     90    m_pcEntropyDecoderIf->parseICFlag( pcCU, uiAbsPartIdx, uiDepth );
     91}
     92#endif
    7693/** decode merge index
    7794 * \param pcCU
     
    137154{
    138155  m_pcEntropyDecoderIf->parsePredMode( pcCU, uiAbsPartIdx, uiDepth );
     156 
     157#if RWTH_SDC_DLT_B0036
     158  // if B-Slice, code SDC flag later
     159  if( !pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSlice()->getSPS()->isDepth() )
     160  {
     161    // decode SDC flag
     162    decodeSDCFlag(pcCU, uiAbsPartIdx, uiDepth);
     163  }
     164#endif
    139165}
    140166
    141167Void TDecEntropy::decodePartSize( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    142168{
     169#if RWTH_SDC_DLT_B0036
     170  if( !pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSDCFlag(uiAbsPartIdx)  )
     171  {
     172    pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
     173    pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth );
     174    return;
     175  }
     176#endif
     177 
    143178  m_pcEntropyDecoderIf->parsePartSize( pcCU, uiAbsPartIdx, uiDepth );
     179 
     180#if RWTH_SDC_DLT_B0036
     181  if( pcCU->getSlice()->isInterB() && pcCU->getSlice()->getSPS()->isDepth() && pcCU->isIntra(uiAbsPartIdx) )
     182  {
     183    // decode SDC flag
     184    decodeSDCFlag(pcCU, uiAbsPartIdx, uiDepth);
     185   
     186    if( pcCU->getSDCFlag(uiAbsPartIdx) )
     187    {
     188      // part size is also known for SDC intra
     189      pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
     190      pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth );
     191    }
     192  }
     193#endif
    144194}
    145195
    146196Void TDecEntropy::decodePredInfo    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU )
    147197{
     198#if RWTH_SDC_DLT_B0036
     199  if( pcCU->getSDCFlag(uiAbsPartIdx) )
     200  {
     201    decodeSDCPredMode(pcCU, uiAbsPartIdx, uiDepth);
     202    return;
     203  }
     204#endif
     205 
    148206  PartSize eMode = pcCU->getPartitionSize( uiAbsPartIdx );
    149207 
     
    186244    return;
    187245  }
     246 
     247#if RWTH_SDC_DLT_B0036
     248  if( pcCU->getSDCFlag(uiAbsPartIdx) )
     249  {
     250    return;
     251  }
     252#endif
    188253 
    189254  m_pcEntropyDecoderIf->parseIPCMInfo( pcCU, uiAbsPartIdx, uiDepth );
     
    449514#endif
    450515  }
     516#if SHARP_INTERVIEW_DECOUPLE_B0111
     517  pcSubCU->fillMvpCand(uiPartIdx, uiPartAddr, eRefList, iRefIdx, pAMVPInfo, iMVPIdx);
     518#else
    451519  pcSubCU->fillMvpCand(uiPartIdx, uiPartAddr, eRefList, iRefIdx, pAMVPInfo);
     520#endif
    452521  pcSubCU->setMVPNumSubParts(pAMVPInfo->iN, eRefList, uiPartAddr, uiPartIdx, uiDepth);
    453522  pcSubCU->setMVPIdxSubParts( iMVPIdx, eRefList, uiPartAddr, uiPartIdx, uiDepth );
     
    917986#endif
    918987 
     988#if RWTH_SDC_DLT_B0036
     989  if( pcCU->getSDCAvailable(uiAbsPartIdx) && pcCU->getSDCFlag( uiAbsPartIdx ) )
     990  {
     991    assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
     992    assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 );
     993    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 );
     994    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
     995    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
     996   
     997    decodeSDCResidualData(pcCU, uiAbsPartIdx, uiDepth);
     998    return;
     999  }
     1000#endif
     1001 
    9191002  if( pcCU->isIntra(uiAbsPartIdx) )
    9201003  {
     
    9521035#endif // !UNIFIED_TRANSFORM_TREE
    9531036  }
     1037
     1038#if FIX_MPI_B0065
     1039  if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER && pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getMergeIndex( uiAbsPartIdx ) == 0 && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N &&  pcCU->getTextureModeDepth( uiAbsPartIdx ) != -1  )
     1040  {
     1041    TComDataCU *pcTextureCU = pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() );
     1042    if( uiDepth == pcTextureCU->getDepth(uiAbsPartIdx))
     1043    {
     1044      PartSize partSize = pcTextureCU->getPartitionSize(uiAbsPartIdx);
     1045      pcCU->setPartSizeSubParts( partSize, uiAbsPartIdx, uiDepth );
     1046    }
     1047    else
     1048    {
     1049      pcCU->setPartSizeSubParts( SIZE_NxN, uiAbsPartIdx, uiDepth );
     1050    }
     1051  }
     1052#endif
     1053
    9541054#if UNIFIED_TRANSFORM_TREE
    9551055  xDecodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, 0, temp, temp1, temp2, bCodeDQP );
     
    9571057  xDecodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, uiLumaTrMode, bCodeDQP );
    9581058#endif // UNIFIED_TRANSFORM_TREE
    959 }
     1059
     1060#if FIX_MPI_B0065
     1061  if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER && pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getMergeIndex( uiAbsPartIdx ) == 0 && pcCU->getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N &&  pcCU->getTextureModeDepth( uiAbsPartIdx ) != -1 )
     1062  {
     1063    pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 
     1064  }
     1065#endif
     1066}
     1067
     1068#if RWTH_SDC_DLT_B0036
     1069Void TDecEntropy::decodeSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     1070{
     1071  assert( pcCU->getSlice()->getSPS()->isDepth() );
     1072  assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
     1073 
     1074  m_pcEntropyDecoderIf->parseSDCPredMode(pcCU, uiAbsPartIdx, uiDepth );
     1075}
     1076
     1077Void TDecEntropy::decodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     1078{
     1079  assert( pcCU->getSlice()->getSPS()->isDepth() );
     1080 
     1081  m_pcEntropyDecoderIf->parseSDCFlag(pcCU, uiAbsPartIdx, uiDepth );
     1082}
     1083
     1084Void TDecEntropy::decodeSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     1085{
     1086  assert( pcCU->getSlice()->getSPS()->isDepth() );
     1087  assert( pcCU->getSDCFlag(uiAbsPartIdx) );
     1088 
     1089  // number of segments depends on prediction mode for INTRA
     1090  UInt uiNumSegments = 2;
     1091  UInt uiLumaPredMode = pcCU->getLumaIntraDir( uiAbsPartIdx );
     1092  if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTRA && (uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX) )
     1093    uiNumSegments = 1;
     1094 
     1095  // decode residual data for each segment
     1096  for( UInt uiSeg = 0; uiSeg < uiNumSegments; uiSeg++ )
     1097    m_pcEntropyDecoderIf->parseSDCResidualData(pcCU, uiAbsPartIdx, uiDepth, uiSeg);
     1098}
     1099#endif
    9601100
    9611101//! \}
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecEntropy.h

    r166 r213  
    7171#endif
    7272
    73 #if VIDYO_VPS_INTEGRATION
     73#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    7474  virtual Void  parseVPS                  ( TComVPS* pcVPS )                       = 0;
    7575#endif
     
    103103public:
    104104  virtual Void parseSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     105#if LGE_ILLUCOMP_B0045
     106  virtual Void parseICFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     107#endif
    105108#if FORCE_REF_VSP==1
    106109  virtual Void parseVspFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     
    141144  virtual Void readTileMarker   ( UInt& uiTileIdx, UInt uiBitsUsed ) = 0;
    142145  virtual Void updateContextTables( SliceType eSliceType, Int iQp ) = 0;
     146 
     147#if RWTH_SDC_DLT_B0036
     148  virtual Void parseSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     149  virtual Void parseSDCPredMode     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     150  virtual Void parseSDCResidualData     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ) = 0;
     151#endif
    143152 
    144153  virtual ~TDecEntropyIf() {}
     
    169178  Void    resetEntropy                ( TComSlice* p)           { m_pcEntropyDecoderIf->resetEntropy(p);                    }
    170179
    171 #if VIDYO_VPS_INTEGRATION
     180#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    172181  Void    decodeVPS                   ( TComVPS* pcVPS ) { m_pcEntropyDecoderIf->parseVPS(pcVPS); }
    173182#endif
     
    199208  Void decodeSplitFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    200209  Void decodeSkipFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     210#if LGE_ILLUCOMP_B0045
     211  Void decodeICFlag            ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     212#endif
    201213#if FORCE_REF_VSP==1
    202214  Void decodeVspFlag           ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     
    256268  Void decodeFlush() { m_pcEntropyDecoderIf->decodeFlush(); }
    257269#endif
     270 
     271#if RWTH_SDC_DLT_B0036
     272  Void decodeSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     273  Void decodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     274  Void decodeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     275#endif
    258276
    259277};// END CLASS DEFINITION TDecEntropy
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecGop.cpp

    r193 r213  
    303303    {
    304304      m_pcDepthMapGenerator->initViewComponent( rpcPic );
    305 #if !QC_MULTI_DIS_CAN
     305#if !QC_MULTI_DIS_CAN_A0097
    306306      m_pcDepthMapGenerator->predictDepthMap  ( rpcPic );
    307307#endif
     
    312312#endif
    313313
     314#if QC_SIMPLE_NBDV_B0047
     315    if(pcSlice->getViewId() && pcSlice->getSPS()->getMultiviewMvPredMode())
     316    {
     317      Int iColPoc = pcSlice->getRefPOC(RefPicList(pcSlice->getColDir()), pcSlice->getColRefIdx());
     318      rpcPic->setRapbCheck(rpcPic->getDisCandRefPictures(iColPoc));
     319    }
     320#endif
    314321
    315322    m_pcSbacDecoders[0].load(m_pcSbacDecoder);
     
    341348#endif
    342349#if DEPTH_MAP_GENERATION
    343 #if !QC_MULTI_DIS_CAN
     350#if !QC_MULTI_DIS_CAN_A0097
    344351    // update virtual depth map
    345352    m_pcDepthMapGenerator->updateDepthMap( rpcPic );
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecSbac.cpp

    r193 r213  
    3838#include "TDecSbac.h"
    3939
     40#if RWTH_SDC_DLT_B0036
     41#define GetNumDepthValues()     (pcCU->getSlice()->getSPS()->getNumDepthValues())
     42#define GetBitsPerDepthValue()  (pcCU->getSlice()->getSPS()->getBitsPerDepthValue())
     43#endif
     44
    4045//! \ingroup TLibDecoder
    4146//! \{
     
    5257, m_cCUSplitFlagSCModel       ( 1,             1,               NUM_SPLIT_FLAG_CTX            , m_contextModels + m_numContextModels, m_numContextModels )
    5358, m_cCUSkipFlagSCModel        ( 1,             1,               NUM_SKIP_FLAG_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
     59#if LGE_ILLUCOMP_B0045
     60, m_cCUICFlagSCModel          ( 1,             1,               NUM_IC_FLAG_CTX               , m_contextModels + m_numContextModels, m_numContextModels)
     61#endif
    5462, m_cCUMergeFlagExtSCModel    ( 1,             1,               NUM_MERGE_FLAG_EXT_CTX        , m_contextModels + m_numContextModels, m_numContextModels)
    5563, m_cCUMergeIdxExtSCModel     ( 1,             1,               NUM_MERGE_IDX_EXT_CTX         , m_contextModels + m_numContextModels, m_numContextModels)
     
    98106, m_cDmmDataSCModel           ( 1,             1,               NUM_DMM_DATA_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
    99107#endif
    100 #if LGE_EDGE_INTRA
     108#if LGE_EDGE_INTRA_A0070
    101109, m_cEdgeIntraSCModel         ( 1,             1,               NUM_EDGE_INTRA_CTX            , m_contextModels + m_numContextModels, m_numContextModels)
    102110#if LGE_EDGE_INTRA_DELTA_DC
    103111, m_cEdgeIntraDeltaDCSCModel  ( 1,             1,               NUM_EDGE_INTRA_DELTA_DC_CTX   , m_contextModels + m_numContextModels, m_numContextModels)
    104112#endif
     113#endif
     114#if RWTH_SDC_DLT_B0036
     115, m_cSDCFlagSCModel             ( 1,             1,                 SDC_NUM_FLAG_CTX           , m_contextModels + m_numContextModels, m_numContextModels)
     116, m_cSDCResidualFlagSCModel     ( 1,             2,  SDC_NUM_RESIDUAL_FLAG_CTX  , m_contextModels + m_numContextModels, m_numContextModels)
     117, m_cSDCResidualSignFlagSCModel ( 1,             2,  SDC_NUM_SIGN_FLAG_CTX      , m_contextModels + m_numContextModels, m_numContextModels)
     118, m_cSDCResidualSCModel         ( 1,             2,  SDC_NUM_RESIDUAL_CTX       , m_contextModels + m_numContextModels, m_numContextModels)
     119, m_cSDCPredModeSCModel             ( 1,             3,                 SDC_NUM_PRED_MODE_CTX     , m_contextModels + m_numContextModels, m_numContextModels)
    105120#endif
    106121{
     
    146161  m_cCUSplitFlagSCModel.initBuffer       ( sliceType, qp, (UChar*)INIT_SPLIT_FLAG );
    147162  m_cCUSkipFlagSCModel.initBuffer        ( sliceType, qp, (UChar*)INIT_SKIP_FLAG );
     163#if LGE_ILLUCOMP_B0045
     164  m_cCUICFlagSCModel.initBuffer          ( sliceType, qp, (UChar*)INIT_IC_FLAG );
     165#endif
    148166  m_cCUMergeFlagExtSCModel.initBuffer    ( sliceType, qp, (UChar*)INIT_MERGE_FLAG_EXT );
    149167  m_cCUMergeIdxExtSCModel.initBuffer     ( sliceType, qp, (UChar*)INIT_MERGE_IDX_EXT );
     
    188206
    189207  m_cCUTransSubdivFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_TRANS_SUBDIV_FLAG );
    190 #if LGE_EDGE_INTRA
     208#if LGE_EDGE_INTRA_A0070
    191209  m_cEdgeIntraSCModel.initBuffer         ( sliceType, qp, (UChar*)INIT_EDGE_INTRA );
    192210#if LGE_EDGE_INTRA_DELTA_DC
     
    199217  m_cDmmModeSCModel.initBuffer           ( sliceType, qp, (UChar*)INIT_DMM_MODE );
    200218  m_cDmmDataSCModel.initBuffer           ( sliceType, qp, (UChar*)INIT_DMM_DATA );
     219#endif
     220#if RWTH_SDC_DLT_B0036
     221  m_cSDCFlagSCModel.initBuffer              ( sliceType, qp, (UChar*)INIT_SDC_FLAG );
     222  m_cSDCResidualFlagSCModel.initBuffer      ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL_FLAG );
     223  m_cSDCResidualSCModel.initBuffer          ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL );
     224  m_cSDCResidualSignFlagSCModel.initBuffer  ( sliceType, qp, (UChar*)INIT_SDC_SIGN_FLAG );
     225  m_cSDCPredModeSCModel.initBuffer              ( sliceType, qp, (UChar*)INIT_SDC_PRED_MODE );
    201226#endif
    202227 
     
    230255  m_cCUSplitFlagSCModel.initBuffer       ( eSliceType, iQp, (UChar*)INIT_SPLIT_FLAG );
    231256  m_cCUSkipFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG );
     257#if LGE_ILLUCOMP_B0045
     258  m_cCUICFlagSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_IC_FLAG );
     259#endif
    232260  m_cCUMergeFlagExtSCModel.initBuffer    ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT );
    233261  m_cCUMergeIdxExtSCModel.initBuffer     ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT );
     
    276304  m_cDmmDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DMM_DATA );
    277305#endif
     306#if RWTH_SDC_DLT_B0036
     307  m_cSDCFlagSCModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG );
     308  m_cSDCResidualFlagSCModel.initBuffer      ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG );
     309  m_cSDCResidualSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL );
     310  m_cSDCResidualSignFlagSCModel.initBuffer  ( eSliceType, iQp, (UChar*)INIT_SDC_SIGN_FLAG );
     311  m_cSDCPredModeSCModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_SDC_PRED_MODE );
     312#endif
    278313
    279314  m_pcTDecBinIf->start();
     
    578613}
    579614
     615#if LGE_ILLUCOMP_B0045
     616/** parse illumination compensation flag
     617 * \param pcCU
     618 * \param uiAbsPartIdx
     619 * \param uiDepth
     620 * \returns Void
     621 */
     622Void TDecSbac::parseICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     623{
     624  UInt uiSymbol = 0;
     625  UInt uiCtxIC = pcCU->getCtxICFlag( uiAbsPartIdx );
     626  m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUICFlagSCModel.get( 0, 0, uiCtxIC ) );
     627  DTRACE_CABAC_VL( g_nSymbolCounter++ );
     628  DTRACE_CABAC_T( "\tICFlag" );
     629  DTRACE_CABAC_T( "\tuiCtxIC: ");
     630  DTRACE_CABAC_V( uiCtxIC );
     631  DTRACE_CABAC_T( "\tuiSymbol: ");
     632  DTRACE_CABAC_V( uiSymbol );
     633  DTRACE_CABAC_T( "\n");
     634 
     635  pcCU->setICFlagSubParts( uiSymbol ? true : false , uiAbsPartIdx, 0, uiDepth );
     636}
     637#endif
     638
    580639#if FORCE_REF_VSP==1
    581640Void TDecSbac::parseVspFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     
    636695  uiNumCand = pcCU->getSlice()->getMaxNumMergeCand();
    637696#if HHI_MPI
    638 #if VSP_N
     697#if VSP_N & !MTK_UNCONSTRAINED_MVI_B0083
    639698  TComDataCU* pcTextCU = pcCU->getSlice()->getSPS()->getUseMVI() ? pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() ) : NULL;
    640699  Int aiRefIdxVsp[2] = { pcTextCU ? pcTextCU->getCUMvField( RefPicList(0) )->getRefIdx( uiAbsPartIdx ) : -1,
     
    652711                                                                        : pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE;
    653712#endif
     713#else
     714  const Bool bMVIAvailable = pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE;
    654715#endif
    655716  const UInt uiMviMergePos = bMVIAvailable ? HHI_MPI_MERGE_POS : uiNumCand;
     
    735796 
    736797  UInt uiSymbol;
    737   m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUSplitFlagSCModel.get( 0, 0, pcCU->getCtxSplitFlag( uiAbsPartIdx, uiDepth ) ) );
    738   DTRACE_CABAC_VL( g_nSymbolCounter++ )
    739   DTRACE_CABAC_T( "\tSplitFlag\n" )
     798
     799#if OL_QTLIMIT_PREDCODING_B0068
     800  Bool bParseSplitFlag    = true;
     801
     802  TComSPS *sps            = pcCU->getPic()->getSlice(0)->getSPS();
     803  TComPic *pcTexture      = pcCU->getSlice()->getTexturePic();
     804  Bool bDepthMapDetect    = (pcTexture != NULL);
     805  Bool bIntraSliceDetect  = (pcCU->getSlice()->getSliceType() == I_SLICE);
     806
     807  if(bDepthMapDetect && !bIntraSliceDetect && sps->getUseQTLPC())
     808  {
     809    TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr());
     810    assert(pcTextureCU->getDepth(uiAbsPartIdx) >= uiDepth);
     811    bParseSplitFlag         = (pcTextureCU->getDepth(uiAbsPartIdx) > uiDepth);
     812  }
     813
     814  if(bParseSplitFlag)
     815  {
     816#endif
     817    m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUSplitFlagSCModel.get( 0, 0, pcCU->getCtxSplitFlag( uiAbsPartIdx, uiDepth ) ) );
     818    DTRACE_CABAC_VL( g_nSymbolCounter++ )
     819    DTRACE_CABAC_T( "\tSplitFlag\n" )
     820#if OL_QTLIMIT_PREDCODING_B0068
     821  }
     822  else
     823    uiSymbol = 0;
     824#endif
     825
    740826  pcCU->setDepthSubParts( uiDepth + uiSymbol, uiAbsPartIdx );
    741827 
     
    753839  UInt uiSymbol, uiMode = 0;
    754840  PartSize eMode;
     841
     842#if OL_QTLIMIT_PREDCODING_B0068
     843  Bool bParsePartSize    = true;
     844  TComSPS *sps           = pcCU->getPic()->getSlice(0)->getSPS();
     845  TComPic *pcTexture     = pcCU->getSlice()->getTexturePic();
     846  Bool bDepthMapDetect   = (pcTexture != NULL);
     847  Bool bIntraSliceDetect = (pcCU->getSlice()->getSliceType() == I_SLICE);
     848
     849  if(bDepthMapDetect && !bIntraSliceDetect && sps->getUseQTLPC())
     850  {
     851    TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr());
     852    assert(pcTextureCU->getDepth(uiAbsPartIdx) >= uiDepth);
     853    if (pcTextureCU->getDepth(uiAbsPartIdx) == uiDepth && pcTextureCU->getPartitionSize( uiAbsPartIdx ) != SIZE_NxN)
     854    {
     855      bParsePartSize = false;
     856      eMode          = SIZE_2Nx2N;
     857    }
     858  }
     859#endif
    755860 
    756861  if ( pcCU->isIntra( uiAbsPartIdx ) )
    757862  {
    758     uiSymbol = 1;
    759     if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth )
    760     {
    761       m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, 0) );
    762     }
    763     eMode = uiSymbol ? SIZE_2Nx2N : SIZE_NxN;
     863#if OL_QTLIMIT_PREDCODING_B0068
     864    if(bParsePartSize)
     865    {
     866#endif
     867      uiSymbol = 1;
     868      if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth )
     869      {
     870        m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, 0) );
     871      }
     872      eMode = uiSymbol ? SIZE_2Nx2N : SIZE_NxN;
     873#if OL_QTLIMIT_PREDCODING_B0068
     874    }
     875#endif
    764876    UInt uiTrLevel = 0;   
    765877    UInt uiWidthInBit  = g_aucConvertToBit[pcCU->getWidth(uiAbsPartIdx)]+2;
     
    777889  else
    778890  {
    779     UInt uiMaxNumBits = 2;
    780     if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth && !( pcCU->getSlice()->getSPS()->getDisInter4x4() && (g_uiMaxCUWidth>>uiDepth) == 8 && (g_uiMaxCUHeight>>uiDepth) == 8 ) )
    781     {
    782       uiMaxNumBits ++;
    783     }
    784     for ( UInt ui = 0; ui < uiMaxNumBits; ui++ )
    785     {
    786       m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, ui) );
    787       if ( uiSymbol )
    788       {
    789         break;
    790       }
    791       uiMode++;
    792     }
    793     eMode = (PartSize) uiMode;
    794     if ( pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) )
    795     {
    796       if (eMode == SIZE_2NxN)
    797       {
     891#if OL_QTLIMIT_PREDCODING_B0068
     892    if(bParsePartSize)
     893    {
     894#endif
     895      UInt uiMaxNumBits = 2;
     896      if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth && !( pcCU->getSlice()->getSPS()->getDisInter4x4() && (g_uiMaxCUWidth>>uiDepth) == 8 && (g_uiMaxCUHeight>>uiDepth) == 8 ) )
     897      {
     898        uiMaxNumBits ++;
     899      }
     900      for ( UInt ui = 0; ui < uiMaxNumBits; ui++ )
     901      {
     902        m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, ui) );
     903        if ( uiSymbol )
     904        {
     905          break;
     906        }
     907        uiMode++;
     908      }
     909      eMode = (PartSize) uiMode;
     910      if ( pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) )
     911      {
     912        if (eMode == SIZE_2NxN)
     913        {
     914#if AMP_CTX
     915            m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUAMPSCModel.get( 0, 0, 0 ));
     916#else
     917          m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUYPosiSCModel.get( 0, 0, 0 ));
     918#endif
     919          if (uiSymbol == 0)
     920          {
     921#if AMP_CTX
     922            m_pcTDecBinIf->decodeBinEP(uiSymbol);
     923#else
     924            m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUYPosiSCModel.get( 0, 0, 1 ));
     925#endif
     926            eMode = (uiSymbol == 0? SIZE_2NxnU : SIZE_2NxnD);
     927          }
     928        }
     929        else if (eMode == SIZE_Nx2N)
     930        {
    798931#if AMP_CTX
    799932          m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUAMPSCModel.get( 0, 0, 0 ));
    800933#else
    801         m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUYPosiSCModel.get( 0, 0, 0 ));
    802 #endif
    803         if (uiSymbol == 0)
    804         {
     934          m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUXPosiSCModel.get( 0, 0, 0 ));
     935#endif
     936          if (uiSymbol == 0)
     937          {
    805938#if AMP_CTX
    806           m_pcTDecBinIf->decodeBinEP(uiSymbol);
    807 #else
    808           m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUYPosiSCModel.get( 0, 0, 1 ));
    809 #endif
    810           eMode = (uiSymbol == 0? SIZE_2NxnU : SIZE_2NxnD);
     939            m_pcTDecBinIf->decodeBinEP(uiSymbol);
     940#else
     941            m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUXPosiSCModel.get( 0, 0, 1 ));
     942#endif
     943            eMode = (uiSymbol == 0? SIZE_nLx2N : SIZE_nRx2N);
     944          }
    811945        }
    812946      }
    813       else if (eMode == SIZE_Nx2N)
    814       {
    815 #if AMP_CTX
    816         m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUAMPSCModel.get( 0, 0, 0 ));
    817 #else
    818         m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUXPosiSCModel.get( 0, 0, 0 ));
    819 #endif
    820         if (uiSymbol == 0)
    821         {
    822 #if AMP_CTX
    823           m_pcTDecBinIf->decodeBinEP(uiSymbol);
    824 #else
    825           m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUXPosiSCModel.get( 0, 0, 1 ));
    826 #endif
    827           eMode = (uiSymbol == 0? SIZE_nLx2N : SIZE_nRx2N);
    828         }
    829       }
    830     }
     947#if OL_QTLIMIT_PREDCODING_B0068
     948    }
     949#endif
    831950  }
    832951  pcCU->setPartSizeSubParts( eMode, uiAbsPartIdx, uiDepth );
     
    9041023#endif
    9051024
    906 #if LGE_EDGE_INTRA
     1025#if LGE_EDGE_INTRA_A0070
    9071026    Bool bCodeEdgeIntra = false;
    9081027    if( pcCU->getSlice()->getSPS()->isDepth() )
     
    9201039#endif
    9211040    Int uiPredNum = pcCU->getIntraDirLumaPredictor(uiAbsPartIdx, uiPreds); 
    922 #if LGE_EDGE_INTRA
     1041#if LGE_EDGE_INTRA_A0070
    9231042    UInt uiCheckBit = 0;
    9241043#endif
     
    9451064
    9461065      m_pcTDecBinIf->decodeBinsEP( uiSymbol, 5 );
    947 #if LGE_EDGE_INTRA
     1066#if LGE_EDGE_INTRA_A0070
    9481067      if (bCodeEdgeIntra)
    9491068      {
     
    9811100      }
    9821101#endif
    983 #if LGE_EDGE_INTRA
     1102#if LGE_EDGE_INTRA_A0070
    9841103      if ( intraPredMode != EDGE_INTRA_IDX)
    9851104      {
     
    9891108          intraPredMode += ( intraPredMode >= uiPreds[i] );
    9901109        }
    991 #if LGE_EDGE_INTRA
    992       }
    993 #endif
    994     }
    995 
    996 #if LGE_EDGE_INTRA
     1110#if LGE_EDGE_INTRA_A0070
     1111      }
     1112#endif
     1113    }
     1114
     1115#if LGE_EDGE_INTRA_A0070
    9971116    if( intraPredMode == EDGE_INTRA_IDX )
    9981117    {
     
    21382257#endif
    21392258
    2140 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX || (LGE_EDGE_INTRA && LGE_EDGE_INTRA_DELTA_DC)
     2259#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX || (LGE_EDGE_INTRA_A0070 && LGE_EDGE_INTRA_DELTA_DC)
    21412260Void TDecSbac::xReadExGolombLevel( UInt& ruiSymbol, ContextModel& rcSCModel  )
    21422261{
     
    23972516#endif
    23982517
    2399 #if LGE_EDGE_INTRA
     2518#if LGE_EDGE_INTRA_A0070
    24002519Void TDecSbac::xParseEdgeIntraInfo( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    24012520{
     
    24942613}
    24952614#endif
     2615 
     2616#if RWTH_SDC_DLT_B0036
     2617Void TDecSbac::parseSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     2618{
     2619  assert( pcCU->getSlice()->getSPS()->isDepth() );
     2620 
     2621  UInt uiSymbol = 0;
     2622  UInt uiCtxSDCFlag = pcCU->getCtxSDCFlag( uiAbsPartIdx );
     2623  m_pcTDecBinIf->decodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, uiCtxSDCFlag ) );
     2624 
     2625  if( uiSymbol == 1 )
     2626  {
     2627    pcCU->setPartSizeSubParts(SIZE_2Nx2N, uiAbsPartIdx, uiDepth);
     2628   
     2629    pcCU->setSDCFlagSubParts( true, uiAbsPartIdx, 0, uiDepth);
     2630    pcCU->setTrIdxSubParts(0, uiAbsPartIdx, uiDepth);
     2631    pcCU->setCbfSubParts(1, 1, 1, uiAbsPartIdx, uiDepth);
     2632  }
     2633}
     2634
     2635Void TDecSbac::parseSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     2636{
     2637  assert( pcCU->getSlice()->getSPS()->isDepth() );
     2638  assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
     2639 
     2640  assert( pcCU->getSDCFlag(uiAbsPartIdx) );
     2641 
     2642  UInt uiCtx            = 0;
     2643 
     2644  UInt uiMPModeIdx      = 0;
     2645 
     2646  for(Int i=0; i<RWTH_SDC_NUM_PRED_MODES-1; i++)
     2647  {
     2648    UInt uiIsMostProb = 0;
     2649    m_pcTDecBinIf->decodeBin( uiIsMostProb, m_cSDCPredModeSCModel.get( 0, i, uiCtx ) );
     2650   
     2651    if ( uiIsMostProb == 1 )
     2652      break;
     2653   
     2654    // else: get next most probable pred mode
     2655    uiMPModeIdx = (uiMPModeIdx+1)%RWTH_SDC_NUM_PRED_MODES;
     2656  }
     2657 
     2658  Int intraPredMode = g_auiSDCPredModes[uiMPModeIdx];
     2659 
     2660#if HHI_DMM_WEDGE_INTRA
     2661  if( intraPredMode == DMM_WEDGE_FULL_IDX )          { xParseWedgeFullInfo          ( pcCU, uiAbsPartIdx, uiDepth ); }
     2662  if( intraPredMode == DMM_WEDGE_PREDDIR_IDX )       { xParseWedgePredDirInfo       ( pcCU, uiAbsPartIdx, uiDepth ); }
     2663#endif
     2664 
     2665  pcCU->setLumaIntraDirSubParts((UChar)intraPredMode, uiAbsPartIdx, uiDepth);
     2666}
     2667
     2668Void TDecSbac::parseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiSegment )
     2669{
     2670  assert( pcCU->getSlice()->getSPS()->isDepth() );
     2671  assert( pcCU->getSDCFlag(uiAbsPartIdx) );
     2672  assert( uiSegment < 2 );
     2673 
     2674  UInt uiResidual = 0;
     2675  UInt uiBit      = 0;
     2676  UInt uiAbsIdx   = 0;
     2677  UInt uiSign     = 0;
     2678  Int  iIdx       = 0;
     2679 
     2680  UInt uiMaxResidualBits  = GetBitsPerDepthValue();
     2681  assert( uiMaxResidualBits <= g_uiBitDepth );
     2682 
     2683  m_pcTDecBinIf->decodeBin(uiResidual, m_cSDCResidualFlagSCModel.get( 0, uiSegment, 0 ) );
     2684 
     2685  if (uiResidual)
     2686  {
     2687    // decode residual sign bit
     2688    m_pcTDecBinIf->decodeBin(uiSign, m_cSDCResidualSignFlagSCModel.get( 0, uiSegment, 0 ) );
     2689   
     2690    // decode residual magnitude
     2691    for (Int i=0; i<uiMaxResidualBits; i++)
     2692    {
     2693      m_pcTDecBinIf->decodeBin(uiBit, m_cSDCResidualSCModel.get( 0, uiSegment, i ) );
     2694      uiAbsIdx |= uiBit << i;
     2695    }
     2696   
     2697    uiAbsIdx += 1;
     2698    iIdx =(Int)(uiSign ? -1 : 1)*uiAbsIdx;
     2699  }
     2700 
     2701  pcCU->setSDCSegmentDCOffset(iIdx, uiSegment, uiAbsPartIdx);
     2702}
     2703#endif
    24962704
    24972705//! \}
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecSbac.h

    r166 r213  
    8787  Void  setBitstream              ( TComInputBitstream* p  ) { m_pcBitstream = p; m_pcTDecBinIf->init( p ); }
    8888 
    89 #if VIDYO_VPS_INTEGRATION
     89#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    9090  Void  parseVPS                  ( TComVPS* pcVPS )  {}
    9191#endif
     
    126126  Void  parseSaoOffset            (SaoLcuParam* psSaoLcuParam);
    127127#endif
     128 
     129#if RWTH_SDC_DLT_B0036
     130  Void parseSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     131  Void parseSDCPredMode    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     132  Void parseSDCResidualData     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart );
     133#endif
    128134private:
    129135  Void  xReadUnarySymbol    ( UInt& ruiSymbol, ContextModel* pcSCModel, Int iOffset );
     
    146152#endif
    147153 
    148 #if LGE_EDGE_INTRA
     154#if LGE_EDGE_INTRA_A0070
    149155  Void xParseEdgeIntraInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    150156#endif
     
    166172
    167173  Void parseSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     174#if LGE_ILLUCOMP_B0045
     175  Void parseICFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     176#endif
    168177#if FORCE_REF_VSP==1
    169178  Void parseVspFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     
    210219  ContextModel3DBuffer m_cCUSplitFlagSCModel;
    211220  ContextModel3DBuffer m_cCUSkipFlagSCModel;
     221#if LGE_ILLUCOMP_B0045
     222  ContextModel3DBuffer m_cCUICFlagSCModel;
     223#endif
    212224  ContextModel3DBuffer m_cCUMergeFlagExtSCModel;
    213225  ContextModel3DBuffer m_cCUMergeIdxExtSCModel;
     
    260272  ContextModel3DBuffer m_cDmmDataSCModel;
    261273#endif
    262 #if LGE_EDGE_INTRA
     274#if LGE_EDGE_INTRA_A0070
    263275  ContextModel3DBuffer m_cEdgeIntraSCModel;
    264276#if LGE_EDGE_INTRA_DELTA_DC
     
    266278#endif
    267279#endif
     280 
     281#if RWTH_SDC_DLT_B0036
     282  ContextModel3DBuffer m_cSDCFlagSCModel;
     283 
     284  ContextModel3DBuffer m_cSDCResidualFlagSCModel;
     285  ContextModel3DBuffer m_cSDCResidualSignFlagSCModel;
     286  ContextModel3DBuffer m_cSDCResidualSCModel;
     287 
     288  ContextModel3DBuffer m_cSDCPredModeSCModel;
     289#endif
    268290};
    269291
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecSlice.cpp

    r193 r213  
    446446, m_ppsBuffer(16)
    447447, m_apsBuffer(64)
    448 #if VIDYO_VPS_INTEGRATION
     448#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    449449, m_vpsBuffer(16)
    450450#endif
     
    458458}
    459459
    460 #if VIDYO_VPS_INTEGRATION
     460#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    461461TComVPS* ParameterSetManagerDecoder::getPrefetchedVPS  (Int vpsId)
    462462{
     
    513513  m_ppsMap.mergePSList(m_ppsBuffer);
    514514  m_spsMap.mergePSList(m_spsBuffer);
    515 #if VIDYO_VPS_INTEGRATION
     515#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    516516  m_vpsMap.mergePSList(m_vpsBuffer);
    517517#endif
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecSlice.h

    r100 r213  
    9696  Void     storePrefetchedAPS(TComAPS *aps)  { m_apsBuffer.storePS( aps->getAPSID(), aps); };
    9797  TComAPS* getPrefetchedAPS  (Int apsId);
    98 #if VIDYO_VPS_INTEGRATION
     98#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    9999  Void     storePrefetchedVPS(TComVPS *vps)  { m_vpsBuffer.storePS( vps->getVPSId(), vps); };
    100100  TComVPS* getPrefetchedVPS  (Int vpsId);
     
    106106  ParameterSetMap<TComPPS> m_ppsBuffer;
    107107  ParameterSetMap<TComAPS> m_apsBuffer;
    108 #if VIDYO_VPS_INTEGRATION
     108#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    109109  ParameterSetMap<TComVPS> m_vpsBuffer;
    110110#endif
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecTop.cpp

    r193 r213  
    5050  m_aaiCodedScale          = new Int* [ MAX_VIEW_NUM ];
    5151  m_aiViewOrderIndex       = new Int  [ MAX_VIEW_NUM ];
     52#if QC_MVHEVC_B0046
     53  m_aiViewId               = new Int  [ MAX_VIEW_NUM ];
     54#endif
    5255  m_aiViewReceived         = new Int  [ MAX_VIEW_NUM ];
    5356  for( UInt uiId = 0; uiId < MAX_VIEW_NUM; uiId++ )
     
    301304
    302305  AOF( pcSlice->getSPS()->getViewId() < MAX_VIEW_NUM );
     306#if VSP_N
     307  if ( !pcSlice->getSPS()->getIsFirstInView() )
     308  {
     309    return;
     310  }
     311#else
    303312  if ( pcSlice->getSPS()->isDepth  () )
    304313  {
    305314    return;
    306315  }
     316#endif
    307317  Bool  bFirstAU          = ( pcSlice->getPOC()               == 0 );
    308318  Bool  bFirstSliceInAU   = ( pcSlice->getPOC()               != Int ( m_iLastPOC ) );
    309319  Bool  bFirstSliceInView = ( pcSlice->getSPS()->getViewId()  != UInt( m_iLastViewId ) || bFirstSliceInAU );
    310320  AOT(  bFirstSliceInAU  &&   pcSlice->getSPS()->getViewId()  != 0 );
     321#if !VSP_N
    311322  AOT( !bFirstSliceInAU  &&   pcSlice->getSPS()->getViewId()   < UInt( m_iLastViewId ) );
     323#endif
    312324  AOT( !bFirstSliceInAU  &&   pcSlice->getSPS()->getViewId()   > UInt( m_iLastViewId + 1 ) );
    313325  AOT( !bFirstAU         &&   pcSlice->getSPS()->getViewId()   > m_uiMaxViewId );
     
    488500  m_bFirstSliceInSequence   = true;
    489501  m_pcCamParsCollector = 0;
     502#if QC_MVHEVC_B0046
     503  m_bFirstNal                  = false;
     504#endif
    490505
    491506#if VSP_N
     
    821836  TComVPS *vps = m_parameterSetManagerDecoder.getVPS(sps->getVPSId());
    822837  assert (vps != 0);
     838#if !QC_REM_IDV_B0046
    823839  if( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA )
     840#else
     841  if( (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA) && !sps->getViewId() )
     842#endif
    824843    // VPS can only be activated on IDR or CRA...
    825844    getTAppDecTop()->getVPSAccess()->setActiveVPSId( sps->getVPSId() );
     
    827846  m_apcSlicePilot->setPPS(pps);
    828847  m_apcSlicePilot->setSPS(sps);
    829 #if VIDYO_VPS_INTEGRATION
     848#if QC_MVHEVC_B0046
     849  TComVPS *vps = m_parameterSetManagerDecoder.getVPS(sps->getVPSId());
     850#endif
     851#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    830852  m_apcSlicePilot->setVPS(vps);
    831853#endif
     
    869891  m_apcSlicePilot->setPPS(m_parameterSetManagerDecoder.getPrefetchedPPS(0));
    870892  m_apcSlicePilot->setSPS(m_parameterSetManagerDecoder.getPrefetchedSPS(0));
    871 #if VIDYO_VPS_INTEGRATION
     893#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
     894#if QC_MVHEVC_B0046
     895  m_apcSlicePilot->setIsDepth(false);
     896#endif
    872897  m_apcSlicePilot->setVPS(m_parameterSetManagerDecoder.getPrefetchedVPS(0));
    873898#endif
    874899  m_apcSlicePilot->initTiles();
    875 
     900#if QC_MVHEVC_B0046
     901  m_apcSlicePilot->setViewId( nalu.m_layerId );
     902  m_apcSlicePilot->setViewId( nalu.m_layerId );
     903  m_apcSlicePilot->setViewOrderIdx(m_apcSlicePilot->getVPS()->getViewId(nalu.m_layerId), nalu.m_layerId);
     904  Int iNumDirectRef = m_apcSlicePilot->getVPS()->getNumDirectRefLayer(nalu.m_layerId);
     905  m_apcSlicePilot->getSPS()->setNumberOfUsableInterViewRefs(iNumDirectRef);
     906  for(Int iNumIvRef = 0; iNumIvRef < iNumDirectRef; iNumIvRef ++)
     907  {
     908    Int iDeltaLayerId = m_apcSlicePilot->getVPS()->getDirectRefLayerId( nalu.m_layerId, iNumIvRef);
     909    m_apcSlicePilot->getSPS()->setUsableInterViewRef(iNumIvRef, (iDeltaLayerId-nalu.m_layerId));
     910  }
     911#endif
    876912  if (m_bFirstSliceInPicture)
    877913  {
     
    888924  if( m_bFirstSliceInPicture )
    889925  {
     926#if QC_MVHEVC_B0046
     927    if( nalu.m_layerId == 0 ) { m_nalUnitTypeBaseView = nalu.m_nalUnitType; }
     928    else                     { m_nalUnitTypeBaseView = m_tAppDecTop->getTDecTop( 0, 0 )->getNalUnitTypeBaseView(); }
     929#else
    890930#if VIDYO_VPS_INTEGRATION
    891931    if( m_apcSlicePilot->getVPS()->getViewId(nalu.m_layerId) == 0 ) { m_nalUnitTypeBaseView = nalu.m_nalUnitType; }
     
    895935    else                     { m_nalUnitTypeBaseView = m_tAppDecTop->getTDecTop( 0, nalu.m_isDepth )->getNalUnitTypeBaseView(); }
    896936#endif
    897    
     937#endif
    898938    m_apcSlicePilot->setNalUnitTypeBaseViewMvc( m_nalUnitTypeBaseView );
    899939  }
     
    909949#endif
    910950  m_apcSlicePilot->setTLayerInfo(nalu.m_temporalId);
     951
     952#if VSP_N
     953  if( m_apcSlicePilot->getSPS()->getViewId() )
     954  if( !m_apcSlicePilot->getSPS()->getIsFirstInView() && !m_isDepth )
     955  {
     956    TComSPS* pcSPSDepth = NULL;
     957    TComPic* pcPicDepth = getTAppDecTop()->getPicFromView( m_apcSlicePilot->getSPS()->getViewId(), 0, true );
     958    if( pcPicDepth )
     959    {
     960      pcSPSDepth = getTAppDecTop()->getPicFromView( m_apcSlicePilot->getSPS()->getViewId(), 0, !m_isDepth )->getSPS();
     961      m_apcSlicePilot->getSPS()->copyCameraParameterPre( pcSPSDepth->getCamParPrecision(), pcSPSDepth->hasCamParInSliceHeader() );
     962    }
     963  }
     964#endif
    911965
    912966  // ALF CU parameters should be part of the slice header -> needs to be fixed
     
    9841038        m_pcPicVSP = new TComPic;
    9851039        m_pcPicVSP->create( m_apcSlicePilot->getSPS()->getPicWidthInLumaSamples(), m_apcSlicePilot->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth );
     1040        m_pcPicVSP->setIsVsp( true );
    9861041        m_pcPicVSP->setCurrSliceIdx(0);
    9871042        m_pcPicVSP->getCurrSlice()->setViewOrderIdx( m_apcSlicePilot->getSPS()->getViewOrderIdx() );
     
    10101065        m_pcPicAvail = new TComPic;
    10111066        m_pcPicAvail->create( m_apcSlicePilot->getSPS()->getPicWidthInLumaSamples(), m_apcSlicePilot->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth );
     1067        m_pcPicAvail->setIsVsp( true );
    10121068        m_pcPicAvail->setCurrSliceIdx(0);
    10131069        m_pcPicAvail->getCurrSlice()->setViewOrderIdx( m_apcSlicePilot->getSPS()->getViewOrderIdx() );
     
    10611117    m_cResidualGenerator.create( true, m_apcSlicePilot->getSPS()->getPicWidthInLumaSamples(), m_apcSlicePilot->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiBitDepth + g_uiBitIncrement );
    10621118#endif
    1063 #if !QC_MULTI_DIS_CAN
     1119#if !QC_MULTI_DIS_CAN_A0097
    10641120#if VSP_N
    10651121#if VSP_SLICE_HEADER
     
    12751331
    12761332    // Set reference list
     1333#if !QC_MVHEVC_B0046
    12771334#if VIDYO_VPS_INTEGRATION
    12781335    pcSlice->setViewId( pcSlice->getVPS()->getViewId(nalu.m_layerId) );
     
    12821339    pcSlice->setIsDepth(m_isDepth);
    12831340#endif
     1341#endif
    12841342
    12851343#if SONY_COLPIC_AVAILABILITY
     
    12931351    assert( m_tAppDecTop != NULL );
    12941352    TComPic * const pcTexturePic = m_isDepth ? m_tAppDecTop->getPicFromView(  m_viewId, pcSlice->getPOC(), false ) : NULL;
     1353
     1354#if FLEX_CODING_ORDER_M23723
     1355    if (pcTexturePic != NULL)
     1356    {
     1357      assert( !m_isDepth || pcTexturePic != NULL );
     1358      pcSlice->setTexturePic( pcTexturePic );
     1359    }
     1360#else
    12951361    assert( !m_isDepth || pcTexturePic != NULL );
    12961362    pcSlice->setTexturePic( pcTexturePic );
     1363#endif
    12971364
    12981365    std::vector<TComPic*> apcInterViewRefPics = m_tAppDecTop->getInterViewRefPics( m_viewId, pcSlice->getPOC(), m_isDepth, pcSlice->getSPS() );
     
    13171384
    13181385    pcSlice->setRefPicListMvc( m_cListPic, apcInterViewRefPics, bUseVsp ? m_pcPicVSP : NULL );
    1319 
    13201386#else
    13211387    pcSlice->setRefPicListMvc( m_cListPic, apcInterViewRefPics );
     
    14161482
    14171483#if VSP_N
     1484#if VSP_SLICE_HEADER
     1485  if( pcSlice->getVspFlag() )
     1486#endif
     1487  if( !pcSlice->getSPS()->getIsFirstInView() && !m_isDepth && !pcSlice->getSPS()->hasCamParInSliceHeader() )
     1488  {
     1489    TComSPS* pcSPSDepth = NULL;
     1490    TComPic* pcPicDepth = getTAppDecTop()->getPicFromView( pcSlice->getViewId(), pcSlice->getPOC(), true );
     1491    if( pcPicDepth )
     1492    {
     1493      pcSPSDepth = getTAppDecTop()->getPicFromView( pcSlice->getViewId(), pcSlice->getPOC(), !m_isDepth )->getSPS();
     1494      pcSlice->getSPS()->copyCameraParameterPost( pcSPSDepth->getCodedScale(), pcSPSDepth->getInvCodedScale(), pcSPSDepth->getCodedOffset(), pcSPSDepth->getInvCodedOffset() );
     1495    }
     1496  }
     1497
    14181498  if( m_pcCamParsCollector )
    14191499  {
     
    14441524  m_cGopDecoder.decompressGop(nalu.m_Bitstream, pcPic, false);
    14451525
     1526#if QC_IV_AS_LT_B0046
     1527  std::vector<TComPic*> apcInterViewRefPics = m_tAppDecTop->getInterViewRefPics( m_viewId, pcSlice->getPOC(), m_isDepth, pcSlice->getSPS() );
     1528  for( Int k = 0; k < apcInterViewRefPics.size(); k++ )
     1529  {
     1530    TComPic*  pcPicIv = apcInterViewRefPics[k];
     1531    pcPicIv->setIsLongTerm( 0 );
     1532  }
     1533#endif
    14461534  if( m_pcCamParsCollector )
    14471535  {
     
    14551543}
    14561544
    1457 #if VIDYO_VPS_INTEGRATION
     1545#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    14581546Void TDecTop::xDecodeVPS()
    14591547{
     
    14621550  m_cEntropyDecoder.decodeVPS( vps );
    14631551  m_parameterSetManagerDecoder.storePrefetchedVPS(vps); 
     1552#if !QC_MVHEVC_B0046
    14641553  getTAppDecTop()->getVPSAccess()->addVPS( vps );
     1554#endif
    14651555}
    14661556#endif
     
    15391629  switch (nalu.m_nalUnitType)
    15401630  {
    1541 #if VIDYO_VPS_INTEGRATION
     1631#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    15421632    case NAL_UNIT_VPS:
    15431633      xDecodeVPS();
     
    15621652    case NAL_UNIT_CODED_SLICE_IDR:
    15631653#if H0566_TLA
     1654#if !QC_REM_IDV_B0046
    15641655    case NAL_UNIT_CODED_SLICE_IDV:
     1656#endif
    15651657    case NAL_UNIT_CODED_SLICE_CRA:
    15661658    case NAL_UNIT_CODED_SLICE_TLA:
     
    15771669}
    15781670
     1671#if QC_MVHEVC_B0046
     1672Void TDecTop::xCopyVPS( TComVPS* pVPSV0 )
     1673{
     1674  m_parameterSetManagerDecoder.storePrefetchedVPS(pVPSV0); 
     1675}
     1676
     1677Void TDecTop::xCopySPS( TComSPS* pSPSV0 )
     1678{
     1679  TComSPS* sps = new TComSPS();
     1680  sps = pSPSV0;
     1681  m_parameterSetManagerDecoder.storePrefetchedSPS(sps);
     1682#if LCU_SYNTAX_ALF
     1683  m_cAdaptiveLoopFilter.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth );
     1684#endif
     1685}
     1686
     1687Void TDecTop::xCopyPPS(TComPPS* pPPSV0 )
     1688{
     1689  m_parameterSetManagerDecoder.storePrefetchedPPS( pPPSV0 );
     1690
     1691  //!!!KS: Activate parameter sets for parsing APS (unless dependency is resolved)
     1692  m_apcSlicePilot->setPPSId(pPPSV0->getPPSId());
     1693  xActivateParameterSets();
     1694  m_apcSlicePilot->initTiles();
     1695}
     1696#endif
    15791697/** Function for checking if picture should be skipped because of random access
    15801698 * \param iSkipFrame skip frame counter
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecTop.h

    r166 r213  
    100100  Int**   m_aaiCodedScale;
    101101  Int*    m_aiViewOrderIndex;
     102#if QC_MVHEVC_B0046
     103  Int*    m_aiViewId;
     104#endif
    102105  Int*    m_aiViewReceived;
    103106  UInt    m_uiCamParsCodedPrecision;
     
    264267 
    265268  Void  deletePicBuffer();
    266 
     269#if QC_MVHEVC_B0046
     270  Void      xCopySPS( TComSPS* pSPSV0);
     271  Void      xCopyPPS( TComPPS* pPPSV0);
     272  Void      xCopyVPS( TComVPS* pVPSV0);
     273#endif
    267274#if HHI_INTER_VIEW_RESIDUAL_PRED
    268275  Void      deleteExtraPicBuffers   ( Int iPoc );
     
    275282  Int  getViewId()                { return m_viewId  ;}
    276283  Void setIsDepth( Bool isDepth ) { m_isDepth = isDepth; }
     284  Bool getIsDepth()               { return m_isDepth; }
    277285
    278286#if SONY_COLPIC_AVAILABILITY
     
    291299  TAppDecTop*         getTAppDecTop()                           { return  m_tAppDecTop; }
    292300  NalUnitType         getNalUnitTypeBaseView()                  { return m_nalUnitTypeBaseView; }
     301#if QC_MVHEVC_B0046
     302  bool                m_bFirstNal; //used to copy SPS, PPS, VPS
     303  ParameterSetManagerDecoder* xGetParaSetDec ()        {return  &m_parameterSetManagerDecoder;}
     304#endif
    293305
    294306#if VSP_N
     
    308320  Bool      xDecodeSlice(InputNALUnit &nalu, Int iSkipFrame, Int iPOCLastDisplay);
    309321#endif
    310 #if VIDYO_VPS_INTEGRATION
     322#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    311323  Void      xDecodeVPS();
    312324#endif
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/NALwrite.cpp

    r165 r213  
    6464#endif
    6565
     66#if QC_MVHEVC_B0046
     67  bsNALUHeader.write(nalu.m_layerId,        5); // when nal_ref_flag is signalled, 5 bits here. otherwise, 6 bits
     68  bsNALUHeader.write(nalu.m_temporalId + 1, 3); // temporal_id
     69#else
    6670#if VIDYO_VPS_INTEGRATION
    6771  bsNALUHeader.write(nalu.m_temporalId, 3); // temporal_id
     
    7983  case NAL_UNIT_CODED_SLICE_IDR:
    8084#if H0566_TLA
     85#if !QC_REM_IDV_B0046
    8186  case NAL_UNIT_CODED_SLICE_IDV:
     87#endif
    8288  case NAL_UNIT_CODED_SLICE_CRA:
    8389  case NAL_UNIT_CODED_SLICE_TLA:
     
    95101#endif
    96102#endif
    97  
     103#endif
    98104  out.write(bsNALUHeader.getByteStream(), bsNALUHeader.getByteStreamLength());
    99105
     
    196202}
    197203
     204#if !QC_MVHEVC_B0046
    198205/**
    199206 * Copy NALU from naluSrc to naluDest
     
    222229  naluDest.m_Bitstream   = naluSrc.m_Bitstream;
    223230}
     231#endif
    224232
    225233//! \}
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/NALwrite.h

    r165 r213  
    6262    NalRefIdc nalRefIDC,
    6363#endif
    64 #if VIDYO_VPS_INTEGRATION
     64#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    6565    unsigned layerId,
    6666#else
     
    7070    unsigned temporalID = 0)
    7171#if NAL_REF_FLAG
    72 #if VIDYO_VPS_INTEGRATION
     72#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    7373  : NALUnit(nalUnitType, nalRefFlag, layerId, temporalID)
    7474#else
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp

    r193 r213  
    375375}
    376376
     377#if QC_MVHEVC_B0046
     378Void TEncCavlc::codeVPS( TComVPS* pcVPS )
     379{
     380  WRITE_CODE( pcVPS->getVPSId(),               4,        "video_parameter_set_id"     );
     381  WRITE_FLAG( pcVPS->getTemporalNestingFlag() -1,        "temporal_id_nesting_flag"   );
     382  WRITE_CODE( 0,                 2,        "vps_reserved_zero_2bits"    );
     383  WRITE_CODE( pcVPS->getMaxLayers() - 1,       6,        "vps_max_layers_minus1"      );
     384  WRITE_CODE( pcVPS->getMaxTLayers() - 1,      3,        "vps_max_sub_layers_minus1"  );
     385  //to be determined
     386  //profile_tier_level( 1, vps_max_sub_layers_minus1 );
     387  //to be modified
     388  WRITE_CODE( 0,                              12,         "vps_extension_offset"      );
     389  for(UInt i=0; i <= pcVPS->getMaxTLayers()-1; i++)
     390  {
     391    WRITE_UVLC( pcVPS->getMaxDecPicBuffering(i),           "max_dec_pic_buffering[i]" );
     392    WRITE_UVLC( pcVPS->getNumReorderPics(i),               "num_reorder_pics[i]"      );
     393    WRITE_UVLC( pcVPS->getMaxLatencyIncrease(i),           "max_latency_increase[i]"  );
     394  }
     395  //!!!waste one bit: 3-view, 3; 2-view or more views: 1
     396  WRITE_UVLC(pcVPS->getNumHRDParameters(),                 "vps_num_hrd_parameters"   );
     397  assert(pcVPS->getNumHRDParameters()==0);
     398  for ( UInt i = 0; i < pcVPS->getNumHRDParameters(); i ++)
     399  {
     400   //   if( i > 0 ) 
     401    //{
     402    //  WRITE_UVLC (0, "op_num_layer_id_values_minus1[ opIdx ]");
     403    //  for( i = 0; i <= op_num_layer_id_values_minus1[ opIdx ]; i++ ) 
     404    //    WRITE_CODE(0, 6, "op_layer_id[ opIdx ][ i ]");
     405    //} 
     406    //hrd_parameters( i  = =  0, vps_max_sub_layers_minus1 ); 
     407  }
     408  WRITE_CODE( 1,      1,        "bit_equal_to_one" );
     409  //btye aligned
     410  m_pcBitIf->writeAlignOne();
     411
     412  if(pcVPS->getMaxLayers() == 3)
     413    pcVPS->setNumAddiLayerOperationPoints (pcVPS->getMaxLayers());    //may be configured
     414  else
     415    pcVPS->setNumAddiLayerOperationPoints (1);   
     416  pcVPS->setNumAddiProLevelSets         (1);
     417  WRITE_CODE( pcVPS->getNumAddiLayerOperationPoints(),         8,               "num_additional_layer_operation_points" );   
     418  WRITE_CODE( pcVPS->getNumAddiProLevelSets(),                 8,               "num_additional_profile_level_sets"     );   
     419  for(UInt i=0; i <= pcVPS->getMaxLayers()-1; i++)
     420  {
     421    WRITE_CODE( 0,         4,               "num_types_zero_4bits[i]" );   
     422    WRITE_CODE( 0,         4,               "type_zero_4bits[i]"      );   
     423    WRITE_CODE( pcVPS->getViewId(i),         8,               "view_id[i]" );   
     424    if(i)
     425    {
     426      WRITE_CODE( pcVPS->getNumDirectRefLayer(i), 6,  "num_direct_ref_layers[ i ]" );   
     427      for (UInt j = 0; j< pcVPS->getNumDirectRefLayer(i); j++)
     428      {
     429        WRITE_CODE( pcVPS->getDirectRefLayerId (i, j), 6,  "ref_layer_id[i][j]" );
     430      }
     431    }
     432  }
     433  for( UInt i=1; i<=pcVPS->getNumAddiProLevelSets(); i++)
     434  {
     435    //profile_tier_level
     436  }
     437  for( UInt i=1; i<= pcVPS->getNumAddiLayerOperationPoints(); i++)
     438  {   
     439    if(pcVPS->getMaxLayers() == 3)
     440    {
     441      pcVPS->setNumOpLayerIdMinus1((i < pcVPS->getNumAddiLayerOperationPoints() ? 1: 2), (i-1));
     442    }
     443    else if( i==1 )
     444    {
     445      assert(pcVPS->getNumAddiLayerOperationPoints()==1);
     446      pcVPS->setNumOpLayerIdMinus1(pcVPS->getMaxLayers()-1, (i-1));
     447    }
     448    WRITE_UVLC( pcVPS->getNumOpLayerIdMinus1(i-1),           "op_num_layer_id_values_minus1[ opIdx ]" );
     449    for(UInt j = 0; j <= pcVPS->getNumOpLayerIdMinus1(i-1); j++ )
     450    {
     451      if(pcVPS->getMaxLayers() == 3 && i== 2 && j==1)
     452        pcVPS->setNumOpLayerId (2, i-1, j);
     453      else
     454        pcVPS->setNumOpLayerId (j, i-1, j);
     455      WRITE_UVLC( pcVPS->getNumOpLayerId(i-1, j),           "op_layer_id[ opIdx ][ i ]" );
     456    }
     457    if (pcVPS->getNumAddiProLevelSets())
     458    {
     459      //profile_level_idx[ i ]
     460    }
     461  }
     462  return;
     463}
     464#else
    377465#if VIDYO_VPS_INTEGRATION
    378466Void TEncCavlc::codeVPS( TComVPS* pcVPS )
     
    419507}
    420508#endif
    421 
     509#endif
    422510#if HHI_MPI
    423511Void TEncCavlc::codeSPS( TComSPS* pcSPS, Bool bIsDepth )
     
    620708#endif
    621709  WRITE_FLAG( 1, "sps_extension_flag" );
    622 
     710#if !QC_MVHEVC_B0046
    623711  WRITE_FLAG( (pcSPS->getNumberOfUsableInterViewRefs() > 0) ? 1 : 0, "interview_refs_present_flag" );
    624712  if( pcSPS->getNumberOfUsableInterViewRefs() > 0 )
     
    642730  {
    643731    WRITE_FLAG( pcSPS->getUseMVI() ? 1 : 0, "use_mvi_flag" );
     732  }
     733#endif
     734
     735#if OL_QTLIMIT_PREDCODING_B0068
     736  if( bIsDepth )
     737  {
     738    WRITE_FLAG( pcSPS->getUseQTLPC() ? 1 : 0, "use_qtlpc_flag");
     739  }
     740#endif
     741 
     742#if RWTH_SDC_DLT_B0036
     743  if( bIsDepth )
     744  {
     745    WRITE_FLAG( pcSPS->getUseDLT() ? 1 : 0, "use_dlt_flag" );
     746    if( pcSPS->getUseDLT() )
     747    {
     748      // code mapping
     749      xWriteUvlc  ( pcSPS->getNumDepthValues() );
     750      for(UInt i=0; i<pcSPS->getNumDepthValues(); i++)
     751      {
     752        xWriteUvlc( pcSPS->idx2DepthValue(i) );
     753      }
     754    }
    644755  }
    645756#endif
     
    653764      WRITE_UVLC( pcSPS->getViewId(), "view_id" );
    654765      WRITE_SVLC( pcSPS->getViewOrderIdx(), "view_order_idx" );
     766#if VSP_N
     767      if( pcSPS->getViewId() )
     768      {
     769        WRITE_FLAG( pcSPS->getIsFirstInView() ? 1 : 0, "camera_parameter_present_flag" );
     770        if( pcSPS->getIsFirstInView() )
     771        {
     772          WRITE_UVLC( pcSPS->getCamParPrecision(), "camera_parameter_precision" );
     773          WRITE_FLAG( pcSPS->hasCamParInSliceHeader() ? 1 : 0, "camera_parameter_in_slice_header" );
     774          if( !pcSPS->hasCamParInSliceHeader() )
     775          {
     776            for( UInt uiId = 0; uiId < pcSPS->getViewId(); uiId++ )
     777            {
     778              WRITE_SVLC( pcSPS->getCodedScale    ()[ uiId ], "coded_scale" );
     779              WRITE_SVLC( pcSPS->getCodedOffset   ()[ uiId ], "coded_offset" );
     780              WRITE_SVLC( pcSPS->getInvCodedScale ()[ uiId ] + pcSPS->getCodedScale ()[ uiId ], "inverse_coded_scale_plus_coded_scale" );
     781              WRITE_SVLC( pcSPS->getInvCodedOffset()[ uiId ] + pcSPS->getCodedOffset()[ uiId ], "inverse_coded_offset_plus_coded_offset" );
     782            }
     783          }
     784        }
     785      }
     786#endif
    655787    }
    656788    else
     
    659791      WRITE_UVLC( pcSPS->getViewId() - 1, "view_id_minus1" );
    660792      WRITE_SVLC( pcSPS->getViewOrderIdx(), "view_order_idx" );
     793#if VSP_N
     794      WRITE_FLAG( pcSPS->getIsFirstInView() ? 1 : 0, "camera_parameter_present_flag" );
     795      if( pcSPS->getIsFirstInView() )
     796      {
     797#endif
    661798      WRITE_UVLC( pcSPS->getCamParPrecision(), "camera_parameter_precision" );
    662799      WRITE_FLAG( pcSPS->hasCamParInSliceHeader() ? 1 : 0, "camera_parameter_in_slice_header" );
     
    671808        }
    672809      }
     810#if VSP_N
     811      }
     812#endif
    673813#if DEPTH_MAP_GENERATION
    674814      WRITE_UVLC( pcSPS->getPredDepthMapGeneration(), "Pdm_generation" );
     
    708848#endif
    709849  WRITE_FLAG( 0, "sps_extension2_flag" );
     850#endif
    710851}
    711852
     
    766907  Int address = (pcSlice->getPic()->getPicSym()->getCUOrderMap(lCUAddress) << reqBitsInner) + innerAddress;
    767908  WRITE_FLAG( address==0, "first_slice_in_pic_flag" );
     909
     910#if LGE_ILLUCOMP_B0045
     911  // IC flag is on only first_slice_in_pic
     912  if (address==0)
     913  {
     914    if( pcSlice->getSPS()->getViewId() && !pcSlice->getIsDepth() )
     915    {
     916      WRITE_FLAG( pcSlice->getApplyIC() ? 1 : 0, "applying IC flag" );
     917    }
     918  }
     919#endif
     920
    768921  if(address>0)
    769922  {
     
    777930  if (!bEntropySlice)
    778931  {
     932#if QC_MVHEVC_B0046
     933    WRITE_UVLC( 0, "pic_parameter_set_id" );
     934#else
    779935    WRITE_UVLC( pcSlice->getPPS()->getPPSId(), "pic_parameter_set_id" );
     936#endif
    780937#if H0388
    781938    if( pcSlice->getPPS()->getOutputFlagPresentFlag() )
     
    784941    }
    785942#endif
     943#if QC_REM_IDV_B0046
     944    if(pcSlice->getNalUnitType()==NAL_UNIT_CODED_SLICE_IDR && pcSlice->getViewId() == 0)
     945#else
    786946    if(pcSlice->getNalUnitType()==NAL_UNIT_CODED_SLICE_IDR)
     947#endif
    787948    {
    788949      WRITE_UVLC( 0, "idr_pic_id" );
     
    792953    {
    793954      WRITE_CODE( (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC()))%(1<<pcSlice->getSPS()->getBitsForPOC()), pcSlice->getSPS()->getBitsForPOC(), "pic_order_cnt_lsb");
     955#if QC_REM_IDV_B0046
     956      if( pcSlice->getPOC() == 0 && !(pcSlice->getSPS()->getViewId() && (pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA)))
     957#else
    794958      if( pcSlice->getPOC() == 0 && pcSlice->getNalUnitType() != NAL_UNIT_CODED_SLICE_IDV )
     959#endif
    795960      {
    796961        TComReferencePictureSet* rps = pcSlice->getRPS();
     
    15011666}
    15021667
     1668#if LGE_ILLUCOMP_B0045
     1669Void TEncCavlc::codeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )
     1670{
     1671  assert(0);
     1672}
     1673#endif
     1674
    15031675#if FORCE_REF_VSP==1
    15041676Void TEncCavlc::codeVspFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )
     
    21282300  return true;
    21292301}
     2302
     2303#if RWTH_SDC_DLT_B0036
     2304Void TEncCavlc::codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx )
     2305{
     2306  assert(0);
     2307}
     2308
     2309Void TEncCavlc::codeSDCResidualData  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment )
     2310{
     2311  assert(0);
     2312}
     2313
     2314Void TEncCavlc::codeSDCPredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx )
     2315{
     2316  assert(0);
     2317}
     2318#endif
    21302319//! \}
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncCavlc.h

    r166 r213  
    114114  UInt  getCoeffCost          ()                { return  m_uiCoeffCost;  }
    115115 
    116 #if VIDYO_VPS_INTEGRATION
     116#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    117117  Void  codeVPS                 ( TComVPS* pcVPS );
    118118#endif
     
    164164
    165165  Void codeSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     166#if LGE_ILLUCOMP_B0045
     167  Void codeICFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     168#endif
    166169#if FORCE_REF_VSP==1
    167170  Void codeVspFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     
    223226  Void codeDFFlag       ( UInt uiCode, const Char *pSymbolName );
    224227  Void codeDFSvlc       ( Int   iCode, const Char *pSymbolName );
     228 
     229#if RWTH_SDC_DLT_B0036
     230  Void codeSDCFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     231  Void codeSDCResidualData  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment );
     232  Void codeSDCPredMode          ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     233#endif
    225234
    226235};
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncCfg.h

    r193 r213  
    181181#endif
    182182  Bool      m_bUseSAO;
     183#if LGE_ILLUCOMP_B0045
     184  Bool      m_bUseIC;
     185#endif
    183186#if SAO_UNIT_INTERLEAVING
    184187  Int       m_maxNumOffsetsPerPic;
     
    194197  Int       m_iSearchRange;                     //  0:Full frame
    195198  Int       m_bipredSearchRange;
    196 
     199#if DV_V_RESTRICTION_B0037
     200  Bool      m_bUseDisparitySearchRangeRestriction;
     201  Int       m_iVerticalDisparitySearchRange;
     202#endif
    197203  //====== Quality control ========
    198204  Int       m_iMaxDeltaQP;                      //  Max. absolute delta QP (1:default)
     
    264270#if HHI_MPI
    265271  Bool      m_bUseMVI;
     272#endif
     273#if RWTH_SDC_DLT_B0036
     274  Bool      m_bUseDLT;
     275  Bool      m_bUseSDC;
    266276#endif
    267277
     
    290300  Int       m_iColumnRowInfoPresent;
    291301  Int       m_iUniformSpacingIdr;
    292 #if FIX_REMOVE_TILE_DEPENDENCE
    293 #else
    294   Int       m_iTileBoundaryIndependenceIdr;
    295 #endif
    296302  Int       m_iNumColumnsMinus1;
    297303  UInt*     m_puiColumnWidth;
     
    322328#endif
    323329
    324 #if VIDYO_VPS_INTEGRATION
     330#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    325331  UInt     m_layerId;
    326332#endif
     
    339345#endif
    340346
    341 #if OL_DEPTHLIMIT_A0044
    342   Bool     m_bDepthPartitionLimiting;
     347#if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER_M23723
     348  Bool m_bUseDMM34;
     349#endif
     350
     351#if OL_QTLIMIT_PREDCODING_B0068
     352  Bool     m_bUseQTLPC;
    343353#endif
    344354
     
    483493  Void      setSearchRange                  ( Int   i )      { m_iSearchRange = i; }
    484494  Void      setBipredSearchRange            ( Int   i )      { m_bipredSearchRange = i; }
    485 
     495#if DV_V_RESTRICTION_B0037
     496  Void      setUseDisparitySearchRangeRestriction ( Bool   b )      { m_bUseDisparitySearchRangeRestriction = b; }
     497  Void      setVerticalDisparitySearchRange ( Int   i )      { m_iVerticalDisparitySearchRange = i; }
     498#endif
    486499#if HHI_INTER_VIEW_MOTION_PRED
    487500  UInt      getMultiviewMvRegMode           ()      { return  m_uiMultiviewMvRegMode; }
     
    574587  Int       getFastSearch                   ()      { return  m_iFastSearch; }
    575588  Int       getSearchRange                  ()      { return  m_iSearchRange; }
    576 
     589#if DV_V_RESTRICTION_B0037
     590  Bool      getUseDisparitySearchRangeRestriction ()      { return  m_bUseDisparitySearchRangeRestriction; }
     591  Int       getVerticalDisparitySearchRange ()      { return  m_iVerticalDisparitySearchRange; }
     592#endif
    577593#if HHI_VSO
    578594  //==== VSO  ==========
     
    716732  Void  setUseMVI                      ( Bool bVal )   {m_bUseMVI = bVal;}
    717733#endif
     734#if RWTH_SDC_DLT_B0036
     735  Void  setUseDLT                       ( Bool  b )     { m_bUseDLT   = b; }
     736  Void  setUseSDC                       ( Bool  b )     { m_bUseSDC   = b; }
     737#endif
    718738  Void  setUseSAO                      ( Bool bVal )   {m_bUseSAO = bVal;}
    719739  Bool  getUseSAO                      ()              {return m_bUseSAO;}
     740#if LGE_ILLUCOMP_B0045
     741  Void  setUseIC                       ( Bool bVal )   {m_bUseIC = bVal;}
     742  Bool  getUseIC                       ()              {return m_bUseIC;}
     743#endif
    720744#if SAO_UNIT_INTERLEAVING
    721745  Void  setMaxNumOffsetsPerPic                   (Int iVal)            { m_maxNumOffsetsPerPic = iVal; }
     
    837861  Int       getTSIG()                            { return m_signHidingThreshold; }
    838862#endif
    839 #if VIDYO_VPS_INTEGRATION
     863#if VIDYO_VPS_INTEGRATION |QC_MVHEVC_B0046
    840864  Void      setLayerId             ( UInt layerId )   { m_layerId = layerId; }
    841865  UInt      getLayerId             ()               { return m_layerId; }
     
    852876#endif
    853877
    854 #if OL_DEPTHLIMIT_A0044
    855   Void      setUseDPL(Bool b) {m_bDepthPartitionLimiting = b; }
    856   Bool      getUseDPL()       {return m_bDepthPartitionLimiting;}
     878#if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER_M23723
     879  Void setUseDMM34( Bool b) { m_bUseDMM34 = b;    }
     880  Bool getUseDMM34()        { return m_bUseDMM34; }
     881#endif
     882
     883#if OL_QTLIMIT_PREDCODING_B0068
     884  Void      setUseQTLPC( Bool b ) { m_bUseQTLPC = b;    }
     885  Bool      getUseQTLPC()         { return m_bUseQTLPC; }
     886#endif
     887 
     888#if RWTH_SDC_DLT_B0036
     889  Bool      getUseDLT()      { return m_bUseDLT;     }
     890  Bool      getUseSDC()      { return m_bUseSDC;     }
    857891#endif
    858892
     
    863897  Void      setCodedOffset                  ( Int** p )      { m_aaiCodedOffset         = p; }
    864898
    865 #if SONY_COLPIC_AVAILABILITY
     899#if SONY_COLPIC_AVAILABILITY || VSP_N
    866900  Int       getViewOrderIdx                 ()      { return  m_iViewOrderIdx; }
    867901#endif
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncCu.cpp

    r193 r213  
    451451  TComPic* pcPic = rpcBestCU->getPic();
    452452
    453 #if OL_DEPTHLIMIT_A0044
    454   TComSPS *sps = pcPic->getSlice(0)->getSPS();
    455   TComPic *pcTexture;
    456   TComDataCU * pcTextureCU;
    457   Bool  depthMapDetect =  false;
    458   //UInt         uiPrevTexPartIndex = 0;
    459 #if OL_DO_NOT_LIMIT_INTRA_SLICES_PART
    460   Bool bIntraSliceDetect = false;
    461 #endif
    462   Bool bTry2NxN = false;
    463   Bool bTryNx2N = false;
    464     pcTexture = rpcBestCU->getSlice()->getTexturePic();
    465     if(pcTexture != NULL) //depth map being encoded
    466     {
    467     depthMapDetect = true;
    468 #if OL_DO_NOT_LIMIT_INTRA_SLICES_PART
    469       bIntraSliceDetect = (rpcBestCU->getSlice()->getSliceType()==I_SLICE);
    470 #endif
    471     if(uiDepth == 0)
    472     {
    473       pcTextureCU = pcTexture->getCU( rpcBestCU->getAddr() );
    474       pcTexture->setPartInfo(pcTextureCU->readPartInfo());
    475       pcTexture->setTexPartIndex(0);
    476     }
    477     }
    478     else
    479     {
    480       depthMapDetect = false;
    481     }
    482 #endif
     453#if OL_QTLIMIT_PREDCODING_B0068
     454  TComSPS *sps         = pcPic->getSlice(0)->getSPS();
     455  TComPic *pcTexture   = rpcBestCU->getSlice()->getTexturePic();
     456
     457  Bool  depthMapDetect    = (pcTexture != NULL);
     458  Bool  bIntraSliceDetect = (rpcBestCU->getSlice()->getSliceType() == I_SLICE);
     459
     460  Bool bTry2NxN = true;
     461  Bool bTryNx2N = true;
     462#endif
     463
    483464  // get Original YUV data from picture
    484465  m_ppcOrigYuv[uiDepth]->copyFromPicYuv( pcPic->getPicYuvOrg(), rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU() );
    485466#if FORCE_REF_VSP
    486   Bool bWholeCUCanBeSynthesized = false;
     467  //Bool bWholeCUCanBeSynthesized = false;
    487468  //Bool bOneSubCUCanNotBeSynthesied = false;
    488469  Bool bSubCUCanBeSynthesized[4];
     
    506487    if(iSubCUCanBeSynthesizedCnt == 4)
    507488    {
    508       bWholeCUCanBeSynthesized = true;
     489      //bWholeCUCanBeSynthesized = true;
    509490    }
    510491    //else if(iSubCUCanBeSynthesizedCnt == 3)
     
    543524  UInt uiTPelY   = rpcBestCU->getCUPelY();
    544525  UInt uiBPelY   = uiTPelY + rpcBestCU->getHeight(0) - 1;
     526
     527#if LGE_ILLUCOMP_B0045
     528  Bool bICEnabled = (!rpcTempCU->getSlice()->getIsDepth() && rpcTempCU->getSlice()->getViewId());
     529
     530  bICEnabled = bICEnabled && rpcTempCU->getSlice()->getApplyIC();
     531#endif
    545532
    546533#if HHI_INTERVIEW_SKIP
     
    650637      // variables for fast encoder decision
    651638      bEarlySkip  = false;
    652       bTrySplit    = true;
     639      bTrySplit   = true;
    653640      fRD_Skip    = MAX_DOUBLE;
    654641
    655642      rpcTempCU->initEstData( uiDepth, iQP );
    656643
    657 #if OL_DEPTHLIMIT_A0044
     644#if OL_QTLIMIT_PREDCODING_B0068
    658645      //logic for setting bTrySplit using the partition information that is stored of the texture colocated CU
    659 #if OL_DO_NOT_LIMIT_INTRA_SLICES_PART
    660       if(depthMapDetect && !bIntraSliceDetect && sps->getUseDPL())
    661 #else
    662       if(depthMapDetect && sps->getUseDPL()) //depth map being encoded
    663 #endif
    664       {
    665         assert(uiDepth == pcTexture->accessPartInfo(1));
    666         if(pcTexture->accessPartInfo(0) == 1) //NxN modes
     646      if(depthMapDetect && !bIntraSliceDetect && sps->getUseQTLPC())
     647      {
     648        TComDataCU* pcTextureCU = pcTexture->getCU( rpcBestCU->getAddr() ); //Corresponding texture LCU
     649        UInt uiCUIdx            = rpcBestCU->getZorderIdxInCU();
     650        assert(pcTextureCU->getDepth(uiCUIdx) >= uiDepth); //Depth cannot be more partitionned than the texture.
     651        if (pcTextureCU->getDepth(uiCUIdx) > uiDepth || pcTextureCU->getPartitionSize(uiCUIdx) == SIZE_NxN) //Texture was split.
    667652        {
    668653          bTrySplit = true;
    669           bTryNx2N = true;
    670           bTry2NxN = true;
    671           //uiPrevTexPartIndex = pcTexture->getTexPartIndex();
    672           pcTexture->incrementTexPartIndex();
     654          bTryNx2N  = true;
     655          bTry2NxN  = true;
    673656        }
    674         else if(pcTexture->accessPartInfo(0) == 0) //2Nx2N modes
    675         {
    676           UInt uiTexdepth;
    677           UInt temp_uiTexPartIndex;
    678           bTrySplit = false;
    679 
    680           //scan ahead till next depth
    681           uiTexdepth = pcTexture->accessPartInfo(1);
    682           //uiPrevTexPartIndex = pcTexture->getTexPartIndex();
    683           pcTexture->incrementTexPartIndex();
    684           temp_uiTexPartIndex = pcTexture->getTexPartIndex(); //store in case to rewind
    685 
    686           while(uiTexdepth != pcTexture->accessPartInfo(1) && uiTexdepth != 0)
    687           {
    688             if(pcTexture->accessPartInfo(1) < uiTexdepth)
    689             {
    690               break;
    691             }
    692             pcTexture->incrementTexPartIndex();
    693 
    694             if(pcTexture->accessPartInfo(1) == OL_END_CU)
    695             {
    696               pcTexture->setTexPartIndex(temp_uiTexPartIndex);
    697               uiTexdepth++;
    698               if(uiTexdepth >= g_uiMaxCUDepth)
    699               {     
    700                 break;
    701               }
    702             }
    703           }
    704         }
    705         else if(pcTexture->accessPartInfo(0) == OL_END_CU)
     657        else
    706658        {
    707659          bTrySplit = false;
    708           bTryNx2N = false;
    709           bTry2NxN = false;
     660          bTryNx2N  = false;
     661          bTry2NxN  = false;
    710662        }
    711         else if(pcTexture->accessPartInfo(0) == 2) //2NxN case
    712         {
    713           bTrySplit = false;
    714           bTryNx2N = false;
    715           bTry2NxN = true;
    716           //uiPrevTexPartIndex = pcTexture->getTexPartIndex(); 
    717           pcTexture->incrementTexPartIndex(); ;
    718         }
    719         else if(pcTexture->accessPartInfo(0) == 3) //Nx2N case
    720         {
    721           bTrySplit = false;
    722           bTryNx2N = true;
    723           bTry2NxN = false;
    724           //uiPrevTexPartIndex = pcTexture->getTexPartIndex(); 
    725           pcTexture->incrementTexPartIndex(); ;
    726         }
    727       }
    728 #endif
    729 
     663      }
     664#endif
    730665
    731666      // do inter modes, SKIP and 2Nx2N
     
    750685        {
    751686          Bool bResPredFlag  = ( uiResPrdId > 0 );
    752 #endif
    753 #if HHI_INTER_VIEW_RESIDUAL_PRED
    754           rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    755 #endif
    756           // SKIP
     687#if LGE_ILLUCOMP_B0045
     688          for(UInt uiICId = 0; uiICId < (bICEnabled ? 2 : 1); uiICId++)
     689          {
     690            Bool bICFlag = (uiICId ? true : false);
     691            rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth);
     692#endif
     693#endif
     694#if HHI_INTER_VIEW_RESIDUAL_PRED
     695            rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
     696#endif
     697            // SKIP
    757698#if HHI_INTERVIEW_SKIP
    758           xCheckRDCostMerge2Nx2N( rpcBestCU, rpcTempCU, bFullyRenderedSec );
    759 #else
    760           xCheckRDCostMerge2Nx2N( rpcBestCU, rpcTempCU );
    761 #endif
    762           rpcTempCU->initEstData( uiDepth, iQP );
    763 
    764           // fast encoder decision for early skip
    765           if ( m_pcEncCfg->getUseFastEnc() )
    766           {
    767             Int iIdx = g_aucConvertToBit[ rpcBestCU->getWidth(0) ];
    768             if ( aiNum [ iIdx ] > 5 && fRD_Skip < EARLY_SKIP_THRES*afCost[ iIdx ]/aiNum[ iIdx ] )
     699            xCheckRDCostMerge2Nx2N( rpcBestCU, rpcTempCU, bFullyRenderedSec );
     700#else
     701            xCheckRDCostMerge2Nx2N( rpcBestCU, rpcTempCU );
     702#endif
     703            rpcTempCU->initEstData( uiDepth, iQP );
     704
     705            // fast encoder decision for early skip
     706            if ( m_pcEncCfg->getUseFastEnc() )
    769707            {
    770               bEarlySkip = true;
    771               bTrySplit  = false;
     708              Int iIdx = g_aucConvertToBit[ rpcBestCU->getWidth(0) ];
     709              if ( aiNum [ iIdx ] > 5 && fRD_Skip < EARLY_SKIP_THRES*afCost[ iIdx ]/aiNum[ iIdx ] )
     710              {
     711                bEarlySkip = true;
     712                bTrySplit  = false;
     713              }
    772714            }
    773           }
    774 
    775           // 2Nx2N, NxN
    776           if ( !bEarlySkip )
    777           {
    778 #if HHI_INTER_VIEW_RESIDUAL_PRED
    779             rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
     715#if LGE_ILLUCOMP_B0045_ENCSIMP
     716            if(bICFlag && rpcBestCU->getMergeFlag(0) && !rpcBestCU->getICFlag(0))
     717            {
     718              bICEnabled = false;
     719              break;
     720            }
     721#endif
     722
     723            // 2Nx2N, NxN
     724            if ( !bEarlySkip )
     725            {
     726#if HHI_INTER_VIEW_RESIDUAL_PRED
     727              rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    780728#endif
    781729#if HHI_INTERVIEW_SKIP
    782             xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N, bFullyRenderedSec );
    783 
    784 #else
    785             xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N );
    786 #endif
    787             rpcTempCU->initEstData( uiDepth, iQP );
    788             if(m_pcEncCfg->getUseCbfFastMode())
    789             {
    790               doNotBlockPu = rpcBestCU->getQtRootCbf( 0 ) != 0;
    791             }
     730              xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N, bFullyRenderedSec );
     731
     732#else
     733              xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N );
     734#endif
     735              rpcTempCU->initEstData( uiDepth, iQP );
     736              if(m_pcEncCfg->getUseCbfFastMode())
     737              {
     738                doNotBlockPu = rpcBestCU->getQtRootCbf( 0 ) != 0;
     739              }
    792740
    793741#if FORCE_REF_VSP==1
    794742#if VSP_CFG
    795             if( rpcBestCU->getSlice()->getSPS()->getVspDepthPresentFlag() || !rpcBestCU->getSlice()->getSPS()->isDepth() )
    796 #else
    797             if( !rpcBestCU->getSlice()->getVspDepthDisableFlag() || !rpcBestCU->getSlice()->getSPS()->isDepth() )
    798 #endif
    799             if( bWholeCUCanBeSynthesized )
    800             {
    801 #if HHI_INTER_VIEW_RESIDUAL_PRED
    802               rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
     743              if( rpcBestCU->getSlice()->getSPS()->getVspDepthPresentFlag() || !rpcBestCU->getSlice()->getSPS()->isDepth() )
     744#else
     745              if( !rpcBestCU->getSlice()->getVspDepthDisableFlag() || !rpcBestCU->getSlice()->getSPS()->isDepth() )
     746#endif
     747              if( bWholeCUCanBeSynthesized )
     748              {
     749#if HHI_INTER_VIEW_RESIDUAL_PRED
     750                rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    803751#endif
    804752#if HHI_INTERVIEW_SKIP
    805               xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N, bFullyRenderedSec, false, true ); // VSP
    806 #else
    807               xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N );
    808 #endif
    809               rpcTempCU->initEstData( uiDepth, iQP );
     753                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N, bFullyRenderedSec, false, true ); // VSP
     754#else
     755                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N );
     756#endif
     757                rpcTempCU->initEstData( uiDepth, iQP );
     758              }
     759//#else
     760//              if( bWholeCUCanBeSynthesized ) // To avoid compiling warning
     761//              {
     762//              }
     763#endif
    810764            }
    811 #else
    812             if( bWholeCUCanBeSynthesized ) // To avoid compiling warning
    813             {
    814             }
    815 #endif
     765#if LGE_ILLUCOMP_B0045
    816766          }
     767#endif
    817768#if HHI_INTER_VIEW_RESIDUAL_PRED
    818769        } // uiResPrdId
     
    820771      } // != I_SLICE
    821772
    822 #if OL_DEPTHLIMIT_A0044
    823 #if OL_DO_NOT_LIMIT_INTRA_SLICES_PART
    824       if(depthMapDetect && !bIntraSliceDetect  && sps->getUseDPL())
    825 #else
    826       if(depthMapDetect  && sps->getUseDPL()) //depth map being encoded
    827 #endif
     773#if LGE_ILLUCOMP_B0045_ENCSIMP
     774      bICEnabled = rpcBestCU->getICFlag(0);
     775#endif
     776
     777#if OL_QTLIMIT_PREDCODING_B0068
     778      if(depthMapDetect && !bIntraSliceDetect  && sps->getUseQTLPC())
    828779      {
    829780        bTrySplitDQP = bTrySplit;
     
    831782      else
    832783      {
     784#endif
    833785        if( (g_uiMaxCUWidth>>uiDepth) >= rpcTempCU->getSlice()->getPPS()->getMinCuDQPSize() )
    834786        {
     
    842794          bTrySplitDQP = bTrySplit;
    843795        }
    844       }
    845 #else
    846 
    847       if( (g_uiMaxCUWidth>>uiDepth) >= rpcTempCU->getSlice()->getPPS()->getMinCuDQPSize() )
    848       {
    849         if(iQP == iBaseQP)
    850         {
    851           bTrySplitDQP = bTrySplit;
    852         }
    853       }
    854       else
    855       {
    856         bTrySplitDQP = bTrySplit;
    857       }
    858 #endif
     796#if OL_QTLIMIT_PREDCODING_B0068
     797      }
     798#endif
     799
    859800#if LOSSLESS_CODING
    860801      if (isAddLowestQP && (iQP == lowestQP))
     
    897838        {
    898839          Bool bResPredFlag  = ( uiResPrdId > 0 );
    899 #endif
    900           // 2Nx2N, NxN
    901           if ( !bEarlySkip )
     840#if LGE_ILLUCOMP_B0045
     841          for(UInt uiICId = 0; uiICId < (bICEnabled ? 2 : 1); uiICId++)
    902842          {
    903 
    904             if(!( rpcBestCU->getSlice()->getSPS()->getDisInter4x4()  && (rpcBestCU->getWidth(0)==8) && (rpcBestCU->getHeight(0)==8) ))
     843            Bool bICFlag = (uiICId ? true : false);
     844            rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth);
     845#endif
     846#endif
     847            // 2Nx2N, NxN
     848            if ( !bEarlySkip )
    905849            {
    906               if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth && doNotBlockPu)
     850
     851              if(!( rpcBestCU->getSlice()->getSPS()->getDisInter4x4()  && (rpcBestCU->getWidth(0)==8) && (rpcBestCU->getHeight(0)==8) ))
    907852              {
    908 #if OL_DEPTHLIMIT_A0044 //add code here to select 2NxN or Nx2N or none
    909 #if OL_DO_NOT_LIMIT_INTRA_SLICES_PART
    910                 if(depthMapDetect && !bIntraSliceDetect  && sps->getUseDPL())
    911 #else
    912                 if(depthMapDetect  && sps->getUseDPL()) //depth map being encoded
    913 #endif
     853                if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth && doNotBlockPu)
    914854                {
    915                   if (bTrySplit)
     855#if OL_QTLIMIT_PREDCODING_B0068 //try InterNxN
     856                  if(bTrySplit)
    916857                  {
    917858#endif
     
    925866#endif
    926867                    rpcTempCU->initEstData( uiDepth, iQP );
    927 #if OL_DEPTHLIMIT_A0044
    928                   }//bTrySplit
    929                 }//depthMapDetect
    930                 else//do things normally
    931                 {
    932 #if HHI_INTER_VIEW_RESIDUAL_PRED
    933                   rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    934 #endif
    935 #if HHI_INTERVIEW_SKIP
    936                   xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_NxN, bFullyRenderedSec   );
    937 #else
    938                   xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_NxN   );
    939 #endif
    940                   rpcTempCU->initEstData( uiDepth, iQP );
    941                 }
    942 #endif
     868#if OL_QTLIMIT_PREDCODING_B0068
     869                  }
     870#endif
     871                }
    943872              }
    944873            }
    945           }
    946 
    947           { // 2NxN, Nx2N
    948 #if OL_DEPTHLIMIT_A0044 //add code here to select 2NxN or Nx2N or none
    949 #if OL_DO_NOT_LIMIT_INTRA_SLICES_PART
    950             if(depthMapDetect && !bIntraSliceDetect  && sps->getUseDPL())
    951 #else
    952             if(depthMapDetect  && sps->getUseDPL()) //depth map being encoded
    953 #endif
    954             {
    955               if (bTryNx2N)
     874
     875            { // 2NxN, Nx2N
     876#if OL_QTLIMIT_PREDCODING_B0068 //try Nx2N
     877              if(bTryNx2N)
    956878              {
    957879#endif
     
    972894                  }
    973895                }
    974 #if OL_DEPTHLIMIT_A0044
    975               }//bTryNx2N
    976             }//depthMapDetect
    977             else//do things normally
    978             {
    979               if(doNotBlockPu)
    980               {
    981 #if HHI_INTER_VIEW_RESIDUAL_PRED
    982                 rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    983 #endif
    984 #if HHI_INTERVIEW_SKIP
    985                 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_Nx2N, bFullyRenderedSec   );
    986 #else
    987                 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_Nx2N  );
    988 #endif
    989                 rpcTempCU->initEstData( uiDepth, iQP );
    990                 if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_Nx2N )
    991                 {
    992                   doNotBlockPu = rpcBestCU->getQtRootCbf( 0 ) != 0;
    993                 }
     896#if OL_QTLIMIT_PREDCODING_B0068
    994897              }
    995             }
    996 #endif
    997 
    998 #if OL_DEPTHLIMIT_A0044 //add code here to select 2NxN or Nx2N or none
    999 #if OL_DO_NOT_LIMIT_INTRA_SLICES_PART
    1000             if(depthMapDetect && !bIntraSliceDetect  && sps->getUseDPL())
    1001 #else
    1002             if(depthMapDetect  && sps->getUseDPL()) //depth map being encoded
    1003 #endif
    1004             {
    1005               if (bTry2NxN)
     898#endif
     899
     900#if OL_QTLIMIT_PREDCODING_B0068 //try 2NxN
     901              if(bTry2NxN)
    1006902              {
    1007903#endif
     
    1022918                  }
    1023919                }
    1024 #if OL_DEPTHLIMIT_A0044
    1025               }//bTryNx2N
    1026             }//depthMapDetect
    1027             else//do things normally
     920#if OL_QTLIMIT_PREDCODING_B0068
     921              }
     922#endif
     923            }
     924
     925#if 1
     926            //! Try AMP (SIZE_2NxnU, SIZE_2NxnD, SIZE_nLx2N, SIZE_nRx2N)
     927            if( pcPic->getSlice(0)->getSPS()->getAMPAcc(uiDepth) )
    1028928            {
    1029               if(doNotBlockPu)
     929#if AMP_ENC_SPEEDUP       
     930              Bool bTestAMP_Hor = false, bTestAMP_Ver = false;
     931
     932#if AMP_MRG
     933              Bool bTestMergeAMP_Hor = false, bTestMergeAMP_Ver = false;
     934
     935              deriveTestModeAMP (rpcBestCU, eParentPartSize, bTestAMP_Hor, bTestAMP_Ver, bTestMergeAMP_Hor, bTestMergeAMP_Ver);
     936#else
     937              deriveTestModeAMP (rpcBestCU, eParentPartSize, bTestAMP_Hor, bTestAMP_Ver);
     938#endif
     939
     940              //! Do horizontal AMP
     941              if ( bTestAMP_Hor )
    1030942              {
    1031 #if HHI_INTER_VIEW_RESIDUAL_PRED
    1032                 rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    1033 #endif
    1034 #if HHI_INTERVIEW_SKIP
    1035                 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxN, bFullyRenderedSec   );
    1036 #else
    1037                 xCheckRDCostInter      ( rpcBestCU, rpcTempCU, SIZE_2NxN  );
    1038 #endif
    1039                 rpcTempCU->initEstData( uiDepth, iQP );
    1040                 if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_2NxN)
    1041                 {
    1042                   doNotBlockPu = rpcBestCU->getQtRootCbf( 0 ) != 0;
    1043                 }
    1044               }
    1045             }
    1046 #endif
    1047           }
    1048 
    1049 #if 1
    1050           //! Try AMP (SIZE_2NxnU, SIZE_2NxnD, SIZE_nLx2N, SIZE_nRx2N)
    1051           if( pcPic->getSlice(0)->getSPS()->getAMPAcc(uiDepth) )
    1052           {
    1053 #if AMP_ENC_SPEEDUP       
    1054             Bool bTestAMP_Hor = false, bTestAMP_Ver = false;
    1055 
    1056 #if AMP_MRG
    1057             Bool bTestMergeAMP_Hor = false, bTestMergeAMP_Ver = false;
    1058 
    1059             deriveTestModeAMP (rpcBestCU, eParentPartSize, bTestAMP_Hor, bTestAMP_Ver, bTestMergeAMP_Hor, bTestMergeAMP_Ver);
    1060 #else
    1061             deriveTestModeAMP (rpcBestCU, eParentPartSize, bTestAMP_Hor, bTestAMP_Ver);
    1062 #endif
    1063 
    1064             //! Do horizontal AMP
    1065             if ( bTestAMP_Hor )
    1066             {
    1067 #if OL_DEPTHLIMIT_A0044 //add code here to select 2NxN or Nx2N or none
    1068 #if OL_DO_NOT_LIMIT_INTRA_SLICES_PART
    1069               if(depthMapDetect && !bIntraSliceDetect  && sps->getUseDPL())
    1070 #else
    1071               if(depthMapDetect  && sps->getUseDPL()) //depth map being encoded
    1072 #endif
    1073               {
    1074                 if (bTry2NxN)
     943#if OL_QTLIMIT_PREDCODING_B0068 //try 2NxnU & 2NxnD
     944                if(bTry2NxN)
    1075945                {
    1076946#endif
     
    1107977                    }
    1108978                  }
    1109 #if OL_DEPTHLIMIT_A0044
    1110                 }//bTry2NxN
    1111               }//depthMapDetect
    1112               else//do things normally
     979#if OL_QTLIMIT_PREDCODING_B0068
     980                }
     981#endif
     982              }
     983#if AMP_MRG
     984              else if ( bTestMergeAMP_Hor )
    1113985              {
    1114                 if(doNotBlockPu)
    1115                 {
    1116 #if HHI_INTER_VIEW_RESIDUAL_PRED
    1117                   rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    1118 #endif
    1119 #if HHI_INTERVIEW_SKIP
    1120                   xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU, bFullyRenderedSec );
    1121 #else
    1122                   xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU );
    1123 #endif
    1124                   rpcTempCU->initEstData( uiDepth, iQP );
    1125                   if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_2NxnU )
    1126                   {
    1127                     doNotBlockPu = rpcBestCU->getQtRootCbf( 0 ) != 0;
    1128                   }
    1129                 }
    1130                 if(doNotBlockPu)
    1131                 {
    1132 #if HHI_INTER_VIEW_RESIDUAL_PRED
    1133                   rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    1134 #endif
    1135 #if HHI_INTERVIEW_SKIP
    1136                   xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD, bFullyRenderedSec );
    1137 #else
    1138                   xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD );
    1139 #endif
    1140                   rpcTempCU->initEstData( uiDepth, iQP );
    1141                   if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_2NxnD )
    1142                   {
    1143                     doNotBlockPu = rpcBestCU->getQtRootCbf( 0 ) != 0;
    1144                   }
    1145                 }
    1146               }
    1147 #endif
    1148             }
    1149 #if AMP_MRG
    1150             else if ( bTestMergeAMP_Hor )
    1151             {
    1152 #if OL_DEPTHLIMIT_A0044 //add code here to select 2NxN or Nx2N or none
    1153 #if OL_DO_NOT_LIMIT_INTRA_SLICES_PART
    1154               if(depthMapDetect && !bIntraSliceDetect  && sps->getUseDPL())
    1155 #else
    1156               if(depthMapDetect  && sps->getUseDPL()) //depth map being encoded
    1157 #endif
    1158               {
    1159                 if (bTry2NxN)
     986#if OL_QTLIMIT_PREDCODING_B0068 //try 2NxnU & 2NxnD Merge
     987                if(bTry2NxN)
    1160988                {
    1161989#endif
     
    11921020                    }
    11931021                  }
    1194 #if OL_DEPTHLIMIT_A0044
    1195                 }//bTry2NxN
    1196               }//depthMapDetect
    1197               else//do things normally
     1022#if OL_QTLIMIT_PREDCODING_B0068
     1023                }
     1024#endif
     1025              }
     1026#endif
     1027
     1028              //! Do horizontal AMP
     1029              if ( bTestAMP_Ver )
    11981030              {
    1199                 if(doNotBlockPu)
    1200                 {
    1201 #if HHI_INTER_VIEW_RESIDUAL_PRED
    1202                   rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    1203 #endif
    1204 #if HHI_INTERVIEW_SKIP
    1205                   xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU, bFullyRenderedSec, true );
    1206 #else
    1207                   xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU, true );
    1208 #endif
    1209                   rpcTempCU->initEstData( uiDepth, iQP );
    1210                   if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_2NxnU )
    1211                   {
    1212                     doNotBlockPu = rpcBestCU->getQtRootCbf( 0 ) != 0;
    1213                   }
    1214                 }
    1215                 if(doNotBlockPu)
    1216                 {
    1217 #if HHI_INTER_VIEW_RESIDUAL_PRED
    1218                   rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    1219 #endif
    1220 #if HHI_INTERVIEW_SKIP
    1221                   xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD, bFullyRenderedSec, true );
    1222 #else
    1223                   xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD, true );
    1224 #endif
    1225                   rpcTempCU->initEstData( uiDepth, iQP );
    1226                   if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_2NxnD )
    1227                   {
    1228                     doNotBlockPu = rpcBestCU->getQtRootCbf( 0 ) != 0;
    1229                   }
    1230                 }
    1231 
    1232               }
    1233 #endif
    1234             }
    1235 #endif
    1236 
    1237             //! Do horizontal AMP
    1238             if ( bTestAMP_Ver )
    1239             {
    1240 #if OL_DEPTHLIMIT_A0044 //add code here to select 2NxN or Nx2N or none
    1241 #if OL_DO_NOT_LIMIT_INTRA_SLICES_PART
    1242               if(depthMapDetect && !bIntraSliceDetect  && sps->getUseDPL())
    1243 #else
    1244               if(depthMapDetect  && sps->getUseDPL()) //depth map being encoded
    1245 #endif
    1246               {
    1247                 if (bTryNx2N)
     1031#if OL_QTLIMIT_PREDCODING_B0068 //try nLx2N & nRx2N
     1032                if(bTryNx2N)
    12481033                {
    12491034#endif
     
    12761061                    rpcTempCU->initEstData( uiDepth, iQP );
    12771062                  }
    1278 #if OL_DEPTHLIMIT_A0044
    1279                 }//bTryNx2N
    1280               }//depthMapDetect
    1281               else//do things normally
     1063#if OL_QTLIMIT_PREDCODING_B0068
     1064                }
     1065#endif
     1066              }
     1067#if AMP_MRG
     1068              else if ( bTestMergeAMP_Ver )
    12821069              {
    1283                 if(doNotBlockPu)
    1284                 {
    1285 #if HHI_INTER_VIEW_RESIDUAL_PRED
    1286                   rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    1287 #endif
    1288 #if HHI_INTERVIEW_SKIP
    1289                   xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N, bFullyRenderedSec );
    1290 #else
    1291                   xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N );
    1292 #endif
    1293                   rpcTempCU->initEstData( uiDepth, iQP );
    1294                   if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_nLx2N )
    1295                   {
    1296                     doNotBlockPu = rpcBestCU->getQtRootCbf( 0 ) != 0;
    1297                   }
    1298                 }
    1299                 if(doNotBlockPu)
    1300                 {
    1301 #if HHI_INTER_VIEW_RESIDUAL_PRED
    1302                   rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    1303 #endif
    1304 #if HHI_INTERVIEW_SKIP
    1305                   xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N, bFullyRenderedSec );
    1306 #else
    1307                   xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N );
    1308 #endif
    1309                   rpcTempCU->initEstData( uiDepth, iQP );
    1310                 }
    1311               }
    1312 #endif
    1313             }
    1314 #if AMP_MRG
    1315             else if ( bTestMergeAMP_Ver )
    1316             {
    1317 #if OL_DEPTHLIMIT_A0044 //add code here to select 2NxN or Nx2N or none
    1318 #if OL_DO_NOT_LIMIT_INTRA_SLICES_PART
    1319               if(depthMapDetect && !bIntraSliceDetect  && sps->getUseDPL())
    1320 #else
    1321               if(depthMapDetect  && sps->getUseDPL()) //depth map being encoded
    1322 #endif
    1323               {
    1324                 if (bTryNx2N)
     1070#if OL_QTLIMIT_PREDCODING_B0068 //try nLx2N & nRx2N (Merge)
     1071                if(bTryNx2N)
    13251072                {
    13261073#endif
     
    13531100                    rpcTempCU->initEstData( uiDepth, iQP );
    13541101                  }
    1355 #if OL_DEPTHLIMIT_A0044
    1356                 }//bTryNx2N
    1357               }//depthMapDetect
    1358               else//do things normally
    1359               {
    1360                 if(doNotBlockPu)
    1361                 {
    1362 #if HHI_INTER_VIEW_RESIDUAL_PRED
    1363                   rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
     1102#if OL_QTLIMIT_PREDCODING_B0068
     1103                }
     1104#endif
     1105              }
     1106#endif
     1107
     1108#else
     1109#if HHI_INTER_VIEW_RESIDUAL_PRED
     1110              rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    13641111#endif
    13651112#if HHI_INTERVIEW_SKIP
    1366                   xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N, bFullyRenderedSec, true );
    1367 #else
    1368                   xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N, true );
    1369 #endif
    1370                   rpcTempCU->initEstData( uiDepth, iQP );
    1371                   if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_nLx2N )
    1372                   {
    1373                     doNotBlockPu = rpcBestCU->getQtRootCbf( 0 ) != 0;
    1374                   }
    1375                 }
    1376                 if(doNotBlockPu)
    1377                 {
    1378 #if HHI_INTER_VIEW_RESIDUAL_PRED
    1379                   rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
     1113              xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU, bFullyRenderedSec );
     1114#else
     1115              xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU );
     1116#endif
     1117              rpcTempCU->initEstData( uiDepth, iQP );
     1118#if HHI_INTER_VIEW_RESIDUAL_PRED
     1119              rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    13801120#endif
    13811121#if HHI_INTERVIEW_SKIP
    1382                   xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N, bFullyRenderedSec, true );
    1383 #else
    1384                   xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N, true );
    1385 #endif
    1386                   rpcTempCU->initEstData( uiDepth, iQP );
    1387                 }
    1388               }
    1389 #endif
    1390             }
    1391 #endif
    1392 
    1393 #else
    1394 #if HHI_INTER_VIEW_RESIDUAL_PRED
    1395             rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
     1122              xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD, bFullyRenderedSec );
     1123#else
     1124              xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD );
     1125#endif
     1126              rpcTempCU->initEstData( uiDepth, iQP );
     1127#if HHI_INTER_VIEW_RESIDUAL_PRED
     1128              rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    13961129#endif
    13971130#if HHI_INTERVIEW_SKIP
    1398             xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU, bFullyRenderedSec );
    1399 #else
    1400             xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU );
    1401 #endif
    1402             rpcTempCU->initEstData( uiDepth, iQP );
    1403 #if HHI_INTER_VIEW_RESIDUAL_PRED
    1404             rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
     1131              xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N, bFullyRenderedSec );
     1132#else
     1133              xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N );
     1134#endif
     1135              rpcTempCU->initEstData( uiDepth, iQP );
     1136#if HHI_INTER_VIEW_RESIDUAL_PRED
     1137              rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    14051138#endif
    14061139#if HHI_INTERVIEW_SKIP
    1407             xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD, bFullyRenderedSec );
    1408 #else
    1409             xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD );
    1410 #endif
    1411             rpcTempCU->initEstData( uiDepth, iQP );
    1412 #if HHI_INTER_VIEW_RESIDUAL_PRED
    1413             rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    1414 #endif
    1415 #if HHI_INTERVIEW_SKIP
    1416             xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N, bFullyRenderedSec );
    1417 #else
    1418             xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N );
    1419 #endif
    1420             rpcTempCU->initEstData( uiDepth, iQP );
    1421 #if HHI_INTER_VIEW_RESIDUAL_PRED
    1422             rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    1423 #endif
    1424 #if HHI_INTERVIEW_SKIP
    1425             xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N, bFullyRenderedSec );
    1426 #else
    1427             xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N );
    1428 #endif
    1429             rpcTempCU->initEstData( uiDepth, iQP );
    1430 
    1431 #endif
    1432           } //! Try AMP (SIZE_2NxnU, SIZE_2NxnD, SIZE_nLx2N, SIZE_nRx2N)
     1140              xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N, bFullyRenderedSec );
     1141#else
     1142              xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N );
     1143#endif
     1144              rpcTempCU->initEstData( uiDepth, iQP );
     1145
     1146#endif
     1147            } //! Try AMP (SIZE_2NxnU, SIZE_2NxnD, SIZE_nLx2N, SIZE_nRx2N)
     1148#endif
     1149#if LGE_ILLUCOMP_B0045
     1150         }
    14331151#endif
    14341152#if HHI_INTER_VIEW_RESIDUAL_PRED
     
    14571175#endif
    14581176        {
     1177#if LGE_ILLUCOMP_B0045
     1178          rpcTempCU->setICFlagSubParts(false, 0, 0, uiDepth);
     1179#endif
    14591180          xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_2Nx2N );
    14601181          rpcTempCU->initEstData( uiDepth, iQP );
    14611182          if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth )
    14621183          {
    1463 #if OL_DEPTHLIMIT_A0044 //add code here to select or deselect NxN mode for Intra
    1464 #if OL_DO_NOT_LIMIT_INTRA_SLICES_PART
    1465             if(depthMapDetect && !bIntraSliceDetect  && sps->getUseDPL())
    1466 #else
    1467             if(depthMapDetect  && sps->getUseDPL()) //depth map being encoded
    1468 #endif
     1184#if OL_QTLIMIT_PREDCODING_B0068 //Try IntraNxN
     1185            if(bTrySplit)
    14691186            {
    1470               if (bTrySplit)
    1471               {
    1472 
    1473 #endif
    1474                 if( rpcTempCU->getWidth(0) > ( 1 << rpcTempCU->getSlice()->getSPS()->getQuadtreeTULog2MinSize() ) )
    1475                 {
    1476                   xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_NxN   );
    1477                   rpcTempCU->initEstData( uiDepth, iQP );
    1478                 }
    1479 #if OL_DEPTHLIMIT_A0044
    1480               }//bTrySplit
    1481             }//depthMapDetect
    1482             else
    1483             {
     1187#endif
    14841188              if( rpcTempCU->getWidth(0) > ( 1 << rpcTempCU->getSlice()->getSPS()->getQuadtreeTULog2MinSize() ) )
    14851189              {
     1190#if LGE_ILLUCOMP_B0045
     1191                rpcTempCU->setICFlagSubParts(false, 0, 0, uiDepth);
     1192#endif
    14861193                xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_NxN   );
    14871194                rpcTempCU->initEstData( uiDepth, iQP );
    14881195              }
     1196#if OL_QTLIMIT_PREDCODING_B0068
    14891197            }
    14901198#endif
     
    15071215#endif
    15081216        {
     1217#if LGE_ILLUCOMP_B0045
     1218          rpcTempCU->setICFlagSubParts(false, 0, 0, uiDepth);
     1219#endif
    15091220          xCheckIntraPCM (rpcBestCU, rpcTempCU);
    15101221          rpcTempCU->initEstData( uiDepth, iQP );
     
    16941405
    16951406#if HHI_VSO
    1696 #if HHI_VSO_SET_OPTIM
    1697 #else
    1698           if( m_pcRdCost->getUseRenModel() ) // necessary ??
    1699           {
    1700             UInt  uiWidth     = m_ppcRecoYuvBest[uhNextDepth]->getWidth   (  );
    1701             UInt  uiHeight    = m_ppcRecoYuvBest[uhNextDepth]->getHeight  (   );
    1702             Pel*  piSrc       = m_ppcRecoYuvBest[uhNextDepth]->getLumaAddr( 0 );
    1703             UInt  uiSrcStride = m_ppcRecoYuvBest[uhNextDepth]->getStride  (   );
    1704             m_pcRdCost->setRenModelData( pcSubBestPartCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );
    1705           }
    1706 #endif
    17071407#endif
    17081408        }
     
    21451845#if HHI_MPI
    21461846  if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == -1 )
    2147 {
     1847  {
    21481848#endif
    21491849  if( !pcCU->getSlice()->isIntra() )
     
    21641864  }
    21651865#if HHI_MPI
    2166 }
     1866  }
    21671867#endif
    21681868 
     
    21721872#endif
    21731873  {
    2174 #if OL_DEPTHLIMIT_A0044
    2175     if(pcCU->getPartDumpFlag())
    2176     {
    2177       pcCU->updatePartInfo(0,uiDepth);
    2178       pcCU->incrementPartInfo();
    2179     }
    2180 #endif
    21811874    m_pcEntropyCoder->encodeMergeIndex( pcCU, uiAbsPartIdx, 0 );
     1875#if LGE_ILLUCOMP_B0045
     1876    m_pcEntropyCoder->encodeICFlag  ( pcCU, uiAbsPartIdx );
     1877#endif
    21821878#if HHI_INTER_VIEW_RESIDUAL_PRED
    21831879    m_pcEntropyCoder->encodeResPredFlag( pcCU, uiAbsPartIdx, 0 );
     
    22171913  // prediction Info ( Intra : direction mode, Inter : Mv, reference idx )
    22181914  m_pcEntropyCoder->encodePredInfo( pcCU, uiAbsPartIdx );
     1915#if LGE_ILLUCOMP_B0045
     1916    m_pcEntropyCoder->encodeICFlag  ( pcCU, uiAbsPartIdx );
     1917#endif
    22191918#if HHI_INTER_VIEW_RESIDUAL_PRED
    22201919    if( !pcCU->isIntra( uiAbsPartIdx ) )
     
    22601959  Bool  bResPrdAvail  = rpcTempCU->getResPredAvail( 0 );
    22611960  Bool  bResPrdFlag   = rpcTempCU->getResPredFlag ( 0 );
     1961#endif
     1962#if LGE_ILLUCOMP_B0045
     1963  Bool  bICFlag = rpcTempCU->getICFlag(0);
    22621964#endif
    22631965
     
    23352037          rpcTempCU->setResPredFlagSubParts ( bResPrdFlag,  0, 0, uhDepth );
    23362038#endif
     2039#if LGE_ILLUCOMP_B0045
     2040          rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uhDepth);
     2041#endif
    23372042
    23382043          // do MC
    23392044#if HHI_INTERVIEW_SKIP
    2340       if ( (uiNoResidual == 0) || bSkipRes ){
    2341 #else
    2342       if ( uiNoResidual == 0 ){
    2343 #endif
     2045      if ( (uiNoResidual == 0) || bSkipRes )
     2046#else
     2047      if ( uiNoResidual == 0 )
     2048#endif
     2049        {
    23442050            m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] );
    23452051            // save pred adress
     
    25842290  m_ppcRecoYuvTemp[uiDepth]->copyToPicLuma(rpcTempCU->getPic()->getPicYuvRec(), rpcTempCU->getAddr(), rpcTempCU->getZorderIdxInCU() );
    25852291 
     2292#if RWTH_SDC_DLT_B0036
     2293  if( !rpcTempCU->getSDCFlag( 0 ) )
     2294#endif
    25862295  m_pcPredSearch  ->estIntraPredChromaQT( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC );
    25872296 
     
    30522761  assert( bRecursiveCall == ( uhDepth != uhTextureModeDepth ) );
    30532762
     2763#if !MTK_UNCONSTRAINED_MVI_B0083
    30542764  if( uhDepth == uhTextureModeDepth )
    30552765  {
     
    30922802    }
    30932803  }
     2804#endif
    30942805
    30952806#if HHI_VSO
     
    31972908    rpcTempCU->setTextureModeDepthSubParts( uhTextureModeDepth, 0, uhDepth );
    31982909    rpcTempCU->copyTextureMotionDataFrom( pcTextureCU, uhDepth, rpcTempCU->getZorderIdxInCU() );
     2910#if FIX_MPI_B0065
     2911    UInt uiAbsPartIdx = rpcTempCU->getZorderIdxInCU();
     2912    if( rpcTempCU->getDepth(0) > pcTextureCU->getDepth(uiAbsPartIdx))
     2913    {
     2914      rpcTempCU->setPartSizeSubParts( SIZE_NxN, 0, uhDepth );
     2915    }
     2916    else
     2917    {
     2918      PartSize partSize = pcTextureCU->getPartitionSize(uiAbsPartIdx);
     2919      rpcTempCU->setPartSizeSubParts( partSize, 0, uhDepth );
     2920    }
     2921#else
    31992922    rpcTempCU->setPartSizeSubParts( SIZE_NxN, 0, uhDepth );
     2923#endif
    32002924    for( UInt ui = 0; ui < rpcTempCU->getTotalNumPart(); ui++ )
    32012925    {
     
    33023026  {
    33033027    m_pcEntropyCoder->encodeMergeIndex( pcCU, 0, 0, true );
     3028#if LGE_ILLUCOMP_B0045
     3029    m_pcEntropyCoder->encodeICFlag( pcCU, 0, true );
     3030#endif
    33043031  }
    33053032  else
     
    33093036    // prediction Info ( Intra : direction mode, Inter : Mv, reference idx )
    33103037    m_pcEntropyCoder->encodePredInfo( pcCU, 0, true );
     3038#if LGE_ILLUCOMP_B0045
     3039    m_pcEntropyCoder->encodeICFlag( pcCU, 0,          true );
     3040#endif
    33113041  }
    33123042  xRestoreDepthWidthHeight( pcCU );
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp

    r193 r213  
    121121}
    122122
    123 #if VIDYO_VPS_INTEGRATION
     123#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    124124Void TEncEntropy::encodeVPS( TComVPS* pcVPS )
    125125{
     
    129129#endif
    130130
    131 #if VIDYO_VPS_INTEGRATION
     131#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    132132Void  codeVPS                 ( TComVPS* pcVPS );
    133133#endif
     
    169169}
    170170
     171#if LGE_ILLUCOMP_B0045
     172Void TEncEntropy::encodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
     173{
     174  if (pcCU->isIntra(uiAbsPartIdx) || (pcCU->getSlice()->getViewId() == 0) || pcCU->getSlice()->getSPS()->isDepth())
     175  {
     176    return;
     177  }
     178
     179  if(!pcCU->getSlice()->getApplyIC())
     180    return;
     181
     182  if( bRD )
     183  {
     184    uiAbsPartIdx = 0;
     185  }
     186
     187  if(pcCU->isICFlagRequired(uiAbsPartIdx))
     188    m_pcEntropyCoderIf->codeICFlag( pcCU, uiAbsPartIdx );
     189}
     190#endif
    171191
    172192#if FORCE_REF_VSP==1
     
    900920#endif
    901921
     922#if !RWTH_SDC_DLT_B0036
    902923  if ( pcCU->getSlice()->isIntra() )
    903924  {
    904925    return;
    905926  }
     927#endif
    906928
    907929  m_pcEntropyCoderIf->codePredMode( pcCU, uiAbsPartIdx );
     930 
     931#if RWTH_SDC_DLT_B0036
     932  // if B-Slice, code SDC flag later
     933  if( !pcCU->getSlice()->isInterB() && pcCU->getSlice()->getSPS()->isDepth() && pcCU->isIntra(uiAbsPartIdx) )
     934  {
     935    // encode SDC flag
     936    encodeSDCFlag(pcCU, uiAbsPartIdx, bRD);
     937  }
     938#endif
    908939}
    909940
     
    950981  }
    951982#endif 
     983#if RWTH_SDC_DLT_B0036
     984  if( !pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSDCFlag(uiAbsPartIdx)  )
     985  {
     986    assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
     987    return;
     988  }
     989#endif
     990 
    952991  m_pcEntropyCoderIf->codePartSize( pcCU, uiAbsPartIdx, uiDepth );
     992 
     993#if RWTH_SDC_DLT_B0036
     994  // code SDC flag now!
     995  if( pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSlice()->getSPS()->isDepth() )
     996  {
     997    // encode SDC flag
     998    encodeSDCFlag(pcCU, uiAbsPartIdx, bRD);
     999   
     1000    if( pcCU->getSDCFlag(uiAbsPartIdx) )
     1001    {
     1002      // part size is also known for SDC intra
     1003      assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
     1004    }
     1005  }
     1006#endif
    9531007}
    9541008
     
    9671021    return;
    9681022  }
     1023 
     1024#if RWTH_SDC_DLT_B0036
     1025  if( pcCU->getSDCFlag(uiAbsPartIdx) )
     1026  {
     1027    return;
     1028  }
     1029#endif
    9691030 
    9701031  if( bRD )
     
    13011362    uiAbsPartIdx = 0;
    13021363  }
     1364 
     1365#if RWTH_SDC_DLT_B0036
     1366  if( pcCU->getSDCFlag(uiAbsPartIdx) )
     1367  {
     1368    encodeSDCPredMode(pcCU, uiAbsPartIdx, bRD);
     1369    return;
     1370  }
     1371#endif
    13031372
    13041373#if FORCE_REF_VSP==1
     
    16471716  pcCU->convertTransIdx( uiAbsPartIdx, pcCU->getTransformIdx(uiAbsPartIdx), uiLumaTrMode, uiChromaTrMode );
    16481717 
     1718#if RWTH_SDC_DLT_B0036
     1719  if( pcCU->getSDCFlag( uiAbsPartIdx ) )
     1720  {
     1721    assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
     1722    assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 );
     1723    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 );
     1724    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
     1725    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
     1726   
     1727    encodeSDCResidualData(pcCU, uiAbsPartIdx);
     1728    return;
     1729  }
     1730#endif
     1731 
    16491732  if( pcCU->isIntra(uiAbsPartIdx) )
    16501733  {
     
    16901773  }
    16911774 
     1775#if FIX_MPI_B0065
     1776  if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER && pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getMergeIndex( uiAbsPartIdx ) == 0 && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N && pcCU->getTextureModeDepth( uiAbsPartIdx ) != -1 )
     1777  {
     1778    TComDataCU *pcTextureCU = pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() );
     1779    if( uiDepth == pcTextureCU->getDepth(uiAbsPartIdx))
     1780    {
     1781      PartSize partSize = pcTextureCU->getPartitionSize(uiAbsPartIdx);
     1782      pcCU->setPartSizeSubParts( partSize, uiAbsPartIdx, uiDepth );
     1783    }
     1784    else
     1785    {
     1786      pcCU->setPartSizeSubParts( SIZE_NxN, uiAbsPartIdx, uiDepth );
     1787    }
     1788  }
     1789#endif
     1790
    16921791#if UNIFIED_TRANSFORM_TREE
    16931792  UInt temp = 0;
     
    16981797  xEncodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, uiLumaTrMode, bCodeDQP );
    16991798#endif // UNIFIED_TRANSFORM_TREE
     1799
     1800#if FIX_MPI_B0065
     1801  if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER && pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getMergeIndex( uiAbsPartIdx ) == 0 && pcCU->getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N &&  pcCU->getTextureModeDepth( uiAbsPartIdx ) != -1 )
     1802  {
     1803    pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 
     1804  }
     1805#endif
    17001806}
    17011807
     
    20222128}
    20232129
     2130#if RWTH_SDC_DLT_B0036
     2131Void TEncEntropy::encodeSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
     2132{
     2133  assert( pcCU->getSlice()->getSPS()->isDepth() );
     2134 
     2135  if( bRD )
     2136    uiAbsPartIdx = 0;
     2137 
     2138  m_pcEntropyCoderIf->codeSDCPredMode(pcCU, uiAbsPartIdx);
     2139}
     2140
     2141Void TEncEntropy::encodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
     2142{
     2143  assert( pcCU->getSlice()->getSPS()->isDepth() );
     2144 
     2145  if( bRD )
     2146    uiAbsPartIdx = 0;
     2147 
     2148  m_pcEntropyCoderIf->codeSDCFlag(pcCU, uiAbsPartIdx);
     2149}
     2150
     2151Void TEncEntropy::encodeSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
     2152{
     2153  assert( pcCU->getSlice()->getSPS()->isDepth() );
     2154  assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 );
     2155  assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
     2156  assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
     2157  assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 );
     2158 
     2159  if( bRD )
     2160    uiAbsPartIdx = 0;
     2161 
     2162  // number of segments depends on prediction mode for INTRA
     2163  UInt uiNumSegments = 2;
     2164  UInt uiLumaPredMode = pcCU->getLumaIntraDir( uiAbsPartIdx );
     2165  if( uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX )
     2166    uiNumSegments = 1;
     2167 
     2168  // encode residual data for each segment
     2169  for( UInt uiSeg = 0; uiSeg < uiNumSegments; uiSeg++ )
     2170    m_pcEntropyCoderIf->codeSDCResidualData(pcCU, uiAbsPartIdx, uiSeg);
     2171}
     2172#endif
     2173
    20242174//! \}
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncEntropy.h

    r166 r213  
    7676  virtual UInt  getCoeffCost          ()                = 0;
    7777
    78 #if VIDYO_VPS_INTEGRATION
     78#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    7979  virtual Void  codeVPS                 ( TComVPS* pcVPS )                                      = 0;
    8080#endif
     
    115115 
    116116  virtual Void codeSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
     117#if LGE_ILLUCOMP_B0045
     118  virtual Void codeICFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
     119#endif
    117120#if FORCE_REF_VSP==1
    118121  virtual Void codeVspFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
     
    127130  virtual Void codePartSize      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    128131  virtual Void codePredMode      ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
     132 
     133#if RWTH_SDC_DLT_B0036
     134  virtual Void codeSDCFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
     135  virtual Void codeSDCResidualData  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ) = 0;
     136  virtual Void codeSDCPredMode          ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
     137#endif
    129138 
    130139#if BURST_IPCM
     
    236245 
    237246public:
    238 #if VIDYO_VPS_INTEGRATION
     247#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    239248  Void encodeVPS               ( TComVPS* pcVPS);
    240249#endif
     
    253262 
    254263  Void encodeSplitFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool bRD = false );
     264#if LGE_ILLUCOMP_B0045
     265  Void encodeICFlag            ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
     266#endif
    255267  Void encodeSkipFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
    256268#if FORCE_REF_VSP==1
     
    302314  Void encodeScalingList       ( TComScalingList* scalingList );
    303315  Void encodeDFParams          (TComAPS* pcAPS);
     316 
     317#if RWTH_SDC_DLT_B0036
     318  Void encodeSDCFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
     319  Void encodeSDCResidualData  ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
     320  Void encodeSDCPredMode   ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
     321#endif
    304322
    305323private:
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncGOP.cpp

    r193 r213  
    246246
    247247      std::vector<TComAPS>& vAPS = m_pcEncTop->getAPS();
    248 #if VIDYO_VPS_INTEGRATION
     248#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    249249    m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, uiPOCCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getEncTop()->getVPS(), m_pcEncTop->getSPS(), m_pcEncTop->getPPS() );
    250250#else
     
    298298      if( pcSlice->getSliceType() == B_SLICE )
    299299      {
    300         if( m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) { pcSlice->setSliceType( P_SLICE ); }
    301       }
     300#if QC_REM_IDV_B0046
     301      if( m_pcCfg->getGOPEntry(pcSlice->getSPS()->getViewId() && ((getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDR) || (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_CRA))? MAX_GOP : iGOPid ).m_sliceType == 'P' ) { pcSlice->setSliceType( P_SLICE ); }
     302#else
     303      if( m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) { pcSlice->setSliceType( P_SLICE ); }
     304#endif
     305    }
    302306
    303307      // Set the nal unit type
     
    333337
    334338#if VSP_SLICE_HEADER && VSP_CFG
     339#if QC_REM_IDV_B0046
     340      pcSlice->setNumVspRefPics( m_pcCfg->getGOPEntry( pcSlice->getSPS()->getViewId() && ((getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDR) || (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_CRA))? MAX_GOP : iGOPid ).m_numVSPRefPics );
     341#else
    335342      pcSlice->setNumVspRefPics( m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_numVSPRefPics );
     343#endif
    336344      pcSlice->setVspFlag( m_pcEncTop->getUseVSP() && pcSlice->getNumVspRefPics() > 0 );
    337345      for( UInt i = 0; i < pcSlice->getNumVspRefPics(); i++ )
    338346      {
     347#if QC_REM_IDV_B0046
     348        pcSlice->setVspRefPos( REF_PIC_LIST_0, i, m_pcCfg->getGOPEntry( pcSlice->getSPS()->getViewId() && ((getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDR) || (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_CRA))? MAX_GOP : iGOPid ).m_VSPRefPosL0[i] );
     349#else
    339350        pcSlice->setVspRefPos( REF_PIC_LIST_0, i, m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_VSPRefPosL0[i] );
     351#endif
    340352        if( pcSlice->getSliceType() == B_SLICE )
    341353        {
     354#if QC_REM_IDV_B0046
     355          pcSlice->setVspRefPos( REF_PIC_LIST_1, i, m_pcCfg->getGOPEntry( pcSlice->getSPS()->getViewId() && ((getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDR) || (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_CRA))? MAX_GOP : iGOPid ).m_VSPRefPosL1[i] );
     356#else
    342357          pcSlice->setVspRefPos( REF_PIC_LIST_1, i, m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_VSPRefPosL1[i] );
     358#endif
    343359        }
    344360      }
     
    361377                                || pcSlice->getVspRefPos( REF_PIC_LIST_1, 0 ) == 0
    362378                              ) ? 0 : 1 );
     379#if !QC_REM_IDV_B0046
    363380      pcSlice->setNumRefIdx( REF_PIC_LIST_0, min( m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_numRefPicsActive + NumberOfVspRefsL0, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs() + NumberOfVspRefsL0) ) );
    364381      pcSlice->setNumRefIdx( REF_PIC_LIST_1, min( m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_numRefPicsActive + NumberOfVspRefsL1, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs() + NumberOfVspRefsL1) ) );
     382#else
     383      Bool bNalRAP = ((getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_CRA) || (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDR)) && (pcSlice->getSPS()->getViewId())  ? 1: 0;
     384      pcSlice->setNumRefIdx( REF_PIC_LIST_0, min( m_pcCfg->getGOPEntry( bNalRAP ? MAX_GOP : iGOPid ).m_numRefPicsActive + NumberOfVspRefsL0, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs() + NumberOfVspRefsL0) ) );
     385      pcSlice->setNumRefIdx( REF_PIC_LIST_1, min( m_pcCfg->getGOPEntry( bNalRAP ? MAX_GOP : iGOPid ).m_numRefPicsActive + NumberOfVspRefsL1, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs() + NumberOfVspRefsL1) ) );
     386#endif
    365387#else
    366388      Int NumberOfVspRefs = ( ( pcPic->getViewId()==0
    367389                                || (m_pcEncTop->getVSPDepthDisable() && m_pcEncTop->getIsDepth())
    368390#if VSP_SLICE_HEADER
    369                                 || !pcSlice->getVspFlag()
     391                                || !m_pcEncTop->getUseVSP()
    370392#endif
    371393                              ) ? 0 : 1 );
     394#if !QC_REM_IDV_B0046
    372395      pcSlice->setNumRefIdx( REF_PIC_LIST_0, min( m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_numRefPicsActive + NumberOfVspRefs, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs() + NumberOfVspRefs) ) );
    373396      pcSlice->setNumRefIdx( REF_PIC_LIST_1, min( m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_numRefPicsActive + NumberOfVspRefs, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs() + NumberOfVspRefs) ) );
    374 #endif
    375 #else
     397#else
     398      Bool bNalRAP = ((getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_CRA) || (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDR)) && (pcSlice->getSPS()->getViewId())  ? 1: 0;
     399      pcSlice->setNumRefIdx( REF_PIC_LIST_0, min( m_pcCfg->getGOPEntry( bNalRAP ? MAX_GOP : iGOPid ).m_numRefPicsActive + NumberOfVspRefsL0, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs() + NumberOfVspRefsL0) ) );
     400      pcSlice->setNumRefIdx( REF_PIC_LIST_1, min( m_pcCfg->getGOPEntry( bNalRAP ? MAX_GOP : iGOPid ).m_numRefPicsActive + NumberOfVspRefsL1, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs() + NumberOfVspRefsL1) ) );
     401#endif
     402#endif
     403#else
     404#if !QC_REM_IDV_B0046
    376405      pcSlice->setNumRefIdx( REF_PIC_LIST_0, min( m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_numRefPicsActive, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs()) ) );
    377406      pcSlice->setNumRefIdx( REF_PIC_LIST_1, min( m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_numRefPicsActive, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs()) ) );
    378 #endif
    379 
     407#else
     408
     409    Bool bNalRAP = ((getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_CRA) || (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDR)) && (pcSlice->getSPS()->getViewId())  ? 1: 0;
     410    pcSlice->setNumRefIdx( REF_PIC_LIST_0, min( m_pcCfg->getGOPEntry( bNalRAP ? MAX_GOP : iGOPid ).m_numRefPicsActive, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs()) ) );
     411    pcSlice->setNumRefIdx( REF_PIC_LIST_1, min( m_pcCfg->getGOPEntry( bNalRAP ? MAX_GOP : iGOPid ).m_numRefPicsActive, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs()) ) );
     412#endif
     413#endif
    380414      TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification();
    381415      refPicListModification->setRefPicListModificationFlagL0( false );
     
    396430      assert( tAppEncTop != NULL );
    397431
     432
     433#if FLEX_CODING_ORDER_M23723
     434      TComPic * pcTexturePic;
     435      if(m_pcEncTop->getIsDepth() == 1)
     436      {
     437        TComPicYuv * recText;
     438        recText = tAppEncTop->getPicYuvFromView(m_pcEncTop->getViewId(), pcSlice->getPOC(), false ,true);
     439        if(recText == NULL)
     440        {
     441           pcSlice->setTexturePic(NULL);
     442        }
     443        else
     444        {
     445           pcTexturePic = m_pcEncTop->getIsDepth() ? tAppEncTop->getPicFromView( m_pcEncTop->getViewId(), pcSlice->getPOC(), false ) : NULL;
     446           pcSlice->setTexturePic( pcTexturePic );
     447        }
     448      }
     449      else
     450    {
     451        pcTexturePic = m_pcEncTop->getIsDepth() ? tAppEncTop->getPicFromView( m_pcEncTop->getViewId(), pcSlice->getPOC(), false ) : NULL;
     452        assert( !m_pcEncTop->getIsDepth() || pcTexturePic != NULL );
     453          pcSlice->setTexturePic( pcTexturePic );
     454      }
     455
     456#else
    398457      TComPic * const pcTexturePic = m_pcEncTop->getIsDepth() ? tAppEncTop->getPicFromView( m_pcEncTop->getViewId(), pcSlice->getPOC(), false ) : NULL;
    399458      assert( !m_pcEncTop->getIsDepth() || pcTexturePic != NULL );
    400459      pcSlice->setTexturePic( pcTexturePic );
    401460
     461#endif
    402462      std::vector<TComPic*> apcInterViewRefPics = tAppEncTop->getInterViewRefPics( m_pcEncTop->getViewId(), pcSlice->getPOC(), m_pcEncTop->getIsDepth(), pcSlice->getSPS() );
    403463#if VSP_N
     
    418478        m_pcEncTop->getVSPBuf()->getCurrSlice()->setPOC( pcPic->getPOC() );
    419479        m_pcEncTop->getVSPBuf()->getCurrSlice()->setViewId( pcPic->getViewId() );
     480        m_pcEncTop->getVSPBuf()->getCurrSlice()->setViewOrderIdx( m_pcEncTop->getViewOrderIdx() );
    420481      }
    421482
     
    435496      if( pcSlice->getSliceType() == B_SLICE )
    436497      {
     498#if !QC_REM_IDV_B0046
    437499        if( m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) { pcSlice->setSliceType( P_SLICE ); }
     500#else
     501      Bool bRAP = ((getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_CRA) || (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDR)) && (pcSlice->getSPS()->getViewId())  ? 1: 0;
     502      if( m_pcCfg->getGOPEntry( bRAP ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) { pcSlice->setSliceType( P_SLICE ); }
     503#endif
    438504      }
    439505     
     
    521587#endif
    522588
    523 #if HHI_VSO_SPEEDUP_A0033
    524 #else
    525     if ( iVSOMode == 4 )
    526     {
    527       m_pcEncTop->getEncTop()->setupRenModel( pcSlice->getPOC(), pcSlice->getViewId(), m_pcEncTop->isDepthCoder() ? 1 : 0 );
    528     }
    529     else
    530     {
    531       AOT(true);
    532     }
    533 #endif
    534589
    535590#if SAIT_VSO_EST_A0033
    536     m_pcRdCost->setVideoRecPicYuv( m_pcEncTop->getEncTop()->getPicYuvFromView( pcSlice->getViewId(), pcSlice->getPOC(), false, true ) );
    537     m_pcRdCost->setDepthPicYuv   ( m_pcEncTop->getEncTop()->getPicYuvFromView( pcSlice->getViewId(), pcSlice->getPOC(), true, false ) );
     591#ifdef FLEX_CODING_ORDER_M23723   
     592{
     593  Bool flagRec;
     594  flagRec =  ((m_pcEncTop->getEncTop()->getPicYuvFromView( pcSlice->getViewId(), pcSlice->getPOC(), false, true) == NULL) ? false: true);
     595  m_pcRdCost->setVideoRecPicYuv( m_pcEncTop->getEncTop()->getPicYuvFromView( pcSlice->getViewId(), pcSlice->getPOC(), false, flagRec ) );
     596  m_pcRdCost->setDepthPicYuv   ( m_pcEncTop->getEncTop()->getPicYuvFromView( pcSlice->getViewId(), pcSlice->getPOC(), true, false ) );
     597}
     598#else
     599  m_pcRdCost->setVideoRecPicYuv( m_pcEncTop->getEncTop()->getPicYuvFromView( pcSlice->getViewId(), pcSlice->getPOC(), false, true ) );
     600  m_pcRdCost->setDepthPicYuv   ( m_pcEncTop->getEncTop()->getPicYuvFromView( pcSlice->getViewId(), pcSlice->getPOC(), true, false ) );
     601#endif
    538602#endif
    539603#if LGE_WVSO_A0119
     
    780844      // init view component and predict virtual depth map
    781845      m_pcDepthMapGenerator->initViewComponent( pcPic );
    782 #if !QC_MULTI_DIS_CAN
     846#if !QC_MULTI_DIS_CAN_A0097
    783847      m_pcDepthMapGenerator->predictDepthMap  ( pcPic );
    784848#endif
     
    791855#endif
    792856
     857#if QC_SIMPLE_NBDV_B0047
     858      if(pcSlice->getViewId() && pcSlice->getSPS()->getMultiviewMvPredMode())
     859      {
     860        Int iColPoc = pcSlice->getRefPOC(RefPicList(pcSlice->getColDir()), pcSlice->getColRefIdx());
     861        pcPic->setRapbCheck(pcPic->getDisCandRefPictures(iColPoc));
     862      }
     863#endif
    793864      while(uiNextCUAddr<uiRealEndAddress) // determine slice boundaries
    794865      {
     
    849920#endif
    850921#if DEPTH_MAP_GENERATION
    851 #if !QC_MULTI_DIS_CAN
     922#if !QC_MULTI_DIS_CAN_A0097
    852923      // update virtual depth map
    853924      m_pcDepthMapGenerator->updateDepthMap( pcPic );
     
    906977      if ( m_bSeqFirst )
    907978      {
    908 #if VIDYO_VPS_INTEGRATION
     979#if QC_MVHEVC_B0046
     980      if(!m_pcEncTop->getLayerId())
     981      {
     982#endif
     983#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    909984        {
    910985          OutputNALUnit nalu(NAL_UNIT_VPS, true, m_pcEncTop->getLayerId());
     
    916991#endif
    917992#if NAL_REF_FLAG
    918 #if VIDYO_VPS_INTEGRATION
     993#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    919994        OutputNALUnit nalu(NAL_UNIT_SPS, true, m_pcEncTop->getLayerId());
    920995#else
     
    9371012
    9381013#if NAL_REF_FLAG
    939 #if VIDYO_VPS_INTEGRATION
     1014#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
     1015#if QC_MVHEVC_B0046
    9401016        nalu = NALUnit(NAL_UNIT_PPS, true, m_pcEncTop->getLayerId());
     1017#else
     1018        nalu = NALUnit(NAL_UNIT_PPS, true, m_pcEncTop->getLayerId());
     1019#endif
    9411020#else
    9421021        nalu = NALUnit(NAL_UNIT_PPS, true, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth());
     
    9491028        writeRBSPTrailingBits(nalu.m_Bitstream);
    9501029        accessUnit.push_back(new NALUnitEBSP(nalu));
    951 
    952         m_bSeqFirst = false;
    953       }
     1030#if QC_MVHEVC_B0046
     1031      }
     1032#endif
     1033      m_bSeqFirst = false;
     1034    }
    9541035
    9551036      /* use the main bitstream buffer for storing the marshalled picture */
     
    10691150#if NAL_REF_FLAG
    10701151        OutputNALUnit nalu( pcSlice->getNalUnitType(), pcSlice->isReferenced(),
    1071 #if !VIDYO_VPS_INTEGRATION
     1152#if !VIDYO_VPS_INTEGRATION &!QC_MVHEVC_B0046
    10721153                           m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth(), pcSlice->getTLayer() );
    10731154#else
     
    12061287          m_pcSbacCoder->load( &pcSbacCoders[0] );
    12071288
     1289
    12081290        pcSlice->setTileOffstForMultES( uiOneBitstreamPerSliceLength );
    12091291        if (!bEntropySlice)
    12101292        {
    1211 #if OL_DEPTHLIMIT_A0044 //start dumping partition information
    1212           m_pcSliceEncoder->setPartDumpFlag(1);
    1213 #endif
    12141293          pcSlice->setTileLocationCount ( 0 );
    12151294          m_pcSliceEncoder->encodeSlice(pcPic, pcBitstreamRedirect, pcSubstreamsOut); // redirect is only used for CAVLC tile position info.
    1216 #if OL_DEPTHLIMIT_A0044 //stop dumping partition information
    1217           m_pcSliceEncoder->setPartDumpFlag(0);
    1218 #endif
    12191295        }
    12201296        else
    12211297        {
    1222 #if OL_DEPTHLIMIT_A0044 //start dumping partition information
    1223           m_pcSliceEncoder->setPartDumpFlag(1);
    1224 #endif
    12251298          m_pcSliceEncoder->encodeSlice(pcPic, &nalu.m_Bitstream, pcSubstreamsOut); // nalu.m_Bitstream is only used for CAVLC tile position info.
    1226 #if OL_DEPTHLIMIT_A0044 //stop dumping partition information
    1227           m_pcSliceEncoder->setPartDumpFlag(0);
    1228 #endif
    1229         }
     1299        }
     1300
    12301301
    12311302        {
     
    15571628          {
    15581629#if NAL_REF_FLAG
    1559 #if VIDYO_VPS_INTEGRATION
     1630#if VIDYO_VPS_INTEGRATION | QC_MVHEVC_B0046
    15601631            OutputNALUnit nalu(NAL_UNIT_APS, true, m_pcEncTop->getLayerId());
    15611632#else
     
    16231694
    16241695#if NAL_REF_FLAG
    1625 #if VIDYO_VPS_INTEGRATION
     1696#if VIDYO_VPS_INTEGRATION | QC_MVHEVC_B0046
    16261697        OutputNALUnit nalu(NAL_UNIT_SEI, false, m_pcEncTop->getLayerId());
    16271698#else
     
    20612132  case NAL_UNIT_CODED_SLICE: return "SLICE";
    20622133#if H0566_TLA
     2134#if !QC_REM_IDV_B0046
    20632135  case NAL_UNIT_CODED_SLICE_IDV: return "IDV";
     2136#endif
    20642137  case NAL_UNIT_CODED_SLICE_CRA: return "CRA";
    20652138  case NAL_UNIT_CODED_SLICE_TLA: return "TLA";
     
    22902363    if( bInterViewOnlySlice )
    22912364    {
     2365#if !QC_REM_IDV_B0046
    22922366      return NAL_UNIT_CODED_SLICE_IDV;
     2367#else
     2368      return NAL_UNIT_CODED_SLICE_IDR;
     2369#endif
    22932370    }
    22942371    else
     
    23032380      if( bInterViewOnlySlice )
    23042381      {
     2382#if !QC_REM_IDV_B0046
    23052383        return NAL_UNIT_CODED_SLICE_IDV;
     2384#else
     2385        return NAL_UNIT_CODED_SLICE_CRA;
     2386#endif
    23062387      }
    23072388      else
     
    23182399      if( bInterViewOnlySlice )
    23192400      {
     2401#if !QC_REM_IDV_B0046
    23202402        return NAL_UNIT_CODED_SLICE_IDV;
     2403#else
     2404        return NAL_UNIT_CODED_SLICE_IDR;
     2405#endif
    23212406      }
    23222407      else
     
    25562641
    25572642  // analyze inter-view modifications
     2643#if !QC_REM_IDV_B0046
    25582644  GOPEntryMvc gem = m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid );
     2645#else
     2646  Bool bRAP = ((getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDR) || (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_CRA)) && (pcSlice->getSPS()->getViewId()) ? 1:0;
     2647  GOPEntryMvc gem = m_pcCfg->getGOPEntry( bRAP ? MAX_GOP : iGOPid );
     2648#endif
    25592649  Int numL0Modifications = 0;
    25602650  Int numL1Modifications = 0;
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncGOP.h

    r193 r213  
    137137 
    138138  Void  preLoopFilterPicAll  ( TComPic* pcPic, UInt64& ruiDist, UInt64& ruiBits );
    139 #if HHI_VSO_SPEEDUP_A0033
    140139  TEncTop* getEncTop() { return m_pcEncTop; }
    141 #endif
    142140 
    143141  TEncSlice*  getSliceEncoder()   { return m_pcSliceEncoder; }
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncSbac.cpp

    r193 r213  
    4242#include <algorithm>
    4343
     44#if RWTH_SDC_DLT_B0036
     45#define GetNumDepthValues()     (pcCU->getSlice()->getSPS()->getNumDepthValues())
     46#define GetBitsPerDepthValue()  (pcCU->getSlice()->getSPS()->getBitsPerDepthValue())
     47#endif
     48
    4449//! \ingroup TLibEncoder
    4550//! \{
     
    6065, m_cCUSplitFlagSCModel       ( 1,             1,               NUM_SPLIT_FLAG_CTX            , m_contextModels + m_numContextModels, m_numContextModels )
    6166, m_cCUSkipFlagSCModel        ( 1,             1,               NUM_SKIP_FLAG_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
     67#if LGE_ILLUCOMP_B0045
     68, m_cCUICFlagSCModel          ( 1,             1,               NUM_IC_FLAG_CTX               , m_contextModels + m_numContextModels, m_numContextModels)
     69#endif
    6270, m_cCUMergeFlagExtSCModel    ( 1,             1,               NUM_MERGE_FLAG_EXT_CTX        , m_contextModels + m_numContextModels, m_numContextModels)
    6371, m_cCUMergeIdxExtSCModel     ( 1,             1,               NUM_MERGE_IDX_EXT_CTX         , m_contextModels + m_numContextModels, m_numContextModels)
     
    106114, m_cDmmDataSCModel           ( 1,             1,               NUM_DMM_DATA_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
    107115#endif
    108 #if LGE_EDGE_INTRA
     116#if LGE_EDGE_INTRA_A0070
    109117, m_cEdgeIntraSCModel         ( 1,             1,               NUM_EDGE_INTRA_CTX            , m_contextModels + m_numContextModels, m_numContextModels)
    110118#if LGE_EDGE_INTRA_DELTA_DC
     
    112120#endif
    113121#endif
     122#if RWTH_SDC_DLT_B0036
     123, m_cSDCFlagSCModel             ( 1,             1,                 SDC_NUM_FLAG_CTX           , m_contextModels + m_numContextModels, m_numContextModels)
     124, m_cSDCResidualFlagSCModel     ( 1,             2,  SDC_NUM_RESIDUAL_FLAG_CTX  , m_contextModels + m_numContextModels, m_numContextModels)
     125, m_cSDCResidualSignFlagSCModel ( 1,             2,  SDC_NUM_SIGN_FLAG_CTX      , m_contextModels + m_numContextModels, m_numContextModels)
     126, m_cSDCResidualSCModel         ( 1,             2,  SDC_NUM_RESIDUAL_CTX       , m_contextModels + m_numContextModels, m_numContextModels)
     127, m_cSDCPredModeSCModel             ( 1,             3,                 SDC_NUM_PRED_MODE_CTX     , m_contextModels + m_numContextModels, m_numContextModels)
     128#endif
    114129{
    115130  assert( m_numContextModels <= MAX_NUM_CTX_MOD );
     
    141156 
    142157  m_cCUSkipFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG );
     158#if LGE_ILLUCOMP_B0045
     159  m_cCUICFlagSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_IC_FLAG );
     160#endif
    143161  m_cCUAlfCtrlFlagSCModel.initBuffer     ( eSliceType, iQp, (UChar*)INIT_ALF_CTRL_FLAG );
    144162  m_cCUMergeFlagExtSCModel.initBuffer    ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT);
     
    187205  m_cDmmDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DMM_DATA );
    188206#endif
    189 #if LGE_EDGE_INTRA
     207#if LGE_EDGE_INTRA_A0070
    190208  m_cEdgeIntraSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_EDGE_INTRA );
    191209#if LGE_EDGE_INTRA_DELTA_DC
    192210  m_cEdgeIntraDeltaDCSCModel.initBuffer  ( eSliceType, iQp, (UChar*)INIT_EDGE_INTRA_DELTA_DC );
    193211#endif
     212#endif
     213#if RWTH_SDC_DLT_B0036
     214  m_cSDCFlagSCModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG );
     215  m_cSDCResidualFlagSCModel.initBuffer      ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG );
     216  m_cSDCResidualSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL );
     217  m_cSDCResidualSignFlagSCModel.initBuffer  ( eSliceType, iQp, (UChar*)INIT_SDC_SIGN_FLAG );
     218  m_cSDCPredModeSCModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_SDC_PRED_MODE );
    194219#endif
    195220
     
    224249      curCost  = m_cCUSplitFlagSCModel.calcCost       ( curSliceType, qp, (UChar*)INIT_SPLIT_FLAG );
    225250      curCost += m_cCUSkipFlagSCModel.calcCost        ( curSliceType, qp, (UChar*)INIT_SKIP_FLAG );
     251#if LGE_ILLUCOMP_B0045
     252      curCost += m_cCUICFlagSCModel.calcCost          ( curSliceType, qp, (UChar*)INIT_IC_FLAG );
     253#endif
    226254      curCost += m_cCUAlfCtrlFlagSCModel.calcCost     ( curSliceType, qp, (UChar*)INIT_ALF_CTRL_FLAG );
    227255      curCost += m_cCUMergeFlagExtSCModel.calcCost    ( curSliceType, qp, (UChar*)INIT_MERGE_FLAG_EXT);
     
    279307  } 
    280308
    281   #if CABAC_INIT_FLAG && POZNAN_CABAC_INIT_FLAG_FIX
     309  #if CABAC_INIT_FLAG && FIX_POZNAN_CABAC_INIT_FLAG
    282310    m_pcSlice->getPPS()->setEncPrevPOC( m_pcSlice->getPOC() );
    283311  #endif
     
    295323 
    296324  m_cCUSkipFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG );
     325#if LGE_ILLUCOMP_B0045
     326  m_cCUICFlagSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_IC_FLAG );
     327#endif
    297328  m_cCUAlfCtrlFlagSCModel.initBuffer     ( eSliceType, iQp, (UChar*)INIT_ALF_CTRL_FLAG );
    298329  m_cCUMergeFlagExtSCModel.initBuffer    ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT);
     
    341372  m_cDmmDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DMM_DATA );
    342373#endif
     374#if RWTH_SDC_DLT_B0036
     375  m_cSDCFlagSCModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG );
     376  m_cSDCResidualFlagSCModel.initBuffer      ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG );
     377  m_cSDCResidualSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL );
     378  m_cSDCResidualSignFlagSCModel.initBuffer  ( eSliceType, iQp, (UChar*)INIT_SDC_SIGN_FLAG );
     379  m_cSDCPredModeSCModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_SDC_PRED_MODE );
     380#endif
    343381 
    344382  m_pcBinIf->start();
     
    358396}
    359397
    360 #if VIDYO_VPS_INTEGRATION
     398#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    361399Void TEncSbac::codeVPS( TComVPS* pcVPS )
    362400{
     
    580618{
    581619  PartSize eSize         = pcCU->getPartitionSize( uiAbsPartIdx );
    582 #if OL_DEPTHLIMIT_A0044
    583   UInt uiSymbol;
    584 #endif
     620
     621#if OL_QTLIMIT_PREDCODING_B0068
     622  TComSPS *sps           = pcCU->getPic()->getSlice(0)->getSPS();
     623  TComPic *pcTexture     = pcCU->getSlice()->getTexturePic();
     624  Bool bDepthMapDetect   = (pcTexture != NULL);
     625  Bool bIntraSliceDetect = (pcCU->getSlice()->getSliceType() == I_SLICE);
     626 
     627  if(bDepthMapDetect && !bIntraSliceDetect && sps->getUseQTLPC() && pcCU->getPic()->getReduceBitsFlag())
     628  {
     629    TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr());
     630    UInt uiCUIdx            = (pcCU->getZorderIdxInCU() == 0) ? uiAbsPartIdx : pcCU->getZorderIdxInCU();
     631    assert(pcTextureCU->getDepth(uiCUIdx) >= uiDepth);
     632    if (pcTextureCU->getDepth(uiCUIdx) == uiDepth && pcTextureCU->getPartitionSize( uiCUIdx ) != SIZE_NxN)
     633    {
     634      assert( eSize == SIZE_2Nx2N );
     635      return;
     636    }
     637  }
     638#endif
     639
    585640  if ( pcCU->isIntra( uiAbsPartIdx ) )
    586641  {
     
    588643    {
    589644      m_pcBinIf->encodeBin( eSize == SIZE_2Nx2N? 1 : 0, m_cCUPartSizeSCModel.get( 0, 0, 0 ) );
    590 #if OL_DEPTHLIMIT_A0044
    591       if(pcCU->getPartDumpFlag())
    592       {
    593         uiSymbol = (UInt)(eSize == SIZE_2Nx2N? 1 : 0);
    594         pcCU->updatePartInfo(uiSymbol?0:1,uiDepth); //0 for 2Nx2N and 1 for NxN
    595         pcCU->incrementPartInfo();
    596       }
    597 #endif
    598     }
    599 #if OL_DEPTHLIMIT_A0044
    600     if(pcCU->getPartDumpFlag() && uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth && !pcCU->getSlice()->isIntra())
    601     {
    602       pcCU->updatePartInfo(0,uiDepth); //0 for 2Nx2N and 1 for NxN
    603       pcCU->incrementPartInfo();
    604     }
    605 #endif
     645    }
    606646    return;
    607647  }
     
    612652    {
    613653      m_pcBinIf->encodeBin( 1, m_cCUPartSizeSCModel.get( 0, 0, 0) );
    614 #if OL_DEPTHLIMIT_A0044
    615       if(pcCU->getPartDumpFlag())
    616       {
    617         pcCU->updatePartInfo(0,uiDepth); //0 for 2Nx2N
    618         pcCU->incrementPartInfo();
    619       }
    620 #endif
    621654      break;
    622655    }
     
    648681        }
    649682      }
    650 #if OL_DEPTHLIMIT_A0044
    651       if(pcCU->getPartDumpFlag())
    652       {
    653         pcCU->updatePartInfo(2,uiDepth); //2 for 2NxN
    654         pcCU->incrementPartInfo();
    655       }
    656 #endif
    657683      break;
    658684    }
     
    688714        }
    689715      }
    690 #if OL_DEPTHLIMIT_A0044
    691       if(pcCU->getPartDumpFlag())
    692       {
    693         pcCU->updatePartInfo(3,uiDepth); //3 for Nx2N
    694         pcCU->incrementPartInfo();
    695       }
    696 #endif
    697716      break;
    698717    }
     
    704723        m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 1) );
    705724        m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 2) );
    706 #if OL_DEPTHLIMIT_A0044
    707         if(pcCU->getPartDumpFlag())
    708         {
    709           pcCU->updatePartInfo(1,uiDepth); //2Nx2N here since we disable NxN in Inter
    710           pcCU->incrementPartInfo();         
    711         }
    712 #endif
    713       }
    714       else
    715       {
    716 #if OL_DEPTHLIMIT_A0044
    717         if(pcCU->getPartDumpFlag())
    718         {
    719           pcCU->updatePartInfo(0,uiDepth); //2Nx2N here since we disable NxN in Inter
    720           pcCU->incrementPartInfo();
    721         }
    722 #endif
    723725      }
    724726      break;
     
    738740Void TEncSbac::codePredMode( TComDataCU* pcCU, UInt uiAbsPartIdx )
    739741{
     742#if RWTH_SDC_DLT_B0036
     743  if ( pcCU->getSlice()->isIntra() )
     744  {
     745    assert( pcCU->isIntra(uiAbsPartIdx) );
     746    return;
     747  }
     748#endif
     749 
    740750  // get context function is here
    741751  Int iPredMode = pcCU->getPredictionMode( uiAbsPartIdx );
     
    789799  DTRACE_CABAC_T( "\n");
    790800}
     801
     802#if LGE_ILLUCOMP_B0045
     803/** code Illumination Compensation flag
     804 * \param pcCU
     805 * \param uiAbsPartIdx
     806 * \returns Void
     807 */
     808Void TEncSbac::codeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )
     809{
     810  // get context function is here
     811  UInt uiSymbol = pcCU->getICFlag( uiAbsPartIdx ) ? 1 : 0;
     812  UInt uiCtxIC  = pcCU->getCtxICFlag( uiAbsPartIdx ) ;
     813  m_pcBinIf->encodeBin( uiSymbol, m_cCUICFlagSCModel.get( 0, 0, uiCtxIC ) );
     814  DTRACE_CABAC_VL( g_nSymbolCounter++ );
     815  DTRACE_CABAC_T( "\tICFlag" );
     816  DTRACE_CABAC_T( "\tuiCtxIC: ");
     817  DTRACE_CABAC_V( uiCtxIC );
     818  DTRACE_CABAC_T( "\tuiSymbol: ");
     819  DTRACE_CABAC_V( uiSymbol );
     820  DTRACE_CABAC_T( "\n");
     821}
     822#endif
    791823
    792824#if FORCE_REF_VSP==1
     
    841873  uiNumCand = pcCU->getSlice()->getMaxNumMergeCand();
    842874#if HHI_MPI
    843 #if VSP_N
     875#if VSP_N & !MTK_UNCONSTRAINED_MVI_B0083
    844876  TComDataCU* pcTextCU = pcCU->getSlice()->getSPS()->getUseMVI() ? pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() ) : NULL;
    845877  Int aiRefIdxVsp[2] = { pcTextCU ? pcTextCU->getCUMvField( RefPicList(0) )->getRefIdx( uiAbsPartIdx ) : -1,
     
    857889                                                                        : pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE;
    858890#endif
     891#else
     892  const Bool bMVIAvailable = pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE;
    859893#endif
    860894  if( bMVIAvailable )
     
    920954 
    921955  assert( uiCtx < 3 );
     956
     957#if OL_QTLIMIT_PREDCODING_B0068
     958  Bool bCodeSplitFlag    = true;
     959
     960  TComSPS *sps           = pcCU->getPic()->getSlice(0)->getSPS();
     961  TComPic *pcTexture     = pcCU->getSlice()->getTexturePic();
     962  Bool bDepthMapDetect   = (pcTexture != NULL);
     963  Bool bIntraSliceDetect = (pcCU->getSlice()->getSliceType() == I_SLICE);
     964
     965  if(bDepthMapDetect && !bIntraSliceDetect && sps->getUseQTLPC() && pcCU->getPic()->getReduceBitsFlag())
     966  {
     967    TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr());
     968    UInt uiCUIdx            = (pcCU->getZorderIdxInCU() == 0) ? uiAbsPartIdx : pcCU->getZorderIdxInCU();
     969    assert(pcTextureCU->getDepth(uiCUIdx) >= uiDepth);
     970    bCodeSplitFlag          = (pcTextureCU->getDepth(uiCUIdx) > uiDepth);
     971  }
     972
     973  if(!bCodeSplitFlag)
     974  {
     975    assert(uiCurrSplitFlag == 0);
     976    return;
     977  }
     978#endif
     979
    922980  m_pcBinIf->encodeBin( uiCurrSplitFlag, m_cCUSplitFlagSCModel.get( 0, 0, uiCtx ) );
    923 #if OL_DEPTHLIMIT_A0044
    924   if(pcCU->getPartDumpFlag())
    925   {
    926     if(pcCU->getSlice()->isIntra() || (!pcCU->getSlice()->isIntra() && uiCurrSplitFlag!=0))
    927     {
    928       pcCU->updatePartInfo(uiCurrSplitFlag,uiDepth);
    929       pcCU->incrementPartInfo();
    930     }
    931   }
    932 #endif
    933981  DTRACE_CABAC_VL( g_nSymbolCounter++ )
    934982  DTRACE_CABAC_T( "\tSplitFlag\n" )
     
    948996}
    949997
    950 #if LGE_EDGE_INTRA
     998#if LGE_EDGE_INTRA_A0070
    951999Void TEncSbac::xCodeEdgeIntraInfo( TComDataCU* pcCU, UInt uiPartIdx )
    9521000{
     
    10291077  if( pcCU->getSlice()->getSPS()->getUseDMM() && pcCU->getWidth( uiAbsPartIdx ) <= DMM_WEDGEMODEL_MAX_SIZE )
    10301078  {
    1031 #if LGE_EDGE_INTRA
     1079#if LGE_EDGE_INTRA_A0070
    10321080    m_pcBinIf->encodeBin( uiDir >= NUM_INTRA_MODE && uiDir < EDGE_INTRA_IDX, m_cDmmFlagSCModel.get(0, 0, 0) );
    10331081#else
     
    10351083#endif
    10361084  }
    1037 #if LGE_EDGE_INTRA
     1085#if LGE_EDGE_INTRA_A0070
    10381086  if( uiDir >= NUM_INTRA_MODE && uiDir < EDGE_INTRA_IDX )
    10391087#else
     
    10671115#endif
    10681116#if HHI_DMM_PRED_TEX
     1117
     1118#if FLEX_CODING_ORDER_M23723
     1119    if ( !pcCU->getSlice()->getSPS()->getUseDMM34() )
     1120    {
     1121      assert( uiDir != DMM_WEDGE_PREDTEX_D_IDX );
     1122      assert( uiDir != DMM_CONTOUR_PREDTEX_D_IDX );
     1123    }
     1124#endif
     1125
    10691126    if( uiDir == DMM_WEDGE_PREDTEX_D_IDX )     { xCodeWedgePredTexDeltaInfo  ( pcCU, uiAbsPartIdx ); }
    10701127    if( uiDir == DMM_CONTOUR_PREDTEX_D_IDX )   { xCodeContourPredTexDeltaInfo( pcCU, uiAbsPartIdx ); }
     
    10721129  }
    10731130  else
    1074 #if LGE_EDGE_INTRA
     1131#if LGE_EDGE_INTRA_A0070
    10751132    if ( uiDir >= EDGE_INTRA_IDX)
    10761133    {
     
    11071164  Int iIntraIdx = pcCU->getIntraSizeIdx(uiAbsPartIdx);
    11081165#endif
    1109 #if LGE_EDGE_INTRA
     1166#if LGE_EDGE_INTRA_A0070
    11101167  Bool bCodeEdgeIntra = false;
    11111168  if( pcCU->getSlice()->getSPS()->isDepth() )
     
    11731230#if LOGI_INTRA_NAME_3MPM
    11741231    m_pcBinIf->encodeBinsEP( uiDir, 5 );
    1175 #if LGE_EDGE_INTRA
     1232#if LGE_EDGE_INTRA_A0070
    11761233  if (bCodeEdgeIntra)
    11771234    if (uiDir == 31) m_pcBinIf->encodeBinsEP(0,1);
     
    25152572}
    25162573
    2517 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX || (LGE_EDGE_INTRA && LGE_EDGE_INTRA_DELTA_DC)
     2574#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX || (LGE_EDGE_INTRA_A0070 && LGE_EDGE_INTRA_DELTA_DC)
    25182575Void TEncSbac::xWriteExGolombLevel( UInt uiSymbol, ContextModel& rcSCModel  )
    25192576{
     
    26812738}
    26822739#endif
     2740
     2741#if RWTH_SDC_DLT_B0036
     2742Void TEncSbac::codeSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx )
     2743{
     2744  assert( pcCU->getSlice()->getSPS()->isDepth() );
     2745  assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
     2746  assert( pcCU->getSDCFlag(uiAbsPartIdx) );
     2747 
     2748  UInt uiPredMode     = pcCU->getLumaIntraDir(uiAbsPartIdx);
     2749  UInt uiCtx          = 0;
     2750 
     2751  UInt uiMPModeIdx    = 0;
     2752 
     2753  for(Int i=0; i<RWTH_SDC_NUM_PRED_MODES-1; i++)
     2754  {
     2755    UInt uiBit = (uiPredMode == g_auiSDCPredModes[uiMPModeIdx]) ? 1 : 0;
     2756    m_pcBinIf->encodeBin( uiBit, m_cSDCPredModeSCModel.get( 0, i, uiCtx ) );
     2757   
     2758    // if mode is most probable mode, we are done here
     2759    if ( uiBit == 1 )
     2760      break;
     2761   
     2762    // else: get next most probable pred mode
     2763    uiMPModeIdx = (uiMPModeIdx+1)%RWTH_SDC_NUM_PRED_MODES;
     2764  }
     2765 
     2766#if HHI_DMM_WEDGE_INTRA
     2767  if( uiPredMode == DMM_WEDGE_FULL_IDX )          { xCodeWedgeFullInfo          ( pcCU, uiAbsPartIdx ); }
     2768  if( uiPredMode == DMM_WEDGE_PREDDIR_IDX )       { xCodeWedgePredDirInfo       ( pcCU, uiAbsPartIdx ); }
     2769#endif
     2770 
     2771  AOF(uiPredMode == g_auiSDCPredModes[uiMPModeIdx]);
     2772}
     2773
     2774Void TEncSbac::codeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )
     2775{
     2776  // get context function is here
     2777  UInt uiSymbol = pcCU->getSDCFlag( uiAbsPartIdx ) ? 1 : 0;
     2778  UInt uiCtxSDCFlag = pcCU->getCtxSDCFlag( uiAbsPartIdx );
     2779  m_pcBinIf->encodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, uiCtxSDCFlag ) );
     2780 
     2781}
     2782
     2783Void TEncSbac::codeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment )
     2784{
     2785  assert( pcCU->getSlice()->getSPS()->isDepth() );
     2786  assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
     2787  assert( pcCU->getSDCFlag(uiAbsPartIdx) );
     2788  assert( uiSegment < 2 );
     2789 
     2790  Pel segmentDCOffset = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx);
     2791 
     2792  UInt uiResidual = segmentDCOffset == 0 ? 0 : 1;
     2793  UInt uiSign     = segmentDCOffset < 0 ? 1 : 0;
     2794  UInt uiAbsIdx   = abs(segmentDCOffset);
     2795  UInt uiBit = 0;
     2796 
     2797  UInt uiMaxResidualBits  = GetBitsPerDepthValue();
     2798  assert( uiMaxResidualBits <= g_uiBitDepth );
     2799 
     2800  // residual flag
     2801  m_pcBinIf->encodeBin( uiResidual, m_cSDCResidualFlagSCModel.get( 0, uiSegment, 0 ) ); //TODO depthmap: more sophisticated context selection
     2802 
     2803  if (uiResidual)
     2804  {
     2805    // encode sign bit of residual
     2806    m_pcBinIf->encodeBin( uiSign, m_cSDCResidualSignFlagSCModel.get( 0, uiSegment, 0 ) ); //TODO depthmap: more sophisticated context selection
     2807       
     2808    assert(uiAbsIdx < GetNumDepthValues());
     2809   
     2810    // encode residual magnitude
     2811    uiAbsIdx -= 1;
     2812    for (Int i=0; i<uiMaxResidualBits; i++)
     2813    {
     2814      uiBit = (uiAbsIdx & (1<<i))>>i;
     2815     
     2816      m_pcBinIf->encodeBin( uiBit, m_cSDCResidualSCModel.get( 0, uiSegment, i ) ); //TODO depthmap: more sophisticated context selection
     2817    }
     2818   
     2819  }
     2820}
     2821#endif
    26832822//! \}
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncSbac.h

    r166 r213  
    9898  //--SBAC RD
    9999
    100 #if VIDYO_VPS_INTEGRATION
     100#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    101101  Void  codeVPS                 ( TComVPS* pcVPS );
    102102#endif
     
    145145#endif
    146146  Void  codeScalingList      ( TComScalingList* scalingList     ){ assert (0);  return;};
     147 
     148#if RWTH_SDC_DLT_B0036
     149  Void codeSDCFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     150  Void codeSDCResidualData  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment );
     151  Void codeSDCPredMode      ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     152#endif
    147153
    148154private:
     
    175181  Void  xCodeContourPredTexDeltaInfo( TComDataCU* pcCU, UInt uiAbsPartIdx );
    176182#endif
    177 #if LGE_EDGE_INTRA
     183#if LGE_EDGE_INTRA_A0070
    178184  Void  xCodeEdgeIntraInfo( TComDataCU* pcCU, UInt uiPartIdx );
    179185#endif
     
    202208  Void codeAlfCtrlFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    203209  Void codeSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     210#if LGE_ILLUCOMP_B0045
     211  Void codeICFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     212#endif
    204213#if FORCE_REF_VSP==1
    205214  Void codeVspFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     
    263272  ContextModel3DBuffer m_cCUSplitFlagSCModel;
    264273  ContextModel3DBuffer m_cCUSkipFlagSCModel;
     274#if LGE_ILLUCOMP_B0045
     275  ContextModel3DBuffer m_cCUICFlagSCModel;
     276#endif
    265277  ContextModel3DBuffer m_cCUMergeFlagExtSCModel;
    266278  ContextModel3DBuffer m_cCUMergeIdxExtSCModel;
     
    313325  ContextModel3DBuffer m_cDmmDataSCModel;
    314326#endif
    315 #if LGE_EDGE_INTRA
     327#if LGE_EDGE_INTRA_A0070
    316328  ContextModel3DBuffer m_cEdgeIntraSCModel;
    317329#if LGE_EDGE_INTRA_DELTA_DC
     
    319331#endif
    320332#endif
     333 
     334#if RWTH_SDC_DLT_B0036
     335  ContextModel3DBuffer m_cSDCFlagSCModel;
     336 
     337  ContextModel3DBuffer m_cSDCResidualFlagSCModel;
     338  ContextModel3DBuffer m_cSDCResidualSignFlagSCModel;
     339  ContextModel3DBuffer m_cSDCResidualSCModel;
     340 
     341  ContextModel3DBuffer m_cSDCPredModeSCModel;
     342#endif
    321343};
    322344
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncSearch.cpp

    r193 r213  
    4242#include <math.h>
    4343
     44#if RWTH_SDC_DLT_B0036
     45#define GetDepthValue2Idx(val)     (pcCU->getSlice()->getSPS()->depthValue2idx(val))
     46#define GetIdx2DepthValue(val)     (pcCU->getSlice()->getSPS()->idx2DepthValue(val))
     47#endif
     48
    4449//! \ingroup TLibEncoder
    4550//! \{
     
    155160                      Int           iSearchRange,
    156161                      Int           bipredSearchRange,
     162#if DV_V_RESTRICTION_B0037
     163                      Bool          bUseDisparitySearchRangeRestriction,
     164                      Int           iVerticalDisparitySearchRange,
     165#endif
    157166                      Int           iFastSearch,
    158167                      Int           iMaxDeltaQP,
     
    167176  m_iSearchRange         = iSearchRange;
    168177  m_bipredSearchRange    = bipredSearchRange;
     178#if DV_V_RESTRICTION_B0037
     179  m_bUseDisparitySearchRangeRestriction = bUseDisparitySearchRangeRestriction;
     180  m_iVerticalDisparitySearchRange = iVerticalDisparitySearchRange;
     181#endif
    169182  m_iFastSearch          = iFastSearch;
    170183  m_iMaxDeltaQP          = iMaxDeltaQP;
     
    195208  const Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + 1;
    196209  for( Int iNum = 0; iNum < iNumAMVPCands+1; iNum++)
    197   {
    198210    for( Int iIdx = 0; iIdx < iNumAMVPCands; iIdx++)
    199211#else
    200212  for( Int iNum = 0; iNum < AMVP_MAX_NUM_CANDS+1; iNum++)
    201   {
    202213    for( Int iIdx = 0; iIdx < AMVP_MAX_NUM_CANDS; iIdx++)
    203214#endif
     
    208219        m_auiMVPIdxCost[iIdx][iNum] = MAX_INT;
    209220    }
    210   }
    211221 
    212222  initTempBuff();
     
    300310
    301311  // distortion
     312#if LGE_ILLUCOMP_B0045
     313  m_cDistParam.bUseIC = pcPatternKey->getICFlag();
     314#endif
    302315  uiSad = m_cDistParam.DistFunc( &m_cDistParam );
    303316 
     
    726739
    727740    m_cDistParam.pCur = piRefPos;
     741#if LGE_ILLUCOMP_B0045
     742    m_cDistParam.bUseIC = pcPatternKey->getICFlag();
     743#endif
    728744    uiDist = m_cDistParam.DistFunc( &m_cDistParam );
    729745    uiDist += m_pcRdCost->getCost( cMvTest.getHor(), cMvTest.getVer() );
     
    975991                                TComYuv*    pcResiYuv,
    976992                                Dist&       ruiDist
    977 #if LG_ZEROINTRADEPTHRESI_M26039
     993#if LG_ZEROINTRADEPTHRESI_A0087
    978994                                ,Bool        bZeroResi
    979995#endif
     
    10101026  pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, uiTrDepth, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail );
    10111027 
    1012 #if LGE_EDGE_INTRA
     1028#if LGE_EDGE_INTRA_A0070
    10131029  if( uiLumaPredMode >= EDGE_INTRA_IDX )
    10141030  {
     
    10581074    }
    10591075  }
    1060 #if LG_ZEROINTRADEPTHRESI_M26039
     1076#if LG_ZEROINTRADEPTHRESI_A0087
    10611077  if(bZeroResi)
    10621078  {
     
    13751391#endif
    13761392                                Double&      dRDCost
    1377 #if LG_ZEROINTRADEPTHRESI_M26039
     1393#if LG_ZEROINTRADEPTHRESI_A0087
    13781394                               ,Bool         bZeroResi
    13791395#endif
     
    13971413  }
    13981414#endif
    1399 #if LGE_EDGE_INTRA
     1415#if LGE_EDGE_INTRA_A0070
    14001416  if( pcCU->getLumaIntraDir( uiAbsPartIdx ) >= EDGE_INTRA_IDX )
    14011417  {
     
    14191435    //----- code luma block with given intra prediction mode and store Cbf-----
    14201436    dSingleCost   = 0.0;
    1421 #if LG_ZEROINTRADEPTHRESI_M26039
     1437#if LG_ZEROINTRADEPTHRESI_A0087
    14221438    xIntraCodingLumaBlk( pcCU, uiTrDepth, uiAbsPartIdx, pcOrgYuv, pcPredYuv, pcResiYuv, uiSingleDistY, bZeroResi );
    14231439#else
     
    16111627}
    16121628
     1629#if RWTH_SDC_DLT_B0036
     1630Void TEncSearch::xIntraCodingSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bResidual )
     1631{
     1632  UInt    uiLumaPredMode    = pcCU     ->getLumaIntraDir( uiAbsPartIdx );
     1633  UInt    uiWidth           = pcCU     ->getWidth   ( 0 );
     1634  UInt    uiHeight          = pcCU     ->getHeight  ( 0 );
     1635  UInt    uiStride          = pcOrgYuv ->getStride  ();
     1636  Pel*    piOrg             = pcOrgYuv ->getLumaAddr( uiAbsPartIdx );
     1637  Pel*    piPred            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
     1638  Pel*    piReco            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
     1639 
     1640  UInt    uiZOrder          = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
     1641  Pel*    piRecIPred        = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );
     1642  UInt    uiRecIPredStride  = pcCU->getPic()->getPicYuvRec()->getStride  ();
     1643 
     1644  AOF( uiWidth == uiHeight );
     1645  AOF( uiAbsPartIdx == 0 );
     1646  AOF( pcCU->getSDCAvailable(uiAbsPartIdx) );
     1647  AOF( pcCU->getSDCFlag(uiAbsPartIdx) );
     1648 
     1649  //===== init availability pattern =====
     1650  Bool  bAboveAvail = false;
     1651  Bool  bLeftAvail  = false;
     1652  pcCU->getPattern()->initPattern   ( pcCU, 0, uiAbsPartIdx );
     1653  pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, 0, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail );
     1654 
     1655  //===== get prediction signal =====
     1656#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     1657  if( uiLumaPredMode >= NUM_INTRA_MODE )
     1658  {
     1659    predIntraLumaDMM( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail, true );
     1660  }
     1661  else
     1662  {
     1663#endif
     1664    predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, pcCU, bAboveAvail, bLeftAvail );
     1665#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     1666  }
     1667#endif
     1668 
     1669  // number of segments depends on prediction mode
     1670  UInt uiNumSegments = 1; 
     1671  Bool* pbMask = NULL;
     1672  UInt uiMaskStride = 0;
     1673 
     1674  if( uiLumaPredMode == DMM_WEDGE_FULL_IDX || uiLumaPredMode == DMM_WEDGE_PREDDIR_IDX )
     1675  {
     1676    Int uiTabIdx = (uiLumaPredMode == DMM_WEDGE_FULL_IDX)?pcCU->getWedgeFullTabIdx(uiAbsPartIdx):pcCU->getWedgePredDirTabIdx(uiAbsPartIdx);
     1677   
     1678    WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[uiWidth])];
     1679    TComWedgelet* pcWedgelet = &(pacWedgeList->at( uiTabIdx ));
     1680   
     1681    uiNumSegments = 2;
     1682    pbMask = pcWedgelet->getPattern();
     1683    uiMaskStride = pcWedgelet->getStride();
     1684  }
     1685 
     1686  // get DC prediction for each segment
     1687  Pel apDCPredValues[2];
     1688  xAnalyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride );
     1689 
     1690  // get original DC for each segment
     1691  Pel apDCOrigValues[2];
     1692  xAnalyzeSegmentsSDC(piOrg, uiStride, uiWidth, apDCOrigValues, uiNumSegments, pbMask, uiMaskStride );
     1693 
     1694  for( UInt uiSegment = 0; uiSegment < uiNumSegments; uiSegment++ )
     1695  {
     1696    // remap reconstructed value to valid depth values
     1697    Pel pDCRec = bResidual?apDCOrigValues[uiSegment]:apDCPredValues[uiSegment];
     1698   
     1699    // get residual (idx)
     1700    Pel pResidualIdx = GetDepthValue2Idx( pDCRec ) - GetDepthValue2Idx( apDCPredValues[uiSegment] );
     1701   
     1702    // save SDC DC offset
     1703    pcCU->setSDCSegmentDCOffset(pResidualIdx, uiSegment, uiAbsPartIdx);
     1704  }
     1705 
     1706  // reconstruct residual based on mask + DC residuals
     1707  Pel apDCResiValues[2];
     1708  //Pel apDCRecoValues[2];
     1709  for( UInt uiSegment = 0; uiSegment < uiNumSegments; uiSegment++ )
     1710  {
     1711    Pel   pPredIdx    = GetDepthValue2Idx( apDCPredValues[uiSegment] );
     1712    Pel   pResiIdx    = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx);
     1713    Pel   pRecoValue  = GetIdx2DepthValue( pPredIdx + pResiIdx );
     1714   
     1715    //apDCRecoValues[uiSegment]  = pRecoValue;
     1716    apDCResiValues[uiSegment]  = pRecoValue - apDCPredValues[uiSegment];
     1717  }
     1718 
     1719  //===== reconstruction =====
     1720  Bool* pMask     = pbMask;
     1721  Pel* pPred      = piPred;
     1722  Pel* pReco      = piReco;
     1723  Pel* pRecIPred  = piRecIPred;
     1724 
     1725  for( UInt uiY = 0; uiY < uiHeight; uiY++ )
     1726  {
     1727    for( UInt uiX = 0; uiX < uiWidth; uiX++ )
     1728    {
     1729      UChar ucSegment = pMask?(UChar)pMask[uiX]:0;
     1730      assert( ucSegment < uiNumSegments );
     1731     
     1732      Pel pPredVal= apDCPredValues[ucSegment];
     1733      Pel pResiDC = apDCResiValues[ucSegment];
     1734     
     1735      pReco    [ uiX ] = Clip( pPredVal + pResiDC );
     1736      pRecIPred[ uiX ] = pReco[ uiX ];
     1737    }
     1738    pPred     += uiStride;
     1739    pReco     += uiStride;
     1740    pRecIPred += uiRecIPredStride;
     1741    pMask     += uiMaskStride;
     1742  }
     1743 
     1744  // clear UV
     1745  UInt  uiStrideC     = pcPredYuv->getCStride();
     1746  Pel   *pRecCb       = pcPredYuv->getCbAddr();
     1747  Pel   *pRecCr       = pcPredYuv->getCrAddr();
     1748 
     1749  for (Int y=0; y<uiHeight/2; y++)
     1750  {
     1751    for (Int x=0; x<uiWidth/2; x++)
     1752    {
     1753      pRecCb[x] = (Pel)(128<<g_uiBitIncrement);
     1754      pRecCr[x] = (Pel)(128<<g_uiBitIncrement);
     1755    }
     1756   
     1757    pRecCb += uiStrideC;
     1758    pRecCr += uiStrideC;
     1759  }
     1760 
     1761  //===== determine distortion =====
     1762#if HHI_VSO
     1763  if ( m_pcRdCost->getUseVSO() )
     1764  {
     1765    ruiDist = m_pcRdCost->getDistVS  ( pcCU, uiAbsPartIdx, piReco, uiStride, piOrg, uiStride, uiWidth, uiHeight, false, 0 );
     1766  }
     1767  else
     1768#endif
     1769  {
     1770    ruiDist = m_pcRdCost->getDistPart( piReco, uiStride, piOrg, uiStride, uiWidth, uiHeight );
     1771  }
     1772 
     1773  //----- determine rate and r-d cost -----
     1774  m_pcEntropyCoder->resetBits();
     1775
     1776  // encode reduced intra header
     1777  m_pcEntropyCoder->encodeSkipFlag( pcCU, 0, true );
     1778  m_pcEntropyCoder->encodePredMode( pcCU, 0, true );
     1779 
     1780  // encode pred direction + residual data
     1781  m_pcEntropyCoder->encodePredInfo( pcCU, 0, true );
     1782 
     1783  UInt   uiBits = m_pcEntropyCoder->getNumberOfWrittenBits();
     1784 
     1785#if HHI_VSO
     1786  if ( m_pcRdCost->getUseLambdaScaleVSO())
     1787  {
     1788    dRDCost = m_pcRdCost->calcRdCostVSO( uiBits, ruiDist );
     1789  }
     1790  else
     1791#endif
     1792  {
     1793    dRDCost = m_pcRdCost->calcRdCost( uiBits, ruiDist );
     1794  }
     1795}
     1796#endif
    16131797
    16141798Void
     
    18482032  UInt    uiQNumParts    = pcCU->getTotalNumPart() >> 2;
    18492033  UInt    uiWidthBit     = pcCU->getIntraSizeIdx(0);
     2034#if FIX_RDO_NEGDIST
     2035  Dist    uiOverallDistY = 0;
     2036  Dist    uiOverallDistC = 0;
     2037#else
    18502038  UInt    uiOverallDistY = 0;
    18512039  UInt    uiOverallDistC = 0;
     2040#endif
    18522041  UInt    CandNum;
    18532042  Double  CandCostList[ FAST_UDI_MAX_RDMODE_NUM ];
     
    18852074    Int numModesForFullRD = g_aucIntraModeNumFast[ uiWidthBit ];
    18862075   
    1887 #if LGE_EDGE_INTRA
     2076#if LGE_EDGE_INTRA_A0070
    18882077  Bool bTestEdgeIntra = false;
    18892078  if ( m_pcEncCfg->isDepthCoder() && uiWidth >= LGE_EDGE_INTRA_MIN_SIZE && uiWidth <= LGE_EDGE_INTRA_MAX_SIZE && uiWidth == uiHeight )
     
    19362125            if ( m_pcRdCost->getUseWVSO() )
    19372126            {   
    1938               Int iDWeight = m_pcRdCost->getDWeight();
    1939               Int iVSDWeight = m_pcRdCost->getVSDWeight();
     2127              Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight();
     2128              Int iVSDWeight = m_pcRdCost->getVSDWeight() * m_pcRdCost->getVSDWeight();
    19402129              Dist iD = (Dist) m_pcRdCost->calcHAD( piOrg, uiStride, piPred, uiStride, uiWidth, uiHeight );
    19412130              uiSad = (Dist) (iDWeight * iD + iVSDWeight * uiSad) / (iDWeight + iVSDWeight);
     
    19512140            if ( m_pcRdCost->getUseWVSO() )
    19522141            {   
    1953               Int iDWeight = m_pcRdCost->getDWeight()*m_pcRdCost->getDWeight();
    1954               Int iVSDWeight = m_pcRdCost->getVSOWeight()*m_pcRdCost->getVSOWeight();
    1955               Dist iD = (Dist) m_pcRdCost->getDistPart( piOrg, uiStride, piPred, uiStride, uiWidth, uiHeight );
    1956               uiSad = (Dist) (iDWeight * iD + iVSDWeight * uiSad) / (iDWeight + iVSDWeight);
     2142              Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight();
     2143              Int iVSOWeight = m_pcRdCost->getVSOWeight() * m_pcRdCost->getDWeight();
     2144              Dist iD = (Dist) m_pcRdCost->calcHAD( piOrg, uiStride, piPred, uiStride, uiWidth, uiHeight );
     2145              uiSad = (Dist) (iDWeight * iD + iVSOWeight * uiSad) / (iDWeight + iVSOWeight);
    19572146            }
    19582147#endif
    19592148          }
    1960 
    19612149        }
    19622150        else
     
    19872175        CandNum += xUpdateCandList( uiMode, cost, numModesForFullRD, uiRdModeList, CandCostList );
    19882176
    1989 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     2177#if (HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX) && !FIX_DMM_NEG_DIST
    19902178        if( bTestDmm ) bTestDmm = uiSad ? true : false;
    19912179#endif
    1992 #if LGE_EDGE_INTRA
     2180#if LGE_EDGE_INTRA_A0070
    19932181        if ( bTestEdgeIntra ) bTestEdgeIntra = uiSad ? true : false;
    19942182#endif
     
    20742262#endif
    20752263#if HHI_DMM_PRED_TEX
     2264     
     2265#if FLEX_CODING_ORDER_M23723
     2266      if ( pcCU->getSlice()->getSPS()->getUseDMM34() )
     2267      {
     2268#endif
    20762269      UInt uiTexTabIdx  = 0;
    20772270      Int  iTexDeltaDC1 = 0;
     
    20972290        uiRdModeList[ numModesForFullRD++ ] = DMM_CONTOUR_PREDTEX_D_IDX;
    20982291      }
    2099 #endif
    2100     }
    2101 #endif
    2102 #if LGE_EDGE_INTRA
     2292#if FLEX_CODING_ORDER_M23723
     2293      }
     2294#endif
     2295#endif
     2296    }
     2297#endif
     2298#if LGE_EDGE_INTRA_A0070
    21032299  if( bTestEdgeIntra )
    21042300  {
     
    21172313   
    21182314    UInt    uiBestPUMode  = 0;
     2315#if FIX_RDO_NEGDIST
     2316    Dist    uiBestPUDistY = 0;
     2317    Dist    uiBestPUDistC = 0;
     2318#else
    21192319    UInt    uiBestPUDistY = 0;
    21202320    UInt    uiBestPUDistC = 0;
     2321#endif
    21212322    Double  dBestPUCost   = MAX_DOUBLE;
     2323#if RWTH_SDC_DLT_B0036
     2324    Bool    bBestUseSDC   = false;
     2325    Pel     apBestDCOffsets[2] = {0,0};
     2326#endif
    21222327    for( UInt uiMode = 0; uiMode < numModesForFullRD; uiMode++ )
    21232328    {
    2124 #if LG_ZEROINTRADEPTHRESI_M26039
     2329#if LG_ZEROINTRADEPTHRESI_A0087
    21252330    Bool bAllowZeroResi = pcCU->getSlice()->getIsDepth() && (pcCU->getSlice()->getPOC()%pcCU->getPic()->getIntraPeriod());// && (uiMode < NUM_INTRA_MODE);
    21262331    for(UInt uiCnt = 0; uiCnt < (bAllowZeroResi ? 2 : 1); uiCnt++)
     
    21322337
    21332338#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     2339#if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER_M23723
     2340      if( m_pcEncCfg->getIsDepth() && !predIntraLumaDMMAvailable( uiOrgMode, uiWidth, uiHeight, pcCU->getSlice()->getSPS()->getUseDMM34() )
     2341#if LGE_EDGE_INTRA_A0070
     2342        && uiOrgMode < EDGE_INTRA_IDX
     2343#endif
     2344        )
     2345
     2346#else
     2347
    21342348      if( m_pcEncCfg->getIsDepth() && !predIntraLumaDMMAvailable( uiOrgMode, uiWidth, uiHeight )
    2135 #if LGE_EDGE_INTRA
     2349#if LGE_EDGE_INTRA_A0070
    21362350        && uiOrgMode < EDGE_INTRA_IDX
    21372351#endif
    21382352        )
     2353#endif
    21392354      {
    21402355        continue;
    21412356      }
     2357#endif
     2358     
     2359#if RWTH_SDC_DLT_B0036
     2360      UInt uiUseSDC = ( m_pcEncCfg->getUseSDC() && pcCU->getPartitionSize(uiPartOffset) == SIZE_2Nx2N )?1:0;
     2361     
     2362      for( UInt uiSDC=0; uiSDC<=uiUseSDC; uiSDC++ )
     2363      {
     2364        for( UInt uiRes = 0; uiRes<=uiUseSDC; uiRes++ )
     2365        {
    21422366#endif
    21432367
     
    21632387      }
    21642388#endif
    2165 
     2389#if RWTH_SDC_DLT_B0036
     2390          // last check: if not available for current intra prediction mode, don't try
     2391          if( uiSDC == 1 && !pcCU->getSDCAvailable(uiPartOffset) )
     2392            continue;
     2393         
     2394          pcCU->setSDCFlagSubParts( uiSDC == 1, uiPartOffset, 0, uiDepth + uiInitTrDepth );
     2395         
     2396          if(uiSDC == 1)
     2397          {
     2398            pcCU->setTrIdxSubParts(0, uiPartOffset, uiDepth + uiInitTrDepth);
     2399            pcCU->setCbfSubParts(1, 1, 1, uiPartOffset, uiDepth + uiInitTrDepth);
     2400           
     2401            // start encoding with SDC
     2402            xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, (uiRes==1));
     2403          }
     2404          else
     2405          {
     2406#endif
    21662407#if HHI_RQT_INTRA_SPEEDUP
    2167 #if LG_ZEROINTRADEPTHRESI_M26039
     2408#if LG_ZEROINTRADEPTHRESI_A0087
    21682409      xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, true, dPUCost, bZeroResi );
    21692410#else
     
    21722413#else
    21732414      xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, dPUCost );
     2415#endif
     2416#if RWTH_SDC_DLT_B0036
     2417          }
    21742418#endif
    21752419     
     
    21852429        uiBestPUDistC = uiPUDistC;
    21862430        dBestPUCost   = dPUCost;
     2431       
     2432#if RWTH_SDC_DLT_B0036
     2433        if( uiSDC == 1 )
     2434        {
     2435          bBestUseSDC = true;
     2436         
     2437          // copy reconstruction
     2438          pcPredYuv->copyPartToPartYuv(pcRecoYuv, uiPartOffset, uiWidth, uiHeight);
     2439         
     2440          // copy DC values
     2441          apBestDCOffsets[0] = pcCU->getSDCSegmentDCOffset(0, uiPartOffset);
     2442          apBestDCOffsets[1] = pcCU->getSDCSegmentDCOffset(1, uiPartOffset);
     2443        }
     2444        else
     2445        {
     2446          bBestUseSDC = false;
     2447#endif
     2448       
     2449        xSetIntraResultQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcRecoYuv );
     2450       
     2451        UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> ( ( pcCU->getDepth(0) + uiInitTrDepth ) << 1 );
     2452        ::memcpy( m_puhQTTempTrIdx,  pcCU->getTransformIdx()       + uiPartOffset, uiQPartNum * sizeof( UChar ) );
     2453        ::memcpy( m_puhQTTempCbf[0], pcCU->getCbf( TEXT_LUMA     ) + uiPartOffset, uiQPartNum * sizeof( UChar ) );
     2454        ::memcpy( m_puhQTTempCbf[1], pcCU->getCbf( TEXT_CHROMA_U ) + uiPartOffset, uiQPartNum * sizeof( UChar ) );
     2455        ::memcpy( m_puhQTTempCbf[2], pcCU->getCbf( TEXT_CHROMA_V ) + uiPartOffset, uiQPartNum * sizeof( UChar ) );
     2456#if RWTH_SDC_DLT_B0036
     2457        }
     2458#endif
     2459      }
     2460#if HHI_RQT_INTRA_SPEEDUP_MOD
     2461      else if( dPUCost < dSecondBestPUCost )
     2462      {
     2463        uiSecondBestMode  = uiOrgMode;
     2464        dSecondBestPUCost = dPUCost;
     2465      }
     2466#endif
     2467#if LG_ZEROINTRADEPTHRESI_A0087
     2468    }
     2469#endif
     2470#if RWTH_SDC_DLT_B0036
     2471      } // SDC residual loop
     2472    } // SDC loop
     2473#endif
     2474    } // Mode loop
     2475   
     2476#if HHI_RQT_INTRA_SPEEDUP
     2477#if HHI_RQT_INTRA_SPEEDUP_MOD
     2478    for( UInt ui =0; ui < 2; ++ui )
     2479#endif
     2480    {
     2481#if HHI_RQT_INTRA_SPEEDUP_MOD
     2482      UInt uiOrgMode   = ui ? uiSecondBestMode  : uiBestPUMode;
     2483      if( uiOrgMode == MAX_UINT )
     2484      {
     2485        break;
     2486      }
     2487#else
     2488      UInt uiOrgMode = uiBestPUMode;
     2489#endif
     2490     
     2491      pcCU->setLumaIntraDirSubParts ( uiOrgMode, uiPartOffset, uiDepth + uiInitTrDepth );
     2492     
     2493      // set context models
     2494      if( m_bUseSBACRD )
     2495      {
     2496        m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] );
     2497      }
     2498     
     2499      // determine residual for partition
     2500      Dist   uiPUDistY = 0;
     2501      Dist   uiPUDistC = 0;
     2502      Double dPUCost   = 0.0;
     2503
     2504#if HHI_VSO
     2505      // reset Model
     2506      if( m_pcRdCost->getUseRenModel() )
     2507      {
     2508        m_pcRdCost->setRenModelData( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight );
     2509      }
     2510#endif
     2511
     2512      xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, false, dPUCost );
     2513     
     2514      // check r-d cost
     2515      if( dPUCost < dBestPUCost )
     2516      {
     2517        uiBestPUMode  = uiOrgMode;
     2518        uiBestPUDistY = uiPUDistY;
     2519        uiBestPUDistC = uiPUDistC;
     2520        dBestPUCost   = dPUCost;
     2521#if RWTH_SDC_DLT_B0036
     2522        bBestUseSDC   = false;
     2523#endif
    21872524       
    21882525        xSetIntraResultQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcRecoYuv );
     
    21952532       
    21962533      }
    2197 #if HHI_RQT_INTRA_SPEEDUP_MOD
    2198       else if( dPUCost < dSecondBestPUCost )
    2199       {
    2200         uiSecondBestMode  = uiOrgMode;
    2201         dSecondBestPUCost = dPUCost;
    2202       }
    2203 #endif
    2204 #if LG_ZEROINTRADEPTHRESI_M26039
    2205     }
    2206 #endif
    2207     } // Mode loop
    2208    
    2209 #if HHI_RQT_INTRA_SPEEDUP
    2210 #if HHI_RQT_INTRA_SPEEDUP_MOD
    2211     for( UInt ui =0; ui < 2; ++ui )
    2212 #endif
    2213     {
    2214 #if HHI_RQT_INTRA_SPEEDUP_MOD
    2215       UInt uiOrgMode   = ui ? uiSecondBestMode  : uiBestPUMode;
    2216       if( uiOrgMode == MAX_UINT )
    2217       {
    2218         break;
    2219       }
    2220 #else
    2221       UInt uiOrgMode = uiBestPUMode;
    2222 #endif
    2223      
    2224       pcCU->setLumaIntraDirSubParts ( uiOrgMode, uiPartOffset, uiDepth + uiInitTrDepth );
    2225      
    2226       // set context models
    2227       if( m_bUseSBACRD )
    2228       {
    2229         m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] );
    2230       }
    2231      
    2232       // determine residual for partition
    2233       Dist   uiPUDistY = 0;
    2234       Dist   uiPUDistC = 0;
    2235       Double dPUCost   = 0.0;
    2236 
    2237 #if HHI_VSO
    2238       // reset Model
    2239       if( m_pcRdCost->getUseRenModel() )
    2240       {
    2241         m_pcRdCost->setRenModelData( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight );
    2242       }
    2243 #endif
    2244 
    2245       xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, false, dPUCost );
    2246      
    2247       // check r-d cost
    2248       if( dPUCost < dBestPUCost )
    2249       {
    2250         uiBestPUMode  = uiOrgMode;
    2251         uiBestPUDistY = uiPUDistY;
    2252         uiBestPUDistC = uiPUDistC;
    2253         dBestPUCost   = dPUCost;
    2254        
    2255         xSetIntraResultQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcRecoYuv );
    2256        
    2257         UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> ( ( pcCU->getDepth(0) + uiInitTrDepth ) << 1 );
    2258         ::memcpy( m_puhQTTempTrIdx,  pcCU->getTransformIdx()       + uiPartOffset, uiQPartNum * sizeof( UChar ) );
    2259         ::memcpy( m_puhQTTempCbf[0], pcCU->getCbf( TEXT_LUMA     ) + uiPartOffset, uiQPartNum * sizeof( UChar ) );
    2260         ::memcpy( m_puhQTTempCbf[1], pcCU->getCbf( TEXT_CHROMA_U ) + uiPartOffset, uiQPartNum * sizeof( UChar ) );
    2261         ::memcpy( m_puhQTTempCbf[2], pcCU->getCbf( TEXT_CHROMA_V ) + uiPartOffset, uiQPartNum * sizeof( UChar ) );
    2262        
    2263       }
    22642534    } // Mode loop
    22652535#endif
     
    22682538    uiOverallDistY += uiBestPUDistY;
    22692539    uiOverallDistC += uiBestPUDistC;
     2540   
     2541#if RWTH_SDC_DLT_B0036
     2542    if( bBestUseSDC )
     2543    {
     2544      pcCU->setTrIdxSubParts(0, uiPartOffset, uiDepth + uiInitTrDepth);
     2545      pcCU->setCbfSubParts(1, 1, 1, uiPartOffset, uiDepth + uiInitTrDepth);
     2546     
     2547      //=== copy best DC segment values back to CU ====
     2548      pcCU->setSDCSegmentDCOffset(apBestDCOffsets[0], 0, uiPartOffset);
     2549      pcCU->setSDCSegmentDCOffset(apBestDCOffsets[1], 1, uiPartOffset);
     2550    }
     2551    else
     2552    {
     2553#endif
    22702554   
    22712555    //--- update transform index and cbf ---
     
    22752559    ::memcpy( pcCU->getCbf( TEXT_CHROMA_U ) + uiPartOffset, m_puhQTTempCbf[1], uiQPartNum * sizeof( UChar ) );
    22762560    ::memcpy( pcCU->getCbf( TEXT_CHROMA_V ) + uiPartOffset, m_puhQTTempCbf[2], uiQPartNum * sizeof( UChar ) );
     2561#if RWTH_SDC_DLT_B0036
     2562    }
     2563#endif
    22772564   
    22782565    //--- set reconstruction for next intra prediction blocks ---
     
    23452632    //=== update PU data ====
    23462633    pcCU->setLumaIntraDirSubParts     ( uiBestPUMode, uiPartOffset, uiDepth + uiInitTrDepth );
     2634#if RWTH_SDC_DLT_B0036
     2635    pcCU->setSDCFlagSubParts          ( bBestUseSDC, uiPartOffset, 0, uiDepth + uiInitTrDepth );
     2636#endif
    23472637    pcCU->copyToPic                   ( uiDepth, uiPU, uiInitTrDepth );
    23482638  } // PU loop
     
    26442934                            iWidth, iHeight, m_pcEncCfg->getUseHADME() );
    26452935#endif
     2936#if LGE_ILLUCOMP_B0045
     2937  cDistParam.bUseIC = false;
     2938#endif
    26462939  ruiErr = cDistParam.DistFunc( &cDistParam );
    26472940}
     
    26612954 */
    26622955#if CU_BASED_MRG_CAND_LIST
     2956#if LG_RESTRICTEDRESPRED_M24766
     2957Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, TComYuv* rpcResiPredYuv, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost, TComMvField* cMvFieldNeighbours, UChar* uhInterDirNeighbours, Int& numValidMergeCand )
     2958#else
    26632959Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost, TComMvField* cMvFieldNeighbours, UChar* uhInterDirNeighbours, Int& numValidMergeCand )
     2960#endif
    26642961#else
    26652962#if LG_RESTRICTEDRESPRED_M24766
     
    29633260    for (Int iNumRef=0; iNumRef < MAX_NUM_REF; iNumRef++) uiCostTempL0[iNumRef] = MAX_UINT;
    29643261    UInt          uiBitsTempL0[MAX_NUM_REF];
    2965 
    29663262#if LG_RESTRICTEDRESPRED_M24766
    29673263    Int iPUResiPredShift[4] = {0, 0, 0, 0};
     
    37724068      UInt uiMRGCost = MAX_UINT;
    37734069#if CU_BASED_MRG_CAND_LIST
     4070#if LG_RESTRICTEDRESPRED_M24766
     4071      xMergeEstimation( pcCU, pcOrgYuv, rpcResiPredYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand);
     4072#else
    37744073      xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand);
     4074#endif
    37754075#else
    37764076#if LG_RESTRICTEDRESPRED_M24766
     
    41104410    cMvCand <<= 2;
    41114411#endif
     4412
     4413#if LGE_ILLUCOMP_B0045
     4414#if VSP_AIC
     4415  Bool bICFlag = pcCU->getICFlag(uiPartAddr) && (pcCU->getSlice()->getPOC() == pcCU->getSlice()->getRefPOC(eRefPicList, iRefIdx));
     4416#else
     4417  Bool bICFlag = pcCU->getICFlag(uiPartAddr) && (pcCU->getSlice()->getViewId() != pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdx));
     4418#endif
     4419#endif
    41124420  // prediction pattern
    41134421  if ( pcCU->getSlice()->getPPS()->getUseWP() && pcCU->getSlice()->getSliceType()==P_SLICE )
     
    41174425  else
    41184426  {
     4427#if LGE_ILLUCOMP_B0045
     4428    xPredInterLumaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMvCand, iSizeX, iSizeY, pcTemplateCand, false, bICFlag );
     4429#else
    41194430    xPredInterLumaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMvCand, iSizeX, iSizeY, pcTemplateCand, false );
     4431#endif
    41204432  }
    41214433
     
    41734485  Int           iSrchRng      = ( bBi ? m_bipredSearchRange : m_iSearchRange );
    41744486#endif
     4487#if DV_V_RESTRICTION_B0037
     4488  Int           iVerDispSrchRng = m_iVerticalDisparitySearchRange; 
     4489#endif
    41754490  TComPattern*  pcPatternKey  = pcCU->getPattern        ();
    41764491 
     
    41794494  pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iRoiWidth, iRoiHeight );
    41804495 
     4496#if LGE_ILLUCOMP_B0045
     4497#if VSP_AIC
     4498  Bool bICFlag = pcCU->getICFlag(uiPartAddr) && (pcCU->getSlice()->getPOC() == pcCU->getSlice()->getRefPOC(eRefPicList, iRefIdxPred));
     4499#else
     4500  Bool bICFlag = pcCU->getICFlag(uiPartAddr) && (pcCU->getSlice()->getViewId() != pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdxPred));
     4501#endif
     4502  pcPatternKey->setICFlag(bICFlag);
     4503#endif
     4504
    41814505  if ( bBi )
    41824506  {
     
    42044528 
    42054529  TComMv      cMvPred = *pcMvPred;
    4206  
     4530
     4531#if DV_V_RESTRICTION_B0037
     4532  Bool bMv_VRng_Restricted = false;
     4533  if( pcCU->getSlice()->getViewId() > 0
     4534      &&
     4535      pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxPred )->getPOC() == pcCU->getSlice()->getPOC()
     4536      &&
     4537      m_bUseDisparitySearchRangeRestriction
     4538     )
     4539  {
     4540      bMv_VRng_Restricted = true;
     4541  }
     4542#endif
     4543
     4544#if DV_V_RESTRICTION_B0037
     4545  if ( bBi )  xSetSearchRange   ( pcCU, rcMv   , iSrchRng, cMvSrchRngLT, cMvSrchRngRB, bMv_VRng_Restricted, iVerDispSrchRng );
     4546  else        xSetSearchRange   ( pcCU, cMvPred, iSrchRng, cMvSrchRngLT, cMvSrchRngRB, bMv_VRng_Restricted, iVerDispSrchRng );
     4547#else
    42074548  if ( bBi )  xSetSearchRange   ( pcCU, rcMv   , iSrchRng, cMvSrchRngLT, cMvSrchRngRB );
    42084549  else        xSetSearchRange   ( pcCU, cMvPred, iSrchRng, cMvSrchRngLT, cMvSrchRngRB );
    4209  
     4550#endif
     4551
    42104552  m_pcRdCost->getMotionCost ( 1, 0 );
    42114553 
     
    42354577    if( bMultiviewReg && !bBi )
    42364578    {
     4579#if DV_V_RESTRICTION_B0037
     4580      xSetSearchRange( pcCU, cOrgDepthMapMv, iSrchRng, cMvSrchRngLT, cMvSrchRngRB, bMv_VRng_Restricted, iVerDispSrchRng  );
     4581#else
    42374582      xSetSearchRange( pcCU, cOrgDepthMapMv, iSrchRng, cMvSrchRngLT, cMvSrchRngRB );
     4583#endif
    42384584    }
    42394585  }
     
    42444590  }
    42454591#endif
    4246 
     4592#if QC_MVHEVC_B0046
     4593  m_pcRdCost->setMultiviewReg( 0 );
     4594#endif
    42474595  setWpScalingDistParam( pcCU, iRefIdxPred, eRefPicList );
    42484596  //  Do integer search
     
    42624610 
    42634611  m_pcRdCost->getMotionCost( 1, 0 );
    4264 
    42654612#if HHI_FULL_PEL_DEPTH_MAP_MV_ACC
    42664613  if( ! pcCU->getSlice()->getIsDepth() )
     
    43054652}
    43064653
    4307 
     4654#if DV_V_RESTRICTION_B0037
     4655Void TEncSearch::xSetSearchRange ( TComDataCU* pcCU, TComMv& cMvPred, Int iSrchRng, TComMv& rcMvSrchRngLT, TComMv& rcMvSrchRngRB, Bool bMv_VRng_Restricted, Int iVerDispSrchRng )
     4656#else
    43084657Void TEncSearch::xSetSearchRange ( TComDataCU* pcCU, TComMv& cMvPred, Int iSrchRng, TComMv& rcMvSrchRngLT, TComMv& rcMvSrchRngRB )
     4658#endif
    43094659{
    43104660  Int  iMvShift = 2;
     
    43214671  rcMvSrchRngRB.setHor( cTmpMvPred.getHor() + (iSrchRng << iMvShift) );
    43224672  rcMvSrchRngRB.setVer( cTmpMvPred.getVer() + (iSrchRng << iMvShift) );
     4673
     4674#if DV_V_RESTRICTION_B0037
     4675  if ( bMv_VRng_Restricted ) {
     4676    Int iRestrictMvVrange = ( iVerDispSrchRng ) << iMvShift;   
     4677    if ( rcMvSrchRngRB.getVer() >= iRestrictMvVrange  ){
     4678      rcMvSrchRngRB.setVer( iRestrictMvVrange );
     4679    }
     4680    //restrict minus vector too
     4681    if ( rcMvSrchRngLT.getVer() <= -iRestrictMvVrange ){
     4682      rcMvSrchRngLT.setVer( -iRestrictMvVrange );
     4683    }
     4684  }
     4685#endif
    43234686  pcCU->clipMv        ( rcMvSrchRngLT );
    43244687  pcCU->clipMv        ( rcMvSrchRngRB );
     
    43654728      setDistParamComp(0);
    43664729
     4730#if LGE_ILLUCOMP_B0045
     4731      m_cDistParam.bUseIC = pcPatternKey->getICFlag();
     4732#endif
    43674733      uiSad = m_cDistParam.DistFunc( &m_cDistParam );
    43684734     
     
    47365102    m_pcEntropyCoder->encodeSkipFlag(pcCU, 0, true);
    47375103    m_pcEntropyCoder->encodeMergeIndex( pcCU, 0, 0, true );
     5104#if LGE_ILLUCOMP_B0045
     5105    m_pcEntropyCoder->encodeICFlag(pcCU, 0, true);
     5106#endif
    47385107#if HHI_INTER_VIEW_RESIDUAL_PRED
    47395108    m_pcEntropyCoder->encodeResPredFlag( pcCU, 0, 0, true );
     
    54865855    }
    54875856   
     5857#if FIX_RDO_NEGDIST
     5858    Dist uiDistU = 0;
     5859    Dist uiDistV = 0;
     5860#else
    54885861    UInt uiDistU = 0;
    54895862    UInt uiDistV = 0;
     5863#endif
    54905864    if( bCodeChroma )
    54915865    {
     
    55255899#endif       
    55265900       
     5901#if FIX_RDO_NEGDIST
     5902        const Dist uiNonzeroDistU = m_pcRdCost->getDistPart( m_pcQTTempTComYuv[uiQTTempAccessLayer].getCbAddr( absTUPartIdxC), m_pcQTTempTComYuv[uiQTTempAccessLayer].getCStride(),
     5903          pcResi->getCbAddr( absTUPartIdxC), pcResi->getCStride(), trWidthC, trHeightC
     5904
     5905#else
    55275906        const UInt uiNonzeroDistU = m_pcRdCost->getDistPart( m_pcQTTempTComYuv[uiQTTempAccessLayer].getCbAddr( absTUPartIdxC), m_pcQTTempTComYuv[uiQTTempAccessLayer].getCStride(),
    55285907          pcResi->getCbAddr( absTUPartIdxC), pcResi->getCStride(), trWidthC, trHeightC
     5908#endif
    55295909#if WEIGHTED_CHROMA_DISTORTION
    55305910          , true
     
    56115991        m_pcTrQuant->invtransformNxN( TEXT_CHROMA,REG_DCT, pcResiCurrV, m_pcQTTempTComYuv[uiQTTempAccessLayer].getCStride(), pcCoeffCurrV, trWidthC, trHeightC, scalingListType );
    56125992#endif
    5613        
     5993#if FIX_RDO_NEGDIST
     5994        const Dist uiNonzeroDistV = m_pcRdCost->getDistPart( m_pcQTTempTComYuv[uiQTTempAccessLayer].getCrAddr( absTUPartIdxC ), m_pcQTTempTComYuv[uiQTTempAccessLayer].getCStride(),
     5995          pcResi->getCrAddr( absTUPartIdxC ), pcResi->getCStride(), trWidthC, trHeightC
     5996#else
    56145997        const UInt uiNonzeroDistV = m_pcRdCost->getDistPart( m_pcQTTempTComYuv[uiQTTempAccessLayer].getCrAddr( absTUPartIdxC ), m_pcQTTempTComYuv[uiQTTempAccessLayer].getCStride(),
    56155998          pcResi->getCrAddr( absTUPartIdxC ), pcResi->getCStride(), trWidthC, trHeightC
     5999#endif
    56166000#if WEIGHTED_CHROMA_DISTORTION
    56176001                                                   , true
     
    61106494#endif
    61116495    m_pcEntropyCoder->encodeMergeIndex(pcCU, 0, 0, true);
     6496#if LGE_ILLUCOMP_B0045
     6497    m_pcEntropyCoder->encodeICFlag(pcCU, 0, true);
     6498#endif
    61126499#if HHI_INTER_VIEW_RESIDUAL_PRED
    61136500    m_pcEntropyCoder->encodeResPredFlag( pcCU, 0, 0, true );
     
    61396526    m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth(0), true );
    61406527    m_pcEntropyCoder->encodePredInfo( pcCU, 0, true );
     6528#if LGE_ILLUCOMP_B0045
     6529    m_pcEntropyCoder->encodeICFlag(pcCU, 0, true);
     6530#endif
    61416531#if HHI_INTER_VIEW_RESIDUAL_PRED
    61426532    m_pcEntropyCoder->encodeResPredFlag( pcCU, 0, 0, true );
     
    63966786
    63976787#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     6788#if ((HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX)&&FLEX_CODING_ORDER_M23723)
     6789Bool TEncSearch::predIntraLumaDMMAvailable( UInt uiMode, UInt uiWidth, UInt uiHeight, Bool bDMMAvailable34 )
     6790#else
    63986791Bool TEncSearch::predIntraLumaDMMAvailable( UInt uiMode, UInt uiWidth, UInt uiHeight )
     6792#endif
    63996793{
    64006794  if( uiMode < NUM_INTRA_MODE ) return true;
     
    64246818      bDMMAvailable = false;
    64256819    }
     6820
     6821#if FLEX_CODING_ORDER_M23723
     6822    if ( !bDMMAvailable34 )
     6823    {
     6824      bDMMAvailable = false;
     6825    }
     6826#endif
     6827
    64266828  }
    64276829#endif
     
    64946896       
    64956897        Dist uiActDist = RDO_DIST_MAX;
    6496 #if FIX_RDO_MACRO
    64976898#if SAIT_VSO_EST_A0033
    64986899        if ( m_pcRdCost->getUseEstimatedVSD() )
     
    65256926#endif // LGE_WVSO_A0119
    65266927        }
    6527 #else // FIX_RDO_MACRO
    6528 #if SAIT_VSO_EST_A0033
    6529         if ( m_pcRdCost->getUseEstimatedVSD() )
    6530         {         
    6531           TComPicYuv* pcVirRec = m_pcRdCost->getVideoRecPicYuv();
    6532           TComPicYuv* pcVirOrg = m_pcRdCost->getDepthPicYuv();
    6533           uiActDist = m_pcRdCost->getDistPart( piPredic, uiStride, piOrig, uiStride, pcVirRec->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()), pcVirOrg->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()), pcVirRec->getStride(), uiWidth, uiHeight );
    6534 #if LGE_WVSO_A0119
    6535           if ( m_pcRdCost->getUseWVSO() )
    6536           {   
    6537             Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight();
    6538             Int iVSDWeight = m_pcRdCost->getVSDWeight() * m_pcRdCost->getVSDWeight();
    6539             Dist iD = (Dist) m_pcRdCost->getDistPart( piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false, DF_SAD );
    6540             uiActDist = (iDWeight * iD + iVSDWeight * (Dist) uiActDist) / ( iDWeight + iVSDWeight);
    6541           }
    6542 #endif // LGE_WVSO_A0119
    6543         }
    6544         else       
    6545 #else  // SAIT_VSO_EST_A0033 <-- wrong #else statement should be #endif
    6546         {       
    6547           uiActDist = m_pcRdCost->getDistVS( pcCU, 0, piPredic, uiStride,  piOrig, uiStride, uiWidth, uiHeight, false, 0 );
    6548 #if LGE_WVSO_A0119
    6549           if ( m_pcRdCost->getUseWVSO() )
    6550           {   
    6551             Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight();
    6552             Int iVSOWeight = m_pcRdCost->getVSOWeight() * m_pcRdCost->getVSOWeight();
    6553             Dist iD = (Dist) m_pcRdCost->getDistPart( piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false, DF_SAD );
    6554             uiActDist = (iDWeight * iD + iVSOWeight * (Dist) uiActDist) / ( iDWeight + iVSOWeight);
    6555           }
    6556 #endif // LGE_WVSO_A0119
    6557         }
    6558 #endif // SAIT_VSO_EST_A0033 <-- wrong #endif should be removed
    6559 #endif // FIX_RDO_MACRO
    65606928
    65616929        if( uiActDist < uiBestDist || uiBestDist == RDO_DIST_MAX )
     
    65996967  WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[uiWidth])];
    66006968  Dist iDist = RDO_DIST_MAX;
     6969#if HHIQC_DMMFASTSEARCH_B0039
     6970  WedgeNodeList* pacWedgeNodeList = &g_aacWedgeNodeLists[(g_aucConvertToBit[uiWidth])];
     6971  xSearchWedgeFullMinDistFast( pcCU, uiAbsPtIdx, pacWedgeNodeList, pacWedgeList, piOrig, uiStride, uiWidth, uiHeight, ruiTabIdx, iDist );
     6972#else
    66016973  xSearchWedgeFullMinDist( pcCU, uiAbsPtIdx, pacWedgeList, piOrig, uiStride, uiWidth, uiHeight, ruiTabIdx, iDist );
     6974#endif
    66026975
    66036976  TComWedgelet* pcBestWedgelet = &(pacWedgeList->at(ruiTabIdx));
     
    67107083}
    67117084
     7085#if HHIQC_DMMFASTSEARCH_B0039
     7086Void TEncSearch::xSearchWedgeFullMinDistFast( TComDataCU* pcCU, UInt uiAbsPtIdx, WedgeNodeList* pacWedgeNodeList, WedgeList* pacWedgeList, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, Dist& riDist )
     7087{
     7088  ruiTabIdx = 0;
     7089
     7090  // local pred buffer
     7091  TComYuv cPredYuv;
     7092  cPredYuv.create( uiWidth, uiHeight );
     7093  cPredYuv.clear();
     7094
     7095  UInt uiPredStride = cPredYuv.getStride();
     7096  Pel* piPred       = cPredYuv.getLumaAddr();
     7097
     7098  Int  iDC1 = 0;
     7099  Int  iDC2 = 0;
     7100
     7101  // coarse wedge search
     7102  Dist uiBestDist   = RDO_DIST_MAX;
     7103  UInt uiBestNodeId = 0;
     7104  for( UInt uiNodeId = 0; uiNodeId < pacWedgeNodeList->size(); uiNodeId++ )
     7105  {
     7106    calcWedgeDCs       ( &(pacWedgeList->at(pacWedgeNodeList->at(uiNodeId).getPatternIdx())), piRef,  uiRefStride,  iDC1, iDC2 );
     7107    assignWedgeDCs2Pred( &(pacWedgeList->at(pacWedgeNodeList->at(uiNodeId).getPatternIdx())), piPred, uiPredStride, iDC1, iDC2 );
     7108
     7109    Dist uiActDist = RDO_DIST_MAX;
     7110#if HHI_VSO
     7111    if( m_pcRdCost->getUseVSO() )
     7112    {
     7113#if SAIT_VSO_EST_A0033
     7114      if ( m_pcRdCost->getUseEstimatedVSD() )
     7115      {         
     7116        TComPicYuv* pcVirRec = m_pcRdCost->getVideoRecPicYuv();
     7117        TComPicYuv* pcVirOrg = m_pcRdCost->getDepthPicYuv();
     7118        uiActDist = m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, pcVirRec->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()), pcVirOrg->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()), pcVirRec->getStride(), uiWidth, uiHeight );
     7119#if LGE_WVSO_A0119
     7120        if ( m_pcRdCost->getUseWVSO() )
     7121        {   
     7122          Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight();
     7123          Int iVSDWeight = m_pcRdCost->getVSDWeight() * m_pcRdCost->getVSDWeight();
     7124          Dist iD = (Dist) m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, DF_SAD );
     7125          uiActDist = (iDWeight * iD + iVSDWeight * (Int) uiActDist) / ( iDWeight + iVSDWeight);
     7126        }
     7127#endif
     7128      }
     7129      else
     7130#endif
     7131      {
     7132        uiActDist = m_pcRdCost->getDistVS( pcCU, 0, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, 0 );
     7133#if LGE_WVSO_A0119
     7134        if ( m_pcRdCost->getUseWVSO() )
     7135        {   
     7136          Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight();
     7137          Int iVSOWeight = m_pcRdCost->getVSOWeight() * m_pcRdCost->getVSOWeight();
     7138          Dist iD = (Dist) m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, DF_SAD );
     7139          uiActDist = (iDWeight * iD + iVSOWeight * (Int) uiActDist) / ( iDWeight + iVSOWeight);
     7140        }
     7141#endif
     7142      }
     7143    }
     7144    else
     7145    {
     7146      uiActDist = m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, DF_SAD );
     7147    }
     7148#else
     7149    uiActDist = m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, DF_SAD );
     7150#endif
     7151    if( uiActDist < uiBestDist || uiBestDist == RDO_DIST_MAX )
     7152    {
     7153      uiBestDist   = uiActDist;
     7154      uiBestNodeId = uiNodeId;
     7155    }
     7156  }
     7157
     7158  // refinement
     7159  Dist uiBestDistRef = uiBestDist;
     7160  UInt uiBestTabIdxRef  = pacWedgeNodeList->at(uiBestNodeId).getPatternIdx();
     7161  for( UInt uiRefId = 0; uiRefId < NUM_WEDGE_REFINES; uiRefId++ )
     7162  {
     7163    if( pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId ) != NO_IDX )
     7164    {
     7165      calcWedgeDCs       ( &(pacWedgeList->at(pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId ))), piRef,  uiRefStride,  iDC1, iDC2 );
     7166      assignWedgeDCs2Pred( &(pacWedgeList->at(pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId ))), piPred, uiPredStride, iDC1, iDC2 );
     7167
     7168      Dist uiActDist = RDO_DIST_MAX;
     7169#if HHI_VSO
     7170      if( m_pcRdCost->getUseVSO() )
     7171      {
     7172        uiActDist = m_pcRdCost->getDistVS( pcCU, 0, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, 0 );
     7173#if LGE_WVSO_A0119
     7174        if ( m_pcRdCost->getUseWVSO() )
     7175        {   
     7176          Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight();
     7177          Int iVSOWeight = m_pcRdCost->getVSOWeight() * m_pcRdCost->getVSOWeight();
     7178          Dist iD = (Dist) m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, DF_SAD );
     7179          uiActDist = (iDWeight * iD + iVSOWeight * (Int) uiActDist) / ( iDWeight + iVSOWeight);
     7180        }
     7181#endif
     7182      }
     7183      else
     7184      {
     7185        uiActDist = m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, DF_SAD );
     7186      }
     7187#else
     7188      uiActDist = m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, DF_SAD );
     7189#endif
     7190      if( uiActDist < uiBestDistRef || uiBestDistRef == RDO_DIST_MAX )
     7191      {
     7192        uiBestDistRef   = uiActDist;
     7193        uiBestTabIdxRef = pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId );
     7194      }
     7195    }
     7196  }
     7197
     7198  riDist    = uiBestDistRef;
     7199  ruiTabIdx = uiBestTabIdxRef;
     7200
     7201  cPredYuv.destroy();
     7202  return;
     7203}
     7204#endif
     7205
    67127206Void TEncSearch::xSearchWedgePredDirMinDist( TComDataCU* pcCU, UInt uiAbsPtIdx, WedgeList* pacWedgeList, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, Int& riWedgeDeltaEnd )
    67137207{
     
    68467340#endif
    68477341
    6848 #if LGE_EDGE_INTRA
     7342#if LGE_EDGE_INTRA_A0070
    68497343Bool TEncSearch::xCheckTerminatedEdge( Bool* pbEdge, Int iX, Int iY, Int iWidth, Int iHeight )
    68507344{
     
    79548448#endif
    79558449#endif
     8450 
     8451#if RWTH_SDC_DLT_B0036
     8452Void TEncSearch::xAnalyzeSegmentsSDC( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride )
     8453{
     8454  Int iSumDepth[2];
     8455  memset(iSumDepth, 0, sizeof(Int)*2);
     8456  Int iSumPix[2];
     8457  memset(iSumPix, 0, sizeof(Int)*2);
     8458 
     8459  for (Int y=0; y<uiSize; y++)
     8460  {
     8461    for (Int x=0; x<uiSize; x++)
     8462    {
     8463      UChar ucSegment = pMask?(UChar)pMask[x]:0;
     8464      assert( ucSegment < uiNumSegments );
     8465     
     8466      iSumDepth[ucSegment] += pOrig[x];
     8467      iSumPix[ucSegment]   += 1;
     8468    }
     8469   
     8470    pOrig  += uiStride;
     8471    pMask  += uiMaskStride;
     8472  }
     8473 
     8474  // compute mean for each segment
     8475  for( UChar ucSeg = 0; ucSeg < uiNumSegments; ucSeg++ )
     8476  {
     8477    if( iSumPix[ucSeg] > 0 )
     8478      rpSegMeans[ucSeg] = iSumDepth[ucSeg] / iSumPix[ucSeg];
     8479    else
     8480      rpSegMeans[ucSeg] = 0;  // this happens for zero-segments
     8481  }
     8482}
     8483#endif
    79568484
    79578485//! \}
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncSearch.h

    r166 r213  
    9494  Int             m_iSearchRange;
    9595  Int             m_bipredSearchRange; // Search range for bi-prediction
     96#if DV_V_RESTRICTION_B0037
     97  Bool            m_bUseDisparitySearchRangeRestriction;
     98  Int             m_iVerticalDisparitySearchRange;
     99#endif
    96100  Int             m_iFastSearch;
    97101  Int             m_aaiAdaptSR[2][33];
     
    132136            Int           iSearchRange,
    133137            Int           bipredSearchRange,
     138#if DV_V_RESTRICTION_B0037
     139            Bool          bUseDisparitySearchRangeRestriction,
     140            Int           iVerticalDisparitySearchRange,
     141#endif
    134142            Int           iFastSearch,
    135143            Int           iMaxDeltaQP,
     
    267275                                    TComYuv*     pcResiYuv,
    268276                                    Dist&        ruiDist
    269 #if LG_ZEROINTRADEPTHRESI_M26039
     277#if LG_ZEROINTRADEPTHRESI_A0087
    270278                                   ,Bool        bZeroResi = false
    271279#endif
     
    292300#endif
    293301                                    Double&      dRDCost
    294 #if LG_ZEROINTRADEPTHRESI_M26039
     302#if LG_ZEROINTRADEPTHRESI_A0087
    295303                                   ,Bool         bZeroResi = false
    296304#endif
     
    315323                                    TComYuv*     pcRecoYuv );
    316324 
     325#if RWTH_SDC_DLT_B0036
     326  Void  xAnalyzeSegmentsSDC       ( Pel* pOrig,
     327                                   UInt uiStride,
     328                                   UInt uiSize,
     329                                   Pel* rpSegMeans,
     330                                   UInt uiNumSegments,
     331                                   Bool* pMask,
     332                                   UInt uiMaskStride );
     333 
     334  Void  xIntraCodingSDC           ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bResidual );
     335#endif
     336 
    317337  // -------------------------------------------------------------------------------------------------------------------
    318338  // DMM intra search
     
    322342  Bool predIntraLumaDMMAvailable  ( UInt           uiMode,
    323343                                    UInt           uiWidth,
    324                                     UInt           uiHeight );
     344#if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER_M23723
     345                                    UInt         uiHeight,
     346                                    Bool         bDMMAvailable34 );
     347#else
     348                                    UInt         uiHeight );
     349#endif
     350
    325351  Void xGetWedgeDeltaDCsMinDist   ( TComWedgelet*  pcWedgelet,
    326352                                    TComDataCU*    pcCU,
     
    337363#endif
    338364
    339 #if LGE_EDGE_INTRA
     365#if LGE_EDGE_INTRA_A0070
    340366  Bool  xEdgePartition       ( TComDataCU* pcCU, UInt uiPartIdx, Bool bPU4x4 );
    341367  Bool  xCheckTerminatedEdge ( Bool* pbEdge, Int iX, Int iY, Int iWidth, Int iHeight );
     
    381407                                    UInt&          ruiTabIdx,
    382408                                    Dist&          riDist );
     409#if HHIQC_DMMFASTSEARCH_B0039
     410  Void xSearchWedgeFullMinDistFast( TComDataCU*    pcCU,
     411                                    UInt           uiAbsPtIdx,
     412                                    WedgeNodeList* pacWedgeNodeList,
     413                                    WedgeList*     pacWedgeList,
     414                                    Pel*           piRef,
     415                                    UInt           uiRefStride,
     416                                    UInt           uiWidth,
     417                                    UInt           uiHeight,
     418                                    UInt&          ruiTabIdx,
     419                                    Dist&          riDist );
     420#endif
    383421  Void xSearchWedgePredDirMinDist ( TComDataCU*    pcCU,
    384422                                    UInt           uiAbsPtIdx,
     
    509547                                    UInt&         ruiSAD );
    510548 
     549#if DV_V_RESTRICTION_B0037
     550  Void xSetSearchRange            ( TComDataCU*   pcCU,
     551                                    TComMv&       cMvPred,
     552                                    Int           iSrchRng,
     553                                    TComMv&       rcMvSrchRngLT,
     554                                    TComMv&       rcMvSrchRngRB,
     555                                    Bool          bDispSrchRngRst,
     556                                    Int           iDispVerSrchRng );
     557#else
    511558  Void xSetSearchRange            ( TComDataCU*   pcCU,
    512559                                    TComMv&       cMvPred,
     
    514561                                    TComMv&       rcMvSrchRngLT,
    515562                                    TComMv&       rcMvSrchRngRB );
     563#endif
    516564 
    517565  Void xPatternSearchFast         ( TComDataCU*   pcCU,
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncSlice.cpp

    r193 r213  
    3838#include "TEncTop.h"
    3939#include "TEncSlice.h"
    40 #if HHI_VSO_SPEEDUP_A0033
    4140#include "../../App/TAppEncoder/TAppEncTop.h"
    42 #endif
    4341#include <math.h>
    4442
     
    164162 \param pPPS          PPS associated with the slice
    165163 */
    166 #if VIDYO_VPS_INTEGRATION
     164#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    167165Void TEncSlice::initEncSlice( TComPic* pcPic, Int iPOCLast, UInt uiPOCCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComVPS * pVPS, TComSPS* pSPS, TComPPS *pPPS )
    168166#else
     
    174172 
    175173  rpcSlice = pcPic->getSlice(0);
    176 #if VIDYO_VPS_INTEGRATION
     174#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    177175  rpcSlice->setVPS( pVPS );
    178176#endif
     
    191189  rpcSlice->setViewOrderIdx(m_pcCfg->getViewOrderIdx());
    192190#endif
    193 
     191#if LGE_ILLUCOMP_B0045
     192  rpcSlice->setApplyIC(false);
     193#endif
    194194  // set mutliview parameters
    195195  rpcSlice->initMultiviewSlice( pcPic->getCodedScale(), pcPic->getCodedOffset() );
     
    648648  TComSlice* pcSlice            = rpcPic->getSlice(getSliceIdx());
    649649  xDetermineStartAndBoundingCUAddr ( uiStartCUAddr, uiBoundingCUAddr, rpcPic, false );
    650 #if LG_ZEROINTRADEPTHRESI_M26039
     650#if LG_ZEROINTRADEPTHRESI_A0087
    651651  rpcPic->setIntraPeriod(this->m_pcCfg->getIntraPeriod());
    652652#endif
     
    657657  m_uiPicDist       = 0;
    658658 
    659 #if CABAC_INIT_FLAG && POZNAN_CABAC_INIT_FLAG_FIX
     659#if CABAC_INIT_FLAG && FIX_POZNAN_CABAC_INIT_FLAG
    660660  Bool bReset =(pcSlice->getPOC() == 0) ||
    661661    (pcSlice->getPOC() % m_pcCfg->getIntraPeriod() == 0) ||
     
    769769  UInt uiTilesAcross  = 0;
    770770
     771#if LGE_ILLUCOMP_B0045
     772  if (pcEncTop->getViewId() != 0 && !pcEncTop->isDepthCoder() && pcEncTop->getUseIC())   // DCP of ViewID 0 is not available
     773  {
     774    pcSlice ->xSetApplyIC();
     775  }
     776#endif
     777
    771778  if( m_pcCfg->getUseSBACRD() )
    772779  {
     
    813820  UInt uiTileStartLCU = 0;
    814821  UInt uiTileLCUX     = 0;
    815 
    816 #if HHI_VSO_SPEEDUP_A0033
     822#if !QC_MVHEVC_B0046
    817823  Int iLastPosY = -1;
    818824#endif
    819 
    820825  // for every CU in slice
    821826  UInt uiEncCUOrder;
     
    828833    TComDataCU*& pcCU = rpcPic->getCU( uiCUAddr );
    829834    pcCU->initCU( rpcPic, uiCUAddr );
    830 
    831 #if HHI_VSO_SPEEDUP_A0033
     835#if !QC_MVHEVC_B0046
    832836    if ( m_pcRdCost->getUseRenModel() )
    833837    {
     
    844848    }   
    845849#endif
    846 
    847 #if OL_DEPTHLIMIT_A0044 //stop dumping partition information
    848     m_bDumpPartInfo = 0;
    849     pcCU->setPartDumpFlag(m_bDumpPartInfo);
    850 #endif
    851 
    852850    // inherit from TR if necessary, select substream to use.
    853851    if( m_pcCfg->getUseSBACRD() )
     
    13071305    }
    13081306
     1307#if OL_QTLIMIT_PREDCODING_B0068
     1308    rpcPic->setReduceBitsFlag(true);
     1309#endif
     1310
    13091311    TComDataCU*& pcCU = rpcPic->getCU( uiCUAddr );   
    1310 #if OL_DEPTHLIMIT_A0044
    1311     pcCU->setPartDumpFlag(m_bDumpPartInfo);
    1312     pcCU->resetPartInfo();
    1313 #endif
    13141312#if !REMOVE_TILE_DEPENDENCE
    13151313    if( (rpcPic->getPicSym()->getTileBoundaryIndependenceIdr()==0) && (rpcPic->getPicSym()->getNumColumnsMinus1()!=0) )
     
    13991397    }
    14001398#endif
     1399
     1400#if OL_QTLIMIT_PREDCODING_B0068
     1401    rpcPic->setReduceBitsFlag(false);
     1402#endif
     1403
    14011404  }
    14021405
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncSlice.h

    r193 r213  
    101101 
    102102  UInt                    m_uiSliceIdx;
    103 #if OL_DEPTHLIMIT_A0044 //flag to signal to start dumping
    104   Bool                    m_bDumpPartInfo;
    105 #endif
    106103public:
    107104  TEncSlice();
     
    113110 
    114111  /// preparation of slice encoding (reference marking, QP and lambda)
    115 #if VIDYO_VPS_INTEGRATION
     112#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    116113  Void    initEncSlice        ( TComPic*  pcPic, Int iPOCLast, UInt uiPOCCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComVPS* pVPS, TComSPS* pSPS, TComPPS *pPPS );
    117114#else
     
    131128  UInt    getSliceIdx()         { return m_uiSliceIdx;                    }
    132129  Void    setSliceIdx(UInt i)   { m_uiSliceIdx = i;                       }
    133 #if OL_DEPTHLIMIT_A0044 //flag to signal to start dumping
    134   Void    setPartDumpFlag(Bool flag) { m_bDumpPartInfo = flag;};
    135 #endif
    136130};
    137131
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncTop.cpp

    r193 r213  
    8888  m_bUseVSP = false;
    8989  m_bVSPDepthDisable = false;
     90  m_bIsFirstInView = false;
    9091#endif
    9192}
     
    101102{
    102103  // initialize global variables
    103 #if FIX_INIT_ROM
    104104  if( m_viewId == 0 && m_isDepth == false )
    105105  {
    106 #endif
    107106    initROM();
    108 #if FIX_INIT_ROM
    109   }
    110 #endif
     107  }
    111108
    112109
     
    414411 
    415412  // initialize encoder search class
     413#if DV_V_RESTRICTION_B0037
     414  m_cSearch.init( this, &m_cTrQuant, m_iSearchRange, m_bipredSearchRange, m_bUseDisparitySearchRangeRestriction, m_iVerticalDisparitySearchRange, m_iFastSearch, 0, &m_cEntropyCoder, &m_cRdCost, getRDSbacCoder(), getRDGoOnSbacCoder() );
     415#else
    416416  m_cSearch.init( this, &m_cTrQuant, m_iSearchRange, m_bipredSearchRange, m_iFastSearch, 0, &m_cEntropyCoder, &m_cRdCost, getRDSbacCoder(), getRDGoOnSbacCoder() );
    417 
     417#endif
    418418  if(m_bUseALF)
    419419  {
     
    428428
    429429#if VSP_N
     430  m_pcPicVSP->setIsVsp( true );
    430431  m_pcPicVSP->setCurrSliceIdx( 0 );
    431432  m_pcPicVSP->getCurrSlice()->setSPS( this->getSPS() );
     
    440441  }
    441442#if DEPTH_MAP_GENERATION
    442 #if !QC_MULTI_DIS_CAN
     443#if !QC_MULTI_DIS_CAN_A0097
    443444  // add extra pic buffers
    444445  Bool  bNeedPrdDepthMapBuf = ( m_uiPredDepthMapGeneration > 0 );
     
    450451#endif
    451452#endif
     453  m_pcPicAvail->setIsVsp( true );
    452454  m_pcPicAvail->setCurrSliceIdx( 0 );
    453455  m_pcPicAvail->getCurrSlice()->setSPS( this->getSPS() );
     
    462464  }
    463465#if DEPTH_MAP_GENERATION
    464 #if !QC_MULTI_DIS_CAN
     466#if !QC_MULTI_DIS_CAN_A0097
    465467  // add extra pic buffers
    466468  bNeedPrdDepthMapBuf = ( m_uiPredDepthMapGeneration > 0 );
     
    687689  // mark it should be extended
    688690  rpcPic->getPicYuvRec()->setBorderExtension(false);
    689 #if FIXES
    690691  rpcPic->getPicYuvOrg()->setBorderExtension(false);
    691 #endif
    692692}
    693693
     
    730730#endif
    731731 
     732#if RWTH_SDC_DLT_B0036
     733  m_cSPS.setUseDLT        ( m_bUseDLT );
     734#endif
     735 
    732736  m_cSPS.setQuadtreeTULog2MaxSize( m_uiQuadtreeTULog2MaxSize );
    733737  m_cSPS.setQuadtreeTULog2MinSize( m_uiQuadtreeTULog2MinSize );
     
    850854  m_cSPS.setUseDMM( m_bUseDMM );
    851855#endif
    852 #if OL_DEPTHLIMIT_A0044
    853   m_cSPS.setUseDPL( m_bDepthPartitionLimiting );
     856
     857#if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER_M23723
     858  m_cSPS.setUseDMM34( m_bUseDMM34 );
     859#endif
     860
     861#if OL_QTLIMIT_PREDCODING_B0068
     862  m_cSPS.setUseQTLPC( m_bUseQTLPC );
    854863#endif
    855864#if HHI_MPI
     
    857866#endif
    858867
     868#if VSP_N
     869  m_cSPS.setIsFirstInView( m_bIsFirstInView );
     870#endif
     871
    859872  if( m_isDepth )
    860873  {
     874#if VSP_N
     875    if( m_cSPS.getIsFirstInView() )
     876      m_cSPS.initMultiviewSPSFlex     ( m_viewId, m_iViewOrderIdx, true, m_cSPS.getIsFirstInView(), m_uiCamParPrecision, m_bCamParInSliceHeader, m_aaiCodedScale, m_aaiCodedOffset );
     877    else
     878      m_cSPS.initMultiviewSPSDepth    ( m_viewId, m_iViewOrderIdx );
     879#else
    861880    m_cSPS.initMultiviewSPSDepth    ( m_viewId, m_iViewOrderIdx );
     881#endif
    862882#if DEPTH_MAP_GENERATION
    863883    m_cSPS.setPredDepthMapGeneration( m_viewId, true );
     
    869889  else
    870890  {
     891#if QC_MVHEVC_B0046
     892    m_cSPS.initMultiviewSPS   ( m_viewId);
     893#else
    871894    m_cSPS.initMultiviewSPS           ( m_viewId, m_iViewOrderIdx, m_uiCamParPrecision, m_bCamParInSliceHeader, m_aaiCodedScale, m_aaiCodedOffset );
     895#endif
    872896    if( m_viewId )
    873897    {
     
    10831107Void TEncTop::selectReferencePictureSet(TComSlice* slice, Int POCCurr, Int GOPid,TComList<TComPic*>& listPic )
    10841108{
     1109#if QC_REM_IDV_B0046
     1110  if( (slice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR ||slice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA) && slice->getSPS()->getViewId() && POCCurr == 0 )
     1111#else
    10851112  if( slice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDV && POCCurr == 0 )
     1113#endif
    10861114  {
    10871115    TComReferencePictureSet* rps = slice->getLocalRPS();
     
    11901218
    11911219    // # substreams is "per tile" when tiles are independent.
    1192 #if FIX_REMOVE_TILE_DEPENDENCE
    11931220    if ( m_iWaveFrontSynchro )
    1194 #else
    1195     if (m_iTileBoundaryIndependenceIdr && m_iWaveFrontSynchro)
    1196 #endif
    11971221    {
    11981222      m_cPPS.setNumSubstreams(m_iWaveFrontSubstreams * (m_iNumColumnsMinus1+1)*(m_iNumRowsMinus1+1));
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncTop.h

    r193 r213  
    148148  TComPic*                m_pcPicVSP;                     ///< view synthesis prediction buffer for current POC to be coded
    149149  TComPic*                m_pcPicAvail;
     150  Bool                    m_bIsFirstInView;
    150151#endif
    151152
     
    245246  TComPic*                getVSPBuf             () { return m_pcPicVSP; }
    246247  TComPic*                getVSPAvailBuf        () { return m_pcPicAvail; }
     248  Void                    setIsFirstInView      ( Bool b ) { m_bIsFirstInView = b; }
     249  Bool                    getIsFirstInView      () { return m_bIsFirstInView; }
    247250#endif
    248251
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibExtractor/TExtrTop.cpp

    r100 r213  
    5555Bool TExtrTop::extract( InputNALUnit& nalu, std::set<UInt>& rsuiExtractLayerIds )
    5656{
    57 #if VIDYO_VPS_INTEGRATION
     57#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    5858  //extraction now has to be done using layer_id
    5959  UInt uiLayerId = nalu.m_layerId;
     
    6565  m_cEntropyDecoder.setBitstream     ( nalu.m_Bitstream );
    6666 
    67 #if VIDYO_VPS_INTEGRATION
     67#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    6868  if ( nalu.m_nalUnitType == NAL_UNIT_VPS )
    6969  {
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibExtractor/TExtrTop.h

    r77 r213  
    5454{
    5555private:
    56 #if VIDYO_VPS_INTEGRATION
     56#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    5757  TComVPS                 m_cVPS;
    5858#endif
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibRenderer/TRenImage.cpp

    r101 r213  
    106106}
    107107
    108 #if HHI_VSO_SPEEDUP_A0033
    109108template<typename T>
    110109Void TRenImage<T>::getDataAndStrides( T** pptData, Int* piStrides )
     
    127126  }
    128127}
    129 #endif
    130128
    131129template<typename T>
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibRenderer/TRenImage.h

    r101 r213  
    6969  TRenImagePlane<T>** getPlanes() const;
    7070
    71 #if HHI_VSO_SPEEDUP_A0033
    7271  Void getDataAndStrides( T**    pptData, Int*  piStrides );
    7372  Void getWidthAndHeight( Int*  piWidths, Int*  piHeights );
    74 #endif
    7573
    7674  UInt getNumberOfPlanes()  const;
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibRenderer/TRenModSetupStrParser.cpp

    r100 r213  
    3636#include "TRenFilter.h"
    3737#include "TRenModSetupStrParser.h"
    38 
     38#if !QC_MVHEVC_B0046
    3939Int
    4040TRenModSetupStrParser::getNumOfModels()
     
    450450  rcNextChar = m_pchSetStr[iPos];
    451451}
     452#endif
     453
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibRenderer/TRenModSetupStrParser.h

    r56 r213  
    3131 * THE POSSIBILITY OF SUCH DAMAGE.
    3232 */
    33 
     33#if !QC_MVHEVC_B0046
    3434#ifndef __TRENMODSETUPSTRPARSER__
    3535#define __TRENMODSETUPSTRPARSER__
     
    127127
    128128#endif //__TRENMODEL__
     129#endif
     130
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibRenderer/TRenModel.cpp

    r193 r213  
    3535#include "TRenFilter.h"
    3636#include "TRenModel.h"
    37 
     37#if !QC_MVHEVC_B0046
    3838///////////  TRENMODEL //////////////////////
    3939TRenModel::TRenModel()
     
    4242  m_iWidth             = -1;
    4343  m_iHeight            = -1;
    44 #if FIX_VSO_SETUP
    4544  m_iUsedHeight        = -1;
    46 #endif
    4745  m_iNumOfBaseViews    = -1;
    4846  m_iSampledWidth      = -1;
     
    437435{
    438436  AOT( iViewNum < 0 || iViewNum > m_iNumOfBaseViews );
    439 #if FIX_VSO_SETUP
    440437  AOF( pcPicYuvVideoData->getHeight() >= m_iUsedHeight + m_uiHorOff && pcPicYuvVideoData->getWidth() == m_iWidth );
    441438  AOF( pcPicYuvDepthData->getHeight() >= m_iUsedHeight + m_uiHorOff && pcPicYuvDepthData->getWidth() == m_iWidth );
    442 #else
    443   AOF( pcPicYuvVideoData->getHeight() <= m_iHeight + m_uiHorOff || pcPicYuvVideoData->getWidth() == m_iWidth );
    444   AOF( pcPicYuvDepthData->getHeight() <= m_iHeight + m_uiHorOff || pcPicYuvDepthData->getWidth() == m_iWidth );
    445 #endif
    446439
    447440  pcPicYuvVideoData->extendPicBorder();
    448441
    449 #if FIX_VSO_SETUP
    450442  TRenFilter::sampleHorUp   ( m_iShiftPrec, pcPicYuvVideoData->getLumaAddr() +  m_uiHorOff        * pcPicYuvVideoData->getStride () , pcPicYuvVideoData->getStride() , m_iWidth,      m_iUsedHeight,      m_aapiCurVideoPel[ iViewNum ][0], m_aaiCurVideoStrides[iViewNum][0] );
    451443  TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvVideoData->getCbAddr()   + (m_uiHorOff >> 1 ) * pcPicYuvVideoData->getCStride() , pcPicYuvVideoData->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiCurVideoPel[ iViewNum ][1], m_aaiCurVideoStrides[iViewNum][1] );
    452444  TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvVideoData->getCrAddr()   + (m_uiHorOff >> 1 ) * pcPicYuvVideoData->getCStride() , pcPicYuvVideoData->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiCurVideoPel[ iViewNum ][2], m_aaiCurVideoStrides[iViewNum][2] );
    453445  TRenFilter::copy          (               pcPicYuvDepthData->getLumaAddr() +  m_uiHorOff        * pcPicYuvDepthData->getStride () , pcPicYuvDepthData->getStride(),  m_iWidth,      m_iUsedHeight,      m_apiCurDepthPel [ iViewNum],     m_aiCurDepthStrides [iViewNum]    );
    454 #else
    455   TRenFilter::sampleHorUp   ( m_iShiftPrec, pcPicYuvVideoData->getLumaAddr() +  m_uiHorOff        * pcPicYuvVideoData->getStride () , pcPicYuvVideoData->getStride() , m_iWidth,      m_iHeight,      m_aapiCurVideoPel[ iViewNum ][0], m_aaiCurVideoStrides[iViewNum][0] );
    456   TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvVideoData->getCbAddr()   + (m_uiHorOff >> 1 ) * pcPicYuvVideoData->getCStride() , pcPicYuvVideoData->getCStride(), m_iWidth >> 1, m_iHeight >> 1, m_aapiCurVideoPel[ iViewNum ][1], m_aaiCurVideoStrides[iViewNum][1] );
    457   TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvVideoData->getCrAddr()   + (m_uiHorOff >> 1 ) * pcPicYuvVideoData->getCStride() , pcPicYuvVideoData->getCStride(), m_iWidth >> 1, m_iHeight >> 1, m_aapiCurVideoPel[ iViewNum ][2], m_aaiCurVideoStrides[iViewNum][2] );
    458   TRenFilter::copy          (               pcPicYuvDepthData->getLumaAddr() +  m_uiHorOff        * pcPicYuvDepthData->getStride () , pcPicYuvDepthData->getStride(),  m_iWidth,      m_iHeight,      m_apiCurDepthPel [ iViewNum],     m_aiCurDepthStrides [iViewNum]    );
    459 #endif
    460446
    461447  // Used for rendering reference pic from original video data
     
    465451  if ( m_abSetupVideoFromOrgForView[iViewNum] )
    466452  {
    467 #if FIX_VSO_SETUP
    468453    AOF( pcPicYuvOrgVideoData->getHeight() >= m_iUsedHeight + m_uiHorOff && pcPicYuvOrgVideoData->getWidth() == m_iWidth );
    469454    pcPicYuvOrgVideoData->extendPicBorder();
     
    471456    TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvOrgVideoData->getCbAddr()   + (m_uiHorOff >> 1 ) * pcPicYuvOrgVideoData->getCStride(), pcPicYuvOrgVideoData->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiOrgVideoPel[ iViewNum ][1], m_aaiOrgVideoStrides[iViewNum][1] );
    472457    TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvOrgVideoData->getCrAddr()   + (m_uiHorOff >> 1 ) * pcPicYuvOrgVideoData->getCStride(), pcPicYuvOrgVideoData->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiOrgVideoPel[ iViewNum ][2], m_aaiOrgVideoStrides[iViewNum][2] );
    473 #else
    474     AOF( pcPicYuvOrgVideoData->getHeight() <= m_iHeight + m_uiHorOff || pcPicYuvOrgVideoData->getWidth() == m_iWidth );
    475     pcPicYuvOrgVideoData->extendPicBorder();
    476     TRenFilter::sampleHorUp   ( m_iShiftPrec, pcPicYuvOrgVideoData->getLumaAddr() +  m_uiHorOff        * pcPicYuvOrgVideoData->getStride() , pcPicYuvOrgVideoData->getStride() , m_iWidth,      m_iHeight,      m_aapiOrgVideoPel[ iViewNum ][0], m_aaiOrgVideoStrides[iViewNum][0] );
    477     TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvOrgVideoData->getCbAddr()   + (m_uiHorOff >> 1 ) * pcPicYuvOrgVideoData->getCStride(), pcPicYuvOrgVideoData->getCStride(), m_iWidth >> 1, m_iHeight >> 1, m_aapiOrgVideoPel[ iViewNum ][1], m_aaiOrgVideoStrides[iViewNum][1] );
    478     TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvOrgVideoData->getCrAddr()   + (m_uiHorOff >> 1 ) * pcPicYuvOrgVideoData->getCStride(), pcPicYuvOrgVideoData->getCStride(), m_iWidth >> 1, m_iHeight >> 1, m_aapiOrgVideoPel[ iViewNum ][2], m_aaiOrgVideoStrides[iViewNum][2] );
    479 #endif
    480458  }
    481459
    482460  if ( m_abSetupDepthFromOrgForView[iViewNum] )
    483461  {
    484 #if FIX_VSO_SETUP
    485462    AOF( pcPicYuvOrgDepthData->getHeight() >= m_iUsedHeight + m_uiHorOff && pcPicYuvOrgDepthData->getWidth() == m_iWidth );
    486463    TRenFilter::copy          (               pcPicYuvOrgDepthData->getLumaAddr() +  m_uiHorOff        * pcPicYuvOrgDepthData->getStride() , pcPicYuvOrgDepthData->getStride(),  m_iWidth,     m_iUsedHeight,      m_apiOrgDepthPel [ iViewNum],     m_aiOrgDepthStrides [iViewNum]    );
    487 #else
    488     AOF( pcPicYuvOrgDepthData->getHeight() <= m_iHeight + m_uiHorOff || pcPicYuvOrgDepthData->getWidth() == m_iWidth );
    489     TRenFilter::copy          (               pcPicYuvOrgDepthData->getLumaAddr() +  m_uiHorOff        * pcPicYuvOrgDepthData->getStride() , pcPicYuvOrgDepthData->getStride(),  m_iWidth,     m_iHeight,      m_apiOrgDepthPel [ iViewNum],     m_aiOrgDepthStrides [iViewNum]    );
    490 #endif
    491464  }
    492465}
     
    497470  AOT( iModelNum < 0 || iModelNum > m_iNumOfRenModels );
    498471
    499 #if FIX_VSO_SETUP
    500472  m_apcRenModels[iModelNum]->setupPart( m_uiHorOff, m_iUsedHeight );
    501 #endif
    502473
    503474  // Switch model  to original data for setup if given to render reference
     
    520491  }
    521492
    522 #if FIX_VSO_SETUP
    523493  m_apcRenModels[iModelNum]->setup     ( pcPicYuvRefView, ppiShiftLutLeft, ppiBaseShiftLutLeft, ppiShiftLutRight, ppiBaseShiftLutRight, iDistToLeft, false );
    524 #else
    525   m_apcRenModels[iModelNum]->setup     ( pcPicYuvRefView, ppiShiftLutLeft, ppiBaseShiftLutLeft, ppiShiftLutRight, ppiBaseShiftLutRight, iDistToLeft, false, m_uiHorOff );
    526 #endif
    527494
    528495  // Setup to Org
     
    545512
    546513    // setup keeping reference rendered from original data
    547 #if FIX_VSO_SETUP
    548514    m_apcRenModels[iModelNum]->setup     ( pcPicYuvRefView, ppiShiftLutLeft, ppiBaseShiftLutLeft, ppiShiftLutRight, ppiBaseShiftLutRight, iDistToLeft, true );
    549 #else
    550     m_apcRenModels[iModelNum]->setup     ( pcPicYuvRefView, ppiShiftLutLeft, ppiBaseShiftLutLeft, ppiShiftLutRight, ppiBaseShiftLutRight, iDistToLeft, true, m_uiHorOff);
    551 #endif
    552515  }
    553516}
     
    579542
    580543
    581 #if FIX_VSO_SETUP
    582544Void
    583545TRenModel::setupPart ( UInt uiHorOff, Int iUsedHeight )
     
    587549  m_iUsedHeight = iUsedHeight;
    588550}
    589 #else
    590 Void
    591 TRenModel::setHorOffset     ( UInt uiHorOff )
    592 {
    593   m_uiHorOff = uiHorOff;
    594 }
    595 #endif
    596551
    597552#if LGE_VSO_EARLY_SKIP_A0093
     
    606561
    607562  AOT( iWidth  + iStartPosX > m_iWidth  );
    608 #if FIX_VSO_SETUP
    609563  AOT( iHeight + iStartPosY > m_iUsedHeight );
    610 #else
    611   AOT( iHeight + iStartPosY > m_iHeight );
    612 #endif
    613564
    614565  AOT( iStartPosX < 0);
     
    644595
    645596  iWidth  = min(iWidth , m_iWidth  - iStartPosX );
    646 #if FIX_VSO_SETUP
    647597  iHeight = min(iHeight, m_iUsedHeight - iStartPosY );
    648 #else
    649   iHeight = min(iHeight, m_iHeight - iStartPosY );
    650 #endif
    651598
    652599  AOT( iStartPosX < 0);
     
    684631TRenModel::getSynthVideo( Int iModelNum, Int iViewNum, TComPicYuv* pcPicYuv )
    685632{
    686 #if FIX_VSO_SETUP
    687633  m_apcRenModels[iModelNum]->getSynthVideo(iViewNum, pcPicYuv );
    688 #else
    689   m_apcRenModels[iModelNum]->getSynthVideo(iViewNum, pcPicYuv, m_uiHorOff );
    690 #endif
    691634}
    692635
     
    694637TRenModel::getSynthDepth( Int iModelNum, Int iViewNum, TComPicYuv* pcPicYuv )
    695638{
    696 #if HHI_VSO_SPEEDUP_A0033 && !FIX_VSO_SETUP
    697   m_apcRenModels[iModelNum]->getSynthDepth(iViewNum, pcPicYuv, m_uiHorOff );
    698 #else
    699639  m_apcRenModels[iModelNum]->getSynthDepth(iViewNum, pcPicYuv );
    700 #endif
    701640}
    702641
     
    705644{
    706645  TComPicYuv cPicYuvSynth;
    707 #if FIX_VSO_SETUP
    708646  cPicYuvSynth.create( m_iWidth, m_iUsedHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth );
    709 #else
    710   cPicYuvSynth.create( m_iWidth, m_iHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth );
    711 #endif
    712647
    713648  TComPicYuv cPicYuvTempRef;
    714 #if FIX_VSO_SETUP
    715649  cPicYuvTempRef.create( m_iWidth, m_iUsedHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth);
    716 #else
    717   cPicYuvTempRef.create( m_iWidth, m_iHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth);
    718 #endif
    719650
    720651  Int64 iSSEY = 0;
     
    724655  for (Int iCurModel = 0; iCurModel < m_iNumOfCurRenModels; iCurModel++)
    725656  {
    726 #if FIX_VSO_SETUP
    727657    m_apcCurRenModels[iCurModel]->getSynthVideo( m_aiCurPosInModels[iCurModel], &cPicYuvSynth );   
    728658    m_apcCurRenModels[iCurModel]->getRefVideo  ( m_aiCurPosInModels[iCurModel], &cPicYuvTempRef   );
     
    731661    iSSEU += TRenFilter::SSE( cPicYuvSynth.getCbAddr()  , cPicYuvSynth.getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, cPicYuvTempRef.getCbAddr()  , cPicYuvTempRef.getCStride());
    732662    iSSEV += TRenFilter::SSE( cPicYuvSynth.getCrAddr()  , cPicYuvSynth.getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, cPicYuvTempRef.getCrAddr()  , cPicYuvTempRef.getCStride());
    733 #else
    734     m_apcCurRenModels[iCurModel]->getSynthVideo( m_aiCurPosInModels[iCurModel], &cPicYuvSynth, 0 );
    735     TComPicYuv* pcPicYuvRef = &cPicYuvTempRef;
    736     m_apcCurRenModels[iCurModel]->getRefVideo  ( m_aiCurPosInModels[iCurModel], pcPicYuvRef  , 0 );
    737 
    738     iSSEY += TRenFilter::SSE( cPicYuvSynth.getLumaAddr(), cPicYuvSynth.getStride(),  m_iWidth,      m_iHeight     , pcPicYuvRef->getLumaAddr(), pcPicYuvRef->getStride() );
    739     iSSEU += TRenFilter::SSE( cPicYuvSynth.getCbAddr()  , cPicYuvSynth.getCStride(), m_iWidth >> 1, m_iHeight >> 1, pcPicYuvRef->getCbAddr()  , pcPicYuvRef->getCStride());
    740     iSSEV += TRenFilter::SSE( cPicYuvSynth.getCrAddr()  , cPicYuvSynth.getCStride(), m_iWidth >> 1, m_iHeight >> 1, pcPicYuvRef->getCrAddr()  , pcPicYuvRef->getCStride());
    741 #endif
    742663  }
    743664
     
    776697  }
    777698}
     699#endif
     700
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibRenderer/TRenModel.h

    r193 r213  
    3232 */
    3333
    34 
     34#if !QC_MVHEVC_B0046
    3535#ifndef __TRENMODEL__
    3636#define __TRENMODEL__
     
    6262
    6363  // Set horizontal offset
    64 #if FIX_VSO_SETUP
    6564  Void  setupPart        ( UInt uiHorOff, Int iUsedHeight );
    66 #else
    67   Void  setHorOffset     ( UInt uiHorOff );
    68 #endif
    6965
    7066  // Set Mode
     
    104100  Int m_iSampledWidth;
    105101  Int m_iPad;
    106 #if FIX_VSO_SETUP
    107102  Int m_iUsedHeight;   // height currently used in buffer, whereas m_iHeight is the total height of the buffer
    108 #endif
    109103
    110104
    111105  Int m_iNumOfBaseViews;
    112106
    113 #if HHI_VSO_SPEEDUP_A0033                 
    114107  // Horizontal Offset in input data
    115108  UInt m_uiHorOff;         
    116 #endif
    117109
    118110  /// Current Error Type ///
     
    164156
    165157#endif //__TRENMODEL__
     158#endif
     159
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibRenderer/TRenSingleModel.cpp

    r193 r213  
    3636#include "TRenSingleModel.h"
    3737
     38#if !QC_MVHEVC_B0046
    3839////////////// TRENSINGLE MODEL ///////////////
    3940template <BlenMod iBM, Bool bBitInc>
     
    4445  m_iHeight = -1;
    4546  m_iStride = -1;
    46 #if FIX_VSO_SETUP
    4747  m_iUsedHeight = -1;
    4848  m_iHorOffset  = -1;
    49 #endif
    5049  m_iMode   = -1;
    5150  m_iPad    = PICYUV_PAD;
     
    104103  if ( m_pcInputSamples [1] ) delete[] m_pcInputSamples [1];
    105104
    106 #if FIX_MEM_LEAKS
    107105  if ( m_pcOutputSamples    ) delete[] m_pcOutputSamples   ;
    108 #else
    109   if ( m_pcOutputSamples    ) delete   m_pcOutputSamples   ;
    110 #endif
    111 
    112 #if FIX_MEM_LEAKS
     106
    113107  if ( m_piInvZLUTLeft  ) delete[] m_piInvZLUTLeft ;
    114108  if ( m_piInvZLUTRight ) delete[] m_piInvZLUTRight;
     
    117111  if ( m_aapiRefVideoPel[1] ) delete[] ( m_aapiRefVideoPel[1] - ( m_aiRefVideoStrides[1] * m_iPad + m_iPad ) );
    118112  if ( m_aapiRefVideoPel[2] ) delete[] ( m_aapiRefVideoPel[2] - ( m_aiRefVideoStrides[2] * m_iPad + m_iPad ) );
    119 #endif
    120113}
    121114
     
    197190  Int iOffsetX = ( iViewPos == VIEWPOS_RIGHT ) ? 1 : 0;
    198191
    199 #if FIX_VSO_SETUP
    200192  for ( Int iPosY = 0; iPosY < m_iUsedHeight; iPosY++ )
    201 #else
    202   for ( Int iPosY = 0; iPosY < m_iHeight; iPosY++ )
    203 #endif
    204193  {
    205194    if ( iViewPos == VIEWPOS_RIGHT )
     
    245234
    246235}
    247 #if FIX_VSO_SETUP
    248236template <BlenMod iBM, Bool bBitInc> Void
    249237TRenSingleModelC<iBM,bBitInc>::setupPart ( UInt uiHorOffset,       Int iUsedHeight )
     
    254242  m_iHorOffset  = (Int) uiHorOffset;
    255243}
    256 #endif
    257244
    258245template <BlenMod iBM, Bool bBitInc> Void
    259 #if FIX_VSO_SETUP
    260246TRenSingleModelC<iBM,bBitInc>::setup( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight,  Int** ppiBaseShiftLutRight,  Int iDistToLeft, Bool bKeepReference )
    261 #else
    262 TRenSingleModelC<iBM,bBitInc>::setup( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight,  Int** ppiBaseShiftLutRight,  Int iDistToLeft, Bool bKeepReference, UInt uiHorOff )
    263 #endif
    264247{
    265248  AOT( !m_bUseOrgRef && pcOrgVideo );
     
    275258  if ( pcOrgVideo && !bKeepReference )
    276259  {
    277 #if FIX_VSO_SETUP
    278260    TRenFilter::copy(             pcOrgVideo->getLumaAddr() +  m_iHorOffset       * pcOrgVideo->getStride() , pcOrgVideo->getStride() , m_iWidth,      m_iUsedHeight,      m_aapiRefVideoPel[0], m_aiRefVideoStrides[0]);
    279261    TRenFilter::sampleCUpHorUp(0, pcOrgVideo->getCbAddr()   + (m_iHorOffset >> 1) * pcOrgVideo->getCStride(), pcOrgVideo->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiRefVideoPel[1], m_aiRefVideoStrides[1]);
    280262    TRenFilter::sampleCUpHorUp(0, pcOrgVideo->getCrAddr()   + (m_iHorOffset >> 1) * pcOrgVideo->getCStride(), pcOrgVideo->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiRefVideoPel[2], m_aiRefVideoStrides[2]);   
    281 #else
    282     TRenFilter::copy(             pcOrgVideo->getLumaAddr() +  uiHorOff       * pcOrgVideo->getStride() , pcOrgVideo->getStride() , m_iWidth,      m_iHeight,      m_aapiRefVideoPel[0], m_aiRefVideoStrides[0]);
    283     TRenFilter::sampleCUpHorUp(0, pcOrgVideo->getCbAddr()   + (uiHorOff >> 1) * pcOrgVideo->getCStride(), pcOrgVideo->getCStride(), m_iWidth >> 1, m_iHeight >> 1, m_aapiRefVideoPel[1], m_aiRefVideoStrides[1]);
    284     TRenFilter::sampleCUpHorUp(0, pcOrgVideo->getCrAddr()   + (uiHorOff >> 1) * pcOrgVideo->getCStride(), pcOrgVideo->getCStride(), m_iWidth >> 1, m_iHeight >> 1, m_aapiRefVideoPel[2], m_aiRefVideoStrides[2]);   
    285 #endif
    286263    xSetStructRefView();
    287264  }
     
    290267  xResetStructError();
    291268  xInitSampleStructs();
    292 #if FIX_VSO_SETUP
    293269  switch ( m_iMode )
    294270  { 
     
    320296    AOT(true);
    321297  }
    322 #else
    323   switch ( m_iMode )
    324   { 
    325   case 0:   
    326 #if LGE_VSO_EARLY_SKIP_A0093
    327     xRenderL<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0],false );
    328 #else
    329     xRenderL<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0] );
    330 #endif   
    331     break;
    332   case 1:   
    333 #ifdef LGE_VSO_EARLY_SKIP_A0093
    334     xRenderR<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1],false);
    335 #else
    336     xRenderR<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1] );
    337 #endif
    338     break;
    339   case 2:
    340     TRenFilter::setupZLUT( true, 30, iDistToLeft, ppiBaseShiftLutLeft, ppiBaseShiftLutRight, m_iBlendZThres, m_iBlendDistWeight, m_piInvZLUTLeft, m_piInvZLUTRight );
    341 #ifdef LGE_VSO_EARLY_SKIP_A0093
    342     xRenderL<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0],false);
    343     xRenderR<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1],false);
    344 #else     
    345     xRenderL<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0] );
    346     xRenderR<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1] );
    347 #endif
    348     break;
    349   default:
    350     AOT(true);
    351   }
    352 #endif
    353298
    354299  // Get Rendered View as Reference
     
    413358#endif 
    414359
    415 #if FIX_VSO_SETUP
    416360  for ( Int iPosY = 0; iPosY < m_iUsedHeight; iPosY++ )
    417 #else
    418   for ( Int iPosY = 0; iPosY < m_iHeight; iPosY++ )
    419 #endif
    420361  {
    421362    for ( Int iPosX = 0; iPosX < m_iWidth; iPosX++ )
     
    470411#endif
    471412
    472 #if FIX_VSO_SETUP
    473413  for ( Int iPosY = 0; iPosY < m_iUsedHeight; iPosY++ )
    474 #else
    475   for ( Int iPosY = 0; iPosY < m_iHeight; iPosY++ )
    476 #endif
    477414  {
    478415    for ( Int iPosX = 0; iPosX < m_iWidth; iPosX++ )
     
    617554}
    618555
    619 #if FIX_VSO_SETUP
    620556template <BlenMod iBM, Bool bBitInc> Void
    621557TRenSingleModelC<iBM,bBitInc>::getSynthVideo( Int iViewPos, TComPicYuv* pcPicYuv )
     
    648584#endif 
    649585}
    650 #else
    651 template <BlenMod iBM, Bool bBitInc> Void
    652 TRenSingleModelC<iBM,bBitInc>::getSynthVideo( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset )
    653 
    654   AOT( pcPicYuv->getWidth() != m_iWidth );
    655   AOT( pcPicYuv->getHeight() > m_iHeight + uiHorOffset );
    656 
    657 #if HHI_VSO_COLOR_PLANES
    658   Pel RenModelOutPels::* piText[3] = { NULL, NULL, NULL };
    659   xGetSampleStrTextPtrs(iViewPos, piText[0], piText[1], piText[2]);
    660 
    661   // Temp image for chroma down sampling
    662   PelImage cTempImage( m_iWidth, m_iHeight, 3, 0);
    663 
    664   Int  aiStrides[3];
    665   Pel* apiData  [3];
    666 
    667   cTempImage.getDataAndStrides( apiData, aiStrides );
    668 
    669   for (UInt uiCurPlane = 0; uiCurPlane < 3; uiCurPlane++ )
    670   {
    671     xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piText[uiCurPlane], apiData[uiCurPlane], aiStrides[uiCurPlane] , m_iWidth, m_iHeight);
    672   } 
    673   xCopy2PicYuv( apiData, aiStrides, pcPicYuv, uiHorOffset );
    674 #else
    675   Pel RenModelOutPels::* piY;
    676   xGetSampleStrTextPtrs(iViewPos, piY);
    677   xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piY, pcPicYuv->getLumaAddr() + uiHorOffset * pcPicYuv->getStride(), pcPicYuv->getStride(), m_iWidth, m_iHeight );
    678   pcPicYuv->setChromaTo( 128 << g_uiBitIncrement );   
    679 #endif 
    680 }
    681 #endif
    682 
    683 #if FIX_VSO_SETUP
     586
    684587template <BlenMod iBM, Bool bBitInc> Void
    685588TRenSingleModelC<iBM,bBitInc>::getSynthDepth( Int iViewPos, TComPicYuv* pcPicYuv )
     
    695598}
    696599
    697 #else
    698 template <BlenMod iBM, Bool bBitInc> Void
    699 TRenSingleModelC<iBM,bBitInc>::getSynthDepth( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOff )
    700 
    701   AOT( iViewPos != 0 && iViewPos != 1);
    702   AOT( pcPicYuv->getWidth()  != m_iWidth  );
    703   AOT( pcPicYuv->getHeight() > m_iHeight + uiHorOff );
    704 
    705   Pel RenModelOutPels::* piD = 0;
    706   xGetSampleStrDepthPtrs(iViewPos, piD);
    707   xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piD, pcPicYuv->getLumaAddr() + pcPicYuv->getStride() * uiHorOff, pcPicYuv->getStride(), m_iWidth, m_iHeight );
    708   pcPicYuv->setChromaTo( 128 << g_uiBitIncrement );   
    709 }
    710 #endif
    711 
    712 #if FIX_VSO_SETUP
     600
    713601template <BlenMod iBM, Bool bBitInc> Void
    714602TRenSingleModelC<iBM,bBitInc>::getRefVideo ( Int iViewPos, TComPicYuv* pcPicYuv )
     
    742630#endif 
    743631}
    744 #else
    745 template <BlenMod iBM, Bool bBitInc> Void
    746 TRenSingleModelC<iBM,bBitInc>::getRefVideo ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset )
    747 
    748   AOT( pcPicYuv->getWidth()  != m_iWidth  );
    749   AOT( pcPicYuv->getHeight() >  m_iHeight + uiHorOffset);
    750 
    751 #if HHI_VSO_COLOR_PLANES
    752   Pel RenModelOutPels::* piText[3];
    753   piText[0] = &RenModelOutPels::iYRef;
    754   piText[1] = &RenModelOutPels::iURef;
    755   piText[2] = &RenModelOutPels::iVRef;
    756 
    757   // Temp image for chroma down sampling
    758 
    759   PelImage cTempImage( m_iWidth, m_iHeight, 3, 0);
    760   Int  aiStrides[3];
    761   Pel* apiData  [3];
    762 
    763   cTempImage.getDataAndStrides( apiData, aiStrides );
    764 
    765   for (UInt uiCurPlane = 0; uiCurPlane < 3; uiCurPlane++ )
    766   {
    767     xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piText[uiCurPlane], apiData[uiCurPlane], aiStrides[uiCurPlane] , m_iWidth, m_iHeight);
    768   }
    769 
    770   xCopy2PicYuv( apiData, aiStrides, pcPicYuv, uiHorOffset );
    771 #else
    772   xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, &RenModelOutPels::iYRef, pcPicYuv->getLumaAddr() *  pcPicYuv->getStride() + uiHorOffset, pcPicYuv->getStride(), m_iWidth, m_iHeight );
    773   pcPicYuv->setChromaTo( 128 << g_uiBitIncrement );   
    774 #endif 
    775 }
    776 #endif
    777632
    778633template <BlenMod iBM, Bool bBitInc> RMDist
     
    20181873}
    20191874
    2020 #if FIX_VSO_SETUP
    20211875template <BlenMod iBM, Bool bBitInc> Void
    20221876TRenSingleModelC<iBM,bBitInc>::xCopy2PicYuv( Pel** ppiSrcVideoPel, Int* piStrides, TComPicYuv* rpcPicYuvTarget )
     
    20261880  TRenFilter::sampleDown2Tap13( ppiSrcVideoPel[2], piStrides[2], m_iWidth, m_iUsedHeight, rpcPicYuvTarget->getCrAddr  () + (m_iHorOffset >> 1) * rpcPicYuvTarget->getCStride(), rpcPicYuvTarget->getCStride() );
    20271881}
    2028 #else
    2029 template <BlenMod iBM, Bool bBitInc> Void
    2030 TRenSingleModelC<iBM,bBitInc>::xCopy2PicYuv( Pel** ppiSrcVideoPel, Int* piStrides, TComPicYuv* rpcPicYuvTarget, UInt uiHorOffset )
    2031 {
    2032   TRenFilter::copy            ( ppiSrcVideoPel[0], piStrides[0], m_iWidth, m_iHeight, rpcPicYuvTarget->getLumaAddr() +  uiHorOffset       * rpcPicYuvTarget->getStride() , rpcPicYuvTarget->getStride () );
    2033   TRenFilter::sampleDown2Tap13( ppiSrcVideoPel[1], piStrides[1], m_iWidth, m_iHeight, rpcPicYuvTarget->getCbAddr  () + (uiHorOffset >> 1) * rpcPicYuvTarget->getCStride(), rpcPicYuvTarget->getCStride() );
    2034   TRenFilter::sampleDown2Tap13( ppiSrcVideoPel[2], piStrides[2], m_iWidth, m_iHeight, rpcPicYuvTarget->getCrAddr  () + (uiHorOffset >> 1) * rpcPicYuvTarget->getCStride(), rpcPicYuvTarget->getCStride() );
    2035 }
    2036 #endif
    20371882
    20381883template class TRenSingleModelC<BLEND_NONE ,true>;
     
    21121957}
    21131958#endif
     1959#endif
     1960
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibRenderer/TRenSingleModel.h

    r193 r213  
    3232 */
    3333
    34 
    35 #ifndef __TRENSINGLEMODEL__
     34#if !QC_MVHEVC_B0046
     35#ifndef __TRENSINGLEMODEL__ 
    3636#define __TRENSINGLEMODEL__
    3737
     
    6969public:
    7070
    71 #if FIX_VIRT_DESTRUCTOR
    7271  virtual ~TRenSingleModel() { } 
    73 #endif
    7472#if LGE_VSO_EARLY_SKIP_A0093
    7573  virtual Void   create    ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bEarlySkip ) = 0;
     
    8078  // Set Frame dependent data
    8179  virtual Void   setLRView ( Int iViewPos, Pel** apiCurVideoPel, Int* aiCurVideoStride, Pel* piCurDepthPel, Int iCurDepthStride ) = 0;
    82 #if FIX_VSO_SETUP
    8380  virtual Void   setupPart ( UInt uiHorOffset,       Int iUsedHeight ) = 0;
    8481  virtual Void   setup     ( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight,  Int** ppiBaseShiftLutRight,  Int iDistToLeft, Bool bKeepReference ) = 0;
    85 #else
    86   virtual Void   setup     ( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight,  Int** ppiBaseShiftLutRight,  Int iDistToLeft, Bool bKeepReference, UInt uiHorOffset ) = 0;
    87 #endif
    8882
    8983  // Set Data
     
    10397  virtual RMDist getDistVideo  ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) = 0;
    10498
    105 #if FIX_VSO_SETUP
    10699  virtual Void   getSynthVideo  ( Int iViewPos, TComPicYuv* pcPicYuv ) = 0; 
    107100  virtual Void   getSynthDepth  ( Int iViewPos, TComPicYuv* pcPicYuv ) = 0;
    108101  virtual Void   getRefVideo    ( Int iViewPos, TComPicYuv* pcPicYuv ) = 0;
    109 #else
    110   virtual Void   getSynthVideo  ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset  ) = 0; 
    111   virtual Void   getSynthDepth  ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset  ) = 0;
    112   virtual Void   getRefVideo    ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset  ) = 0;
    113 #endif
    114102};
    115103
     
    181169  // Set Frame dependent data
    182170  Void   setLRView ( Int iViewPos, Pel** apiCurVideoPel, Int* aiCurVideoStride, Pel* piCurDepthPel, Int iCurDepthStride );
    183 #if FIX_VSO_SETUP
    184171  Void   setupPart ( UInt uiHorOffset,       Int uiUsedHeight );
    185172  Void   setup     ( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight,  Int** ppiBaseShiftLutRight,  Int iDistToLeft, Bool bKeepReference );
    186 #else
    187   Void   setup     ( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight,  Int** ppiBaseShiftLutRight,  Int iDistToLeft, Bool bKeepReference, UInt uiHorOffset );
    188 #endif
    189173
    190174#if LGE_VSO_EARLY_SKIP_A0093
     
    203187  RMDist getDistVideo  ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData );
    204188
    205 #if FIX_VSO_SETUP
    206189  Void   getSynthVideo  ( Int iViewPos, TComPicYuv* pcPicYuv ); 
    207190  Void   getSynthDepth  ( Int iViewPos, TComPicYuv* pcPicYuv );
    208191  Void   getRefVideo    ( Int iViewPos, TComPicYuv* pcPicYuv );
    209 #else
    210   Void   getSynthVideo  ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset ); 
    211   Void   getSynthDepth  ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset  );
    212   Void   getRefVideo    ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset  );
    213 #endif
    214192
    215193private:
     
    293271  Void            xInitSampleStructs           ();
    294272  Void            xSetStructSynthViewAsRefView ();
    295 #if FIX_VSO_SETUP
    296273  Void            xCopy2PicYuv                ( Pel** ppiSrcVideoPel, Int* piStrides, TComPicYuv* rpcPicYuvTarget );
    297 #else
    298   Void            xCopy2PicYuv                ( Pel** ppiSrcVideoPel, Int* piStrides, TComPicYuv* rpcPicYuvTarget, UInt uiHorOffset );
    299 #endif
    300274
    301275  template< typename S, typename T>
    302276  Void   xCopyFromSampleStruct ( S* ptSource , Int iSourceStride, T S::* ptSourceElement, T* ptTarget, Int iTargetStride, Int iWidth, Int iHeight )
    303277  {
    304 #if FIX_VSO_SETUP
    305278    AOT( iWidth != m_iWidth );
    306279    for (Int iPosY = 0; iPosY < iHeight; iPosY++)
    307 #else
    308     for (Int iPosY = 0; iPosY < m_iHeight; iPosY++)
    309 #endif
    310280    {
    311281      for (Int iPosX = 0; iPosX < m_iWidth; iPosX++)
     
    321291  Void   xCopyToSampleStruct ( T* ptSource , Int iSourceStride, S* ptTarget, Int iTargetStride, T S::* ptSourceElement, Int iWidth, Int iHeight )
    322292  {
    323 #if FIX_VSO_SETUP
    324293    AOT( iWidth != m_iWidth );
    325294    for (Int iPosY = 0; iPosY < iHeight; iPosY++)
    326 #else
    327     for (Int iPosY = 0; iPosY < m_iHeight; iPosY++)
    328 #endif
    329295    {
    330296      for (Int iPosX = 0; iPosX < m_iWidth; iPosX++)
     
    344310  Int   m_iStride;
    345311  Int   m_iPad;
    346 #if FIX_VSO_SETUP
    347312  Int   m_iUsedHeight;
    348313  Int   m_iHorOffset;
    349 #endif
    350314
    351315  Int   m_iSampledWidth;
    352 #if FIX_VSO_SETUP
    353 #else
    354   Int   m_iSampledHeight;
    355 #endif
    356316  Int   m_iSampledStride;
    357317
     
    431391
    432392#endif //__TRENSINGLEMODEL__
     393#endif
     394
Note: See TracChangeset for help on using the changeset viewer.