Ignore:
Timestamp:
20 May 2015, 20:08:27 (10 years ago)
Author:
rwth
Message:
  • updated Xcode project
  • migrated transmission of DLT (including minor fixes)
Location:
branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r1209 r1219  
    496496Void TDecCavlc::parsePps3dExtension( TComPPS* pcPPS )
    497497{
    498 #if H_3D
     498#if NH_3D_DLT
    499499  UInt uiCode = 0;
    500500  //
    501   TComDLT* pcDLT = new TComDLT;
     501  TComDLT* pcDLT = pcPPS->getDLT();
    502502  //Ed.(GT): PPSs are copied in HM16.4. This would cause that the only the DLT pointer is copied. Therefore, a deep copy of the DLT needs to be implemented. Another option would be to use a vectors for the DLT arrays in TComDLT.
    503503
     
    508508  {
    509509    READ_CODE(6, uiCode, "pps_depth_layers_minus1");
    510     pcDLT->setNumDepthViews( uiCode );
    511 
     510    pcDLT->setNumDepthViews( uiCode+1 );
     511   
    512512    READ_CODE(4, uiCode, "pps_bit_depth_for_depth_views_minus8");
    513513    pcDLT->setDepthViewBitDepth( (uiCode+8) );
    514 
    515     //Ed.(GT): Please remove parsing dependency from VPS here !
    516     for( Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ )
    517     {
    518       if ( i != 0 )
    519       {
    520         if( pcVPS->getDepthId( i ) == 1 )
    521         {
    522           READ_FLAG(uiCode, "dlt_flag[i]");
    523           pcDLT->setUseDLTFlag(i, (uiCode == 1) ? true : false);
    524 
    525           if ( pcDLT->getUseDLTFlag( i ) )
     514   
     515    for( Int i = 0; i <= pcDLT->getNumDepthViews(); i++ )
     516    {
     517      Int layerId = pcDLT->getDepthIdxToLayerId(i);
     518     
     519      READ_FLAG(uiCode, "dlt_flag[i]");
     520      pcDLT->setUseDLTFlag(layerId, (uiCode == 1) ? true : false);
     521     
     522      if ( pcDLT->getUseDLTFlag( layerId ) )
     523      {
     524        Bool bDltBitMapRepFlag    = false;
     525        UInt uiMaxDiff            = INT_MAX;
     526        UInt uiMinDiff            = 0;
     527        UInt uiCodeLength         = 0;
     528       
     529        READ_FLAG(uiCode, "inter_view_dlt_pred_enable_flag[ i ]");
     530       
     531        if( uiCode )
     532        {
     533          assert( pcDLT->getUseDLTFlag( 1 ));
     534        }
     535        pcDLT->setInterViewDltPredEnableFlag( layerId, (uiCode == 1) ? true : false );
     536       
     537        if ( pcDLT->getInterViewDltPredEnableFlag( layerId ) == false )
     538        {
     539          READ_FLAG(uiCode, "dlt_bit_map_rep_flag[ layerId ]");
     540          bDltBitMapRepFlag = (uiCode == 1) ? true : false;
     541        }
     542        else
     543        {
     544          bDltBitMapRepFlag = false;
     545        }
     546       
     547        UInt uiNumDepthValues = 0;
     548        std::vector<Int> aiIdx2DepthValue(256);
     549       
     550        // Bit map
     551        if ( bDltBitMapRepFlag )
     552        {
     553          for (UInt d=0; d<256; d++)
    526554          {
    527             Bool bDltBitMapRepFlag    = false;
    528             UInt uiMaxDiff            = 0xffffffff;
    529             UInt uiMinDiff            = 0;
    530             UInt uiCodeLength         = 0;
    531 
    532             READ_FLAG(uiCode, "inter_view_dlt_pred_enable_flag[ i ]");
    533 
    534             if( uiCode )
     555            READ_FLAG(uiCode, "dlt_bit_map_flag[ layerId ][ j ]");
     556            if (uiCode == 1)
    535557            {
    536                 assert( pcDLT->getUseDLTFlag( 1 ));
     558              aiIdx2DepthValue[uiNumDepthValues] = d;
     559              uiNumDepthValues++;
    537560            }
    538             pcDLT->setInterViewDltPredEnableFlag( i, (uiCode == 1) ? true : false );
    539 
    540             if ( pcDLT->getInterViewDltPredEnableFlag( i ) == false )
     561          }
     562        }
     563        // Diff Coding
     564        else
     565        {
     566          READ_CODE(8, uiNumDepthValues, "num_depth_values_in_dlt[i]");   // num_entry
     567         
     568          {
     569            // 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.
     570           
     571            if (uiNumDepthValues > 1)
    541572            {
    542               READ_FLAG(uiCode, "dlt_bit_map_rep_flag[ layerId ]");
    543               bDltBitMapRepFlag = (uiCode == 1) ? true : false;
     573              READ_CODE(8, uiCode, "max_diff[ layerId ]");
     574              uiMaxDiff = uiCode;
    544575            }
    545576            else
    546577            {
    547               bDltBitMapRepFlag = false;
     578              uiMaxDiff = 0;           // when there is only one value in DLT
    548579            }
    549580           
    550             UInt uiNumDepthValues = 0;
    551             Int  aiIdx2DepthValue[256];
    552 
    553             // Bit map
    554             if ( bDltBitMapRepFlag )
     581            if (uiNumDepthValues > 2)
    555582            {
    556               for (UInt d=0; d<256; d++)
     583              uiCodeLength = (UInt) gCeilLog2(uiMaxDiff + 1);
     584              READ_CODE(uiCodeLength, uiCode, "min_diff_minus1[ layerId ]");
     585              uiMinDiff = uiCode + 1;
     586            }
     587            else
     588            {
     589              uiMinDiff = uiMaxDiff;   // when there are only one or two values in DLT
     590            }
     591           
     592            READ_CODE(8, uiCode, "dlt_depth_value0[layerId]");   // entry0
     593            aiIdx2DepthValue[0] = uiCode;
     594           
     595            if (uiMaxDiff == uiMinDiff)
     596            {
     597              for (UInt d=1; d<uiNumDepthValues; d++)
    557598              {
    558                 READ_FLAG(uiCode, "dlt_bit_map_flag[ layerId ][ j ]");
    559                 if (uiCode == 1)
    560                 {
    561                   aiIdx2DepthValue[uiNumDepthValues] = d;
    562                   uiNumDepthValues++;
    563                 }
     599                aiIdx2DepthValue[d] = aiIdx2DepthValue[d-1] + uiMinDiff + 0;
    564600              }
    565601            }
    566             // Diff Coding
    567602            else
    568603            {
    569               READ_CODE(8, uiNumDepthValues, "num_depth_values_in_dlt[i]");   // num_entry
    570 
     604              uiCodeLength = (UInt) gCeilLog2(uiMaxDiff - uiMinDiff + 1);
     605              for (UInt d=1; d<uiNumDepthValues; d++)
    571606              {
    572                 // 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.
    573 
    574                 if (uiNumDepthValues > 1)
    575                 {
    576                   READ_CODE(8, uiCode, "max_diff[ layerId ]");
    577                   uiMaxDiff = uiCode;
    578                 }
    579                 else
    580                 {
    581                   uiMaxDiff = 0;           // when there is only one value in DLT
    582                 }
    583 
    584                 if (uiNumDepthValues > 2)
    585                 {
    586                   uiCodeLength = (UInt) ceil(Log2(uiMaxDiff + 1));
    587                   READ_CODE(uiCodeLength, uiCode, "min_diff_minus1[ layerId ]");
    588                   uiMinDiff = uiCode + 1;
    589                 }
    590                 else
    591                 {
    592                   uiMinDiff = uiMaxDiff;   // when there are only one or two values in DLT
    593                 }
    594 
    595                 READ_CODE(8, uiCode, "dlt_depth_value0[layerId]");   // entry0
    596                 aiIdx2DepthValue[0] = uiCode;
    597 
    598                 if (uiMaxDiff == uiMinDiff)
    599                 {
    600                   for (UInt d=1; d<uiNumDepthValues; d++)
    601                   {
    602                     aiIdx2DepthValue[d] = aiIdx2DepthValue[d-1] + uiMinDiff + 0;
    603                   }
    604                 }
    605                 else
    606                 {
    607                   uiCodeLength = (UInt) ceil(Log2(uiMaxDiff - uiMinDiff + 1));
    608                   for (UInt d=1; d<uiNumDepthValues; d++)
    609                   {
    610                     READ_CODE(uiCodeLength, uiCode, "dlt_depth_value_diff_minus_min[ layerId ][ j ]");
    611                     aiIdx2DepthValue[d] = aiIdx2DepthValue[d-1] + uiMinDiff + uiCode;
    612                   }
    613                 }
    614 
     607                READ_CODE(uiCodeLength, uiCode, "dlt_depth_value_diff_minus_min[ layerId ][ j ]");
     608                aiIdx2DepthValue[d] = aiIdx2DepthValue[d-1] + uiMinDiff + uiCode;
    615609              }
    616610            }
    617611           
    618             if( pcDLT->getInterViewDltPredEnableFlag( i ) )
    619             {
    620               // interpret decoded values as delta DLT
    621               AOF( pcVPS->getDepthId( 1 ) == 1 );
    622               AOF( i > 1 );
    623               // assumes ref layer id to be 1
    624               Int* piRefDLT = pcDLT->idx2DepthValue( 1 );
    625               UInt uiRefNum = pcDLT->getNumDepthValues( 1 );
    626               pcDLT->setDeltaDLT(i, piRefDLT, uiRefNum, aiIdx2DepthValue, uiNumDepthValues);
    627             }
    628             else
    629             {
    630               // store final DLT
    631               pcDLT->setDepthLUTs(i, aiIdx2DepthValue, uiNumDepthValues);
    632             }
    633 
    634612          }
    635613        }
    636       }
    637     }
    638   }
    639 
    640   pcPPS->setDLT( pcDLT );
     614       
     615        if( pcDLT->getInterViewDltPredEnableFlag( layerId ) )
     616        {
     617          // interpret decoded values as delta DLT
     618          AOF( layerId > 1 );
     619          // assumes ref layer id to be 1
     620          std::vector<Int> viRefDLT = pcDLT->idx2DepthValue( 1 );
     621          UInt uiRefNum = pcDLT->getNumDepthValues( 1 );
     622          pcDLT->setDeltaDLT(layerId, viRefDLT, uiRefNum, aiIdx2DepthValue, uiNumDepthValues);
     623        }
     624        else
     625        {
     626          // store final DLT
     627          pcDLT->setDepthLUTs(layerId, aiIdx2DepthValue, uiNumDepthValues);
     628        }
     629       
     630#ifdef DEBUG
     631        printf("---------------------------------------------\n");
     632        printf("LayerId: %d\n", layerId);
     633        printf("getUseDLTFlag: %d\n", pcDLT->getUseDLTFlag(layerId));
     634        printf("getInterViewDltPredEnableFlag: %d\n", pcDLT->getInterViewDltPredEnableFlag(layerId));
     635        printf("getUseBitmapRep: %d\n", pcDLT->getUseBitmapRep(layerId));
     636        printf("getNumDepthValues: %d\n", pcDLT->getNumDepthValues(layerId));
     637        for(Int i=0; i<pcDLT->getNumDepthValues(layerId); i++)
     638          printf("depthValue[%d] = %d\n", i, pcDLT->idx2DepthValue(layerId, i));
     639#endif
     640      }
     641    }
     642  }
    641643#endif
    642644}
  • branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder/TDecCu.cpp

    r1209 r1219  
    14611461  for( UInt uiSegment = 0; uiSegment < uiNumSegments; uiSegment++ )
    14621462  {
    1463 #if H_3D_DIM_DLT
     1463#if NH_3D_DLT
    14641464    Pel   pPredIdx    = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] );
    14651465    Pel   pResiIdx    = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx);
  • branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibDecoder/TDecTop.cpp

    r1200 r1219  
    13231323  // GT: Please don't add parsing dependency of SPS from VPS here again!!!
    13241324#endif
     1325#if NH_3D_DLT
     1326  // create mapping from depth layer indexes to layer ids
     1327  Int j=0;
     1328  for( Int i=0; i<=m_parameterSetManager.getFirstVPS()->getMaxLayersMinus1(); i++ )
     1329  {
     1330    Int layerId = m_parameterSetManager.getFirstVPS()->getLayerIdInNuh(i);
     1331    if( m_parameterSetManager.getFirstVPS()->getDepthId(layerId) )
     1332      pps->getDLT()->setDepthIdxToLayerId(j++, i);
     1333  }
     1334#endif
    13251335  m_cEntropyDecoder.decodePPS( pps );
    13261336
Note: See TracChangeset for help on using the changeset viewer.