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

JCT3V-F0131, JCT3V-F0139

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

Legend:

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