Changeset 1179 in 3DVCSoftware for trunk/source/Lib/TLibDecoder/TDecTop.cpp


Ignore:
Timestamp:
7 Apr 2015, 17:05:30 (9 years ago)
Author:
tech
Message:

Merged branch 13.1-dev0@1178.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibDecoder/TDecTop.cpp

    r1133 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    7676  xDeleteArray( m_adBaseViewShiftLUT, MAX_NUM_LAYERS, MAX_NUM_LAYERS, 2 );
    7777  xDeleteArray( m_aiBaseViewShiftLUT, MAX_NUM_LAYERS, MAX_NUM_LAYERS, 2 );
     78#if HHI_CAM_PARA_K0052
     79  xDeleteArray( m_receivedIdc, m_vps->getNumViews() );
     80#else
    7881  xDeleteArray( m_receivedIdc, m_uiMaxViewIndex + 1 );
     82#endif
    7983}
    8084
     
    9195  m_firstReceivedPoc        = -2;
    9296
     97#if HHI_CAM_PARA_K0052 
     98  for (Int i = 0; i <= vps->getMaxLayersMinus1(); i++)
     99  {
     100    Int curViewIdxInVps = m_vps->getVoiInVps( m_vps->getViewIndex( m_vps->getLayerIdInNuh( i ) ) ) ;
     101    m_bCamParsVaryOverTime = m_bCamParsVaryOverTime || vps->getCpInSliceSegmentHeaderFlag( curViewIdxInVps );   
     102  }
     103
     104  assert( m_receivedIdc == NULL );
     105  m_receivedIdc = new Int*[ m_vps->getNumViews() ];
     106  for (Int i = 0; i < m_vps->getNumViews(); i++)
     107  {
     108    m_receivedIdc[i] = new Int[ m_vps->getNumViews() ];
     109  }
     110
     111  xResetReceivedIdc( true );
     112
     113  for (Int voiInVps = 0; voiInVps < m_vps->getNumViews(); voiInVps++ )
     114  {
     115    if( !m_vps->getCpInSliceSegmentHeaderFlag( voiInVps ) )
     116    {
     117      for (Int baseVoiInVps = 0; baseVoiInVps < m_vps->getNumViews(); baseVoiInVps++ )
     118      {
     119        if( m_vps->getCpPresentFlag( voiInVps, baseVoiInVps ) )
     120        {
     121          m_receivedIdc   [ baseVoiInVps ][ voiInVps ] = -1;
     122          m_aaiCodedScale [ baseVoiInVps ][ voiInVps ] = m_vps->getCodedScale    (voiInVps) [ baseVoiInVps ];
     123          m_aaiCodedOffset[ baseVoiInVps ][ voiInVps ] = m_vps->getCodedOffset   (voiInVps) [ baseVoiInVps ];
     124
     125          m_receivedIdc   [ voiInVps ][ baseVoiInVps ] = -1;
     126          m_aaiCodedScale [ voiInVps ][ baseVoiInVps ] = m_vps->getInvCodedScale (voiInVps) [ baseVoiInVps ];
     127          m_aaiCodedOffset[ voiInVps ][ baseVoiInVps ] = m_vps->getInvCodedOffset(voiInVps) [ baseVoiInVps ];
     128          xInitLUTs( baseVoiInVps, voiInVps, m_aaiCodedScale[ baseVoiInVps ][ voiInVps ], m_aaiCodedOffset[ baseVoiInVps ][ voiInVps ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT );
     129          xInitLUTs( voiInVps, baseVoiInVps, m_aaiCodedScale[ voiInVps ][ baseVoiInVps ], m_aaiCodedOffset[ voiInVps ][ baseVoiInVps ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT );
     130        }
     131      }
     132    }
     133  }
     134}
     135
     136#else
    93137  m_uiMaxViewIndex            = -1;
    94138  for (Int i = 0; i <= vps->getMaxLayersMinus1(); i++)
     
    98142    m_uiMaxViewIndex = std::max( m_uiMaxViewIndex, curViewIdx  ) ;
    99143  }
    100 
    101144  assert( m_receivedIdc == NULL );
    102145  m_receivedIdc = new Int*[ m_uiMaxViewIndex + 1];
     
    131174}
    132175
     176#endif
     177
     178
     179
    133180Void
    134181CamParsCollector::xResetReceivedIdc( Bool overWriteFlag )
    135182{
     183#if HHI_CAM_PARA_K0052
     184  for (Int i = 0; i < m_vps->getNumViews(); i++)
     185  { 
     186    for (Int j = 0; j < m_vps->getNumViews(); j++)
     187    {
     188#else
    136189  for (Int i = 0; i <= m_uiMaxViewIndex; i++)
    137190  { 
    138191    for (Int j = 0; j <= m_uiMaxViewIndex; j++)
    139192    {
     193#endif
    140194      if ( overWriteFlag ||  ( m_receivedIdc[i][j] != -1 ) )
    141195      {
     
    178232  CamParsCollector::xInitLUTs( UInt uiSourceView, UInt uiTargetView, Int iScale, Int iOffset, Double****& radLUT, Int****& raiLUT)
    179233{
     234#if HHI_CAM_PARA_K0052
     235  Int     iLog2DivLuma   = m_uiBitDepthForLUT + m_vps->getCpPrecision() + 1 - m_iLog2Precision;   AOF( iLog2DivLuma > 0 );
     236#else
    180237  Int     iLog2DivLuma   = m_uiBitDepthForLUT + m_vps->getCamParPrecision() + 1 - m_iLog2Precision;   AOF( iLog2DivLuma > 0 );
     238#endif
    181239  Int     iLog2DivChroma = iLog2DivLuma + 1;
    182240
     
    255313  }
    256314
     315#if HHI_CAM_PARA_K0052
     316  UInt voiInVps          = m_vps->getVoiInVps(pcSlice->getViewIndex()); 
     317  if( m_vps->getCpInSliceSegmentHeaderFlag( voiInVps ) ) // check consistency of slice parameters here
     318  {   
     319    for( Int baseVoiInVps = 0; baseVoiInVps < m_vps->getNumViews(); baseVoiInVps++ )
     320    {       
     321      if ( m_vps->getCpPresentFlag( voiInVps, baseVoiInVps ) )
     322      {
     323        if ( m_receivedIdc[ voiInVps ][ baseVoiInVps ] != 0 )
     324        {     
     325          AOF( m_aaiCodedScale [ voiInVps ][ baseVoiInVps ] == pcSlice->getInvCodedScale () [ baseVoiInVps ] );
     326          AOF( m_aaiCodedOffset[ voiInVps ][ baseVoiInVps ] == pcSlice->getInvCodedOffset() [ baseVoiInVps ] );
     327        }
     328        else
     329        {         
     330          m_receivedIdc   [ voiInVps ][ baseVoiInVps ]  = 1;
     331          m_aaiCodedScale [ voiInVps ][ baseVoiInVps ]  = pcSlice->getInvCodedScale () [ baseVoiInVps ];
     332          m_aaiCodedOffset[ voiInVps ][ baseVoiInVps ]  = pcSlice->getInvCodedOffset() [ baseVoiInVps ];
     333          xInitLUTs( voiInVps, baseVoiInVps, m_aaiCodedScale[ voiInVps ][ baseVoiInVps ], m_aaiCodedOffset[ voiInVps ][ baseVoiInVps ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT);
     334        }
     335        if ( m_receivedIdc[ baseVoiInVps ][ voiInVps ] != 0 )
     336        {     
     337          AOF( m_aaiCodedScale [ baseVoiInVps ][ voiInVps ] == pcSlice->getCodedScale    () [ baseVoiInVps ] );
     338          AOF( m_aaiCodedOffset[ baseVoiInVps ][ voiInVps ] == pcSlice->getCodedOffset   () [ baseVoiInVps ] );
     339        }
     340        else
     341        {       
     342          m_receivedIdc   [ baseVoiInVps ][ voiInVps ]  = 1;
     343          m_aaiCodedScale [ baseVoiInVps ][ voiInVps ]  = pcSlice->getCodedScale    () [ baseVoiInVps ];
     344          m_aaiCodedOffset[ baseVoiInVps ][ voiInVps ]  = pcSlice->getCodedOffset   () [ baseVoiInVps ];
     345          xInitLUTs( baseVoiInVps, voiInVps, m_aaiCodedScale[ baseVoiInVps ][ voiInVps ], m_aaiCodedOffset[ baseVoiInVps ][ voiInVps ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT);
     346        }
     347      }
     348    }
     349  } 
     350#else
    257351  UInt uiViewIndex          = pcSlice->getViewIndex(); 
    258352  if( m_vps->getCamParPresent( uiViewIndex ) )
     
    289383    }
    290384  }
     385#endif
     386
     387
    291388}
    292389
     
    311408    if( iPOC == m_firstReceivedPoc )
    312409    {
     410#if HHI_CAM_PARA_K0052
     411      fprintf( m_pCodedScaleOffsetFile, "#ViewOrderIdx     ViewIdVal\n" );
     412      fprintf( m_pCodedScaleOffsetFile, "#------------ -------------\n" );
     413     
     414      for( UInt voiInVps = 0; voiInVps < m_vps->getNumViews(); voiInVps++ )
     415      {
     416        fprintf( m_pCodedScaleOffsetFile, "%13d %13d\n", m_vps->getViewOIdxList( voiInVps ), m_vps->getViewIdVal( m_vps->getViewOIdxList( voiInVps ) ) );
     417      }
     418      fprintf( m_pCodedScaleOffsetFile, "\n\n");
     419      fprintf( m_pCodedScaleOffsetFile, "# StartFrame     EndFrame    TargetVOI      BaseVOI   CodedScale  CodedOffset    Precision\n" );
     420      fprintf( m_pCodedScaleOffsetFile, "#----------- ------------ ------------ ------------ ------------ ------------ ------------\n" );
     421    }
     422    if( iPOC == m_firstReceivedPoc || m_bCamParsVaryOverTime  )
     423    {
     424      Int iS = iPOC;
     425      Int iE = ( m_bCamParsVaryOverTime ? iPOC : ~( 1 << 31 ) );
     426      for( UInt voiInVps = 0; voiInVps < m_vps->getNumViews(); voiInVps++ )
     427      {
     428        for( UInt baseVoiInVps = 0; baseVoiInVps < m_vps->getNumViews(); baseVoiInVps++ )
     429        {
     430          if( voiInVps != baseVoiInVps )
     431          {
     432            if ( m_receivedIdc[baseVoiInVps][voiInVps] != 0 )
     433            {           
     434              fprintf( m_pCodedScaleOffsetFile, "%12d %12d %12d %12d %12d %12d %12d\n",
     435                iS, iE, m_vps->getViewOIdxList( voiInVps ), m_vps->getViewOIdxList( baseVoiInVps ),
     436                m_aaiCodedScale [ baseVoiInVps ][ voiInVps ],
     437                m_aaiCodedOffset[ baseVoiInVps ][ voiInVps ], m_vps->getCpPrecision() );
     438#else
    313439      fprintf( m_pCodedScaleOffsetFile, "#  ViewIndex       ViewId\n" );
    314440      fprintf( m_pCodedScaleOffsetFile, "#----------- ------------\n" );
     
    325451      Int iS = iPOC;
    326452      Int iE = ( m_bCamParsVaryOverTime ? iPOC : ~( 1 << 31 ) );
     453#if HHI_CAM_PARA_K0052
     454      for( UInt uiViewIndex = 0; uiViewIndex < m_vps->getNumViews(); uiViewIndex++ )
     455      {
     456        for( UInt uiBaseIndex = 0; uiBaseIndex < m_vps->getNumViews(); uiBaseIndex++ )
     457#else
    327458      for( UInt uiViewIndex = 0; uiViewIndex <= m_uiMaxViewIndex; uiViewIndex++ )
    328459      {
    329460        for( UInt uiBaseIndex = 0; uiBaseIndex <= m_uiMaxViewIndex; uiBaseIndex++ )
     461#endif
    330462        {
    331463          if( uiViewIndex != uiBaseIndex )
     
    333465            if ( m_receivedIdc[uiBaseIndex][uiViewIndex] != 0 )
    334466            {           
     467#if HHI_CAM_PARA_K0052
     468              fprintf( m_pCodedScaleOffsetFile, "%12d %12d %12d %12d %12d %12d %12d\n",
     469                iS, iE, uiViewIndex, uiBaseIndex, m_aaiCodedScale[ uiBaseIndex ][ uiViewIndex ], m_aaiCodedOffset[ uiBaseIndex ][ uiViewIndex ], m_vps->getCpPrecision() );
     470#else
    335471              fprintf( m_pCodedScaleOffsetFile, "%12d %12d %12d %12d %12d %12d %12d\n",
    336472                iS, iE, uiViewIndex, uiBaseIndex, m_aaiCodedScale[ uiBaseIndex ][ uiViewIndex ], m_aaiCodedOffset[ uiBaseIndex ][ uiViewIndex ], m_vps->getCamParPrecision() );
     473#endif
     474#endif
    337475            }           
    338476          }
     
    417555#if !H_MV
    418556  initROM();
     557#endif
     558#if H_3D_ANNEX_SELECTION_FIX
     559  m_cCavlcDecoder.setDecTop( this );
    419560#endif
    420561  m_cGopDecoder.init( &m_cEntropyDecoder, &m_cSbacDecoder, &m_cBinCABAC, &m_cCavlcDecoder, &m_cSliceDecoder, &m_cLoopFilter, &m_cSAO );
     
    727868#endif
    728869#if H_3D
     870#if !HHI_INTER_COMP_PRED_K0052
    729871  m_apcSlicePilot->init3dToolParameters();
     872#endif
    730873#endif
    731874  pps->setSPS(sps);
     
    9551098  xActivateParameterSets();
    9561099
     1100#if SONY_MV_V_CONST_C0078
     1101  //Check Multiview Main profile constraint in G.11.1.1
     1102  //  When ViewOrderIdx[ i ] derived according to any active VPS is equal to 1
     1103  //  for the layer with nuh_layer_id equal to i in subBitstream,
     1104  //  inter_view_mv_vert_constraint_flag shall be equal to 1
     1105  //  in the sps_multilayer_extension( ) syntax structure in each active SPS for that layer.
     1106  if( m_apcSlicePilot->getSPS()->getPTL()->getGeneralPTL()->getProfileIdc()==Profile::MULTIVIEWMAIN
     1107      &&
     1108      m_apcSlicePilot->getVPS()->getViewOrderIdx(m_apcSlicePilot->getVPS()->getLayerIdInNuh(getLayerId()))==1
     1109     )
     1110  {
     1111    assert( m_apcSlicePilot->getSPS()->getInterViewMvVertConstraintFlag()==1 );
     1112  }
     1113#endif
     1114
    9571115  if (m_apcSlicePilot->isNextSlice())
    9581116  {
     
    10741232#endif
    10751233#endif
     1234#if HHI_RES_PRED_K0052
     1235  pcSlice->setIvPicLists( m_ivPicLists );         
     1236#endif
     1237
    10761238  if (bNextSlice)
    10771239  {
     
    11091271
    11101272#if H_3D
     1273#if !HHI_RES_PRED_K0052
    11111274    pcSlice->setIvPicLists( m_ivPicLists );         
     1275#endif
     1276
     1277#if HHI_INTER_COMP_PRED_K0052
     1278    pcSlice->checkInCompPredRefLayers();
    11121279#if H_3D_IV_MERGE
    11131280#if H_3D_FCO
     
    11171284#endif
    11181285#endif   
     1286#else
     1287#if H_3D_IV_MERGE
     1288#if H_3D_FCO
     1289    //assert( !getIsDepth() );
     1290#else
     1291    assert( !getIsDepth() || ( pcSlice->getTexturePic() != 0 ) );
     1292#endif
     1293#endif   
     1294#endif
    11191295#endif
    11201296#if H_MV
Note: See TracChangeset for help on using the changeset viewer.