Changeset 748 in 3DVCSoftware


Ignore:
Timestamp:
18 Dec 2013, 09:00:24 (10 years ago)
Author:
zte
Message:

JCT3V-F0131, JCT3V-F0139

Location:
branches/HTM-9.1-dev0-ZTE
Files:
1 added
19 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-9.1-dev0-ZTE/source/App/TAppEncoder/TAppEncTop.cpp

    r738 r748  
    7676#endif
    7777 
     78#if DLT_DIFF_CODING_IN_PPS
     79  TComDLT& dlt = m_dlt;
     80#endif
     81
    7882#if H_MV
    7983  Int maxTempLayer = -1;
     
    125129#if H_3D
    126130  xSetVPSExtension2        ( vps );
    127   m_ivPicLists.setVPS      ( &vps );
     131  m_ivPicLists.setVPS      ( &vps );
     132#if DLT_DIFF_CODING_IN_PPS
     133  xDeriveDltArray          ( vps, dlt );
     134#endif
    128135#endif
    129136
     
    218225  // H_MV
    219226  m_cTEncTop.setVPS(&vps);
     227
     228#if DLT_DIFF_CODING_IN_PPS
     229  m_cTEncTop.setDLT(&dlt);
     230#endif
    220231
    221232  m_cTEncTop.setProfile(m_profile);
     
    12471258
    12481259#if H_3D_DIM_DLT
     1260#if DLT_DIFF_CODING_IN_PPS
     1261Void TAppEncTop::xAnalyzeInputBaseDepth(UInt layer, UInt uiNumFrames, TComVPS* vps, TComDLT* dlt)
     1262#else
    12491263Void TAppEncTop::xAnalyzeInputBaseDepth(UInt layer, UInt uiNumFrames, TComVPS* vps)
     1264#endif
    12501265{
    12511266  TComPicYuv*       pcDepthPicYuvOrg = new TComPicYuv;
     
    13071322  if( uiNumFrames == 0 || numBitsForValue(iNumDepthValues) == g_bitDepthY )
    13081323  {
     1324#if DLT_DIFF_CODING_IN_PPS
     1325    dlt->setUseDLTFlag(layer, false);
     1326#else
    13091327    // don't use DLT
    13101328    vps->setUseDLTFlag(layer, false);
     1329#endif
    13111330  }
    13121331 
    13131332  // assign LUT
     1333#if DLT_DIFF_CODING_IN_PPS
     1334  if( dlt->getUseDLTFlag(layer) )
     1335    dlt->setDepthLUTs(layer, aiIdx2DepthValue, iNumDepthValues);
     1336#else
    13141337  if( vps->getUseDLTFlag(layer) )
    13151338    vps->setDepthLUTs(layer, aiIdx2DepthValue, iNumDepthValues);
     1339#endif
    13161340 
    13171341  // free temporary memory
     
    19671991#endif
    19681992#if H_3D_DIM_DLT
     1993#if !DLT_DIFF_CODING_IN_PPS
    19691994    vps.setUseDLTFlag( layer , isDepth && m_useDLT );
    19701995    if( vps.getUseDLTFlag( layer ) )
     
    19762001#endif
    19772002    }
     2003#endif
    19782004#endif
    19792005#endif
     
    20112037}
    20122038#endif
     2039
     2040#if DLT_DIFF_CODING_IN_PPS
     2041Void TAppEncTop::xDeriveDltArray( TComVPS& vps, TComDLT& dlt )
     2042{
     2043  Int  iNumDepthViews  = 0;
     2044  Bool bDltPresentFlag = false;
     2045
     2046  for ( Int layer = 0; layer <= vps.getMaxLayersMinus1(); layer++ )
     2047  {
     2048    Bool isDepth = ( vps.getDepthId( layer ) == 1 );
     2049
     2050    if ( isDepth )
     2051    {
     2052      iNumDepthViews++;
     2053    }
     2054
     2055    dlt.setUseDLTFlag( layer , isDepth && m_useDLT );
     2056    if( dlt.getUseDLTFlag( layer ) )
     2057    {
     2058      xAnalyzeInputBaseDepth(layer, max(m_iIntraPeriod[layer], 24), &vps, &dlt);
     2059      bDltPresentFlag = bDltPresentFlag || dlt.getUseDLTFlag(layer);
     2060    }
     2061  }
     2062
     2063  dlt.setDltPresentFlag( bDltPresentFlag );
     2064  dlt.setNumDepthViews ( iNumDepthViews  );
     2065}
     2066#endif
    20132067#endif
    20142068//! \}
  • branches/HTM-9.1-dev0-ZTE/source/App/TAppEncoder/TAppEncTop.h

    r738 r748  
    8686#endif
    8787
     88#if DLT_DIFF_CODING_IN_PPS
     89  TComDLT                    m_dlt;                         ///< dlt
     90#endif
     91
    8892  UInt m_essentialBytes;
    8993  UInt m_totalBytes;
     
    135139  Void xSetVPSExtension2( TComVPS& vps );
    136140#endif
     141#if DLT_DIFF_CODING_IN_PPS
     142  Void xDeriveDltArray( TComVPS& vps, TComDLT& dlt );
     143#endif
    137144#if H_3D_DIM_DLT
     145#if DLT_DIFF_CODING_IN_PPS
     146  Void  xAnalyzeInputBaseDepth(UInt layer, UInt uiNumFrames, TComVPS* vps, TComDLT* dlt);
     147#else
    138148  Void  xAnalyzeInputBaseDepth(UInt layer, UInt uiNumFrames, TComVPS* vps);
     149#endif
    139150#endif
    140151public:
  • branches/HTM-9.1-dev0-ZTE/source/Lib/TLibCommon/TComPrediction.cpp

    r724 r748  
    506506    {
    507507#if H_3D_DIM_DLT
     508#if DLT_DIFF_CODING_IN_PPS
     509      segDC1 = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC1 ) + deltaDC1 );
     510      segDC2 = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC2 ) + deltaDC2 );
     511#else
    508512      segDC1 = pcCU->getSlice()->getVPS()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC1 ) + deltaDC1 );
    509513      segDC2 = pcCU->getSlice()->getVPS()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC2 ) + deltaDC2 );
     514#endif
    510515#else
    511516      segDC1 = ClipY( predDC1 + deltaDC1 );
  • branches/HTM-9.1-dev0-ZTE/source/Lib/TLibCommon/TComSlice.cpp

    r738 r748  
    18161816    m_vpsDepthModesFlag [i] = false;
    18171817#if H_3D_DIM_DLT
     1818#if !DLT_DIFF_CODING_IN_PPS
    18181819    m_bUseDLTFlag         [i] = false;
    18191820   
     
    18321833    }
    18331834#endif
     1835#endif
    18341836#if H_3D
    18351837    m_ivMvScalingFlag = true;
     
    19021904    if (m_repFormat[ i ] != NULL )      delete m_repFormat[ i ];   
    19031905#if H_3D_DIM_DLT
     1906#if !DLT_DIFF_CODING_IN_PPS
    19041907    if ( m_iDepthValue2Idx[i] != 0 )
    19051908    {
     
    19141917    }
    19151918#endif
     1919#endif
    19161920  }
    19171921#endif
     
    19191923
    19201924#if H_3D_DIM_DLT
     1925#if !DLT_DIFF_CODING_IN_PPS
    19211926  Void TComVPS::setDepthLUTs(Int layerIdInVps, Int* idxToDepthValueTable, Int iNumDepthValues)
    19221927  {
     
    19791984    m_iBitsPerDepthValue[layerIdInVps] = numBitsForValue(m_iNumDepthmapValues[layerIdInVps]);
    19801985  }
     1986#endif
    19811987#endif
    19821988
     
    24442450, m_ppsInferScalingListFlag(false)
    24452451, m_ppsScalingListRefLayerId(0)
     2452#if DLT_DIFF_CODING_IN_PPS
     2453, m_pcDLT(NULL)
     2454#endif
    24462455#endif
    24472456{
     
    24632472  delete m_scalingList;
    24642473}
     2474
     2475#if DLT_DIFF_CODING_IN_PPS
     2476TComDLT::TComDLT()
     2477: m_bDltPresentFlag(false)
     2478, m_iNumDepthViews(0)
     2479, m_uiDepthViewBitDepth(8)
     2480{
     2481  m_uiDepthViewBitDepth = g_bitDepthY;
     2482
     2483  for( Int i = 0; i < MAX_NUM_LAYERS; i++ )
     2484  {
     2485    m_bUseDLTFlag                 [i] = false;
     2486    m_bInterViewDltPredEnableFlag [i] = false;
     2487
     2488    // allocate some memory and initialize with default mapping
     2489    m_iNumDepthmapValues[i] = ((1 << m_uiDepthViewBitDepth)-1)+1;
     2490    m_iBitsPerDepthValue[i] = numBitsForValue(m_iNumDepthmapValues[i]);
     2491
     2492    m_iDepthValue2Idx[i]    = (Int*) xMalloc(Int, m_iNumDepthmapValues[i]);
     2493    m_iIdx2DepthValue[i]    = (Int*) xMalloc(Int, m_iNumDepthmapValues[i]);
     2494
     2495    //default mapping
     2496    for (Int d=0; d<m_iNumDepthmapValues[i]; d++)
     2497    {
     2498      m_iDepthValue2Idx[i][d] = d;
     2499      m_iIdx2DepthValue[i][d] = d;
     2500    }
     2501  }
     2502}
     2503
     2504TComDLT::~TComDLT()
     2505{
     2506  for( Int i = 0; i < MAX_NUM_LAYERS; i++ )
     2507  {
     2508    if ( m_iDepthValue2Idx[i] != NULL )
     2509    {
     2510      xFree( m_iDepthValue2Idx[i] );
     2511      m_iDepthValue2Idx[i] = NULL;
     2512    }
     2513
     2514    if ( m_iIdx2DepthValue[i] != NULL )
     2515    {
     2516      xFree( m_iIdx2DepthValue[i] );
     2517      m_iIdx2DepthValue[i] = NULL;
     2518    }
     2519  }
     2520}
     2521
     2522Void TComDLT::setDepthLUTs(Int layerIdInVps, Int* idxToDepthValueTable, Int iNumDepthValues)
     2523{
     2524  if( idxToDepthValueTable == NULL || iNumDepthValues == 0 ) // default mapping only
     2525    return;
     2526
     2527  // copy idx2DepthValue to internal array
     2528  memcpy(m_iIdx2DepthValue[layerIdInVps], idxToDepthValueTable, iNumDepthValues*sizeof(UInt));
     2529
     2530  UInt uiMaxDepthValue = ((1 << g_bitDepthY)-1);
     2531  for(Int p=0; p<=uiMaxDepthValue; p++)
     2532  {
     2533    Int iIdxDown    = 0;
     2534    Int iIdxUp      = iNumDepthValues-1;
     2535    Bool bFound     = false;
     2536
     2537    // iterate over indices to find lower closest depth
     2538    Int i = 1;
     2539    while(!bFound && i<iNumDepthValues)
     2540    {
     2541      if( m_iIdx2DepthValue[layerIdInVps][i] > p )
     2542      {
     2543        iIdxDown  = i-1;
     2544        bFound    = true;
     2545      }
     2546
     2547      i++;
     2548    }
     2549    // iterate over indices to find upper closest depth
     2550    i = iNumDepthValues-2;
     2551    bFound = false;
     2552    while(!bFound && i>=0)
     2553    {
     2554      if( m_iIdx2DepthValue[layerIdInVps][i] < p )
     2555      {
     2556        iIdxUp  = i+1;
     2557        bFound    = true;
     2558      }
     2559
     2560      i--;
     2561    }
     2562
     2563    // assert monotony
     2564    assert(iIdxDown<=iIdxUp);
     2565
     2566    // assign closer depth value/idx
     2567    if( abs(p-m_iIdx2DepthValue[layerIdInVps][iIdxDown]) < abs(p-m_iIdx2DepthValue[layerIdInVps][iIdxUp]) )
     2568    {
     2569      m_iDepthValue2Idx[layerIdInVps][p] = iIdxDown;
     2570    }
     2571    else
     2572    {
     2573      m_iDepthValue2Idx[layerIdInVps][p] = iIdxUp;
     2574    }
     2575
     2576  }
     2577
     2578  // update DLT variables
     2579  m_iNumDepthmapValues[layerIdInVps] = iNumDepthValues;
     2580  m_iBitsPerDepthValue[layerIdInVps] = numBitsForValue(m_iNumDepthmapValues[layerIdInVps]);
     2581}
     2582#endif
    24652583
    24662584#if H_MV
     
    37073825  // It is a requirement of bitstream conformance that bitstream partition with index j shall not include
    37083826  // direct or indirect reference layers of any layers in bitstream partition i for any values of i and j
    3709   // in the range of 0 to num_bitstream_partitions[ h ] – 1, inclusive, such that i is less than j.
     3827  // in the range of 0 to num_bitstream_partitions[ h ] ?1, inclusive, such that i is less than j.
    37103828
    37113829  for ( Int partJ = 0; partJ < getNumBitstreamPartitions( h ); partJ++ )
  • branches/HTM-9.1-dev0-ZTE/source/Lib/TLibCommon/TComSlice.h

    r738 r748  
    849849#endif
    850850  Bool        m_vpsDepthModesFlag        [MAX_NUM_LAYERS   ];
     851
    851852#if H_3D_DIM_DLT
     853#if !DLT_DIFF_CODING_IN_PPS
    852854  Bool        m_bUseDLTFlag              [MAX_NUM_LAYERS   ];
    853855 
     
    857859  Int*        m_iIdx2DepthValue          [MAX_NUM_LAYERS   ];
    858860#endif
     861#endif
     862
    859863#if H_3D
    860864  Bool        m_ivMvScalingFlag;
     
    11571161  Void    setVpsDepthModesFlag( Int layerIdInVps, Bool val )               { m_vpsDepthModesFlag[ layerIdInVps ] = val; }
    11581162  Bool    getVpsDepthModesFlag( Int layerIdInVps )                         { return m_vpsDepthModesFlag[ layerIdInVps ]; }
     1163
    11591164#if H_3D_DIM_DLT
     1165#if !DLT_DIFF_CODING_IN_PPS
    11601166  Bool    getUseDLTFlag      ( Int layerIdInVps )                         { return m_bUseDLTFlag[ layerIdInVps ]; }
    11611167  Void    setUseDLTFlag      ( Int layerIdInVps, Bool b ) { m_bUseDLTFlag[ layerIdInVps ]  = b;          }
     
    11671173  Void    setDepthLUTs( Int layerIdInVps, Int* idx2DepthValue = NULL, Int iNumDepthValues = 0 );
    11681174#endif
     1175#endif
    11691176
    11701177  Bool    getIvMvScalingFlag   (  )                       { return m_ivMvScalingFlag; }
     
    11811188#endif
    11821189};
     1190
     1191#if DLT_DIFF_CODING_IN_PPS
     1192class TComDLT
     1193{
     1194private:
     1195  Bool        m_bDltPresentFlag;
     1196  Bool        m_bUseDLTFlag              [ MAX_NUM_LAYERS ];
     1197  Bool        m_bInterViewDltPredEnableFlag[ MAX_NUM_LAYERS ];
     1198
     1199  Int         m_iBitsPerDepthValue       [ MAX_NUM_LAYERS ];
     1200  Int         m_iNumDepthmapValues       [ MAX_NUM_LAYERS ];
     1201  Int*        m_iDepthValue2Idx          [ MAX_NUM_LAYERS ];
     1202  Int*        m_iIdx2DepthValue          [ MAX_NUM_LAYERS ];
     1203
     1204  Int         m_iNumDepthViews;
     1205  UInt        m_uiDepthViewBitDepth;
     1206
     1207public:
     1208  TComDLT();
     1209  ~TComDLT();
     1210
     1211  Bool    getDltPresentFlag  ()                           { return m_bDltPresentFlag; }
     1212  Void    setDltPresentFlag  ( Bool b )                   { m_bDltPresentFlag = b;    }
     1213
     1214  Bool    getUseDLTFlag      ( Int layerIdInVps )         { return m_bUseDLTFlag[ layerIdInVps ]; }
     1215  Void    setUseDLTFlag      ( Int layerIdInVps, Bool b ) { m_bUseDLTFlag[ layerIdInVps ]  = b;   }
     1216
     1217  Bool    getInterViewDltPredEnableFlag( Int layerIdInVps )         { return m_bInterViewDltPredEnableFlag[ layerIdInVps ]; }
     1218  Void    setInterViewDltPredEnableFlag( Int layerIdInVps, Bool b ) { m_bInterViewDltPredEnableFlag[ layerIdInVps ] = b;    }
     1219
     1220
     1221  Void    setNumDepthViews   ( Int n )                    { m_iNumDepthViews = n; }
     1222  Int     getNumDepthViews   ()                           { return m_iNumDepthViews; }
     1223
     1224  Void    setDepthViewBitDepth( UInt n )                  { m_uiDepthViewBitDepth = n; }
     1225  UInt    getDepthViewBitDepth()                          { return m_uiDepthViewBitDepth; }
     1226
     1227  Int     getBitsPerDepthValue( Int layerIdInVps )        { return getUseDLTFlag(layerIdInVps)?m_iBitsPerDepthValue[layerIdInVps]:g_bitDepthY; }
     1228  Int     getNumDepthValues( Int layerIdInVps )           { return getUseDLTFlag(layerIdInVps)?m_iNumDepthmapValues[layerIdInVps]:((1 << g_bitDepthY)-1); }
     1229  Int     depthValue2idx( Int layerIdInVps, Pel value )   { return getUseDLTFlag(layerIdInVps)?m_iDepthValue2Idx[layerIdInVps][value]:value; }
     1230  Pel     idx2DepthValue( Int layerIdInVps, UInt uiIdx )  { return getUseDLTFlag(layerIdInVps)?m_iIdx2DepthValue[layerIdInVps][uiIdx]:uiIdx; }
     1231  Void    setDepthLUTs( Int layerIdInVps, Int* idx2DepthValue = NULL, Int iNumDepthValues = 0 );
     1232};
     1233#endif
    11831234
    11841235class Window
     
    18401891  Int  m_ppsScalingListRefLayerId;
    18411892#endif
     1893
     1894#if DLT_DIFF_CODING_IN_PPS
     1895  TComDLT*  m_pcDLT;
     1896#endif
     1897
    18421898public:
    18431899  TComPPS();
     
    18641920  Void      setMinCuDQPSize     ( UInt u ) { m_uiMinCuDQPSize = u;    }
    18651921  UInt      getMinCuDQPSize     ()         { return m_uiMinCuDQPSize; }
     1922
     1923#if DLT_DIFF_CODING_IN_PPS
     1924  Void      setDLT              ( TComDLT* pcDLT ) { m_pcDLT = pcDLT; }
     1925  TComDLT*  getDLT              ()                 { return m_pcDLT; }
     1926#endif
    18661927
    18671928  Void      setChromaCbQpOffset( Int i ) { m_chromaCbQpOffset = i;    }
  • branches/HTM-9.1-dev0-ZTE/source/Lib/TLibCommon/TypeDef.h

    r738 r748  
    215215#define H_3D_DIM_SDC                      1   // Simplified Depth Coding method
    216216#define H_3D_DIM_DLT                      1   // Depth Lookup Table
     217
     218#if H_3D_DIM_DLT
     219#define DLT_DIFF_CODING_IN_PPS            1   // moving DLT syntax elements from VPS to PPS and differential coding of DLT values
     220                                              // JCT3V-F0131, JCT3V-F0139
     221#if DLT_DIFF_CODING_IN_PPS
     222#define Log2( n ) ( log((double)n) / log(2.0) )
     223#endif
     224#endif
     225
    217226#define H_3D_DIM_ENC                      1   // Depth Intra encoder optimizations, includes:
    218227                                              // HHI_DEPTH_INTRA_SEARCH_RAU_C0160
     
    262271#define H_MV_FIX_SKIP_PICTURES                  1  // Fix related to skipping pictures.
    263272#define H_MV_6_HRD_O0164_15                     1  // (HRD/O0164/Multilayer HRD) #15 Decision: Adopt, modified as follows: It was suggested to constrain the stalling based on the relative cpb removal times, which must be in decoding order. The "du_based_bpb_sync_flag" is not needed, in view of this. SEI in the highest layer of the layer set or (inclusive "or") VPS VUI is used to carry the parameters (at encoder discretion). SEI in higher layer and SEI in VUI do not need to repeat information available in some lower layer. Shall be after APS SEI and buffering period SEI and before all other SEI of all layers except other HRD related SEI.
    264 #define H_MV_6_HRD_O0217_13                     1  // (HRD/O0217/Sub-DPB based DPB operations) #13 Decision: Adopt – Specify a separate DPB capacity for each layer – no sharing of capacity across layers – each layer has its own parameters (max pictures, max latency, max reordering). This proposal would specify distinct parameters for each "output layer set" and to change the definition of an operation point to be specific to an output layer set instead of a 'layer set". Decision: Adopted this aspect as well.
     273#define H_MV_6_HRD_O0217_13                     1  // (HRD/O0217/Sub-DPB based DPB operations) #13 Decision: Adopt ?Specify a separate DPB capacity for each layer ?no sharing of capacity across layers ?each layer has its own parameters (max pictures, max latency, max reordering). This proposal would specify distinct parameters for each "output layer set" and to change the definition of an operation point to be specific to an output layer set instead of a 'layer set". Decision: Adopted this aspect as well.
    265274#define H_MV_6_SHVC_O0098_36                    1  // (SHVC/O0098/Scaled ref layer offset) #36 Modify signalling of scaled reference layer offsets to allow signalling of any lower layer, rather than just a direct reference layer, in order to enable alignment of auxiliary pictures. In further JCT-VC and JCT-3V discussion, it was also agreed to use the same offset signalling for MV-HEVC as well as SHVC
    266275#define H_MV_6_GEN_0153_28                      1  //(Gen/O0153/output highest layer) #28 Add a flag in the VPS to indicate if startup process should output the highest available layer if the target output layer is not available.
     
    291300#define H_MV_6_PS_O0096_21                      1  // (PS/O0096/direct_dependency_type gating flag) #21 Add a gating flag in VPS extension to condition the presence of direct dependency type, with a default type signalled, from JCTVC-O0096
    292301#define H_MV_6_PS_O0109_22                      1  // (PS/O0109/view_id_len) #22 Modify the VPS extension syntax and semantics to replace view_id_len_minus1 with view_id_len, always signal that syntax element, add a constraint that (1<<view_id_len) >= NumViews, and modify view_id_val semantics to infer value of 0 when not present, from discussion of JCTVC-O0109
    293 #define H_MV_6_PS_O0109_23                      1  // (PS/O0109/profile_ref_minus1 constraint) #23 Modify the semantics of profile_ref_minus1[ i ] to replace “shall be less than i” with “shall be less than or equal to i”, from discussion of JCTVC-O0109
     302#define H_MV_6_PS_O0109_23                      1  // (PS/O0109/profile_ref_minus1 constraint) #23 Modify the semantics of profile_ref_minus1[ i ] to replace “shall be less than i?with “shall be less than or equal to i? from discussion of JCTVC-O0109
    294303#define H_MV_6_PS_O0109_24                      1  // (PS/O0109/vps_vui_present_flag move) #24 Move the vps_vui_present_flag to precede vps_vui_offset, and make vps_vui_offset conditional on that flag, from JCTVC-O0109
    295304/////////////////////////////////////////////////////////////////////////////////////////
  • branches/HTM-9.1-dev0-ZTE/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r738 r748  
    215215}
    216216
     217#if DLT_DIFF_CODING_IN_PPS
     218Void TDecCavlc::parsePPS(TComPPS* pcPPS, TComVPS* pcVPS )
     219#else
    217220Void TDecCavlc::parsePPS(TComPPS* pcPPS)
     221#endif
    218222{
    219223#if ENC_DEC_TRACE 
     
    364368  if (uiCode)
    365369  {
    366     while ( xMoreRbspData() )
    367     {
    368       READ_FLAG( uiCode, "pps_extension_data_flag");
    369     }
    370   }
    371 }
     370#if DLT_DIFF_CODING_IN_PPS
     371    parsePPSExtension( pcPPS, pcVPS );
     372    READ_FLAG( uiCode, "pps_extension2_flag");
     373    if ( uiCode )
     374    {
     375#endif
     376      while ( xMoreRbspData() )
     377      {
     378        READ_FLAG( uiCode, "pps_extension_data_flag");
     379      }
     380#if DLT_DIFF_CODING_IN_PPS
     381    }
     382#endif
     383  }
     384}
     385
     386#if DLT_DIFF_CODING_IN_PPS
     387Void TDecCavlc::parsePPSExtension( TComPPS* pcPPS, TComVPS* pcVPS )
     388{
     389  UInt uiCode = 0;
     390  TComDLT* pcDLT = new TComDLT;
     391
     392  READ_FLAG(uiCode, "dlt_present_flag");
     393  pcDLT->setDltPresentFlag( (uiCode == 1) ? true : false );
     394
     395  if ( pcDLT->getDltPresentFlag() )
     396  {
     397    READ_CODE(6, uiCode, "pps_depth_layers_minus1");
     398    pcDLT->setNumDepthViews( uiCode );
     399
     400    READ_CODE(4, uiCode, "pps_bit_depth_for_depth_views_minus8");
     401    pcDLT->setDepthViewBitDepth( (uiCode+8) );
     402
     403    for( Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ )
     404    {
     405      if ( i != 0 )
     406      {
     407        if( pcVPS->getDepthId( i ) == 1 )
     408        {
     409          READ_FLAG(uiCode, "dlt_flag[i]");
     410          pcDLT->setUseDLTFlag(i, (uiCode == 1) ? true : false);
     411
     412          if ( pcDLT->getUseDLTFlag( i ) )
     413          {
     414            UInt uiNumDepthValues     = 0;
     415            Bool bDltBitMapRepFlag    = false;
     416            UInt uiMaxDiff            = 0xffffffff;
     417            UInt uiMinDiff            = 0;
     418            UInt uiCodeLength         = 0;
     419            UInt uiDiffMaxMinDltValue = 0;
     420
     421            READ_FLAG(uiCode, "inter_view_dlt_pred_enable_flag[ i ]");
     422            pcDLT->setInterViewDltPredEnableFlag( i, (uiCode == 1) ? true : false );
     423
     424            if ( pcDLT->getInterViewDltPredEnableFlag( i ) == false )
     425            {
     426              READ_FLAG(uiCode, "dlt_bit_map_rep_flag[ layerId ]");
     427              bDltBitMapRepFlag = (uiCode == 1) ? true : false;
     428            }
     429            else
     430            {
     431              bDltBitMapRepFlag = false;
     432            }
     433
     434            // Bit map
     435            if ( bDltBitMapRepFlag )
     436            {
     437              UInt uiNumDepthValues = 0;
     438              Int  aiIdx2DepthValue[256];
     439
     440              for (UInt d=0; d<256; d++)
     441              {
     442                READ_FLAG(uiCode, "dlt_bit_map_flag[ layerId ][ j ]");
     443                if (uiCode == 1)
     444                {
     445                  aiIdx2DepthValue[uiNumDepthValues] = d;
     446                  uiNumDepthValues++;
     447                }
     448              }
     449
     450              pcDLT->setDepthLUTs(i, aiIdx2DepthValue, uiNumDepthValues);
     451            }
     452            // Diff Coding
     453            else
     454            {
     455              READ_CODE(8, uiNumDepthValues, "num_depth_values_in_dlt[i]");   // num_entry
     456
     457              if ( pcDLT->getInterViewDltPredEnableFlag( i ) == false )       // Single-view DLT Diff Coding
     458              {
     459                // The condition if( pcVPS->getNumDepthValues(i) > 0 ) is always true since for Single-view Diff Coding, there is at least one depth value in depth component.
     460
     461                Int* aiIdx2DepthValue = (Int*) calloc(uiNumDepthValues, sizeof(Int));
     462
     463                if (uiNumDepthValues > 1)
     464                {
     465                  READ_CODE(8, uiCode, "max_diff[ layerId ]");
     466                  uiMaxDiff = uiCode;
     467                }
     468                else
     469                {
     470                  uiMaxDiff = 0;           // when there is only one value in DLT
     471                }
     472
     473                if (uiNumDepthValues > 2)
     474                {
     475                  uiCodeLength = (UInt) ceil(Log2(uiMaxDiff + 1));
     476                  READ_CODE(uiCodeLength, uiCode, "min_diff_minus1[ layerId ]");
     477                  uiMinDiff = uiCode + 1;
     478                }
     479                else
     480                {
     481                  uiMinDiff = uiMaxDiff;   // when there are only one or two values in DLT
     482                }
     483
     484                READ_CODE(8, uiCode, "dlt_depth_value0[layerId]");   // entry0
     485                aiIdx2DepthValue[0] = uiCode;
     486
     487                if (uiMaxDiff == uiMinDiff)
     488                {
     489                  for (UInt d=1; d<uiNumDepthValues; d++)
     490                  {
     491                    aiIdx2DepthValue[d] = aiIdx2DepthValue[d-1] + uiMinDiff + 0;
     492                  }
     493                }
     494                else
     495                {
     496                  uiCodeLength = (UInt) ceil(Log2(uiMaxDiff - uiMinDiff + 1));
     497                  for (UInt d=1; d<uiNumDepthValues; d++)
     498                  {
     499                    READ_CODE(uiCodeLength, uiCode, "dlt_depth_value_diff_minus_min[ layerId ][ j ]");
     500                    aiIdx2DepthValue[d] = aiIdx2DepthValue[d-1] + uiMinDiff + uiCode;
     501                  }
     502                }
     503
     504                pcDLT->setDepthLUTs(i, aiIdx2DepthValue, uiNumDepthValues);
     505
     506                free(aiIdx2DepthValue);
     507              }             
     508            }
     509          }
     510        }
     511      }
     512    }
     513  }
     514
     515  pcPPS->setDLT( pcDLT );
     516}
     517#endif
    372518
    373519Void  TDecCavlc::parseVUI(TComVUI* pcVUI, TComSPS *pcSPS)
     
    17381884        //          READ_FLAG( uiCode, "lim_qt_pred_flag[i]");                  pcVPS->setLimQtPreFlag     ( i, uiCode == 1 ? true : false );
    17391885#if H_3D_DIM_DLT
     1886#if !DLT_DIFF_CODING_IN_PPS
    17401887        if( pcVPS->getVpsDepthModesFlag( i ) )
    17411888        {
     
    17621909          free(aiIdx2DepthValue);
    17631910        }
     1911#endif
    17641912#endif
    17651913#if H_3D_INTER_SDC
  • branches/HTM-9.1-dev0-ZTE/source/Lib/TLibDecoder/TDecCAVLC.h

    r738 r748  
    105105  Void  parseSPS            ( TComSPS* pcSPS );
    106106#endif
     107
     108#if DLT_DIFF_CODING_IN_PPS
     109  Void  parsePPS            ( TComPPS* pcPPS, TComVPS* pcVPS );
     110  Void  parsePPSExtension   ( TComPPS* pcPPS, TComVPS* pcVPS );
     111#else
     112  Void  parsePPS            ( TComPPS* pcPPS);
     113#endif
     114
    107115  Void  parsePPS            ( TComPPS* pcPPS);
    108116  Void  parseVUI            ( TComVUI* pcVUI, TComSPS* pcSPS );
  • branches/HTM-9.1-dev0-ZTE/source/Lib/TLibDecoder/TDecCu.cpp

    r735 r748  
    781781    {
    782782#if LGE_PRED_RES_CODING_DLT_DOMAIN_F0159
    783         if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getVPS()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
     783#if DLT_DIFF_CODING_IN_PPS
     784      if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
     785#else
     786      if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getVPS()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
     787#endif
    784788        {
    785             pReco    [ uiX ] = pcCU->getSlice()->getVPS()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), Clip3( 0, pcCU->getSlice()->getVPS()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) - 1, pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] ) + pResi[ uiX ] ) );
     789#if DLT_DIFF_CODING_IN_PPS
     790          pReco    [ uiX ] = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), Clip3( 0, pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) - 1, pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] ) + pResi[ uiX ] ) );
     791#else
     792          pReco    [ uiX ] = pcCU->getSlice()->getVPS()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), Clip3( 0, pcCU->getSlice()->getVPS()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) - 1, pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] ) + pResi[ uiX ] ) );
     793#endif
    786794        }
    787795        else
     
    10001008  {
    10011009#if H_3D_DIM_DLT
     1010#if DLT_DIFF_CODING_IN_PPS
     1011    Pel   pPredIdx    = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] );
     1012    Pel   pResiIdx    = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx);
     1013    Pel   pRecoValue  = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pPredIdx + pResiIdx );
     1014#else
    10021015    Pel   pPredIdx    = pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] );
    10031016    Pel   pResiIdx    = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx);
    10041017    Pel   pRecoValue  = pcCU->getSlice()->getVPS()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pPredIdx + pResiIdx );
    1005    
     1018#endif
     1019
    10061020    apDCResiValues[uiSegment]  = pRecoValue - apDCPredValues[uiSegment];
    10071021#else
  • branches/HTM-9.1-dev0-ZTE/source/Lib/TLibDecoder/TDecEntropy.h

    r655 r748  
    7171  virtual Void  parseSPS                  ( TComSPS* pcSPS )                                      = 0;
    7272#endif
     73#if DLT_DIFF_CODING_IN_PPS
     74  virtual Void  parsePPS                  ( TComPPS* pcPPS, TComVPS* pcVPS )                      = 0;
     75#else
    7376  virtual Void  parsePPS                  ( TComPPS* pcPPS )                                      = 0;
     77#endif
    7478
    7579  virtual Void parseSliceHeader          ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager)       = 0;
     
    148152  Void    decodeSPS                   ( TComSPS* pcSPS     )    { m_pcEntropyDecoderIf->parseSPS(pcSPS);                    }
    149153#endif
     154#if DLT_DIFF_CODING_IN_PPS
     155  Void    decodePPS                   ( TComPPS* pcPPS, TComVPS* pcVPS )    { m_pcEntropyDecoderIf->parsePPS(pcPPS, pcVPS);                    }
     156#else
    150157  Void    decodePPS                   ( TComPPS* pcPPS )    { m_pcEntropyDecoderIf->parsePPS(pcPPS);                    }
     158#endif
    151159  Void    decodeSliceHeader           ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager)  { m_pcEntropyDecoderIf->parseSliceHeader(rpcSlice, parameterSetManager);         }
    152160
  • branches/HTM-9.1-dev0-ZTE/source/Lib/TLibDecoder/TDecSbac.cpp

    r724 r748  
    568568 
    569569#if H_3D_DIM_DLT
     570#if DLT_DIFF_CODING_IN_PPS
     571  UInt uiMaxResidualBits = pcCU->getSlice()->getPPS()->getDLT()->getBitsPerDepthValue( pcCU->getSlice()->getLayerIdInVps() );
     572#else
    570573  UInt uiMaxResidualBits = pcCU->getSlice()->getVPS()->getBitsPerDepthValue( pcCU->getSlice()->getLayerIdInVps() );
     574#endif
    571575#else
    572576  UInt uiMaxResidualBits = g_bitDepthY;
     
    592596    UInt uiCount = 0;
    593597#if H_3D_DIM_DLT
     598#if DLT_DIFF_CODING_IN_PPS
     599    UInt uiNumDepthValues = pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() );
     600#else
    594601    UInt uiNumDepthValues = pcCU->getSlice()->getVPS()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() );
     602#endif
    595603#else
    596604    UInt uiNumDepthValues = ((1 << g_bitDepthY)-1);
  • branches/HTM-9.1-dev0-ZTE/source/Lib/TLibDecoder/TDecSbac.h

    r724 r748  
    8181  Void  parseSPS                  ( TComSPS* /*pcSPS*/ ) {}
    8282#endif
     83#if DLT_DIFF_CODING_IN_PPS
     84  Void  parsePPS                  ( TComPPS* /*pcPPS*/, TComVPS* /*pcVPS*/ ) {}
     85#else
    8386  Void  parsePPS                  ( TComPPS* /*pcPPS*/ ) {}
     87#endif
    8488
    8589  Void  parseSliceHeader          ( TComSlice*& /*rpcSlice*/, ParameterSetManagerDecoder* /*parameterSetManager*/) {}
  • branches/HTM-9.1-dev0-ZTE/source/Lib/TLibDecoder/TDecTop.cpp

    r738 r748  
    11511151  pps->setLayerId( getLayerId() );
    11521152#endif
     1153#if DLT_DIFF_CODING_IN_PPS
     1154  // Assuming that all PPS indirectly refer to the same VPS via different SPS
     1155  // There is no parsing dependency in decoding DLT in PPS.
     1156  // The VPS information passed to decodePPS() is used to arrange the decoded DLT tables to their corresponding layers.
     1157  // This is equivalent to the process of
     1158  //   Step 1) decoding DLT tables based on the number of depth layers, and
     1159  //   Step 2) mapping DLT tables to the depth layers
     1160  // as descripted in the 3D-HEVC WD.
     1161  TComVPS* vps = m_parameterSetManagerDecoder.getPrefetchedVPS( 0 );
     1162  m_cEntropyDecoder.decodePPS( pps, vps );
     1163#else
    11531164  m_cEntropyDecoder.decodePPS( pps );
     1165#endif
    11541166  m_parameterSetManagerDecoder.storePrefetchedPPS( pps );
    11551167}
  • branches/HTM-9.1-dev0-ZTE/source/Lib/TLibEncoder/TEncCavlc.cpp

    r738 r748  
    256256  WRITE_UVLC( pcPPS->getLog2ParallelMergeLevelMinus2(), "log2_parallel_merge_level_minus2");
    257257  WRITE_FLAG( pcPPS->getSliceHeaderExtensionPresentFlag() ? 1 : 0, "slice_segment_header_extension_present_flag");
     258
     259#if !DLT_DIFF_CODING_IN_PPS
    258260  WRITE_FLAG( 0, "pps_extension_flag" );
    259 }
     261#else
     262  WRITE_FLAG( 1, "pps_extension_flag" );
     263  codePPSExtension( pcPPS );
     264  WRITE_FLAG( 0, "pps_extension2_flag" );
     265#endif
     266}
     267
     268#if DLT_DIFF_CODING_IN_PPS
     269Void  TEncCavlc::codePPSExtension        ( TComPPS* pcPPS )
     270{
     271  // Assuming that all PPS indirectly refer to the same VPS via different SPS
     272  // There is no parsing dependency in decoding DLT in PPS.
     273  // The VPS information passed to decodePPS() is used to arrange the decoded DLT tables to their corresponding layers.
     274  // This is equivalent to the process of
     275  //   Step 1) decoding DLT tables based on the number of depth layers, and
     276  //   Step 2) mapping DLT tables to the depth layers
     277  // as descripted in the 3D-HEVC WD.
     278  TComVPS* pcVPS = pcPPS->getSPS()->getVPS();
     279
     280  TComDLT* pcDLT = pcPPS->getDLT();
     281
     282  WRITE_FLAG( pcDLT->getDltPresentFlag() ? 1 : 0, "dlt_present_flag" );
     283
     284  if ( pcDLT->getDltPresentFlag() )
     285  {
     286    WRITE_CODE(pcDLT->getNumDepthViews(), 6, "pps_depth_layers_minus1");
     287    WRITE_CODE((pcDLT->getDepthViewBitDepth() - 8), 4, "pps_bit_depth_for_depth_views_minus8");
     288
     289    for( Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ )
     290    {
     291      if ( i != 0 )
     292      {
     293        if ( pcVPS->getDepthId( i ) == 1 )
     294        {
     295          WRITE_FLAG( pcDLT->getUseDLTFlag( i ) ? 1 : 0, "dlt_flag[i]" );
     296
     297          if ( pcDLT->getUseDLTFlag( i ) )
     298          {
     299            WRITE_FLAG( pcDLT->getInterViewDltPredEnableFlag( i ) ? 1 : 0, "inter_view_dlt_pred_enable_flag[ i ]");
     300
     301            // determine whether to use bit-map
     302            Bool bDltBitMapRepFlag       = false;
     303            UInt uiNumBitsNonBitMap      = 0;
     304            UInt uiNumBitsBitMap         = 0;
     305
     306            UInt uiMaxDiff               = 0;
     307            UInt uiMinDiff               = 0xffffffff;
     308            UInt uiLengthMinDiff         = 0;
     309            UInt uiLengthDltDiffMinusMin = 0;
     310
     311            UInt* puiDltDiffValues       = NULL;
     312
     313            if ( NULL == (puiDltDiffValues = (UInt *)calloc(pcDLT->getNumDepthValues(i), sizeof(UInt))) )
     314            {
     315              exit(-1);
     316            }
     317
     318            for (UInt d = 1; d < pcDLT->getNumDepthValues(i); d++)
     319            {
     320              puiDltDiffValues[d] = pcDLT->idx2DepthValue(i, d) - pcDLT->idx2DepthValue(i, (d-1));
     321
     322              if ( uiMaxDiff < puiDltDiffValues[d] )
     323              {
     324                uiMaxDiff = puiDltDiffValues[d];
     325              }
     326
     327              if ( uiMinDiff > puiDltDiffValues[d] )
     328              {
     329                uiMinDiff = puiDltDiffValues[d];
     330              }
     331            }
     332
     333            // counting bits
     334            // diff coding branch
     335            uiNumBitsNonBitMap += 8;                          // u(v) bits for num_depth_values_in_dlt[layerId] (i.e. num_entry[ layerId ])
     336
     337            if ( pcDLT->getNumDepthValues(i) > 1 )
     338            {
     339              uiNumBitsNonBitMap += 8;                        // u(v) bits for max_diff[ layerId ]
     340            }
     341
     342            if ( pcDLT->getNumDepthValues(i) > 2 )
     343            {
     344              uiLengthMinDiff    = (UInt) ceil(Log2(uiMaxDiff + 1));
     345              uiNumBitsNonBitMap += uiLengthMinDiff;          // u(v)  bits for min_diff[ layerId ]
     346            }
     347
     348            uiNumBitsNonBitMap += 8;                          // u(v) bits for dlt_depth_value0[ layerId ]
     349
     350            if (uiMaxDiff > uiMinDiff)
     351            {
     352              uiLengthDltDiffMinusMin = (UInt) ceil(Log2(uiMaxDiff - uiMinDiff + 1));
     353              uiNumBitsNonBitMap += uiLengthDltDiffMinusMin * (pcDLT->getNumDepthValues(i) - 1);  // u(v) bits for dlt_depth_value_diff_minus_min[ layerId ][ j ]
     354            }
     355
     356            // bit map branch
     357            uiNumBitsBitMap = 256;   // uiNumBitsBitMap = 1 << pcDLT->getDepthViewBitDepth();
     358
     359            // determine bDltBitMapFlag
     360            bDltBitMapRepFlag = (uiNumBitsBitMap > uiNumBitsNonBitMap) ? false : true;
     361
     362            // Actual coding
     363            if ( pcDLT->getInterViewDltPredEnableFlag( i ) == false )
     364            {
     365              WRITE_FLAG( bDltBitMapRepFlag ? 1 : 0, "dlt_bit_map_rep_flag[ layerId ]" );
     366            }
     367            else
     368            {
     369              bDltBitMapRepFlag = false;
     370            }
     371
     372            // bit map coding
     373            if ( bDltBitMapRepFlag )
     374            {
     375              UInt uiDltArrayIndex = 0;
     376              for (UInt d=0; d < 256; d++)
     377              {
     378                if ( d == pcDLT->idx2DepthValue(i, uiDltArrayIndex) )
     379                {                 
     380                  WRITE_FLAG(1, "dlt_bit_map_flag[ layerId ][ j ]");
     381                  uiDltArrayIndex++;
     382                }
     383                else
     384                {
     385                  WRITE_FLAG(0, "dlt_bit_map_flag[ layerId ][ j ]");
     386                }
     387              }
     388            }
     389            // Diff Coding
     390            else
     391            {
     392              WRITE_CODE(pcDLT->getNumDepthValues(i), 8, "num_depth_values_in_dlt[layerId]");    // num_entry
     393
     394              if ( pcDLT->getInterViewDltPredEnableFlag( i ) == false )   // Single-view DLT Diff Coding
     395              {
     396                // The condition if( pcVPS->getNumDepthValues(i) > 0 ) is always true since for Single-view Diff Coding, there is at least one depth value in depth component.
     397                if ( pcDLT->getNumDepthValues(i) > 1 )
     398                {
     399                  WRITE_CODE(uiMaxDiff, 8, "max_diff[ layerId ]");        // max_diff
     400                }
     401
     402                if ( pcDLT->getNumDepthValues(i) > 2 )
     403                {
     404                  WRITE_CODE((uiMinDiff - 1), uiLengthMinDiff, "min_diff_minus1[ layerId ]");     // min_diff_minus1
     405                }
     406
     407                WRITE_CODE(pcDLT->idx2DepthValue(i, 0), 8, "dlt_depth_value0[layerId]");          // entry0
     408
     409                if (uiMaxDiff > uiMinDiff)
     410                {
     411                  for (UInt d=1; d < pcDLT->getNumDepthValues(i); d++)
     412                  {
     413                    WRITE_CODE( (puiDltDiffValues[d] - uiMinDiff), uiLengthDltDiffMinusMin, "dlt_depth_value_diff_minus_min[ layerId ][ j ]");    // entry_value_diff_minus_min[ k ]
     414                  }
     415                }
     416              }
     417            }
     418
     419            free(puiDltDiffValues);
     420          }
     421        }
     422      }
     423    }
     424  }
     425}
     426#endif
    260427
    261428Void TEncCavlc::codeVUI( TComVUI *pcVUI, TComSPS* pcSPS )
     
    14631630        //WRITE_FLAG( pcVPS->getLimQtPredFlag    ( i ) ? 1 : 0 ,          "lim_qt_pred_flag[i]"     );
    14641631#if H_3D_DIM_DLT
     1632#if !DLT_DIFF_CODING_IN_PPS
    14651633        if( pcVPS->getVpsDepthModesFlag( i ) )
    14661634        {
     
    14751643            WRITE_UVLC( pcVPS->idx2DepthValue(i, d), "dlt_depth_value[i][d]" );
    14761644          }
    1477         }       
     1645        }
     1646#endif
    14781647#endif
    14791648#if H_3D_INTER_SDC
  • branches/HTM-9.1-dev0-ZTE/source/Lib/TLibEncoder/TEncCavlc.h

    r738 r748  
    116116#endif
    117117  Void  codePPS                 ( TComPPS* pcPPS );
     118
     119#if DLT_DIFF_CODING_IN_PPS
     120  Void  codePPSExtension        ( TComPPS* pcPPS );
     121#endif
     122
    118123  Void  codeSliceHeader         ( TComSlice* pcSlice );
    119124  Void  codePTL                 ( TComPTL* pcPTL, Bool profilePresentFlag, Int maxNumSubLayersMinus1);
  • branches/HTM-9.1-dev0-ZTE/source/Lib/TLibEncoder/TEncCfg.h

    r724 r748  
    330330  TComVPS                    m_cVPS;
    331331#endif
     332
     333#if DLT_DIFF_CODING_IN_PPS
     334  TComDLT*  m_cDLT;
     335#endif
     336
    332337  Bool      m_recalculateQPAccordingToLambda;                 ///< recalculate QP value according to the lambda value
    333338  Int       m_activeParameterSetsSEIEnabled;                  ///< enable active parameter set SEI message
     
    441446  , m_isDepth(false)
    442447  , m_bUseVSO(false)
     448#endif
     449#if DLT_DIFF_CODING_IN_PPS
     450  , m_cDLT(NULL)
    443451#endif
    444452#endif
     
    867875  TComVPS *getVPS() { return &m_cVPS; }
    868876#endif
     877
     878#if DLT_DIFF_CODING_IN_PPS
     879  Void      setDLT           ( TComDLT *p ) { m_cDLT = p; }
     880  TComDLT*  getDLT           ()             { return m_cDLT; }
     881#endif
     882
    869883  Void      setUseRecalculateQPAccordingToLambda ( Bool b ) { m_recalculateQPAccordingToLambda = b;    }
    870884  Bool      getUseRecalculateQPAccordingToLambda ()         { return m_recalculateQPAccordingToLambda; }
  • branches/HTM-9.1-dev0-ZTE/source/Lib/TLibEncoder/TEncSbac.cpp

    r724 r748  
    632632
    633633#if H_3D_DIM_DLT
     634#if DLT_DIFF_CODING_IN_PPS
     635  UInt uiMaxResidualBits = pcCU->getSlice()->getPPS()->getDLT()->getBitsPerDepthValue( pcCU->getSlice()->getLayerIdInVps() );
     636#else
    634637  UInt uiMaxResidualBits = pcCU->getSlice()->getVPS()->getBitsPerDepthValue( pcCU->getSlice()->getLayerIdInVps() );
     638#endif
    635639#else
    636640  UInt uiMaxResidualBits = g_bitDepthY;
     
    653657   
    654658#if H_3D_DIM_DLT
    655     UInt uiNumDepthValues = pcCU->getSlice()->getVPS()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() );
     659#if DLT_DIFF_CODING_IN_PPS
     660      UInt uiNumDepthValues = pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() );
     661#else
     662      UInt uiNumDepthValues = pcCU->getSlice()->getVPS()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() );
     663#endif
    656664#else
    657665    UInt uiNumDepthValues = ((1 << g_bitDepthY)-1);
  • branches/HTM-9.1-dev0-ZTE/source/Lib/TLibEncoder/TEncSearch.cpp

    r735 r748  
    11271127      {
    11281128#if LGE_PRED_RES_CODING_DLT_DOMAIN_F0159
    1129           if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getVPS()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
     1129#if DLT_DIFF_CODING_IN_PPS
     1130        if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
     1131#else
     1132        if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getVPS()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
     1133#endif
    11301134          {
    1131               pResi[ uiX ] = pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pOrg[ uiX ] ) - pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] );
     1135#if DLT_DIFF_CODING_IN_PPS
     1136            pResi[ uiX ] = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pOrg[ uiX ] ) - pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] );
     1137#else
     1138            pResi[ uiX ] = pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pOrg[ uiX ] ) - pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] );
     1139#endif
    11321140          }
    11331141          else
     
    12021210      {
    12031211#if LGE_PRED_RES_CODING_DLT_DOMAIN_F0159
    1204           if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getVPS()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
     1212#if DLT_DIFF_CODING_IN_PPS
     1213        if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
     1214#else
     1215        if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getVPS()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
     1216#endif
    12051217          {
    1206               pReco    [ uiX ] = pcCU->getSlice()->getVPS()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), Clip3( 0, pcCU->getSlice()->getVPS()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) - 1, pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] ) + pResi[ uiX ] ) );
     1218#if DLT_DIFF_CODING_IN_PPS
     1219            pReco    [ uiX ] = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), Clip3( 0, pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) - 1, pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] ) + pResi[ uiX ] ) );
     1220#else
     1221            pReco    [ uiX ] = pcCU->getSlice()->getVPS()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), Clip3( 0, pcCU->getSlice()->getVPS()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) - 1, pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] ) + pResi[ uiX ] ) );
     1222#endif
    12071223          }
    12081224          else
     
    19351951    // get residual (idx)
    19361952#if H_3D_DIM_DLT
     1953#if DLT_DIFF_CODING_IN_PPS
     1954    Pel pResidualIdx = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pDCRec ) - pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] );
     1955#else
    19371956    Pel pResidualIdx = pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pDCRec ) - pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] );
     1957#endif
    19381958#else
    19391959    Pel pResidualIdx = pDCRec - apDCPredValues[uiSegment];
     
    19491969  {
    19501970#if H_3D_DIM_DLT
     1971#if DLT_DIFF_CODING_IN_PPS
     1972    Pel   pPredIdx    = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] );
     1973    Pel   pResiIdx    = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx);
     1974    Pel   pRecoValue  = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pPredIdx + pResiIdx );
     1975#else
    19511976    Pel   pPredIdx    = pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] );
    19521977    Pel   pResiIdx    = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx);
    19531978    Pel   pRecoValue  = pcCU->getSlice()->getVPS()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pPredIdx + pResiIdx );
    1954    
     1979#endif
     1980
    19551981    apDCResiValues[uiSegment]  = pRecoValue - apDCPredValues[uiSegment];
    19561982#else
     
    73467372
    73477373#if H_3D_DIM_DLT
     7374#if DLT_DIFF_CODING_IN_PPS
     7375  rDeltaDC1 = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), ClipY(predDC1 + rDeltaDC1) ) - pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC1 );
     7376  rDeltaDC2 = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), ClipY(predDC2 + rDeltaDC2) ) - pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC2 );
     7377#else
    73487378  rDeltaDC1 = pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), ClipY(predDC1 + rDeltaDC1) ) - pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC1 );
    73497379  rDeltaDC2 = pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), ClipY(predDC2 + rDeltaDC2) ) - pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC2 );
     7380#endif
    73507381#endif
    73517382}
  • branches/HTM-9.1-dev0-ZTE/source/Lib/TLibEncoder/TEncTop.cpp

    r738 r748  
    299299{
    300300  // initialize SPS
     301#if DLT_DIFF_CODING_IN_PPS
     302  // Assuming that all PPS indirectly refer to the same VPS via different SPS
     303  m_cSPS.setVPS(m_cVPS);
     304#endif
    301305  xInitSPS();
    302306 
     
    870874  m_cPPS.setSPSId( getLayerIdInVps() );
    871875#endif
     876
     877#if DLT_DIFF_CODING_IN_PPS
     878  m_cPPS.setDLT( getDLT() );
     879#endif
     880
    872881  m_cPPS.setConstrainedIntraPred( m_bUseConstrainedIntraPred );
    873882  Bool bUseDQP = (getMaxCuDQPDepth() > 0)? true : false;
Note: See TracChangeset for help on using the changeset viewer.