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/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
Note: See TracChangeset for help on using the changeset viewer.