Changeset 1179 in 3DVCSoftware for trunk/source/Lib/TLibEncoder


Ignore:
Timestamp:
7 Apr 2015, 17:05:30 (10 years ago)
Author:
tech
Message:

Merged branch 13.1-dev0@1178.

Location:
trunk/source/Lib/TLibEncoder
Files:
41 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibEncoder/AnnexBwrite.h

    r964 r1179  
    44 * granted under this license.
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/NALwrite.cpp

    r964 r1179  
    44 * granted under this license.
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/NALwrite.h

    r872 r1179  
    44 * granted under this license.
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/SEIwrite.cpp

    r964 r1179  
    44 * granted under this license.
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/SEIwrite.h

    r884 r1179  
    44 * granted under this license.
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/SyntaxElementWriter.cpp

    r872 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    4949  if( g_HLSTraceEnable )
    5050  {
     51#if H_MV_ENC_DEC_TRAC
     52    if ( !g_disableNumbering )
     53    {
     54#endif
    5155    fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
     56#if H_MV_ENC_DEC_TRAC
     57    }
     58#endif
     59
    5260    if( length<10 )
    5361    {
     
    6674  if( g_HLSTraceEnable )
    6775  {
     76#if H_MV_ENC_DEC_TRAC
     77    if ( !g_disableNumbering )
     78    {
     79#endif
    6880    fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
     81#if H_MV_ENC_DEC_TRAC
     82    }
     83#endif
     84
    6985    fprintf( g_hTrace, "%-50s ue(v) : %d\n", pSymbolName, value );
    7086  }
     
    7692  if( g_HLSTraceEnable )
    7793  {
     94#if H_MV_ENC_DEC_TRAC
     95    if ( !g_disableNumbering )
     96    {
     97#endif
    7898    fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
     99#if H_MV_ENC_DEC_TRAC
     100    }
     101#endif
     102
    79103    fprintf( g_hTrace, "%-50s se(v) : %d\n", pSymbolName, value );
    80104  }
     
    86110  if( g_HLSTraceEnable )
    87111  {
     112#if H_MV_ENC_DEC_TRAC
     113    if ( !g_disableNumbering )
     114    {
     115#endif
    88116    fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
     117#if H_MV_ENC_DEC_TRAC
     118    }
     119#endif
    89120    fprintf( g_hTrace, "%-50s u(1)  : %d\n", pSymbolName, value );
    90121  }
  • trunk/source/Lib/TLibEncoder/SyntaxElementWriter.h

    r872 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncAnalyze.cpp

    r872 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncAnalyze.h

    r872 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncBinCoder.h

    r872 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncBinCoderCABAC.cpp

    r872 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncBinCoderCABAC.h

    r872 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncBinCoderCABACCounter.cpp

    r872 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncBinCoderCABACCounter.h

    r872 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncCavlc.cpp

    r1133 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    4040#include "SEIwrite.h"
    4141#include "../TLibCommon/TypeDef.h"
    42 
     42#if H_3D_ANNEX_SELECTION_FIX
     43#include "TEncTop.h"
     44#endif
    4345//! \ingroup TLibEncoder
    4446//! \{
     47
    4548
    4649#if ENC_DEC_TRACE
     
    678681#endif
    679682  WRITE_UVLC( pcSPS->getChromaFormatIdc (),         "chroma_format_idc" );
     683#if !H_3D_DISABLE_CHROMA
    680684  assert(pcSPS->getChromaFormatIdc () == 1);
     685#endif
    681686  // in the first version chroma_format_idc can only be equal to 1 (4:2:0)
    682687  if( pcSPS->getChromaFormatIdc () == 3 )
     
    857862  WRITE_FLAG( pcPPS->getPocResetInfoPresentFlag( ) ? 1 : 0 , "poc_reset_info_present_flag" );
    858863  WRITE_FLAG( pcPPS->getPpsInferScalingListFlag( ) ? 1 : 0 , "pps_infer_scaling_list_flag" );
     864#if FIX_TICKET_95
     865  if (pcPPS->getPpsInferScalingListFlag())
     866  {
     867    WRITE_CODE( pcPPS->getPpsScalingListRefLayerId( ), 6, "pps_scaling_list_ref_layer_id" );
     868  }
     869#else   
    859870  WRITE_CODE( pcPPS->getPpsScalingListRefLayerId( ), 6, "pps_scaling_list_ref_layer_id" );
     871#endif
    860872  WRITE_UVLC( 0, "num_ref_loc_offsets" );
    861873  WRITE_FLAG( 0 , "colour_mapping_enabled_flag" );
     
    889901      WRITE_FLAG( sps3dExt->getQtPredFlag( d ) ? 1 : 0 , "qt_pred_flag" );
    890902      WRITE_FLAG( sps3dExt->getInterSdcFlag( d ) ? 1 : 0 , "inter_sdc_flag" );
     903#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     904      WRITE_FLAG( sps3dExt->getDepthIntraSkipFlag( d ) ? 1 : 0 , "intra_skip_flag" );
     905#else
    891906      WRITE_FLAG( sps3dExt->getIntraSingleFlag( d ) ? 1 : 0 , "intra_single_flag" );
     907#endif
    892908    }
    893909  }
     
    13651381  if ( pcRepFormat->getChromaAndBitDepthVpsPresentFlag() )
    13661382  { 
    1367   WRITE_CODE( pcRepFormat->getChromaFormatVpsIdc( ), 2, "chroma_format_vps_idc" );
    1368 
    1369   if ( pcRepFormat->getChromaFormatVpsIdc() == 3 )
    1370   {
    1371     WRITE_FLAG( pcRepFormat->getSeparateColourPlaneVpsFlag( ) ? 1 : 0 , "separate_colour_plane_vps_flag" );
    1372   }
    1373   WRITE_CODE( pcRepFormat->getBitDepthVpsLumaMinus8( ),      4, "bit_depth_vps_luma_minus8" );
    1374   WRITE_CODE( pcRepFormat->getBitDepthVpsChromaMinus8( ),    4, "bit_depth_vps_chroma_minus8" );
     1383    WRITE_CODE( pcRepFormat->getChromaFormatVpsIdc( ), 2, "chroma_format_vps_idc" ); 
     1384
     1385    if ( pcRepFormat->getChromaFormatVpsIdc() == 3 )
     1386    {
     1387      WRITE_FLAG( pcRepFormat->getSeparateColourPlaneVpsFlag( ) ? 1 : 0 , "separate_colour_plane_vps_flag" );
     1388    }
     1389    WRITE_CODE( pcRepFormat->getBitDepthVpsLumaMinus8( ),      4, "bit_depth_vps_luma_minus8" );
     1390    WRITE_CODE( pcRepFormat->getBitDepthVpsChromaMinus8( ),    4, "bit_depth_vps_chroma_minus8" );
    13751391  }
    13761392  else
     
    15981614Void TEncCavlc::codeVPS3dExtension( TComVPS* pcVPS )
    15991615{
     1616#if HHI_CAM_PARA_K0052
     1617  WRITE_UVLC( pcVPS->getCpPrecision( ), "cp_precision" );
     1618  for (Int n = 1; n < pcVPS->getNumViews(); n++)
     1619  {
     1620    Int i      = pcVPS->getViewOIdxList( n );
     1621    Int iInVps = pcVPS->getVoiInVps( i );
     1622    WRITE_CODE( pcVPS->getNumCp( iInVps ), 6, "num_cp" );
     1623
     1624    if( pcVPS->getNumCp( iInVps ) > 0 )
     1625    {
     1626      WRITE_FLAG( pcVPS->getCpInSliceSegmentHeaderFlag( iInVps ) ? 1 : 0 , "cp_in_slice_segment_header_flag" );
     1627      for( Int m = 0; m < pcVPS->getNumCp( iInVps ); m++ )
     1628      {
     1629        WRITE_UVLC( pcVPS->getCpRefVoi( iInVps, m ), "cp_ref_voi" );
     1630        if( !pcVPS->getCpInSliceSegmentHeaderFlag( iInVps ) )
     1631        {
     1632          Int j      = pcVPS->getCpRefVoi( iInVps, m );
     1633          Int jInVps = pcVPS->getVoiInVps( j );
     1634          WRITE_SVLC( pcVPS->getVpsCpScale   ( iInVps, jInVps ), "vps_cp_scale" );
     1635          WRITE_SVLC( pcVPS->getVpsCpOff     ( iInVps, jInVps ), "vps_cp_off" );
     1636          WRITE_SVLC( pcVPS->getVpsCpInvScale( iInVps, jInVps ) + pcVPS->getVpsCpScale( iInVps, jInVps ), "vps_cp_inv_scale_plus_scale" );
     1637          WRITE_SVLC( pcVPS->getVpsCpInvOff  ( iInVps, jInVps ) + pcVPS->getVpsCpOff  ( iInVps, jInVps ), "vps_cp_inv_off_plus_off" );
     1638        }
     1639      }
     1640    }
     1641  } 
     1642#else
    16001643  WRITE_UVLC( pcVPS->getCamParPrecision(), "cp_precision" );
    16011644  for (UInt viewIndex=1; viewIndex<pcVPS->getNumViews(); viewIndex++)
     
    16171660    }
    16181661  }
     1662#endif
    16191663}
    16201664#endif
     
    17211765
    17221766    // in the first version chroma_format_idc is equal to one, thus colour_plane_id will not be present
     1767#if H_3D_DISABLE_CHROMA
     1768    assert (pcSlice->getSPS()->getChromaFormatIdc() == 1 || pcSlice->getIsDepth() );
     1769    assert (pcSlice->getSPS()->getChromaFormatIdc() == 0 || !pcSlice->getIsDepth() );
     1770#else
    17231771    assert (pcSlice->getSPS()->getChromaFormatIdc() == 1 );
     1772#endif
    17241773    // if( separate_colour_plane_flag  ==  1 )
    17251774    //   colour_plane_id                                      u(2)
     
    18951944    }
    18961945#endif
     1946
     1947#if HHI_INTER_COMP_PRED_K0052
     1948#if H_3D     
     1949  if( getEncTop()->decProcAnnexI() )
     1950  {
     1951      if ( pcSlice->getInCmpPredAvailFlag() )
     1952      {
     1953        WRITE_FLAG( pcSlice->getInCompPredFlag(), "in_comp_pred_flag" );
     1954      }
     1955  }
     1956#endif
     1957#endif
    18971958    if(pcSlice->getSPS()->getUseSAO())
    18981959    {
     
    19001961      {
    19011962         WRITE_FLAG( pcSlice->getSaoEnabledFlag(), "slice_sao_luma_flag" );
     1963#if H_3D_DISABLE_CHROMA
     1964         if ( !pcSlice->getIsDepth() )
     1965         {
    19021966         WRITE_FLAG( pcSlice->getSaoEnabledFlagChroma(), "slice_sao_chroma_flag" );
     1967      }
     1968#else
     1969         WRITE_FLAG( pcSlice->getSaoEnabledFlagChroma(), "slice_sao_chroma_flag" );
     1970#endif
    19031971      }
    19041972    }
     
    20182086    }
    20192087#if H_3D_IC
     2088#if H_3D_ANNEX_SELECTION_FIX
     2089    else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE )
     2090      && !pcSlice->getIsDepth() && vps->getNumRefListLayers( layerId ) > 0
     2091      && getEncTop()->decProcAnnexI()       
     2092      )
     2093#else
    20202094    else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE ) && !pcSlice->getIsDepth() && vps->getNumRefListLayers( layerId ) > 0 )
     2095#endif
    20212096    {
    20222097      WRITE_FLAG( pcSlice->getApplyIC() ? 1 : 0, "slice_ic_enable_flag" );
     
    20732148      WRITE_FLAG(pcSlice->getLFCrossSliceBoundaryFlag()?1:0, "slice_loop_filter_across_slices_enabled_flag");
    20742149    }
    2075   }
     2150#if HHI_CAM_PARA_K0052
     2151#if H_3D
     2152    if (getEncTop()->decProcAnnexI() )
     2153    {
     2154      Int voiInVps = vps->getVoiInVps( pcSlice->getViewIndex() );
     2155      if( vps->getCpInSliceSegmentHeaderFlag( voiInVps ) && !pcSlice->getIsDepth() )
     2156      {
     2157        for( Int m = 0; m < vps->getNumCp( voiInVps ); m++ )
     2158        {
     2159          Int jInVps = vps->getVoiInVps( vps->getCpRefVoi( voiInVps, m ));
     2160          WRITE_SVLC( pcSlice->getCpScale   ( jInVps )   , "cp_scale" );
     2161          WRITE_SVLC( pcSlice->getCpOff     ( jInVps )   , "cp_off" );
     2162          WRITE_SVLC( pcSlice->getCpInvScale( jInVps ) + pcSlice->getCpScale( jInVps ) , "cp_inv_scale_plus_scale" );
     2163          WRITE_SVLC( pcSlice->getCpInvOff  ( jInVps ) + pcSlice->getCpOff  ( jInVps ) , "cp_inv_off_plus_off" );
     2164        }
     2165      }
     2166    }
     2167#endif
     2168#endif
     2169  }
     2170
     2171#if !HHI_CAM_PARA_K0052 
    20762172#if H_3D
    20772173#if H_3D_FCO
     
    20892185    }
    20902186  }
     2187#endif
    20912188#endif
    20922189
     
    24352532  assert(0);
    24362533}
     2534
     2535#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     2536Void TEncCavlc::codeDIS( TComDataCU* pcCU, UInt uiAbsPartIdx )
     2537{
     2538  assert(0);
     2539}
     2540#else
    24372541#if H_3D_SINGLE_DEPTH
    24382542Void TEncCavlc::codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx )
     
    24412545}
    24422546#endif
     2547#endif
     2548
    24432549Void TEncCavlc::codeSplitFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    24442550{
     
    25442650{
    25452651  wpScalingParam  *wp;
     2652#if  H_3D_DISABLE_CHROMA
     2653  Bool            bChroma     = !pcSlice->getIsDepth(); // color always present in HEVC ?
     2654#else
    25462655  Bool            bChroma     = true; // color always present in HEVC ?
     2656#endif
    25472657  Int             iNbRef       = (pcSlice->getSliceType() == B_SLICE ) ? (2) : (1);
    25482658  Bool            bDenomCoded  = false;
  • trunk/source/Lib/TLibEncoder/TEncCavlc.h

    r1133 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    6868  TComSlice*    m_pcSlice;
    6969  UInt          m_uiCoeffCost;
    70 
     70#if H_3D_ANNEX_SELECTION_FIX
     71  TEncTop*      m_encTop;
     72#endif
    7173  Void codeShortTermRefPicSet              ( TComSPS* pcSPS, TComReferencePictureSet* pcRPS, Bool calledFromSliceHeader, Int idx );
    7274  Bool findMatchingLTRP ( TComSlice* pcSlice, UInt *ltrpsIndex, Int ltrpPOC, Bool usedFlag );
     
    127129  Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx );
    128130  Void codeSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     131#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     132  Void codeDIS           ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     133#else
    129134#if H_3D_SINGLE_DEPTH
    130135  Void codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx );
     136#endif
    131137#endif
    132138  Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     
    181187  Void codeDFFlag       ( UInt uiCode, const Char *pSymbolName );
    182188  Void codeDFSvlc       ( Int   iCode, const Char *pSymbolName );
    183 
     189#if H_3D_ANNEX_SELECTION_FIX
     190  TEncTop* getEncTop()               { return m_encTop; };
     191  Void     setEncTop( TEncTop* et )  {  m_encTop = et; };
     192#endif
    184193};
    185194
  • trunk/source/Lib/TLibEncoder/TEncCfg.h

    r1133 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    7878  Int m_interViewRefPosL[2][MAX_NUM_REF_PICS]; 
    7979#endif
     80#if HHI_INTER_COMP_PRED_K0052
     81  Bool m_interCompPredFlag;
     82#endif
    8083  GOPEntry()
    8184  : m_POC(-1)
     
    9598  , m_numActiveRefLayerPics(0)
    9699#endif
     100#if HHI_INTER_COMP_PRED_K0052
     101#if H_3D
     102  , m_interCompPredFlag(false)
     103#endif
     104#endif
    97105  {
    98106    ::memset( m_referencePics, 0, sizeof(m_referencePics) );
     
    180188  Int       m_iSearchRange;                     //  0:Full frame
    181189  Int       m_bipredSearchRange;
    182 
     190#if SONY_MV_V_CONST_C0078
     191  Bool      m_bUseDisparitySearchRangeRestriction;
     192  Int       m_iVerticalDisparitySearchRange;
     193#endif
    183194  //====== Quality control ========
    184195  Int       m_iMaxDeltaQP;                      //  Max. absolute delta QP (1:default)
     
    369380
    370381  //====== Camera Parameters ======
     382#if !HHI_CAM_PARA_K0052
    371383  UInt      m_uiCamParPrecision;
    372384  Bool      m_bCamParInSliceHeader;
    373385  Int**     m_aaiCodedScale;
    374386  Int**     m_aaiCodedOffset;
     387#endif
    375388  TAppComCamPara* m_cameraParameters;
    376389 
     
    405418  Bool      m_bUseQTL;
    406419#endif
     420#if H_3D_ANNEX_SELECTION_FIX
     421  Int m_profileIdc;
     422#endif
     423
    407424#endif
    408425public:
     
    418435  , m_isDepth(false)
    419436  , m_bUseVSO(false)
     437#if H_3D_ANNEX_SELECTION_FIX
     438  , m_profileIdc( -1 )
     439#endif
    420440#endif
    421441#endif
     
    502522  Void      setSearchRange                  ( Int   i )      { m_iSearchRange = i; }
    503523  Void      setBipredSearchRange            ( Int   i )      { m_bipredSearchRange = i; }
     524#if SONY_MV_V_CONST_C0078
     525  Void      setUseDisparitySearchRangeRestriction ( Bool   b )      { m_bUseDisparitySearchRangeRestriction = b; }
     526  Void      setVerticalDisparitySearchRange ( Int   i )      { m_iVerticalDisparitySearchRange = i; }
     527#endif
    504528
    505529  //====== Quality control ========
     
    554578  Int       getFastSearch                   ()      { return  m_iFastSearch; }
    555579  Int       getSearchRange                  ()      { return  m_iSearchRange; }
     580#if SONY_MV_V_CONST_C0078
     581  Bool      getUseDisparitySearchRangeRestriction ()      { return  m_bUseDisparitySearchRangeRestriction; }
     582  Int       getVerticalDisparitySearchRange ()            { return  m_iVerticalDisparitySearchRange; }
     583#endif
    556584
    557585  //==== Quality control ========
     
    895923
    896924 //==== CAMERA PARAMETERS  ==========
     925#if !HHI_CAM_PARA_K0052
    897926  Void      setCamParPrecision              ( UInt  u )      { m_uiCamParPrecision      = u; }
    898927  Void      setCamParInSliceHeader          ( Bool  b )      { m_bCamParInSliceHeader   = b; }
    899928  Void      setCodedScale                   ( Int** p )      { m_aaiCodedScale          = p; }
    900929  Void      setCodedOffset                  ( Int** p )      { m_aaiCodedOffset         = p; }
     930#endif
    901931  Void      setCameraParameters             ( TAppComCamPara* c) { m_cameraParameters   = c; }
    902932
     
    946976  Bool      getUseQTL                       ()         { return m_bUseQTL; }
    947977#endif
     978#if H_3D_ANNEX_SELECTION_FIX
     979  Void                    setProfileIdc( Int a )    { assert( a == 1 || a == 6 || a == 8 ); m_profileIdc = a;  }
     980  Bool                    decProcAnnexI()           { assert( m_profileIdc != -1 ); return ( m_profileIdc == 8); }   
     981#endif
     982
    948983#endif // H_3D
    949984};
  • trunk/source/Lib/TLibEncoder/TEncCu.cpp

    r1133 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    275275  m_ppcTempCU[0]->initCU( rpcCU->getPic(), rpcCU->getAddr() );
    276276
     277#if H_3D_DISABLE_CHROMA
     278  m_ppcWeightedTempCU[0]->initCU( rpcCU->getPic(), rpcCU->getAddr() );
     279#endif
     280
    277281#if KWU_RC_MADPRED_E0227
    278282  m_LCUPredictionSAD = 0;
     
    437441#if H_3D_VSP
    438442  DisInfo DvInfo;
     443#if !SEC_ARP_REM_ENC_RESTRICT_K0035
    439444  DvInfo.bDV = false;
     445#endif
    440446  DvInfo.m_acNBDV.setZero();
    441447  DvInfo.m_aVIdxCan = 0;
     
    583589          if (rpcTempCU->getSlice()->getIsDepth() )
    584590          {
     591#if SEC_ARP_REM_ENC_RESTRICT_K0035
     592            rpcTempCU->getDispforDepth(0, 0, &DvInfo);
     593#else
    585594            DvInfo.bDV = rpcTempCU->getDispforDepth(0, 0, &DvInfo);
     595#endif
    586596          }
    587597          else
     
    590600#if H_3D_NBDV_REF
    591601          if( rpcTempCU->getSlice()->getDepthRefinementFlag() )
     602#if SEC_ARP_REM_ENC_RESTRICT_K0035
     603            rpcTempCU->getDisMvpCandNBDV(&DvInfo, true);
     604#else
    592605            DvInfo.bDV = rpcTempCU->getDisMvpCandNBDV(&DvInfo, true);
     606#endif
    593607          else
    594608#endif
     609#if SEC_ARP_REM_ENC_RESTRICT_K0035
     610            rpcTempCU->getDisMvpCandNBDV(&DvInfo);
     611#else
    595612            DvInfo.bDV = rpcTempCU->getDisMvpCandNBDV(&DvInfo);
     613#endif
    596614
    597615#if H_3D_IV_MERGE
     
    712730    }
    713731#endif
     732#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     733    rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP  );
     734    if( rpcBestCU->getSlice()->getDepthIntraSkipFlag() )
     735    {
     736      xCheckRDCostDIS( rpcBestCU, rpcTempCU, SIZE_2Nx2N );
     737      rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP  );
     738    }
     739#else
    714740#if H_3D_SINGLE_DEPTH
    715741    rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP  );
     
    719745      rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP  );
    720746    }
     747#endif
    721748#endif
    722749    if(!earlyDetectionSkipMode)
     
    12261253      TComDataCU* pcSubTempPartCU     = m_ppcTempCU[uhNextDepth];
    12271254
     1255#if H_3D_DISABLE_CHROMA
     1256      m_ppcWeightedTempCU[uhNextDepth]->setSlice( m_ppcWeightedTempCU[ uiDepth]->getSlice());
     1257#endif
    12281258      for ( UInt uiPartUnitIdx = 0; uiPartUnitIdx < 4; uiPartUnitIdx++ )
    12291259      {
     
    15771607    return;
    15781608  }
     1609#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     1610  m_pcEntropyCoder->encodeDIS( pcCU, uiAbsPartIdx );
     1611  if(!pcCU->getDISFlag(uiAbsPartIdx))
     1612  {
     1613#else
    15791614#if H_3D_SINGLE_DEPTH
    15801615  m_pcEntropyCoder->encodeSingleDepthMode( pcCU, uiAbsPartIdx );
     
    15821617  {
    15831618#endif
     1619#endif
    15841620  m_pcEntropyCoder->encodePredMode( pcCU, uiAbsPartIdx );
    15851621 
    15861622  m_pcEntropyCoder->encodePartSize( pcCU, uiAbsPartIdx, uiDepth );
    15871623 
     1624#if !HHI_MOVE_SYN_K0052
    15881625#if H_3D_DIM_SDC
    15891626  m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx, false );
    15901627#endif
     1628#endif
    15911629  if (pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N )
    15921630  {
    15931631    m_pcEntropyCoder->encodeIPCMInfo( pcCU, uiAbsPartIdx );
    1594 
    15951632    if(pcCU->getIPCMFlag(uiAbsPartIdx))
    15961633    {
     1634#if HHI_MOVE_SYN_K0052
     1635#if H_3D_DIM_SDC
     1636      m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx, false );
     1637#endif 
     1638#endif
    15971639      // Encode slice finish
    15981640      finishCU(pcCU,uiAbsPartIdx,uiDepth);
     
    16031645  // prediction Info ( Intra : direction mode, Inter : Mv, reference idx )
    16041646  m_pcEntropyCoder->encodePredInfo( pcCU, uiAbsPartIdx );
    1605 
     1647#if HHI_MOVE_SYN_K0052
     1648  m_pcEntropyCoder->encodeDBBPFlag( pcCU, uiAbsPartIdx );
     1649#if H_3D_DIM_SDC
     1650  m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx, false );
     1651#endif 
     1652#endif
    16061653#if H_3D_ARP
    16071654  m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx );
     
    16121659  // Encode Coefficients
    16131660  Bool bCodeDQP = getdQPFlag();
     1661#if H_3D_DISABLE_CHROMA
     1662  m_pcEntropyCoder->encodeCoeff( pcCU, uiAbsPartIdx, uiDepth, pcCU->getWidth (uiAbsPartIdx), pcCU->getHeight(uiAbsPartIdx), bCodeDQP, false );
     1663#else
    16141664  m_pcEntropyCoder->encodeCoeff( pcCU, uiAbsPartIdx, uiDepth, pcCU->getWidth (uiAbsPartIdx), pcCU->getHeight(uiAbsPartIdx), bCodeDQP );
     1665#endif
    16151666  setdQPFlag( bCodeDQP );
     1667#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     1668  }
     1669#else
    16161670#if H_3D_SINGLE_DEPTH
    16171671  }
     1672#endif
    16181673#endif
    16191674  // --- write terminating bit ---
     
    18341889#if H_3D_ARP
    18351890  Int nARPWMax = rpcTempCU->getSlice()->getARPStepNum() - 1;
     1891#if SEC_ARP_REM_ENC_RESTRICT_K0035
     1892  if( nARPWMax < 0 || bICFlag )
     1893#else
    18361894  if( nARPWMax < 0 || !rpcTempCU->getDvInfo(0).bDV || bICFlag )
     1895#endif
    18371896  {
    18381897    nARPWMax = 0;
     
    20002059
    20012060          rpcTempCU->setSkipFlagSubParts( rpcTempCU->getQtRootCbf(0) == 0, 0, uhDepth );
     2061#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     2062          rpcTempCU->setDISFlagSubParts( false, 0, uhDepth );
     2063#else
    20022064#if H_3D_SINGLE_DEPTH
    20032065          rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth );
     2066#endif
    20042067#endif
    20052068#if H_3D_VSP // possible bug fix
     
    20422105              }
    20432106              rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth );
     2107#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     2108              rpcTempCU->setDISFlagSubParts( false, 0, uhDepth );
     2109#else
    20442110#if H_3D_SINGLE_DEPTH
    20452111              rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth );
     2112#endif
    20462113#endif
    20472114              rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth );
     
    21662233  Bool bFirstTime = true;
    21672234  Int nARPWMax    = rpcTempCU->getSlice()->getARPStepNum() - 1;
    2168 
     2235#if SEC_ARP_REM_ENC_RESTRICT_K0035
     2236  if( nARPWMax < 0 || ePartSize != SIZE_2Nx2N || rpcTempCU->getICFlag(0) )
     2237#else
    21692238  if( nARPWMax < 0 || ePartSize != SIZE_2Nx2N || !rpcTempCU->getDvInfo(0).bDV || rpcTempCU->getICFlag(0) )
     2239#endif
    21702240  {
    21712241    nARPWMax = 0;
     
    21932263 
    21942264  rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth );
     2265#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     2266  rpcTempCU->setDISFlagSubParts( false, 0, uhDepth );
     2267#else
    21952268#if H_3D_SINGLE_DEPTH
    21962269  rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth );
     2270#endif
    21972271#endif
    21982272  rpcTempCU->setPartSizeSubParts  ( ePartSize,  0, uhDepth );
     
    23032377      }
    23042378      rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth );
     2379#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     2380      rpcTempCU->setDISFlagSubParts( false, 0, uhDepth );
     2381#else
    23052382#if H_3D_SINGLE_DEPTH
    23062383      rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth );
     2384#endif
    23072385#endif
    23082386      rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth );
     
    24132491  }
    24142492}
     2493
     2494#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     2495Void TEncCu::xCheckRDCostDIS( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize )
     2496{
     2497  UInt uiDepth = rpcTempCU->getDepth( 0 );
     2498  if( !rpcBestCU->getSlice()->getIsDepth() || (eSize != SIZE_2Nx2N))
     2499  {
     2500    return;
     2501  }
     2502
     2503#if H_3D_VSO // M5
     2504  if( m_pcRdCost->getUseRenModel() )
     2505  {
     2506    UInt  uiWidth     = m_ppcOrigYuv[uiDepth]->getWidth   ();
     2507    UInt  uiHeight    = m_ppcOrigYuv[uiDepth]->getHeight  ();
     2508    Pel*  piSrc       = m_ppcOrigYuv[uiDepth]->getLumaAddr();
     2509    UInt  uiSrcStride = m_ppcOrigYuv[uiDepth]->getStride  ();
     2510    m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );
     2511  }
     2512#endif
     2513
     2514  rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth );
     2515  rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth );
     2516  rpcTempCU->setPredModeSubParts( MODE_INTRA, 0, uiDepth );
     2517  rpcTempCU->setCUTransquantBypassSubParts( rpcTempCU->getCUTransquantBypass(0), 0, uiDepth );
     2518
     2519  rpcTempCU->setTrIdxSubParts(0, 0, uiDepth);
     2520  rpcTempCU->setCbfSubParts(0, 1, 1, 0, uiDepth);
     2521  rpcTempCU->setDISFlagSubParts(true, 0, uiDepth);
     2522  rpcTempCU->setLumaIntraDirSubParts (DC_IDX, 0, uiDepth);
     2523#if H_3D_DIM_SDC
     2524  rpcTempCU->setSDCFlagSubParts( false, 0, uiDepth);
     2525#endif
     2526
     2527  UInt uiPreCalcDistC;
     2528  m_pcPredSearch  ->estIntraPredDIS      ( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC, false );
     2529
     2530#if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC
     2531  Int oldTraceCopyBack = g_traceCopyBack;
     2532  g_traceCopyBack = false; 
     2533#endif
     2534  m_ppcRecoYuvTemp[uiDepth]->copyToPicLuma(rpcTempCU->getPic()->getPicYuvRec(), rpcTempCU->getAddr(), rpcTempCU->getZorderIdxInCU() );
     2535  #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC 
     2536    g_traceCopyBack = oldTraceCopyBack;
     2537  #endif
     2538
     2539
     2540  m_pcEntropyCoder->resetBits();
     2541  if ( rpcTempCU->getSlice()->getPPS()->getTransquantBypassEnableFlag())
     2542  {
     2543    m_pcEntropyCoder->encodeCUTransquantBypassFlag( rpcTempCU, 0,          true );
     2544  }
     2545  m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0,          true );
     2546  m_pcEntropyCoder->encodeDIS( rpcTempCU, 0,          true );
     2547
     2548
     2549  m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]);
     2550
     2551  rpcTempCU->getTotalBits() = m_pcEntropyCoder->getNumberOfWrittenBits();
     2552  rpcTempCU->getTotalBins() = ((TEncBinCABAC *)((TEncSbac*)m_pcEntropyCoder->m_pcEntropyCoderIf)->getEncBinIf())->getBinsCoded();
     2553
     2554
     2555#if H_3D_VSO // M6
     2556  if( m_pcRdCost->getUseLambdaScaleVSO()) 
     2557    rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCostVSO( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 
     2558  else
     2559#endif
     2560    rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() );
     2561
     2562
     2563  xCheckDQP( rpcTempCU );
     2564  xCheckBestMode(rpcBestCU, rpcTempCU, uiDepth);
     2565}
     2566#else
    24152567#if H_3D_SINGLE_DEPTH
    24162568Void TEncCu::xCheckRDCostSingleDepth( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize )
     
    24802632}
    24812633#endif
     2634#endif
    24822635
    24832636Void TEncCu::xCheckRDCostInterDBBP( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, Bool bUseMRG )
     
    25222675  AOF( uiDepthStride != 0 );
    25232676 
     2677#if HS_DBBP_CLEAN_K0048
     2678  PartSize eVirtualPartSize = m_pcPredSearch->getPartitionSizeFromDepth(pDepthPels, uiDepthStride, uiWidth, rpcTempCU);
     2679
    25242680  // derive partitioning from depth
     2681  Bool pMask[MAX_CU_SIZE*MAX_CU_SIZE];
     2682  Bool bValidMask = m_pcPredSearch->getSegmentMaskFromDepth(pDepthPels, uiDepthStride, uiWidth, uiHeight, pMask, rpcTempCU);
     2683#else
    25252684  PartSize eVirtualPartSize = m_pcPredSearch->getPartitionSizeFromDepth(pDepthPels, uiDepthStride, uiWidth);
    25262685 
     
    25282687  Bool pMask[MAX_CU_SIZE*MAX_CU_SIZE];
    25292688  Bool bValidMask = m_pcPredSearch->getSegmentMaskFromDepth(pDepthPels, uiDepthStride, uiWidth, uiHeight, pMask);
     2689#endif
    25302690 
    25312691  if( !bValidMask )
     
    26362796
    26372797  rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth );
     2798#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     2799  rpcTempCU->setDISFlagSubParts( false, 0, uiDepth );
     2800#else
    26382801#if H_3D_SINGLE_DEPTH
    26392802  rpcTempCU->setSingleDepthFlagSubParts( false, 0, uiDepth );
     2803#endif
    26402804#endif
    26412805  rpcTempCU->setPartSizeSubParts( eSize, 0, uiDepth );
     
    26562820 
    26572821#if H_3D_DIM_SDC
     2822#if 0 // H_3D_DISABLE_CHROMA
     2823  if( !rpcTempCU->getSDCFlag( 0 ) && !rpcTempCU->getSlice()->getIsDepth() )
     2824#else
    26582825  if( !rpcTempCU->getSDCFlag( 0 ) )
     2826#endif
    26592827#endif
    26602828  m_pcPredSearch  ->estIntraPredChromaQT( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC );
     
    26662834  }
    26672835  m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0,          true );
     2836#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     2837  m_pcEntropyCoder->encodeDIS( rpcTempCU, 0,          true );
     2838  if(!rpcTempCU->getDISFlag(0))
     2839  {
     2840#else
    26682841#if H_3D_SINGLE_DEPTH
    26692842  m_pcEntropyCoder->encodeSingleDepthMode( rpcTempCU, 0,          true );
     
    26712844  {
    26722845#endif
     2846#endif
    26732847  m_pcEntropyCoder->encodePredMode( rpcTempCU, 0,          true );
    26742848  m_pcEntropyCoder->encodePartSize( rpcTempCU, 0, uiDepth, true );
     2849#if !HHI_MOVE_SYN_K0052
    26752850#if H_3D_DIM_SDC
    26762851  m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true );
    26772852#endif
     2853#endif
    26782854  m_pcEntropyCoder->encodePredInfo( rpcTempCU, 0,          true );
    26792855  m_pcEntropyCoder->encodeIPCMInfo(rpcTempCU, 0, true );
     2856#if HHI_MOVE_SYN_K0052
     2857#if H_3D_DIM_SDC
     2858  m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true );
     2859#endif
     2860#endif
    26802861
    26812862  // Encode Coefficients
    26822863  Bool bCodeDQP = getdQPFlag();
     2864#if H_3D_DISABLE_CHROMA
     2865  m_pcEntropyCoder->encodeCoeff( rpcTempCU, 0, uiDepth, rpcTempCU->getWidth (0), rpcTempCU->getHeight(0), bCodeDQP, true );
     2866#else
    26832867  m_pcEntropyCoder->encodeCoeff( rpcTempCU, 0, uiDepth, rpcTempCU->getWidth (0), rpcTempCU->getHeight(0), bCodeDQP );
     2868#endif
     2869
     2870
    26842871  setdQPFlag( bCodeDQP );
     2872#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     2873  }
     2874#else
    26852875#if H_3D_SINGLE_DEPTH
    26862876  }
    2687 #endif       
     2877#endif
     2878#endif
    26882879  m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]);
    26892880 
     
    27132904
    27142905  rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth );
     2906#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     2907  rpcTempCU->setDISFlagSubParts( false, 0, uiDepth );
     2908#else
    27152909#if H_3D_SINGLE_DEPTH
    27162910  rpcTempCU->setSingleDepthFlagSubParts( false, 0, uiDepth );
     2911#endif
    27172912#endif
    27182913  rpcTempCU->setIPCMFlag(0, true);
     
    27322927  }
    27332928  m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0,          true );
     2929#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     2930  m_pcEntropyCoder->encodeDIS( rpcTempCU, 0,          true );
     2931#else
    27342932#if H_3D_SINGLE_DEPTH
    27352933  m_pcEntropyCoder->encodeSingleDepthMode( rpcTempCU, 0,          true );
    27362934#endif
     2935#endif
    27372936  m_pcEntropyCoder->encodePredMode ( rpcTempCU, 0,          true );
    27382937  m_pcEntropyCoder->encodePartSize ( rpcTempCU, 0, uiDepth, true );
     2938#if !HHI_MOVE_SYN_K0052
    27392939#if H_3D_DIM_SDC
    27402940  m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true );
    27412941#endif
     2942#endif
    27422943  m_pcEntropyCoder->encodeIPCMInfo ( rpcTempCU, 0, true );
    2743 
     2944#if HHI_MOVE_SYN_K0052
     2945#if H_3D_DIM_SDC
     2946  m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true );
     2947#endif
     2948#endif
    27442949  m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]);
    27452950
  • trunk/source/Lib/TLibEncoder/TEncCu.h

    r1084 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    159159  Void  xCheckRDCostInterDBBP( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, Bool bUseMRG = false );
    160160#endif
     161#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     162  Void  xCheckRDCostDIS   ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize  );
     163#else
    161164#if H_3D_SINGLE_DEPTH
    162165  Void  xCheckRDCostSingleDepth   ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize  );
     166#endif
    163167#endif
    164168#if H_3D_DIM
  • trunk/source/Lib/TLibEncoder/TEncEntropy.cpp

    r1133 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    111111  m_pcEntropyCoderIf->codeSkipFlag( pcCU, uiAbsPartIdx );
    112112}
     113
     114#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     115Void TEncEntropy::encodeDIS( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
     116{
     117  if ( !pcCU->getSlice()->getIsDepth() )
     118  {
     119    return;
     120  }
     121  if( bRD )
     122  {
     123    uiAbsPartIdx = 0;
     124  }
     125  m_pcEntropyCoderIf->codeDIS( pcCU, uiAbsPartIdx );
     126}
     127#else
    113128#if H_3D_SINGLE_DEPTH
    114129Void TEncEntropy::encodeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
     
    125140}
    126141#endif
     142#endif
     143
    127144/** encode merge flag
    128145 * \param pcCU
     
    254271  m_pcEntropyCoderIf->codePartSize( pcCU, uiAbsPartIdx, uiDepth );
    255272 
     273#if !HHI_MOVE_SYN_K0052
    256274#if H_3D_DBBP
    257275  if( pcCU->getSlice()->getDepthBasedBlkPartFlag() && (pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) && pcCU->getWidth(uiAbsPartIdx) > 8 && pcCU->getSlice()->getDefaultRefViewIdxAvailableFlag() )
     
    259277    encodeDBBPFlag(pcCU, uiAbsPartIdx, bRD);
    260278  }
     279#endif
    261280#endif
    262281}
     
    285304}
    286305
     306#if H_3D_DISABLE_CHROMA
     307Void TEncEntropy::xEncodeTransform( TComDataCU* pcCU,UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP, Bool rd )
     308#else
    287309Void TEncEntropy::xEncodeTransform( TComDataCU* pcCU,UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP )
    288 {
     310#endif
     311{
     312
     313#if H_MV_ENC_DEC_TRAC
     314#if ENC_DEC_TRACE
     315  UInt uiLPelX   = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ];
     316  UInt uiTPelY   = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ];
     317
     318  DTRACE_TU_S("=========== transform_tree ===========\n")
     319  DTRACE_TU("x0", uiLPelX)
     320  DTRACE_TU("x1", uiTPelY)
     321  DTRACE_TU("log2TrafoSize", g_uiMaxCUWidth>>uiDepth)
     322  DTRACE_TU("trafoDepth"  , uiDepth)
     323#endif
     324#endif
     325
    289326  const UInt uiSubdiv = pcCU->getTransformIdx( uiAbsPartIdx ) + pcCU->getDepth( uiAbsPartIdx ) > uiDepth;
    290327  const UInt uiLog2TrafoSize = g_aucConvertToBit[pcCU->getSlice()->getSPS()->getMaxCUWidth()]+2 - uiDepth;
     
    292329  UInt cbfU = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrIdx );
    293330  UInt cbfV = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrIdx );
    294 
     331#if H_3D_DISABLE_CHROMA
     332  if( !rd && pcCU->getSlice()->getSPS()->getChromaFormatIdc() == 0 )
     333  {
     334    cbfU = 0;
     335    cbfV = 0;
     336  }
     337#endif
    295338  if(uiTrIdx==0)
    296339  {
     
    309352      cbfU = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_U, uiTrIdx );
    310353      cbfV = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_V, uiTrIdx );
     354#if H_3D_DISABLE_CHROMA
     355      if( !rd && pcCU->getSlice()->getSPS()->getChromaFormatIdc() == 0 )
     356      {
     357        cbfU = 0;
     358        cbfV = 0;
     359      }
     360#endif
    311361    }
    312362  }
     
    349399  if( bFirstCbfOfCU || uiLog2TrafoSize > 2 )
    350400  {
     401#if H_3D_DISABLE_CHROMA
     402    if (pcCU->getSlice()->getSPS()->getChromaFormatIdc() != 0 || rd)
     403    {
     404      if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr - 1 ) )
     405      {
     406        m_pcEntropyCoderIf->codeQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr );
     407      }
     408      if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr - 1 ) )
     409      {
     410        m_pcEntropyCoderIf->codeQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr );
     411      }
     412    }
     413#else
    351414    if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr - 1 ) )
    352415    {
     
    357420      m_pcEntropyCoderIf->codeQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr );
    358421    }
     422#endif
    359423  }
    360424  else if( uiLog2TrafoSize == 2 )
    361425  {
     426#if H_3D_DISABLE_CHROMA
     427    if ( rd && pcCU->getSlice()->getSPS()->getChromaFormatIdc() != 0 )
     428    {
    362429    assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr ) == pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr - 1 ) );
    363430    assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr ) == pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr - 1 ) );
     431  }
     432#else
     433    assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr ) == pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr - 1 ) );
     434    assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr ) == pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr - 1 ) );
     435#endif
    364436  }
    365437 
     
    374446    const UInt partNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1);
    375447   
     448#if H_3D_DISABLE_CHROMA
     449    xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP, rd );
     450
     451    uiAbsPartIdx += partNum;  offsetLuma += size;  offsetChroma += (size>>2);
     452    xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP ,rd );
     453
     454    uiAbsPartIdx += partNum;  offsetLuma += size;  offsetChroma += (size>>2);
     455    xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP, rd );
     456
     457    uiAbsPartIdx += partNum;  offsetLuma += size;  offsetChroma += (size>>2);
     458    xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP, rd );
     459#else
    376460    xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP );
    377461
     
    384468    uiAbsPartIdx += partNum;  offsetLuma += size;  offsetChroma += (size>>2);
    385469    xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP );
     470#endif
    386471  }
    387472  else
     
    400485#endif
    401486   
     487#if H_3D_DISABLE_CHROMA
     488    Bool notcbfUV = !rd && pcCU->getSlice()->getSPS()->getChromaFormatIdc() == 0 ? 1 : ( !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) ) ;
     489    if( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA &&
     490      uiDepth == pcCU->getDepth( uiAbsPartIdx ) && notcbfUV )
     491#else
    402492    if( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) )
     493#endif
    403494    {
    404495      assert( pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, 0 ) );
     
    489580    encodeIntraDirModeLuma  ( pcCU, uiAbsPartIdx,true );
    490581#if H_3D_DIM_SDC
     582#if H_3D_DISABLE_CHROMA
     583    if(!pcCU->getSDCFlag(uiAbsPartIdx) && ( pcCU->getSlice()->getSPS()->getChromaFormatIdc() != 0  || bRD ) )
     584#else
    491585    if(!pcCU->getSDCFlag(uiAbsPartIdx))
     586#endif
    492587#endif
    493588    encodeIntraDirModeChroma( pcCU, uiAbsPartIdx, bRD );
     
    657752 * \param uiHeight
    658753 */
     754#if H_3D_DISABLE_CHROMA
     755Void TEncEntropy::encodeCoeff( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, Bool& bCodeDQP, Bool rd )
     756#else
    659757Void TEncEntropy::encodeCoeff( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, Bool& bCodeDQP )
     758#endif
    660759{
    661760  UInt uiMinCoeffSize = pcCU->getPic()->getMinCUWidth()*pcCU->getPic()->getMinCUHeight();
     
    668767    assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 );
    669768    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 );
     769#if H_3D_DISABLE_CHROMA
     770    if (!pcCU->getSlice()->getIsDepth() )
     771    {
     772      assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
     773      assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
     774    }
     775#else
    670776    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
    671777    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
    672   }
     778#endif
     779  }
     780
    673781
    674782  if( pcCU->getSDCFlag( uiAbsPartIdx ) && !pcCU->isIntra( uiAbsPartIdx ) )
     
    723831  }
    724832 
     833#if H_3D_DISABLE_CHROMA
     834  xEncodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, bCodeDQP, rd);
     835#else
    725836  xEncodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, bCodeDQP);
     837#endif
    726838}
    727839
     
    792904Void TEncEntropy::encodeDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
    793905{
    794   if( bRD )
    795   {
    796     uiAbsPartIdx = 0;
    797   }
    798   m_pcEntropyCoderIf->codeDBBPFlag( pcCU, uiAbsPartIdx );
     906#if HHI_MOVE_SYN_K0052
     907  if( pcCU->getSlice()->getDepthBasedBlkPartFlag() &&
     908    ( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN ||
     909      pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) &&
     910      pcCU->getWidth(uiAbsPartIdx) > 8 &&
     911      pcCU->getSlice()->getDefaultRefViewIdxAvailableFlag() )
     912  {
     913#endif
     914    if( bRD )
     915    {
     916      uiAbsPartIdx = 0;
     917    }
     918    m_pcEntropyCoderIf->codeDBBPFlag( pcCU, uiAbsPartIdx );
     919#if HHI_MOVE_SYN_K0052
     920  }
     921#endif
    799922}
    800923#endif
  • trunk/source/Lib/TLibEncoder/TEncEntropy.h

    r1133 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    8282  virtual Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
    8383  virtual Void codeSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
     84#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     85  virtual Void codeDIS          ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
     86#else
    8487#if H_3D_SINGLE_DEPTH
    8588  virtual Void codeSingleDepthMode      ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
     89#endif
    8690#endif
    8791  virtual Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
     
    147151  Void    resetBits                 ()                        { m_pcEntropyCoderIf->resetBits();      }
    148152  Void    resetCoeffCost            ()                        { m_pcEntropyCoderIf->resetCoeffCost(); }
    149   UInt    getNumberOfWrittenBits    ()                        { return m_pcEntropyCoderIf->getNumberOfWrittenBits(); }
     153  UInt    getNumberOfWrittenBits    ()
     154  {
     155#if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC
     156    Bool oldJustDoIt = g_bJustDoIt;
     157    g_bJustDoIt = true;
     158    writeToTraceFile( "NumberOfWrittenBits", m_pcEntropyCoderIf->getNumberOfWrittenBits(), g_encNumberOfWrittenBits );
     159    g_bJustDoIt = oldJustDoIt;
     160#endif
     161    return m_pcEntropyCoderIf->getNumberOfWrittenBits();
     162  }
    150163  UInt    getCoeffCost              ()                        { return  m_pcEntropyCoderIf->getCoeffCost(); }
    151164  Void    resetEntropy              ()                        { m_pcEntropyCoderIf->resetEntropy();  }
     
    166179  Void encodeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
    167180  Void encodeSkipFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
     181#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     182  Void encodeDIS               ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD=false );
     183#else
    168184#if H_3D_SINGLE_DEPTH
    169185  Void encodeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD=false );
     186#endif
    170187#endif
    171188  Void encodePUWise       ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
     
    209226
    210227private:
     228#if H_3D_DISABLE_CHROMA
     229  Void xEncodeTransform        ( TComDataCU* pcCU,UInt offsetLumaOffset, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP, Bool rd );
     230public:
     231  Void encodeCoeff             ( TComDataCU* pcCU,                 UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, Bool& bCodeDQP, Bool rd );
     232#else
    211233  Void xEncodeTransform        ( TComDataCU* pcCU,UInt offsetLumaOffset, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP );
    212234public:
    213235  Void encodeCoeff             ( TComDataCU* pcCU,                 UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, Bool& bCodeDQP );
     236#endif
    214237 
    215238  Void encodeCoeffNxN         ( TComDataCU* pcCU, TCoeff* pcCoeff, UInt uiAbsPartIdx, UInt uiTrWidth, UInt uiTrHeight, UInt uiDepth, TextType eType );
  • trunk/source/Lib/TLibEncoder/TEncGOP.cpp

    r1133 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    885885    Int numDirectRefLayers = vps    ->getNumDirectRefLayers( getLayerId() );
    886886#endif
     887#if HHI_INTER_COMP_PRED_K0052
     888    pcSlice->setIvPicLists( m_ivPicLists );         
     889
     890    Int gopNum = (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid;
     891    GOPEntry gopEntry      = m_pcCfg->getGOPEntry( gopNum );     
     892#else
    887893    GOPEntry gopEntry      = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid );     
     894#endif
    888895   
    889896    Bool interLayerPredLayerIdcPresentFlag = false;
     
    922929    assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics );
    923930   
     931#if HHI_INTER_COMP_PRED_K0052
     932#if H_3D
     933    if ( m_pcEncTop->decProcAnnexI() )
     934    {   
     935      pcSlice->deriveInCmpPredAndCpAvailFlag();
     936      if ( pcSlice->getInCmpPredAvailFlag() )
     937      {     
     938        pcSlice->setInCompPredFlag( gopEntry.m_interCompPredFlag );
     939      }
     940      else
     941      {
     942        if (gopEntry.m_interCompPredFlag )
     943        {
     944          if ( gopNum == MAX_GOP)
     945          {
     946            printf( "\nError: FrameI_l%d cannot enable inter-component prediction.\n", pcSlice->getVPS()->getLayerIdInVps( getLayerId() ) );
     947          }
     948          else
     949          {
     950            printf( "\nError: Frame%d_l%d cannot enable inter-component prediction.\n", gopNum, pcSlice->getVPS()->getLayerIdInVps( getLayerId() ) );
     951          }
     952         
     953          exit(EXIT_FAILURE);
     954        }
     955      }
     956      pcSlice->init3dToolParameters();
     957      pcSlice->checkInCompPredRefLayers();
     958    }
     959   
     960
     961    // This needs to be done after initilizaiton of 3D tool parameters.
     962    pcSlice->setMaxNumMergeCand      ( m_pcCfg->getMaxNumMergeCand()   + ( ( pcSlice->getMpiFlag( ) || pcSlice->getIvMvPredFlag( ) || pcSlice->getViewSynthesisPredFlag( )   ) ? 1 : 0 ));
     963#endif
     964#endif
     965
    924966    pcSlice->createInterLayerReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer0, m_refPicSetInterLayer1 );
    925967    pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer0.size() + (Int) m_refPicSetInterLayer1.size()) ) );
     
    9681010    }
    9691011#endif
     1012#if !HHI_INTER_COMP_PRED_K0052
    9701013#if H_3D
    9711014    pcSlice->setIvPicLists( m_ivPicLists );         
     
    9731016    assert( !m_pcEncTop->getIsDepth() || ( pcSlice->getTexturePic() != 0 ) );
    9741017#endif   
     1018#endif
    9751019#endif
    9761020#if H_3D_IC
     
    19501994              m_pcSAO->PCMLFDisableProcess(pcPic);
    19511995
     1996#if H_3D_DISABLE_CHROMA
     1997            if (pcSlice->getIsDepth())
     1998            {
     1999              sliceEnabled[SAO_Cb] = false;
     2000              sliceEnabled[SAO_Cr] = false;
     2001            }
     2002#endif
    19522003            //assign SAO slice header
    19532004            for(Int s=0; s< uiNumSlices; s++)
  • trunk/source/Lib/TLibEncoder/TEncGOP.h

    r1084 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncPic.cpp

    r872 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncPic.h

    r872 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncPreanalyzer.cpp

    r872 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncPreanalyzer.h

    r872 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncRateCtrl.cpp

    r872 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncRateCtrl.h

    r872 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp

    r964 r1179  
    44 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2014, ITU/ISO/IEC
     6 * Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.h

    r872 r1179  
    44 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2014, ITU/ISO/IEC
     6 * Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncSbac.cpp

    r1133 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    5858, m_cCUSplitFlagSCModel       ( 1,             1,               NUM_SPLIT_FLAG_CTX            , m_contextModels + m_numContextModels, m_numContextModels )
    5959, m_cCUSkipFlagSCModel        ( 1,             1,               NUM_SKIP_FLAG_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
     60#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     61, m_cCUDISFlagSCModel         ( 1,             1,               NUM_DIS_FLAG_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
     62, m_cCUDISTypeSCModel         ( 1,             1,               NUM_DIS_TYPE_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
     63#else
    6064#if H_3D_SINGLE_DEPTH
    6165, m_cCUSingleDepthFlagSCModel        ( 1,             1,               NUM_SINGLEDEPTH_FLAG_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
    6266, m_cSingleDepthValueSCModel         ( 1,             1,               NUM_SINGLE_DEPTH_VALUE_DATA_CTX      , m_contextModels + m_numContextModels, m_numContextModels)
     67#endif
    6368#endif
    6469, m_cCUMergeFlagExtSCModel    ( 1,             1,               NUM_MERGE_FLAG_EXT_CTX        , m_contextModels + m_numContextModels, m_numContextModels)
     
    134139 
    135140  m_cCUSkipFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG );
     141#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     142  m_cCUDISFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_DIS_FLAG );
     143  m_cCUDISTypeSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_DIS_TYPE );
     144#else
    136145#if H_3D_SINGLE_DEPTH
    137146  m_cCUSingleDepthFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SINGLEDEPTH_FLAG );
    138147  m_cSingleDepthValueSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA );
     148#endif
    139149#endif
    140150  m_cCUMergeFlagExtSCModel.initBuffer    ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT);
     
    214224      curCost  = m_cCUSplitFlagSCModel.calcCost       ( curSliceType, qp, (UChar*)INIT_SPLIT_FLAG );
    215225      curCost += m_cCUSkipFlagSCModel.calcCost        ( curSliceType, qp, (UChar*)INIT_SKIP_FLAG );
     226#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     227      curCost += m_cCUDISFlagSCModel.calcCost         ( curSliceType, qp, (UChar*)INIT_DIS_FLAG );
     228      curCost += m_cCUDISTypeSCModel.calcCost         ( curSliceType, qp, (UChar*)INIT_DIS_TYPE );
     229#else
    216230#if H_3D_SINGLE_DEPTH
    217231      curCost += m_cCUSingleDepthFlagSCModel.calcCost        ( curSliceType, qp, (UChar*)INIT_SINGLEDEPTH_FLAG );
    218232      curCost += m_cSingleDepthValueSCModel.calcCost         ( curSliceType, qp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA );
     233#endif
    219234#endif
    220235      curCost += m_cCUMergeFlagExtSCModel.calcCost    ( curSliceType, qp, (UChar*)INIT_MERGE_FLAG_EXT);
     
    287302 
    288303  m_cCUSkipFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG );
     304#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     305  m_cCUDISFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_DIS_FLAG );
     306  m_cCUDISTypeSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_DIS_TYPE );
     307#else
    289308#if H_3D_SINGLE_DEPTH
    290309  m_cCUSingleDepthFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SINGLEDEPTH_FLAG );
    291310  m_cSingleDepthValueSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA );
    292 #endif 
     311#endif
     312#endif
    293313  m_cCUMergeFlagExtSCModel.initBuffer    ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT);
    294314  m_cCUMergeIdxExtSCModel.initBuffer     ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT);
     
    446466  m_pcBinIf->encodeBinsEP( bins, numBins );
    447467}
     468
     469#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     470Void TEncSbac::codeDIS( TComDataCU* pcCU, UInt uiAbsPartIdx )
     471{
     472  UInt uiSymbol = pcCU->getDISFlag(uiAbsPartIdx ) ? 1 : 0;
     473  m_pcBinIf->encodeBin( uiSymbol, m_cCUDISFlagSCModel.get( 0, 0, 0 ) );
     474  if(uiSymbol)
     475  {
     476    UInt uiUnaryIdx = (UInt) pcCU->getDISType(uiAbsPartIdx);
     477    UInt uiNumCand  = 4;
     478
     479    if ( uiNumCand > 1 )
     480    {
     481      for( UInt ui = 0; ui < uiNumCand - 1; ++ui )
     482      {
     483        const UInt uiSymbol2 = ui == uiUnaryIdx ? 0 : 1;
     484        if ( ui == 0 )
     485        {
     486          m_pcBinIf->encodeBin( uiSymbol2, m_cCUDISTypeSCModel.get( 0, 0, 0 ) );
     487        }
     488        else
     489        {
     490          m_pcBinIf->encodeBinEP( uiSymbol2 );
     491        }
     492        if( uiSymbol2 == 0 )
     493        {
     494          break;
     495        }
     496      }
     497    }
     498  }
     499}
     500#else
    448501#if H_3D_SINGLE_DEPTH
    449502Void TEncSbac::codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx )
     
    477530}
    478531#endif
     532#endif
     533
    479534/** Coding of coeff_abs_level_minus3
    480535 * \param uiSymbol value of coeff_abs_level_minus3
     
    10401095  DTRACE_CABAC_V( uiCtx )
    10411096  DTRACE_CABAC_T( "\n" )
    1042 #endif
     1097#else
     1098  DTRACE_TU("split_transform_flag", uiSymbol )
     1099#endif
     1100
    10431101}
    10441102
     
    13711429  DTRACE_CABAC_V( uiAbsPartIdx )
    13721430  DTRACE_CABAC_T( "\n" )
     1431#else
     1432  if ( eType == TEXT_CHROMA_U )
     1433  {
     1434    DTRACE_TU("cbf_cb", uiCbf )
     1435  }
     1436  else if ( eType == TEXT_CHROMA_V )
     1437  {
     1438    DTRACE_TU("cbf_cr", uiCbf )
     1439  }
     1440  else
     1441  {
     1442    DTRACE_TU("cbf_luma", uiCbf )
     1443  }
    13731444#endif
    13741445}
     
    14461517    }
    14471518
     1519#if H_3D_DISABLE_CHROMA
     1520    if( pcCU->getSlice()->getSPS()->getChromaFormatIdc() != 0 )
     1521    {   
     1522#endif
    14481523    piPCMSample = pcCU->getPCMSampleCb() + uiChromaOffset;
    14491524    uiWidth = pcCU->getWidth(uiAbsPartIdx)/2;
     
    14771552      piPCMSample += uiWidth;
    14781553    }
     1554#if H_3D_DISABLE_CHROMA
     1555    }
     1556#endif
    14791557    m_pcBinIf->resetBac();
    14801558  }
     
    22892367  UInt uiSymbol = pcCU->getSDCFlag( uiAbsPartIdx ) ? 1 : 0;
    22902368  UInt uiCtxSDCFlag = pcCU->getCtxSDCFlag( uiAbsPartIdx );
    2291 
     2369  DTRACE_CU("dc_only_flag", uiSymbol)
    22922370  m_pcBinIf->encodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, uiCtxSDCFlag ) );
    22932371}
     
    23052383  UInt uiSymbol = pcCU->getDBBPFlag( uiAbsPartIdx ) ? 1 : 0;
    23062384  m_pcBinIf->encodeBin( uiSymbol, m_cDBBPFlagSCModel.get( 0, 0, 0 ) );
     2385  DTRACE_CU("dbbp_flag", uiSymbol)
    23072386}
    23082387#endif
  • trunk/source/Lib/TLibEncoder/TEncSbac.h

    r1133 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    146146  Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx );
    147147  Void codeSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     148#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     149  Void codeDIS           ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     150#else
    148151#if H_3D_SINGLE_DEPTH
    149152  Void codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx );
     153#endif
    150154#endif
    151155  Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     
    215219  ContextModel3DBuffer m_cCUSplitFlagSCModel;
    216220  ContextModel3DBuffer m_cCUSkipFlagSCModel;
     221#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     222  ContextModel3DBuffer m_cCUDISFlagSCModel;
     223  ContextModel3DBuffer m_cCUDISTypeSCModel;
     224#else
    217225#if H_3D_SINGLE_DEPTH
    218226  ContextModel3DBuffer m_cCUSingleDepthFlagSCModel;
    219227  ContextModel3DBuffer m_cSingleDepthValueSCModel;
     228#endif
    220229#endif
    221230  ContextModel3DBuffer m_cCUMergeFlagExtSCModel;
  • trunk/source/Lib/TLibEncoder/TEncSearch.cpp

    r1133 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    915915        }
    916916        m_pcEntropyCoder->encodeSkipFlag( pcCU, 0, true );
     917#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     918        m_pcEntropyCoder->encodeDIS(pcCU, 0, true );
     919        if(!pcCU->getDISFlag(uiAbsPartIdx))
     920#else
    917921#if H_3D_SINGLE_DEPTH
    918922        m_pcEntropyCoder->encodeSingleDepthMode(pcCU, 0, true );
    919923        if(!pcCU->getSingleDepthFlag(uiAbsPartIdx))
    920924#endif
    921         m_pcEntropyCoder->encodePredMode( pcCU, 0, true );
    922       }
     925#endif
     926          m_pcEntropyCoder->encodePredMode( pcCU, 0, true );
     927      }
     928#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     929      else
     930      {
     931        m_pcEntropyCoder->encodeDIS(pcCU, 0, true );
     932      }
     933#else
    923934#if H_3D_SINGLE_DEPTH
    924935      else
     
    926937        m_pcEntropyCoder->encodeSingleDepthMode(pcCU, 0, true );
    927938      }
    928 #endif     
     939#endif
     940#endif
     941#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     942      if(!pcCU->getDISFlag(uiAbsPartIdx))
     943      {
     944#else
    929945#if H_3D_SINGLE_DEPTH
    930946      if(!pcCU->getSingleDepthFlag(uiAbsPartIdx))
    931947      {
    932948#endif
    933       m_pcEntropyCoder  ->encodePartSize( pcCU, 0, pcCU->getDepth(0), true );
    934 
     949#endif
     950        m_pcEntropyCoder  ->encodePartSize( pcCU, 0, pcCU->getDepth(0), true );
     951
     952#if !HHI_MOVE_SYN_K0052
    935953#if H_3D_DIM_SDC
    936       m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
    937 #endif
    938       if (pcCU->isIntra(0) && pcCU->getPartitionSize(0) == SIZE_2Nx2N )
    939       {
    940         m_pcEntropyCoder->encodeIPCMInfo( pcCU, 0, true );
    941 
    942         if ( pcCU->getIPCMFlag (0))
    943         {
    944           return;
    945         }
    946       }
     954        m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
     955#endif
     956#endif
     957        if (pcCU->isIntra(0) && pcCU->getPartitionSize(0) == SIZE_2Nx2N )
     958        {
     959          m_pcEntropyCoder->encodeIPCMInfo( pcCU, 0, true );
     960          if ( pcCU->getIPCMFlag (0))
     961          {
     962#if HHI_MOVE_SYN_K0052
     963#if H_3D_DIM_SDC
     964            m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
     965#endif
     966#endif
     967            return;
     968          }
     969        }
     970#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     971      }
     972#else
    947973#if H_3D_SINGLE_DEPTH
    948     }
    949 #endif
    950     }
     974      }
     975#endif
     976#endif
     977    }
     978#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     979    if(!pcCU->getDISFlag(uiAbsPartIdx))
     980    {
     981#else
    951982#if H_3D_SINGLE_DEPTH
    952       if(!pcCU->getSingleDepthFlag(uiAbsPartIdx))
    953       {
    954 #endif
    955     // luma prediction mode
    956     if( pcCU->getPartitionSize(0) == SIZE_2Nx2N )
    957     {
    958       if( uiAbsPartIdx == 0 )
    959       {
    960         m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, 0 );
     983    if(!pcCU->getSingleDepthFlag(uiAbsPartIdx))
     984    {
     985#endif
     986#endif
     987      // luma prediction mode
     988      if( pcCU->getPartitionSize(0) == SIZE_2Nx2N )
     989      {
     990        if( uiAbsPartIdx == 0 )
     991        {
     992          m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, 0 );
    961993#if H_3D_DIM_SDC
    962         if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( 0 ) ) && getDimType( pcCU->getLumaIntraDir( 0 ) ) < DIM_NUM_TYPE )
    963         {
    964           m_pcEntropyCoder->encodeDeltaDC( pcCU, 0 );
    965         }
    966 #endif
    967       }
    968     }
    969     else
    970     {
    971       UInt uiQNumParts = pcCU->getTotalNumPart() >> 2;
    972       if( uiTrDepth == 0 )
    973       {
    974         assert( uiAbsPartIdx == 0 );
    975         for( UInt uiPart = 0; uiPart < 4; uiPart++ )
    976         {
    977           m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiPart * uiQNumParts );
     994#if HHI_MOVE_SYN_K0052
    978995#if H_3D_DIM_SDC
    979           if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( uiPart * uiQNumParts ) ) && getDimType( pcCU->getLumaIntraDir( uiPart * uiQNumParts ) ) < DIM_NUM_TYPE )
     996          m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
     997#endif
     998#endif
     999          if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( 0 ) ) && getDimType( pcCU->getLumaIntraDir( 0 ) ) < DIM_NUM_TYPE )
    9801000          {
    981             m_pcEntropyCoder->encodeDeltaDC( pcCU, uiPart * uiQNumParts );
     1001            m_pcEntropyCoder->encodeDeltaDC( pcCU, 0 );
    9821002          }
    9831003#endif
    9841004        }
    9851005      }
    986       else if( ( uiAbsPartIdx % uiQNumParts ) == 0 )
    987       {
    988         m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiAbsPartIdx );
     1006      else
     1007      {
     1008        UInt uiQNumParts = pcCU->getTotalNumPart() >> 2;
     1009        if( uiTrDepth == 0 )
     1010        {
     1011          assert( uiAbsPartIdx == 0 );
     1012          for( UInt uiPart = 0; uiPart < 4; uiPart++ )
     1013          {
     1014            m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiPart * uiQNumParts );
     1015
     1016#if HHI_MOVE_SYN_K0052
     1017          }
     1018          m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
     1019          for( UInt uiPart = 0; uiPart < 4; uiPart++ )
     1020          {
     1021#endif
    9891022#if H_3D_DIM_SDC
    990         if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( uiAbsPartIdx ) ) && getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx ) ) < DIM_NUM_TYPE )
    991         {
    992           m_pcEntropyCoder->encodeDeltaDC( pcCU, uiAbsPartIdx );
    993       }
    994 #endif
    995     }
    996   }
     1023            if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( uiPart * uiQNumParts ) ) && getDimType( pcCU->getLumaIntraDir( uiPart * uiQNumParts ) ) < DIM_NUM_TYPE )
     1024            {
     1025              m_pcEntropyCoder->encodeDeltaDC( pcCU, uiPart * uiQNumParts );
     1026            }
     1027#endif
     1028          }
     1029        }
     1030        else if( ( uiAbsPartIdx % uiQNumParts ) == 0 )
     1031        {
     1032          m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiAbsPartIdx );
     1033#if H_3D_DIM_SDC
     1034#if HHI_MOVE_SYN_K0052
     1035          if( uiAbsPartIdx == 0 ) 
     1036          {
     1037            m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
     1038          }
     1039#endif
     1040          if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( uiAbsPartIdx ) ) && getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx ) ) < DIM_NUM_TYPE )
     1041          {
     1042            m_pcEntropyCoder->encodeDeltaDC( pcCU, uiAbsPartIdx );
     1043          }
     1044#endif
     1045        }
     1046      }
     1047#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     1048    }
     1049#else
    9971050#if H_3D_SINGLE_DEPTH
    9981051    }
     1052#endif
    9991053#endif
    10001054  }
     
    18591913  dRDCost  += dSingleCost;
    18601914}
     1915
     1916#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     1917Void TEncSearch::xIntraCodingDIS( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, UInt uiPredMode )
     1918{
     1919  UInt    uiWidth           = pcCU     ->getWidth   ( 0 );
     1920  UInt    uiHeight          = pcCU     ->getHeight  ( 0 );
     1921  UInt    uiStride          = pcOrgYuv ->getStride  ();
     1922  Pel*    piOrg             = pcOrgYuv ->getLumaAddr( uiAbsPartIdx );
     1923  Pel*    piPred            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
     1924
     1925  AOF( uiWidth == uiHeight );
     1926  AOF( uiAbsPartIdx == 0 );
     1927  pcCU->setDISTypeSubParts(uiPredMode, uiAbsPartIdx, 0, pcCU->getDepth(0)); 
     1928  //===== reconstruction =====
     1929
     1930  Bool bAboveAvail = false;
     1931  Bool bLeftAvail  = false;
     1932  pcCU->getPattern()->initPattern   ( pcCU, 0, 0 );
     1933  pcCU->getPattern()->initAdiPattern( pcCU, 0, 0, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail );
     1934
     1935  if ( uiPredMode == 0 )
     1936  {
     1937    predIntraLumaAng( pcCU->getPattern(), VER_IDX, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );
     1938  }
     1939  else if ( uiPredMode == 1 )
     1940  {
     1941    predIntraLumaAng( pcCU->getPattern(), HOR_IDX, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );
     1942  }
     1943  else if ( uiPredMode == 2 )
     1944  {
     1945    Pel pSingleDepth = 1 << ( g_bitDepthY - 1 );
     1946    pcCU->getNeighDepth ( 0, 0, &pSingleDepth, 0 );
     1947    for( UInt uiY = 0; uiY < uiHeight; uiY++ )
     1948    {
     1949      for( UInt uiX = 0; uiX < uiWidth; uiX++ )
     1950      {
     1951        piPred[ uiX ] = pSingleDepth;
     1952      }
     1953      piPred+= uiStride;
     1954    }
     1955  }
     1956  else if ( uiPredMode == 3 )
     1957  {
     1958    Pel pSingleDepth = 1 << ( g_bitDepthY - 1 );
     1959    pcCU->getNeighDepth ( 0, 0, &pSingleDepth, 1 );
     1960    for( UInt uiY = 0; uiY < uiHeight; uiY++ )
     1961    {
     1962      for( UInt uiX = 0; uiX < uiWidth; uiX++ )
     1963      {
     1964        piPred[ uiX ] = pSingleDepth;
     1965      }
     1966      piPred+= uiStride;
     1967    }
     1968  }
     1969
     1970  // clear UV
     1971  UInt  uiStrideC     = pcPredYuv->getCStride();
     1972  Pel   *pRecCb       = pcPredYuv->getCbAddr();
     1973  Pel   *pRecCr       = pcPredYuv->getCrAddr();
     1974
     1975  for (Int y=0; y<uiHeight/2; y++)
     1976  {
     1977    for (Int x=0; x<uiWidth/2; x++)
     1978    {
     1979      pRecCb[x] = 1<<(g_bitDepthC-1);
     1980      pRecCr[x] = 1<<(g_bitDepthC-1);
     1981    }
     1982
     1983    pRecCb += uiStrideC;
     1984    pRecCr += uiStrideC;
     1985  }
     1986
     1987  piPred            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
     1988  //===== determine distortion =====
     1989#if H_3D_VSO
     1990  if ( m_pcRdCost->getUseVSO() )
     1991    ruiDist = m_pcRdCost->getDistPartVSO  ( pcCU, uiAbsPartIdx, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, false );
     1992  else
     1993#endif
     1994    ruiDist = m_pcRdCost->getDistPart(g_bitDepthY, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight );
     1995
     1996  //===== determine rate and r-d cost =====
     1997  m_pcEntropyCoder->resetBits();
     1998  m_pcEntropyCoder->encodeDIS( pcCU, 0, true );
     1999  UInt uiBits = m_pcEntropyCoder->getNumberOfWrittenBits();
     2000
     2001#if H_3D_VSO
     2002  if ( m_pcRdCost->getUseLambdaScaleVSO())
     2003    dRDCost = m_pcRdCost->calcRdCostVSO( uiBits, ruiDist );
     2004  else
     2005#endif
     2006    dRDCost = m_pcRdCost->calcRdCost( uiBits, ruiDist );
     2007}
     2008#else
    18612009#if H_3D_SINGLE_DEPTH
    18622010Void TEncSearch::xIntraCodingSingleDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Int iTestDepthIdx, Pel *DepthNeighbor )
     
    19212069}
    19222070#endif
     2071#endif
     2072
    19232073#if H_3D_DIM_SDC
    19242074Void TEncSearch::xIntraCodingSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi  )
     
    21682318
    21692319  m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth( 0 ), true );
     2320#if !HHI_MOVE_SYN_K0052
    21702321  m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
     2322#endif
    21712323
    21722324  // encode pred direction + DC residual data
    21732325  m_pcEntropyCoder->encodePredInfo( pcCU, 0, true );
     2326#if HHI_MOVE_SYN_K0052
     2327  m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
     2328#endif
     2329
    21742330  Bool bDummy = false;
     2331#if H_3D_DISABLE_CHROMA
     2332  m_pcEntropyCoder->encodeCoeff( pcCU, 0, pcCU->getDepth( 0 ), uiWidth, uiHeight, bDummy, true );
     2333#else
    21752334  m_pcEntropyCoder->encodeCoeff( pcCU, 0, pcCU->getDepth( 0 ), uiWidth, uiHeight, bDummy );
     2335#endif
    21762336  UInt uiBits = m_pcEntropyCoder->getNumberOfWrittenBits();
    21772337
     
    28613021  pcCU->setChromIntraDirSubParts( uiBestMode, 0, pcCU->getDepth( 0 ) );
    28623022}
     3023
     3024#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     3025Void TEncSearch::estIntraPredDIS( TComDataCU* pcCU,
     3026                                  TComYuv*    pcOrgYuv,
     3027                                  TComYuv*    pcPredYuv,
     3028                                  TComYuv*    pcResiYuv,
     3029                                  TComYuv*    pcRecoYuv,
     3030                                  UInt&       ruiDistC,
     3031                                  Bool        bLumaOnly )
     3032{
     3033  UInt    uiDepth        = pcCU->getDepth(0);
     3034  UInt    uiWidth        = pcCU->getWidth (0);
     3035  UInt    uiHeight       = pcCU->getHeight(0);
     3036
     3037
     3038  Pel* piOrg         = pcOrgYuv ->getLumaAddr( 0, uiWidth );
     3039  UInt uiStride      = pcPredYuv->getStride();
     3040
     3041  Dist   uiDist = 0;
     3042  Double dCost   = 0.0;
     3043  Dist    uiBestDist = 0;
     3044  Double  dBestCost   = MAX_DOUBLE;
     3045  UInt     uiBestDISType = 0;
     3046
     3047  for( UInt uiPredMode = 0; uiPredMode < 4 ; uiPredMode++ )
     3048  {
     3049    // set context models
     3050    m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] );
     3051
     3052    // determine residual for partition
     3053    uiDist = 0;
     3054    dCost   = 0.0;
     3055#if H_3D_VSO // M36
     3056    if( m_pcRdCost->getUseRenModel() )
     3057    {
     3058      m_pcRdCost->setRenModelData( pcCU, 0, piOrg, uiStride, uiWidth, uiHeight );
     3059    }
     3060#endif
     3061    xIntraCodingDIS(pcCU, 0, pcOrgYuv, pcPredYuv, uiDist, dCost, uiPredMode);
     3062    // check r-d cost
     3063    if( dCost < dBestCost )
     3064    {
     3065      uiBestDist = uiDist;
     3066      dBestCost   = dCost;
     3067      uiBestDISType = pcCU->getDISType(0);
     3068      // copy reconstruction
     3069      pcPredYuv->copyPartToPartYuv(pcRecoYuv, 0, uiWidth, uiHeight);
     3070    }
     3071  }
     3072
     3073
     3074  pcCU->setDISTypeSubParts(uiBestDISType, 0, 0, uiDepth); 
     3075  assert(uiBestDISType >= 0);
     3076
     3077  //===== reset context models =====
     3078  m_pcRDGoOnSbacCoder->load(m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST]);
     3079
     3080  //===== set distortion (rate and r-d costs are determined later) =====
     3081  pcCU->getTotalDistortion() = uiBestDist;
     3082}
     3083#else
    28633084#if H_3D_SINGLE_DEPTH
    28643085Void
     
    29503171
    29513172#endif
     3173#endif
     3174
    29523175Void
    29533176TEncSearch::estIntraPredQT( TComDataCU* pcCU,
     
    53115534  TComMv      cMvPred = *pcMvPred;
    53125535 
     5536#if SONY_MV_V_CONST_C0078
     5537  Bool bMv_VRng_Restricted = false;
     5538  if( m_pcEncCfg->getUseDisparitySearchRangeRestriction()
     5539       &&
     5540      pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxPred )->getPOC() == pcCU->getSlice()->getPOC()
     5541    )
     5542  {
     5543      bMv_VRng_Restricted = true;
     5544  }
     5545  if ( bBi )  xSetSearchRange   ( pcCU, rcMv   , iSrchRng, cMvSrchRngLT, cMvSrchRngRB, bMv_VRng_Restricted, m_pcEncCfg->getVerticalDisparitySearchRange() );
     5546  else        xSetSearchRange   ( pcCU, cMvPred, iSrchRng, cMvSrchRngLT, cMvSrchRngRB, bMv_VRng_Restricted, m_pcEncCfg->getVerticalDisparitySearchRange() );
     5547#else
    53135548  if ( bBi )  xSetSearchRange   ( pcCU, rcMv   , iSrchRng, cMvSrchRngLT, cMvSrchRngRB );
    53145549  else        xSetSearchRange   ( pcCU, cMvPred, iSrchRng, cMvSrchRngLT, cMvSrchRngRB );
     5550#endif
    53155551 
    53165552  m_pcRdCost->getMotionCost ( 1, 0 );
     
    53655601
    53665602
     5603#if SONY_MV_V_CONST_C0078
     5604Void TEncSearch::xSetSearchRange ( TComDataCU* pcCU, TComMv& cMvPred, Int iSrchRng, TComMv& rcMvSrchRngLT, TComMv& rcMvSrchRngRB, Bool bMv_VRng_Restricted, Int iVerDispSrchRng )
     5605#else
    53675606Void TEncSearch::xSetSearchRange ( TComDataCU* pcCU, TComMv& cMvPred, Int iSrchRng, TComMv& rcMvSrchRngLT, TComMv& rcMvSrchRngRB )
     5607#endif
    53685608{
    53695609  Int  iMvShift = 2;
     
    53805620  rcMvSrchRngRB.setHor( cTmpMvPred.getHor() + (iSrchRng << iMvShift) );
    53815621  rcMvSrchRngRB.setVer( cTmpMvPred.getVer() + (iSrchRng << iMvShift) );
     5622 
     5623#if SONY_MV_V_CONST_C0078
     5624  if ( bMv_VRng_Restricted ) {
     5625    Int iRestrictMvVrange = ( iVerDispSrchRng - 1 ) << iMvShift ; // -1 to consider subpel search
     5626    if ( rcMvSrchRngRB.getVer() >= iRestrictMvVrange  ){
     5627      rcMvSrchRngRB.setVer( iRestrictMvVrange ); //only positive side is restricted
     5628    }
     5629  }
     5630#endif
     5631
    53825632  pcCU->clipMv        ( rcMvSrchRngLT );
    53835633  pcCU->clipMv        ( rcMvSrchRngRB );
     
    71197369    const UInt uiQTTempAccessLayer = pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() - uiLog2TrSize;
    71207370
     7371#if 0 //H_3D_DISABLE_CHROMA
     7372    Bool  bCodeChroma   = !pcCU->getSlice()->getIsDepth();
     7373#else
    71217374    Bool  bCodeChroma   = true;
     7375#endif
    71227376    UInt  uiTrModeC     = uiTrMode;
    71237377    UInt  uiLog2TrSizeC = uiLog2TrSize-1;
     
    72617515    }
    72627516    m_pcEntropyCoder->encodeSkipFlag ( pcCU, 0, true );
     7517#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     7518    m_pcEntropyCoder->encodeDIS ( pcCU, 0, true );
     7519#else
    72637520#if H_3D_SINGLE_DEPTH
    72647521    m_pcEntropyCoder->encodeSingleDepthMode ( pcCU, 0, true );
    72657522#endif
     7523#endif
    72667524    m_pcEntropyCoder->encodePredMode( pcCU, 0, true );
    72677525    m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth(0), true );
     7526#if !HHI_MOVE_SYN_K0052
    72687527#if H_3D_DIM_SDC
    72697528    m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
    72707529#endif
     7530#endif
    72717531    m_pcEntropyCoder->encodePredInfo( pcCU, 0, true );
     7532#if HHI_MOVE_SYN_K0052
     7533#if H_3D_DIM_SDC
     7534    m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
     7535#endif
     7536#endif
    72727537#if H_3D_ARP
    7273     m_pcEntropyCoder->encodeARPW( pcCU , 0 );
     7538    m_pcEntropyCoder->encodeARPW( pcCU , 0  );
    72747539#endif
    72757540#if H_3D_IC
    72767541    m_pcEntropyCoder->encodeICFlag( pcCU, 0, true );
    72777542#endif
     7543#if HHI_MOVE_SYN_K0052
     7544    m_pcEntropyCoder->encodeDBBPFlag( pcCU, 0, true );
     7545#endif
    72787546    Bool bDummy = false;
     7547#if H_3D_DISABLE_CHROMA
     7548    m_pcEntropyCoder->encodeCoeff   ( pcCU, 0, pcCU->getDepth(0), pcCU->getWidth(0), pcCU->getHeight(0), bDummy, true );
     7549#else
    72797550    m_pcEntropyCoder->encodeCoeff   ( pcCU, 0, pcCU->getDepth(0), pcCU->getWidth(0), pcCU->getHeight(0), bDummy );
     7551#endif
    72807552   
    72817553    ruiBits += m_pcEntropyCoder->getNumberOfWrittenBits();
  • trunk/source/Lib/TLibEncoder/TEncSearch.h

    r1084 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    191191                                  TComYuv*    pcRecoYuv,
    192192                                  UInt        uiPreCalcDistC );
     193#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     194  Void  estIntraPredDIS        ( TComDataCU* pcCU,
     195                                 TComYuv*    pcOrgYuv,
     196                                 TComYuv*    pcPredYuv,
     197                                 TComYuv*    pcResiYuv,
     198                                 TComYuv*    pcRecoYuv,
     199                                 UInt&       ruiDistC,
     200                                 Bool        bLumaOnly );
     201#else
    193202#if H_3D_SINGLE_DEPTH
    194203  Void  estIntraPredSingleDepth  ( TComDataCU* pcCU,
     
    199208                                  UInt&       ruiDistC,
    200209                                  Bool        bLumaOnly );
    201 #endif   
     210#endif
     211#endif
    202212 
    203213  /// encoder estimation - inter prediction (non-skip)
     
    354364                                    UInt         uiAbsPartIdx,
    355365                                    UInt         stateU0V1Both2 );
     366#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     367  Void xIntraCodingDIS           ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, UInt uiPredMode );
     368#else
    356369#if H_3D_SINGLE_DEPTH
    357370  Void xIntraCodingSingleDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Int iTestDepthIdx, Pel * DepthNeighbor );
     371#endif
    358372#endif
    359373#if H_3D_DIM
     
    466480                                    UInt&         ruiSAD );
    467481 
     482#if SONY_MV_V_CONST_C0078
     483  Void xSetSearchRange           (  TComDataCU* pcCU,
     484                                    TComMv& cMvPred,
     485                                    Int iSrchRng,
     486                                    TComMv& rcMvSrchRngLT,
     487                                    TComMv& rcMvSrchRngRB,
     488                                    Bool bMv_VRng_Restricted,
     489                                    Int iVerDispSrchRng );
     490#else
    468491  Void xSetSearchRange            ( TComDataCU*   pcCU,
    469492                                    TComMv&       cMvPred,
     
    471494                                    TComMv&       rcMvSrchRngLT,
    472495                                    TComMv&       rcMvSrchRngRB );
     496#endif
    473497 
    474498  Void xPatternSearchFast         ( TComDataCU*   pcCU,
  • trunk/source/Lib/TLibEncoder/TEncSlice.cpp

    r1133 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    215215  rpcSlice->setPicOutputFlag( true );
    216216  rpcSlice->setPOC( pocCurr );
     217#if !HHI_INTER_COMP_PRED_K0052
    217218#if H_3D
    218   rpcSlice->init3dToolParameters();
     219    rpcSlice->init3dToolParameters();
     220#endif
    219221#endif
    220222#if H_3D_IC
     
    610612  rpcSlice->setSliceSegmentMode     ( m_pcCfg->getSliceSegmentMode()     );
    611613  rpcSlice->setSliceSegmentArgument ( m_pcCfg->getSliceSegmentArgument() );
     614#if !HHI_INTER_COMP_PRED_K0052
    612615#if H_3D_IV_MERGE
    613616  rpcSlice->setMaxNumMergeCand      ( m_pcCfg->getMaxNumMergeCand()   + ( ( rpcSlice->getMpiFlag( ) || rpcSlice->getIvMvPredFlag( ) || rpcSlice->getViewSynthesisPredFlag( )   ) ? 1 : 0 ));
    614617#else
    615618  rpcSlice->setMaxNumMergeCand        ( m_pcCfg->getMaxNumMergeCand()        );
     619#endif
     620#else
     621#if !H_3D
     622  rpcSlice->setMaxNumMergeCand        ( m_pcCfg->getMaxNumMergeCand()        );
     623#endif
    616624#endif
    617625  xStoreWPparam( pPPS->getUseWP(), pPPS->getWPBiPred() );
  • trunk/source/Lib/TLibEncoder/TEncSlice.h

    r1133 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/TEncTop.cpp

    r1133 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    9191  m_aICEnableNum = NULL;
    9292#endif
     93#if H_3D_ANNEX_SELECTION_FIX
     94  m_cCavlcCoder.setEncTop(this);
     95#endif
    9396}
    9497
     
    364367  }
    365368#endif
     369
    366370  // initialize processing unit classes
    367371  m_cGOPEncoder.  init( this );
     
    413417#endif
    414418#if H_3D
     419#if HHI_CAM_PARA_K0052
     420  pcPicCurr->setScaleOffset( m_cameraParameters->getCodedScale(), m_cameraParameters->getCodedOffset() );
     421#else
    415422  pcPicCurr->setScaleOffset( m_aaiCodedScale, m_aaiCodedOffset );
     423#endif
    416424#endif
    417425}
     
    760768    m_cSPS.setSpsInferScalingListFlag   ( true );
    761769    m_cSPS.setSpsScalingListRefLayerId( m_cVPS->getIdRefLayer( getLayerId(), 0 ) );
    762   }
     770#if SONY_MV_V_CONST_C0078
     771    if ( m_bUseDisparitySearchRangeRestriction )
     772    {
     773      m_cSPS.setInterViewMvVertConstraintFlag ( true ) ;
     774    }
     775#endif
     776  } 
    763777  m_cSPS.setSpsExtensionPresentFlag       ( true );
    764778  m_cSPS.setSpsMultilayerExtensionFlag    ( true );
     
    773787  m_cSPS.setMaxCUHeight   ( g_uiMaxCUHeight     );
    774788  m_cSPS.setMaxCUDepth    ( g_uiMaxCUDepth      );
     789#if H_3D_DISABLE_CHROMA
     790  m_cSPS.setChromaFormatIdc( getIsDepth() ? CHROMA_400 : CHROMA_420 );
     791#endif
    775792
    776793  Int minCUSize = m_cSPS.getMaxCUWidth() >> ( m_cSPS.getMaxCUDepth()-g_uiAddCUDepth );
  • trunk/source/Lib/TLibEncoder/TEncTop.h

    r1133 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/WeightPredAnalysis.cpp

    r872 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
  • trunk/source/Lib/TLibEncoder/WeightPredAnalysis.h

    r872 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
Note: See TracChangeset for help on using the changeset viewer.