Changeset 767 in 3DVCSoftware for branches/HTM-9.2-dev0/source/Lib/TLibDecoder


Ignore:
Timestamp:
12 Jan 2014, 04:39:11 (11 years ago)
Author:
tech
Message:

Cleanup part 4

Location:
branches/HTM-9.2-dev0/source/Lib/TLibDecoder
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r766 r767  
    215215}
    216216
    217 #if DLT_DIFF_CODING_IN_PPS
     217#if H_3D
    218218Void TDecCavlc::parsePPS(TComPPS* pcPPS, TComVPS* pcVPS )
    219219#else
     
    368368  if (uiCode)
    369369  {
    370 #if DLT_DIFF_CODING_IN_PPS
     370#if H_3D
    371371    parsePPSExtension( pcPPS, pcVPS );
    372372    READ_FLAG( uiCode, "pps_extension2_flag");
     
    378378        READ_FLAG( uiCode, "pps_extension_data_flag");
    379379      }
    380 #if DLT_DIFF_CODING_IN_PPS
    381     }
    382 #endif
    383   }
    384 }
    385 
    386 #if DLT_DIFF_CODING_IN_PPS
     380#if H_3D
     381    }
     382#endif
     383  }
     384}
     385
     386#if H_3D
    387387Void TDecCavlc::parsePPSExtension( TComPPS* pcPPS, TComVPS* pcVPS )
    388388{
     389  //Ed.(GT): pcVPS should not be used here. Needs to be fixed.
    389390  UInt uiCode = 0;
    390391  TComDLT* pcDLT = new TComDLT;
     
    10051006  }
    10061007#endif
    1007 
    1008 #if !CAM_HLS_F0136_F0045_F0082
    1009   UInt uiCamParPrecision = 0;
    1010   Bool bCamParSlice      = false;
    1011   if ( !depthFlag )
    1012   {     
    1013     READ_UVLC( uiCamParPrecision, "cp_precision" );
    1014     READ_FLAG( uiCode, "cp_in_slice_header_flag" );    bCamParSlice = ( uiCode == 1 );
    1015     if( !bCamParSlice )
    1016     {       
    1017       for( UInt uiBaseIndex = 0; uiBaseIndex < viewIndex; uiBaseIndex++ )
    1018       {
    1019         Int iCode;
    1020         READ_SVLC( iCode, "cp_scale" );                m_aaiTempScale  [ uiBaseIndex ][ viewIndex ]   = iCode;
    1021         READ_SVLC( iCode, "cp_off" );                  m_aaiTempOffset [ uiBaseIndex ][ viewIndex ]   = iCode;
    1022         READ_SVLC( iCode, "cp_inv_scale_plus_scale" ); m_aaiTempScale  [ viewIndex   ][ uiBaseIndex ] = iCode - m_aaiTempScale [ uiBaseIndex ][ viewIndex ];
    1023         READ_SVLC( iCode, "cp_inv_off_plus_off" );     m_aaiTempOffset [ viewIndex   ][ uiBaseIndex ] = iCode - m_aaiTempOffset[ uiBaseIndex ][ viewIndex ];
    1024       }
    1025     }
    1026   }
    1027   pcSPS->initCamParaSPS( viewIndex, uiCamParPrecision, bCamParSlice, m_aaiTempScale, m_aaiTempOffset );
    1028 #endif
    10291008}
    10301009#endif
     
    11321111#if H_3D
    11331112      m_pcBitstream->readOutTrailingBits();
    1134 #if CAM_HLS_F0136_F0045_F0082
    11351113      pcVPS->createCamPars(pcVPS->getNumViews());
    1136 #endif
    11371114      parseVPSExtension2( pcVPS );   
    11381115      READ_FLAG( uiCode,  "vps_extension3_flag" );
     
    17421719        READ_FLAG( uiCode, "vps_depth_modes_flag[i]" );             pcVPS->setVpsDepthModesFlag( i, uiCode == 1 ? true : false );
    17431720        //          READ_FLAG( uiCode, "lim_qt_pred_flag[i]");                  pcVPS->setLimQtPreFlag     ( i, uiCode == 1 ? true : false );
    1744 #if H_3D_DIM_DLT
    1745 #if !DLT_DIFF_CODING_IN_PPS
    1746         if( pcVPS->getVpsDepthModesFlag( i ) )
    1747         {
    1748           READ_FLAG( uiCode, "dlt_flag[i]" );                       pcVPS->setUseDLTFlag( i, uiCode == 1 ? true : false );
    1749         }
    1750         if( pcVPS->getUseDLTFlag( i ) )
    1751         {
    1752           // decode mapping
    1753           UInt uiNumDepthValues;
    1754           // parse number of values in DLT
    1755           READ_UVLC(uiNumDepthValues, "num_depth_values_in_dlt[i]");
    1756 
    1757           // parse actual DLT values
    1758           Int* aiIdx2DepthValue = (Int*) calloc(uiNumDepthValues, sizeof(Int));
    1759           for(Int d=0; d<uiNumDepthValues; d++)
    1760           {
    1761             READ_UVLC(uiCode, "dlt_depth_value[i][d]");
    1762             aiIdx2DepthValue[d] = (Int)uiCode;
    1763           }
    1764 
    1765           pcVPS->setDepthLUTs(i, aiIdx2DepthValue, uiNumDepthValues);
    1766 
    1767           // clean memory
    1768           free(aiIdx2DepthValue);
    1769         }
    1770 #endif
    1771 #endif
    17721721#if H_3D_INTER_SDC
    17731722            READ_FLAG( uiCode, "depth_inter_SDC_flag" );              pcVPS->setInterSDCFlag( i, uiCode ? true : false );
     
    17761725    }
    17771726  }
    1778 #if CAM_HLS_F0136_F0045_F0082
     1727
    17791728  UInt uiCamParPrecision = 0;
    17801729  Bool bCamParSlice      = false;
     
    18021751    }
    18031752  }
    1804 #endif
     1753
    18051754  READ_FLAG( uiCode, "iv_mv_scaling_flag");                       pcVPS->setIvMvScalingFlag( uiCode == 1 ? true : false );
    18061755}
     
    24622411  }
    24632412
    2464 #if CAM_HLS_F0044
    2465 #if CAM_HLS_F0136_F0045_F0082
     2413#if H_3D
    24662414  if( rpcSlice->getVPS()->hasCamParInSliceHeader( rpcSlice->getViewIndex() )  && !rpcSlice->getIsDepth() )
    2467 #else
    2468   if( rpcSlice->getSPS()->hasCamParInSliceHeader() )
    2469 #endif
    24702415  {
    24712416    UInt uiViewIndex = rpcSlice->getViewIndex();
     
    24792424    rpcSlice->setCamparaSlice( m_aaiTempScale, m_aaiTempOffset );
    24802425  }
    2481 
    24822426#endif
    24832427
     
    24852429  {
    24862430    READ_UVLC(uiCode,"slice_header_extension_length");
    2487 #if H_3D && !CAM_HLS_F0044
    2488 #if CAM_HLS_F0136_F0045_F0082
    2489     if( rpcSlice->getVPS()->hasCamParInSliceHeader( rpcSlice->getViewIndex() )  && !rpcSlice->getIsDepth() )
    2490 #else
    2491     if( rpcSlice->getSPS()->hasCamParInSliceHeader() )
    2492 #endif
    2493     {
    2494       UInt uiViewIndex = rpcSlice->getViewIndex();
    2495       for( UInt uiBaseIndex = 0; uiBaseIndex < uiViewIndex; uiBaseIndex++ )
    2496       {
    2497         READ_SVLC( iCode, "cp_scale" );                m_aaiTempScale [ uiBaseIndex ][ uiViewIndex ] = iCode;
    2498         READ_SVLC( iCode, "cp_off" );                  m_aaiTempOffset[ uiBaseIndex ][ uiViewIndex ] = iCode;
    2499         READ_SVLC( iCode, "cp_inv_scale_plus_scale" ); m_aaiTempScale [ uiViewIndex ][ uiBaseIndex ] = iCode - m_aaiTempScale [ uiBaseIndex ][ uiViewIndex ];
    2500         READ_SVLC( iCode, "cp_inv_off_plus_off" );     m_aaiTempOffset[ uiViewIndex ][ uiBaseIndex ] = iCode - m_aaiTempOffset[ uiBaseIndex ][ uiViewIndex ];
    2501       }
    2502       rpcSlice->setCamparaSlice( m_aaiTempScale, m_aaiTempOffset );
    2503     }
    2504 
    2505     READ_FLAG(uiCode,"slice_segment_header_extension2_flag");
    2506     if ( uiCode )
    2507     {   
    2508       READ_UVLC(uiCode,"slice_header_extension2_length");
    2509       for(Int i=0; i<uiCode; i++)
    2510       {
    2511         UInt ignore;
    2512         READ_CODE(8,ignore,"slice_header_extension2_data_byte");
    2513       }
    2514     }
    2515   }
    2516 #else
     2431
    25172432    for(Int i=0; i<uiCode; i++)
    25182433    {
     
    25212436    }
    25222437  }
    2523 #endif
     2438
    25242439  m_pcBitstream->readByteAlignment();
    25252440
  • branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecCAVLC.h

    r766 r767  
    9696#endif
    9797
    98 #if H_3D && DLT_DIFF_CODING_IN_PPS
     98#if H_3D
    9999  Void  parsePPS            ( TComPPS* pcPPS, TComVPS* pcVPS );
    100100  Void  parsePPSExtension   ( TComPPS* pcPPS, TComVPS* pcVPS );
  • branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecCu.cpp

    r765 r767  
    754754    {
    755755#if H_3D
    756 #if DLT_DIFF_CODING_IN_PPS
    757756      if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
    758 #else
    759       if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getVPS()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
    760 #endif
    761         {
    762 #if DLT_DIFF_CODING_IN_PPS
    763           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 ] ) );
    764 #else
    765           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 ] ) );
    766 #endif
    767         }
    768         else
    769         {
    770       pReco    [ uiX ] = ClipY( pPred[ uiX ] + pResi[ uiX ] );
    771         }
     757      {
     758        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 ] ) );
     759      }
     760      else
     761      {
     762        pReco    [ uiX ] = ClipY( pPred[ uiX ] + pResi[ uiX ] );
     763      }
    772764#endif
    773765      pRecIPred[ uiX ] = pReco[ uiX ];
     
    979971  {
    980972#if H_3D_DIM_DLT
    981 #if DLT_DIFF_CODING_IN_PPS
    982973    Pel   pPredIdx    = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] );
    983974    Pel   pResiIdx    = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx);
    984975    Pel   pRecoValue  = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pPredIdx + pResiIdx );
    985 #else
    986     Pel   pPredIdx    = pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] );
    987     Pel   pResiIdx    = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx);
    988     Pel   pRecoValue  = pcCU->getSlice()->getVPS()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pPredIdx + pResiIdx );
    989 #endif
    990976
    991977    apDCResiValues[uiSegment]  = pRecoValue - apDCPredValues[uiSegment];
  • branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecEntropy.h

    r758 r767  
    7171  virtual Void  parseSPS                  ( TComSPS* pcSPS )                                      = 0;
    7272#endif
    73 #if DLT_DIFF_CODING_IN_PPS
     73#if H_3D
    7474  virtual Void  parsePPS                  ( TComPPS* pcPPS, TComVPS* pcVPS )                      = 0;
    7575#else
     
    152152  Void    decodeSPS                   ( TComSPS* pcSPS     )    { m_pcEntropyDecoderIf->parseSPS(pcSPS);                    }
    153153#endif
    154 #if DLT_DIFF_CODING_IN_PPS
     154#if H_3D
    155155  Void    decodePPS                   ( TComPPS* pcPPS, TComVPS* pcVPS )    { m_pcEntropyDecoderIf->parsePPS(pcPPS, pcVPS);                    }
    156156#else
  • branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecSbac.cpp

    r764 r767  
    442442 
    443443#if H_3D_DIM_DLT
    444 #if DLT_DIFF_CODING_IN_PPS
    445444  UInt uiMaxResidualBits = pcCU->getSlice()->getPPS()->getDLT()->getBitsPerDepthValue( pcCU->getSlice()->getLayerIdInVps() );
    446 #else
    447   UInt uiMaxResidualBits = pcCU->getSlice()->getVPS()->getBitsPerDepthValue( pcCU->getSlice()->getLayerIdInVps() );
    448 #endif
    449445#else
    450446  UInt uiMaxResidualBits = g_bitDepthY;
     
    470466    UInt uiCount = 0;
    471467#if H_3D_DIM_DLT
    472 #if DLT_DIFF_CODING_IN_PPS
    473468    UInt uiNumDepthValues = pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() );
    474 #else
    475     UInt uiNumDepthValues = pcCU->getSlice()->getVPS()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() );
    476 #endif
    477469#else
    478470    UInt uiNumDepthValues = ((1 << g_bitDepthY)-1);
  • branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecSbac.h

    r764 r767  
    8181  Void  parseSPS                  ( TComSPS* /*pcSPS*/ ) {}
    8282#endif
    83 #if DLT_DIFF_CODING_IN_PPS
     83#if H_3D
    8484  Void  parsePPS                  ( TComPPS* /*pcPPS*/, TComVPS* /*pcVPS*/ ) {}
    8585#else
  • branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecTop.cpp

    r766 r767  
    228228    m_uiMaxViewIndex                     = std::max( m_uiMaxViewIndex, uiViewIndex );
    229229    m_aiViewId[ uiViewIndex ]            = pcSlice->getViewId();
    230 #if CAM_HLS_F0136_F0045_F0082
     230
    231231    if( uiViewIndex == 1 )
    232232    {
     
    239239      AOF( m_bCamParsVaryOverTime    == pcSlice->getVPS()->hasCamParInSliceHeader ( uiViewIndex ) );
    240240    }
    241 #else
    242     if( uiViewIndex == 1 )
    243     {
    244       m_uiCamParsCodedPrecision       = pcSlice->getSPS()->getCamParPrecision     ();
    245       m_bCamParsVaryOverTime          = pcSlice->getSPS()->hasCamParInSliceHeader ();
    246     }
    247     else if( uiViewIndex > 1 )
    248     {
    249       AOF( m_uiCamParsCodedPrecision == pcSlice->getSPS()->getCamParPrecision     () );
    250       AOF( m_bCamParsVaryOverTime    == pcSlice->getSPS()->hasCamParInSliceHeader () );
    251     }
    252 #endif
     241
    253242    for( UInt uiBaseIndex = 0; uiBaseIndex < uiViewIndex; uiBaseIndex++ )
    254243    {
     
    264253      else
    265254      {
    266 #if CAM_HLS_F0136_F0045_F0082
    267255        m_aaiCodedScale [ uiBaseIndex ][ uiViewIndex ]  = pcSlice->getVPS()->getCodedScale    (uiViewIndex) [ uiBaseIndex ];
    268256        m_aaiCodedOffset[ uiBaseIndex ][ uiViewIndex ]  = pcSlice->getVPS()->getCodedOffset   (uiViewIndex) [ uiBaseIndex ];
    269257        m_aaiCodedScale [ uiViewIndex ][ uiBaseIndex ]  = pcSlice->getVPS()->getInvCodedScale (uiViewIndex) [ uiBaseIndex ];
    270258        m_aaiCodedOffset[ uiViewIndex ][ uiBaseIndex ]  = pcSlice->getVPS()->getInvCodedOffset(uiViewIndex) [ uiBaseIndex ];
    271 #else
    272         m_aaiCodedScale [ uiBaseIndex ][ uiViewIndex ]  = pcSlice->getSPS()->getCodedScale    () [ uiBaseIndex ];
    273         m_aaiCodedOffset[ uiBaseIndex ][ uiViewIndex ]  = pcSlice->getSPS()->getCodedOffset   () [ uiBaseIndex ];
    274         m_aaiCodedScale [ uiViewIndex ][ uiBaseIndex ]  = pcSlice->getSPS()->getInvCodedScale () [ uiBaseIndex ];
    275         m_aaiCodedOffset[ uiViewIndex ][ uiBaseIndex ]  = pcSlice->getSPS()->getInvCodedOffset() [ uiBaseIndex ];
    276 #endif
    277259        xInitLUTs( uiBaseIndex, uiViewIndex, m_aaiCodedScale[ uiBaseIndex ][ uiViewIndex ], m_aaiCodedOffset[ uiBaseIndex ][ uiViewIndex ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT );
    278260        xInitLUTs( uiViewIndex, uiBaseIndex, m_aaiCodedScale[ uiViewIndex ][ uiBaseIndex ], m_aaiCodedOffset[ uiViewIndex ][ uiBaseIndex ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT );
     
    306288CamParsCollector::copyCamParamForSlice( TComSlice* pcSlice )
    307289{
    308 #if !CAM_HLS_F0136_F0045_F0082
    309   UInt uiViewIndex = pcSlice->getViewIndex();
    310 
    311   pcSlice->getSPS()->initCamParaSPS( uiViewIndex, m_uiCamParsCodedPrecision, m_bCamParsVaryOverTime, m_aaiCodedScale, m_aaiCodedOffset );
    312 #endif
    313290  if( m_bCamParsVaryOverTime )
    314291  {
     
    11111088    m_pcCamParsCollector->setSlice( pcSlice );
    11121089  }
    1113 #if H_3D_IV_MERGE
    1114   if( pcSlice->getIsDepth() )
    1115   {
    1116 #if !CAM_HLS_F0136_F0045_F0082
    1117     pcSlice->getSPS()->setHasCamParInSliceHeader( false );
    1118 #endif
    1119   }
    1120 #endif
    11211090#endif
    11221091  m_bFirstSliceInPicture = false;
     
    11581127  pps->setLayerId( getLayerId() );
    11591128#endif
    1160 #if DLT_DIFF_CODING_IN_PPS
     1129#if H_3D
    11611130  // Assuming that all PPS indirectly refer to the same VPS via different SPS
    11621131  // There is no parsing dependency in decoding DLT in PPS.
     
    11651134  //   Step 1) decoding DLT tables based on the number of depth layers, and
    11661135  //   Step 2) mapping DLT tables to the depth layers
    1167   // as descripted in the 3D-HEVC WD.
     1136  // as described in the 3D-HEVC WD.
    11681137  TComVPS* vps = m_parameterSetManagerDecoder.getPrefetchedVPS( 0 );
    11691138  m_cEntropyDecoder.decodePPS( pps, vps );
Note: See TracChangeset for help on using the changeset viewer.