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

JCT3V-F0131, JCT3V-F0139

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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++ )
Note: See TracChangeset for help on using the changeset viewer.