Changeset 1172 in 3DVCSoftware


Ignore:
Timestamp:
5 Apr 2015, 22:58:19 (9 years ago)
Author:
tech
Message:

K0050: Camera paramters.

Location:
branches/HTM-13.1-dev0
Files:
1 added
21 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-13.1-dev0/source/App/TAppEncoder/TAppEncCfg.cpp

    r1170 r1172  
    17131713  xConfirmPara( m_pchBaseViewCameraNumbers  == 0                ,   "BaseViewCameraNumbers must be given" );
    17141714#if BUG_FIX_TK65
     1715#if HHI_CAM_PARA_K0052
     1716  xConfirmPara( m_iNumberOfViews != m_cCameraData.getBaseViewNumbers().size() ,   "Number of Views in BaseViewCameraNumbers must be equal to NumberOfViews" );
     1717#else
    17151718  xConfirmPara( ( ((UInt) m_numberOfLayers >> 1 ) != m_cCameraData.getBaseViewNumbers().size() ) && ( m_numberOfLayers != m_cCameraData.getBaseViewNumbers().size() ),   "Number of Views in BaseViewCameraNumbers must be equal to NumberOfViews" );
     1719#endif
    17161720#else
    17171721  xConfirmPara( ((UInt) m_numberOfLayers >> 1 ) != m_cCameraData.getBaseViewNumbers().size(),   "Number of Views in BaseViewCameraNumbers must be equal to NumberOfViews" );
  • branches/HTM-13.1-dev0/source/App/TAppEncoder/TAppEncTop.cpp

    r1170 r1172  
    140140  xSetVPSVUI               ( vps );
    141141#if H_3D
     142#if HHI_CAM_PARA_K0052
     143  xSetCamPara              ( vps );
     144#endif
     145#endif
     146#if H_3D
    142147  m_ivPicLists.setVPS      ( &vps );
    143148  xDeriveDltArray          ( vps, dlt );
     
    224229    //====== Camera Parameters =========
    225230    m_cTEncTop.setCameraParameters             ( &m_cCameraData );     
     231#if !HHI_CAM_PARA_K0052
    226232    m_cTEncTop.setCamParPrecision              ( m_cCameraData.getCamParsCodedPrecision  () );
    227233    m_cTEncTop.setCamParInSliceHeader          ( m_cCameraData.getVaryingCameraParameters() );
     234
    228235    m_cTEncTop.setCodedScale                   ( m_cCameraData.getCodedScale             () );
    229236    m_cTEncTop.setCodedOffset                  ( m_cCameraData.getCodedOffset            () );
     237#endif
    230238#if H_3D_VSO
    231239    //====== VSO =========
     
    791799{
    792800#if H_3D
     801#if !HHI_CAM_PARA_K0052
    793802  for ( Int viewIndex = 0; viewIndex < m_vps->getNumViews(); viewIndex++ )
    794803  {
     
    796805      m_cCameraData.getVaryingCameraParameters(), m_cCameraData.getCodedScale(), m_cCameraData.getCodedOffset() );
    797806  }
     807#endif
    798808#endif
    799809
     
    22282238  }
    22292239}
     2240
     2241#if HHI_CAM_PARA_K0052
     2242#if H_3D
     2243Void TAppEncTop::xSetCamPara                ( TComVPS& vps )
     2244{
     2245  vps.setCpPrecision( m_cCameraData.getCamParsCodedPrecision());
     2246
     2247  for ( Int n = 1; n < vps.getNumViews(); n++ )
     2248  { 
     2249    Int i      = vps.getViewOIdxList( n );
     2250    Int iInVps = vps.getVoiInVps    ( i );
     2251    vps.setNumCp( iInVps,  n);   
     2252
     2253    if ( vps.getNumCp( iInVps ) > 0 )
     2254    {
     2255      vps.setCpInSliceSegmentHeaderFlag( iInVps, m_cCameraData.getVaryingCameraParameters() );
     2256
     2257      for( Int m = 0; m < vps.getNumCp( iInVps ); m++ )
     2258      {
     2259        vps.setCpRefVoi( iInVps, m, vps.getViewOIdxList( m ) );
     2260        if( !vps.getCpInSliceSegmentHeaderFlag( iInVps ) )
     2261        {
     2262          Int j = vps.getCpRefVoi( iInVps, m );
     2263          Int jInVps = vps.getVoiInVps( j );         
     2264
     2265          vps.setVpsCpScale   ( iInVps, jInVps, m_cCameraData.getCodedScale() [ jInVps ][ iInVps ] ) ;
     2266          vps.setVpsCpInvScale( iInVps, jInVps, m_cCameraData.getCodedScale() [ iInVps ][ jInVps ] ) ;
     2267          vps.setVpsCpOff     ( iInVps, jInVps, m_cCameraData.getCodedOffset()[ jInVps ][ iInVps ] ) ;
     2268          vps.setVpsCpInvOff  ( iInVps, jInVps, m_cCameraData.getCodedOffset()[ iInVps ][ jInVps ] ) ;
     2269        }
     2270      }
     2271    }
     2272  }
     2273  vps.deriveCpPresentFlag();
     2274}
     2275#endif
     2276#endif
     2277
     2278
    22302279Bool TAppEncTop::xLayerIdInTargetEncLayerIdList(Int nuhLayerId)
    22312280{
  • branches/HTM-13.1-dev0/source/App/TAppEncoder/TAppEncTop.h

    r1133 r1172  
    142142  Void xSetDpbSize                ( TComVPS& vps );
    143143  Void xSetVPSVUI                 ( TComVPS& vps );
     144#if HHI_CAM_PARA_K0052
     145#if H_3D
     146  Void xSetCamPara                ( TComVPS& vps );
     147#endif
     148#endif
    144149  GOPEntry* xGetGopEntry( Int layerIdInVps, Int poc );
    145150  Int  xGetMax( std::vector<Int>& vec);
  • branches/HTM-13.1-dev0/source/Lib/TAppCommon/TAppComCamPara.cpp

    r1133 r1172  
    399399
    400400
     401#if !HHI_CAM_PARA_K0052
    401402Void
    402403TAppComCamPara::xGetViewOrderIndices( const std::vector<Int>& raiId2SortedId, std::vector<Int>& raiVOIdx )
     
    411412  }
    412413}
     414#endif
    413415
    414416
     
    447449    else
    448450    {
    449     Int     iBaseView  = m_aiBaseViews[ iBaseViewId ];
    450     Double  dFL1, dFLX;
    451     Double  dCP1, dCPX;
    452     Double  dCS1, dCSX;
    453     Double  dZN1, dZNX;
    454     Double  dZF1, dZFX;
    455     Bool    bInterpolated;
    456     xGetGeometryData( iBaseView, m_uiFirstFrameId, dFL1, dCP1, dCS1, bInterpolated );  AOT( bInterpolated );
    457     xGetZNearZFar   ( iBaseView, m_uiFirstFrameId, dZN1, dZF1 );
    458 
    459     for( UInt uiFrameId = m_uiFirstFrameId + 1; !bChangeDetected && uiFrameId <= m_uiLastFrameId; uiFrameId++ )
    460     {
    461       xGetGeometryData( iBaseView, uiFrameId, dFLX, dCPX, dCSX, bInterpolated );  AOT( bInterpolated );
    462       xGetZNearZFar   ( iBaseView, uiFrameId, dZNX, dZFX );
    463 
    464       if( dFL1 != dFLX || dCP1 != dCPX || dCS1 != dCSX || dZN1 != dZNX || dZF1 != dZFX )
    465       {
    466         bChangeDetected = true;
    467       }
    468     }
    469   }
     451      Int     iBaseView  = m_aiBaseViews[ iBaseViewId ];
     452      Double  dFL1, dFLX;
     453      Double  dCP1, dCPX;
     454      Double  dCS1, dCSX;
     455      Double  dZN1, dZNX;
     456      Double  dZF1, dZFX;
     457      Bool    bInterpolated;
     458      xGetGeometryData( iBaseView, m_uiFirstFrameId, dFL1, dCP1, dCS1, bInterpolated );  AOT( bInterpolated );
     459      xGetZNearZFar   ( iBaseView, m_uiFirstFrameId, dZN1, dZF1 );
     460
     461      for( UInt uiFrameId = m_uiFirstFrameId + 1; !bChangeDetected && uiFrameId <= m_uiLastFrameId; uiFrameId++ )
     462      {
     463        xGetGeometryData( iBaseView, uiFrameId, dFLX, dCPX, dCSX, bInterpolated );  AOT( bInterpolated );
     464        xGetZNearZFar   ( iBaseView, uiFrameId, dZNX, dZFX );
     465
     466        if( dFL1 != dFLX || dCP1 != dCPX || dCS1 != dCSX || dZN1 != dZNX || dZF1 != dZFX )
     467        {
     468          bChangeDetected = true;
     469        }
     470      }
     471    }
    470472  }
    471473  return bChangeDetected;
     
    721723  else
    722724  {
    723   Double  dScale, dOffset;
    724   Bool    bInterpolated = xGetShiftParameterReal( uiSourceView, uiTargetView, uiFrame, false, bByIdx, dScale, dOffset );
    725   AOT(    bInterpolated ); // must be base view
    726 
    727   Double  dMultOffset   = (Double)( 1 << ( m_uiCamParsCodedPrecision + 1 ) );
    728   Double  dMultScale    = (Double)( 1 << ( m_uiCamParsCodedPrecision + 1 + m_uiInputBitDepth ) );
    729   riOffset              = (Int)floor( dMultOffset * dOffset + .5 );
    730   riScale               = (Int)floor( dMultScale  * dScale  + .5 );
    731 }
    732 
     725    Double  dScale, dOffset;
     726    Bool    bInterpolated = xGetShiftParameterReal( uiSourceView, uiTargetView, uiFrame, false, bByIdx, dScale, dOffset );
     727    AOT(    bInterpolated ); // must be base view
     728
     729    Double  dMultOffset   = (Double)( 1 << ( m_uiCamParsCodedPrecision + 1 ) );
     730    Double  dMultScale    = (Double)( 1 << ( m_uiCamParsCodedPrecision + 1 + m_uiInputBitDepth ) );
     731    riOffset              = (Int)floor( dMultOffset * dOffset + .5 );
     732    riScale               = (Int)floor( dMultScale  * dScale  + .5 );
     733  }
    733734}
    734735
     
    958959
    959960
     961
     962#if !HHI_CAM_PARA_K0052
    960963Void
    961964TAppComCamPara::xSetPdmConversionParams()
     
    995998  }
    996999}
     1000#endif
    9971001
    9981002
     
    12801284
    12811285  //===== set derived parameters =====
     1286#if !HHI_CAM_PARA_K0052
    12821287  xGetViewOrderIndices( m_aiBaseId2SortedId, m_aiViewOrderIndex );
     1288#endif
    12831289  m_bCamParsVaryOverTime = xGetCamParsChangeFlag();
    12841290
  • branches/HTM-13.1-dev0/source/Lib/TAppCommon/TAppComCamPara.h

    r655 r1172  
    8585
    8686  // SPS and slice header related variables
     87#if !HHI_CAM_PARA_K0052
    8788  std::vector<Int>    m_aiViewOrderIndex;                     ///< list of view order indices
     89#endif
    8890  UInt                m_uiCamParsCodedPrecision;              ///< precision for coding of camera parameters (x: max error in disparity is 2^(-x) luma samples)
    8991  Bool                m_bCamParsVaryOverTime;                 ///< flag specifying whether camera parameters vary for given frame numbers
     
    145147  // getting conversion parameters for disparity to virtual depth conversion
    146148  Void  xGetCameraShifts          ( UInt uiSourceView, UInt uiTargetView, UInt uiFrame, Double& rdCamPosShift, Double& rdPicPosShift );
     149#if !HHI_CAM_PARA_K0052
    147150  Void  xSetPdmConversionParams   ();
     151#endif
    148152
    149153public:
     
    216220  Bool                getVaryingCameraParameters()  { return m_bCamParsVaryOverTime;    }
    217221  UInt                getCamParsCodedPrecision  ()  { return m_uiCamParsCodedPrecision; }
     222#if !HHI_CAM_PARA_K0052
    218223  std::vector<Int>&   getViewOrderIndex         ()  { return m_aiViewOrderIndex;        }
     224#endif
    219225  Int**               getCodedScale             ()  { return m_aaiCodedScale;           }
    220226  Int**               getCodedOffset            ()  { return m_aaiCodedOffset;          }
  • branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComRom.cpp

    r1169 r1172  
    400400Bool g_stopAtPos             = false;
    401401Bool g_outputPos             = false;
     402Bool g_traceCameraParameters = true;
    402403#endif
    403404#endif
     
    601602
    602603  Bool stopFlag = false;
    603   if ( g_stopAtPos && poc == 0 && layerId == 1 )
     604  if ( g_stopAtPos && poc == 0 && layerId == 2 )
    604605  {
    605606    Bool stopAtCU = true;
    606607    if ( stopAtCU )        // Stop at CU with specific size
    607608    {   
    608       stopFlag = ( cuPelX  == 888 ) && ( cuPelY  == 248 ) && ( cuWidth == 8 ) && ( cuHeight == 8);
     609      stopFlag = ( cuPelX  == 0 ) && ( cuPelY  == 0 ) && ( cuWidth == 16 ) && ( cuHeight == 16 );
    609610    }
    610611    else
  • branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComRom.h

    r1169 r1172  
    230230
    231231#ifndef ENC_DEC_TRACE
    232 #define ENC_DEC_TRACE   0
     232#define ENC_DEC_TRACE   0 
    233233#endif
    234234
     
    265265 extern Bool   g_stopAtPos;             // Stop at position
    266266 extern Bool   g_outputPos;             // Output position
     267 extern Bool   g_traceCameraParameters; // Trace camera parameters
    267268
    268269#define DTRACE_CU(x,y)             writeToTraceFile( x,y, g_traceCU );
  • branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComSlice.cpp

    r1171 r1172  
    140140, m_inCmpPredFlag                 ( false )
    141141#endif
     142#if HHI_CAM_PARA_K0052
     143, m_numViews                        ( 0    )
     144#endif
    142145, m_depthToDisparityB             ( NULL )
    143146, m_depthToDisparityF             ( NULL )
     
    211214  m_puiSubstreamSizes = NULL;
    212215#if H_3D
     216#if HHI_CAM_PARA_K0052   
     217  for( UInt i = 0; i < m_numViews; i++ )
     218#else
    213219  for( UInt i = 0; i < getViewIndex(); i++ )
     220#endif
    214221  {
    215222    if ( m_depthToDisparityB && m_depthToDisparityB[ i ] )
     
    221228    {
    222229      delete[] m_depthToDisparityF [ i ];
    223   }
     230    }
    224231  }
    225232
     
    830837Void TComSlice::setCamparaSlice( Int** aaiScale, Int** aaiOffset )
    831838
     839#if HHI_CAM_PARA_K0052
     840  Int voiInVps      = m_pcVPS->getVoiInVps(getViewIndex() );
     841  if( m_pcVPS->getNumCp( voiInVps ) > 0 )
     842  {   
     843    if( m_pcVPS->getCpInSliceSegmentHeaderFlag( voiInVps ) )
     844    {
     845      for( Int m = 0; m < m_pcVPS->getNumCp( voiInVps ); m++ )
     846      {     
     847        Int j      = m_pcVPS->getCpRefVoi( voiInVps, m );
     848        Int jInVps = m_pcVPS->getVoiInVps( j );
     849
     850        setCpScale   ( jInVps , aaiScale [ jInVps   ][ voiInVps ]);
     851        setCpInvScale( jInVps , aaiScale [ voiInVps ][ jInVps   ]);
     852        setCpOff     ( jInVps , aaiOffset[ jInVps   ][ voiInVps ]);
     853        setCpInvOff  ( jInVps , aaiOffset[ voiInVps ][ jInVps   ]);
     854      }
     855    }
     856  }
     857#else
    832858  if( m_pcVPS->hasCamParInSliceHeader( m_viewIndex ) )
    833859  {   
     
    840866    }
    841867  }
     868#endif
    842869}
    843870#endif
     
    22542281  Int i = 0, j = 0;
    22552282
     2283#if HHI_CAM_PARA_K0052
     2284  m_numCp    = new Int [ iNumViews ];
     2285  m_cpRefVoi = new Int*[ iNumViews ];
     2286  m_cpInSliceSegmentHeaderFlag = new Bool[ iNumViews ];
     2287
     2288  m_cpPresentFlag  = new Bool*[ iNumViews ];
     2289#else
    22562290  m_bCamParPresent = new Bool[ iNumViews ];
    22572291  m_bCamParInSliceHeader = new Bool[ iNumViews ];
     2292#endif
     2293 
    22582294
    22592295  m_aaaiCodedScale = new Int**[ iNumViews ];
     
    22612297  for ( i = 0; i < iNumViews ; i++ )
    22622298  {
     2299#if HHI_CAM_PARA_K0052
     2300    m_cpInSliceSegmentHeaderFlag[i] = false;     
     2301#else
    22632302    m_bCamParPresent[i] = false;
    22642303    m_bCamParInSliceHeader[i] = false;
     2304#endif
     2305   
    22652306    m_aaaiCodedScale[i] = new Int*[ 2 ];
    22662307    m_aaaiCodedOffset[i] = new Int*[ 2 ];
     2308
     2309#if HHI_CAM_PARA_K0052
     2310    m_numCp   [i] = 0;
     2311    m_cpRefVoi[i] = new Int[ iNumViews ];
     2312    m_cpPresentFlag[i] = new Bool[ iNumViews ];
     2313    for ( j = 0; j < iNumViews; j++)
     2314    {
     2315      m_cpRefVoi[i][j] = 0;
     2316      m_cpPresentFlag[i][j] = false;
     2317    }
     2318#endif
    22672319    for ( j = 0; j < 2; j++ )
    22682320    {
     
    22832335  Int i = 0, j = 0;
    22842336
     2337#if !HHI_CAM_PARA_K0052
    22852338  if ( m_bCamParPresent != NULL )
    22862339  {
     
    22912344    delete [] m_bCamParInSliceHeader;
    22922345  }
     2346#else
     2347  if ( m_numCp != NULL )
     2348  {
     2349    delete [] m_numCp;
     2350  }
     2351
     2352  if ( m_cpRefVoi != NULL )
     2353  {
     2354    for ( i = 0; i < iNumViews ; i++ )
     2355    {
     2356      delete [] m_cpRefVoi[i];
     2357    }
     2358    delete[] m_cpRefVoi;
     2359  }
     2360
     2361  if ( m_cpPresentFlag != NULL )
     2362  {
     2363    for ( i = 0; i < iNumViews ; i++ )
     2364    {
     2365      delete [] m_cpPresentFlag[i];
     2366    }
     2367    delete[] m_cpPresentFlag;
     2368  }
     2369
     2370
     2371  if ( m_cpInSliceSegmentHeaderFlag != NULL )
     2372  {
     2373    delete [] m_cpInSliceSegmentHeaderFlag;
     2374  }
     2375#endif
     2376
    22932377
    22942378  if ( m_aaaiCodedScale != NULL )
     
    23202404
    23212405
    2322 Void
    2323   TComVPS::initCamParaVPS( UInt uiViewIndex, Bool bCamParPresent, UInt uiCamParPrecision, Bool bCamParSlice, Int** aaiScale, Int** aaiOffset )
     2406#if !HHI_CAM_PARA_K0052
     2407Void TComVPS::initCamParaVPS( UInt uiViewIndex, Bool bCamParPresent, UInt uiCamParPrecision, Bool bCamParSlice, Int** aaiScale, Int** aaiOffset )
    23242408{
    23252409  AOT( uiViewIndex != 0 && !bCamParSlice && ( aaiScale == 0 || aaiOffset == 0 ) ); 
     
    23402424  }
    23412425}
     2426#endif
    23422427
    23432428#endif // H_3D
     
    27742859#endif
    27752860#if H_3D
     2861#if !HHI_CAM_PARA_K0052
    27762862, m_bCamParInSliceHeader      (false)
     2863#endif
    27772864#endif
    27782865{
     
    39904077#if H_3D_NBDV_REF
    39914078  setupLUT = setupLUT || getDepthRefinementFlag( );
    3992 #endif
     4079#endif  
    39934080
    39944081#if H_3D_IV_MERGE
     
    40004087    return;
    40014088
     4089#if HHI_CAM_PARA_K0052
     4090  m_numViews = getVPS()->getNumViews();
     4091#endif
    40024092  /// GT: Allocation should be moved to a better place later;
    40034093  if ( m_depthToDisparityB == NULL )
    40044094  {
     4095#if HHI_CAM_PARA_K0052   
     4096    m_depthToDisparityB = new Int*[ m_numViews ];
     4097    for ( Int i = 0; i < getVPS()->getNumViews(); i++ )
     4098#else
    40054099    m_depthToDisparityB = new Int*[ getViewIndex() ];
    40064100    for ( Int i = 0; i < getViewIndex(); i++ )
     4101#endif
    40074102    {
    40084103      m_depthToDisparityB[ i ] = new Int[ Int(1 << g_bitDepthY) ];
     
    40104105  }
    40114106
     4107 
    40124108  if ( m_depthToDisparityF == NULL )
    40134109  {
     4110#if HHI_CAM_PARA_K0052   
     4111    m_depthToDisparityF = new Int*[ m_numViews ];
     4112    for ( Int i = 0; i < m_numViews; i++ )
     4113#else
    40144114    m_depthToDisparityF= new Int*[ getViewIndex() ];
    40154115    for ( Int i = 0; i < getViewIndex(); i++ )
     4116#endif
    40164117    {
    40174118      m_depthToDisparityF[ i ] = new Int[ Int(1 << g_bitDepthY) ];
     
    40244125  TComVPS* vps = getVPS();
    40254126
     4127#if HHI_CAM_PARA_K0052
     4128  Int log2Div = g_bitDepthY - 1 + vps->getCpPrecision();
     4129  Int voiInVps = vps->getVoiInVps( getViewIndex() );
     4130  Bool camParaSH = vps->getCpInSliceSegmentHeaderFlag( voiInVps ); 
     4131
     4132  Int* codScale     = camParaSH ? m_aaiCodedScale [ 0 ] : vps->getCodedScale    ( voiInVps );
     4133  Int* codOffset    = camParaSH ? m_aaiCodedOffset[ 0 ] : vps->getCodedOffset   ( voiInVps );
     4134  Int* invCodScale  = camParaSH ? m_aaiCodedScale [ 1 ] : vps->getInvCodedScale ( voiInVps );
     4135  Int* invCodOffset = camParaSH ? m_aaiCodedOffset[ 1 ] : vps->getInvCodedOffset( voiInVps );
     4136
     4137
     4138  for (Int i = 0; i < voiInVps; i++)
     4139  {
     4140    Int iInVoi = vps->getVoiInVps( i );
     4141#if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC
     4142    if ( g_traceCameraParameters )
     4143    {
     4144      std::cout << std::endl << "Cp: " << codScale   [ iInVoi ] << " " <<    codOffset[ iInVoi ] << " "
     4145                << invCodScale[ iInVoi ] << " " << invCodOffset[ iInVoi ] << " " << log2Div;
     4146    }
     4147#endif
     4148    for ( Int d = 0; d <= ( ( 1 << g_bitDepthY ) - 1 ); d++ )
     4149    {     
     4150      Int offset =    ( codOffset  [ iInVoi ] << g_bitDepthY ) + ( ( 1 << log2Div ) >> 1 );         
     4151      m_depthToDisparityB[ iInVoi ][ d ] = ( codScale [ iInVoi ] * d + offset ) >> log2Div;
     4152
     4153      Int invOffset = ( invCodOffset[ iInVoi ] << g_bitDepthY ) + ( ( 1 << log2Div ) >> 1 );         
     4154      m_depthToDisparityF[ iInVoi ][ d ] = ( invCodScale[ iInVoi ] * d + invOffset ) >> log2Div;
     4155    }
     4156  }
     4157#else
    40264158  Int log2Div = g_bitDepthY - 1 + vps->getCamParPrecision();
     4159
    40274160  Int viewIndex = getViewIndex();
    40284161
     
    40454178    }
    40464179  }
     4180#endif
    40474181}
    40484182#endif
     
    40914225  Bool depthOfRefViewsAvailFlag = false;
    40924226  Bool textOfCurViewAvailFlag = false;
    4093 #endif
    4094 
    4095  
    4096 
    4097 #if !HHI_INTER_COMP_PRED_K0052
     4227
    40984228  TComVPS* vps = getVPS();
    40994229
     
    41714301  m_ivMvScalingFlag        = sps3dExt->getIvMvScalingFlag      ( depthFlag )                                 ;                             
    41724302  m_ivResPredFlag          = sps3dExt->getIvResPredFlag        ( depthFlag ) && nRLLG0                       ;                               
     4303#if HHI_CAM_PARA_K0052
     4304  m_depthRefinementFlag    = sps3dExt->getDepthRefinementFlag  ( depthFlag )           && getInCompPredFlag() && m_cpAvailableFlag;
     4305  m_viewSynthesisPredFlag  = sps3dExt->getViewSynthesisPredFlag( depthFlag ) && nRLLG0 && getInCompPredFlag() && m_cpAvailableFlag;
     4306#else
    41734307  m_depthRefinementFlag    = sps3dExt->getDepthRefinementFlag  ( depthFlag )           && getInCompPredFlag();                           
    4174   m_viewSynthesisPredFlag  = sps3dExt->getViewSynthesisPredFlag( depthFlag ) && nRLLG0 && getInCompPredFlag();                         
     4308  m_viewSynthesisPredFlag  = sps3dExt->getViewSynthesisPredFlag( depthFlag ) && nRLLG0 && getInCompPredFlag();                           
     4309#endif
    41754310  m_depthBasedBlkPartFlag  = sps3dExt->getDepthBasedBlkPartFlag( depthFlag )           && getInCompPredFlag();                         
    41764311  m_mpiFlag                = sps3dExt->getMpiFlag              ( depthFlag )           && getInCompPredFlag();
  • branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComSlice.h

    r1171 r1172  
    914914  // VPS EXTENSION 2 SYNTAX ELEMENTS
    915915#if H_3D
     916#if HHI_CAM_PARA_K0052 
     917  Int*        m_numCp; 
     918  Int**       m_cpRefVoi;
     919  Bool**      m_cpPresentFlag;
     920  Int         m_cpPrecision;
     921  Bool*       m_cpInSliceSegmentHeaderFlag;
     922#else
    916923  UInt        m_uiCamParPrecision;
    917924  Bool*       m_bCamParInSliceHeader;
    918925  Bool*       m_bCamParPresent;
     926#endif
    919927  Int         ***m_aaaiCodedScale ;
    920928  Int         ***m_aaaiCodedOffset;
     
    11881196#if HHI_VIEW_ID_LIST_I5_J0107 || HHI_INTER_COMP_PRED_K0052
    11891197  Int     getViewOIdxList( Int i )                                         { return m_viewOIdxList[i]; }
     1198#if HHI_CAM_PARA_K0052
     1199  std::vector<Int> getViewOIdxList( )                                               { return m_viewOIdxList; }
     1200#endif
    11901201#endif
    11911202#if HHI_INTER_COMP_PRED_K0052
     1203#if HHI_CAM_PARA_K0052
     1204  Int     getVoiInVps( Int viewOIdx )                                     
     1205#else
    11921206  Int     getInvViewOIdxList( Int viewOIdx )                                     
     1207#endif
    11931208  {   
    11941209    for ( Int i = 0; i < m_viewOIdxList.size(); i++ )
     
    12021217    return -1;
    12031218  };
     1219
     1220#if HHI_CAM_PARA_K0052
     1221  Bool    getViewCompLayerPresentFlag (Int i, Bool d ) { return  m_viewCompLayerPresentFlag[ getVoiInVps(i) ][d]; }
     1222  Bool    getViewCompLayerId          (Int i, Bool d ) { return  m_viewCompLayerId         [ getVoiInVps(i) ][d]; }
     1223#else
    12041224  Bool    getViewCompLayerPresentFlag (Int i, Bool d ) { return  m_viewCompLayerPresentFlag[ getInvViewOIdxList(i) ][d]; }
    12051225  Bool    getViewCompLayerId          (Int i, Bool d ) { return  m_viewCompLayerId         [ getInvViewOIdxList(i) ][d]; }
     1226#endif
    12061227#endif
    12071228  Bool    getDependencyFlag( Int i, Int j )                                { return m_dependencyFlag[i][j]; }
     
    13251346  Void createCamPars(Int iNumViews);
    13261347  Void deleteCamPars();
     1348#if HHI_CAM_PARA_K0052
     1349  Void initCamParaVPS( Int vOIdxInVps, Int numCp, Bool cpInSliceSegmentHeaderFlag, Int* cpRefVoi, Int** aaiScale, Int** aaiOffset );
     1350#else
    13271351  Void initCamParaVPS      (  UInt uiViewIndex, Bool bCamParPresent = false, UInt uiCamParPrecision = 0, Bool bCamParSlice = false, Int** aaiScale = 0, Int** aaiOffset = 0 );
     1352#endif
     1353 
     1354#if HHI_CAM_PARA_K0052
     1355
     1356  Void setCpPrecision( Int  val ) { m_cpPrecision = val; }
     1357  Int  getCpPrecision(  ) { return m_cpPrecision; }
     1358
     1359  Void setNumCp( Int i, Int  val ) { m_numCp[i] = val; }
     1360  Int  getNumCp( Int i )           { return m_numCp[i]; }
     1361
     1362  Void setCpRefVoi( Int i, Int m, Int  val ) { m_cpRefVoi[i][m] = val; }
     1363  Int  getCpRefVoi( Int i, Int m )           { return m_cpRefVoi[i][m]; }   
     1364 
     1365  Void setCpInSliceSegmentHeaderFlag( Int i, Bool flag ) { m_cpInSliceSegmentHeaderFlag[i] = flag; }
     1366  Bool getCpInSliceSegmentHeaderFlag( Int i )            { return m_cpInSliceSegmentHeaderFlag[i]; }
     1367 
     1368  Void setVpsCpScale( Int i, Int j, Int  val ) { m_aaaiCodedScale [i][0][j] = val; }
     1369  Int  getVpsCpScale( Int i, Int j ) { return m_aaaiCodedScale[i][0][j]; }
     1370
     1371  Void setVpsCpOff( Int i, Int j, Int  val ) { m_aaaiCodedOffset[i][0][j] = val; }
     1372  Int  getVpsCpOff( Int i, Int j ) { return m_aaaiCodedOffset[i][0][j]; }
     1373
     1374  Void setVpsCpInvScale( Int i, Int j, Int  val ) { m_aaaiCodedScale[i][1][j] = val; }
     1375  Int  getVpsCpInvScale( Int i, Int j ) { return m_aaaiCodedScale[i][1][j]; }
     1376
     1377  Void setVpsCpInvOff( Int i, Int j, Int  val ) { m_aaaiCodedOffset[i][1][j] = val; }
     1378  Int  getVpsCpInvOff( Int i, Int j ) { return m_aaaiCodedOffset[i][1][j]; }
     1379
     1380// Derived
     1381  Void deriveCpPresentFlag( )
     1382  {
     1383    for( Int nInVps = 0; nInVps < getNumViews(); nInVps++  )
     1384    {
     1385      for( Int mInVps = 0; mInVps < getNumViews(); mInVps++ )
     1386      {
     1387        m_cpPresentFlag[nInVps][mInVps] = 0;
     1388      }
     1389    }
     1390
     1391   for( Int n = 1; n < getNumViews(); n++ )
     1392   {
     1393      Int iInVps = getVoiInVps(  getViewOIdxList( n ) );     
     1394      for( Int m = 0; m < getNumCp( iInVps ); m++ )
     1395      {
     1396         m_cpPresentFlag[ iInVps ][ getVoiInVps( getCpRefVoi( iInVps, m ) ) ] = 1;
     1397      }
     1398    }
     1399  }
     1400
     1401  Void setCpPresentFlag( Int i, Int m, Bool flag ) { m_cpPresentFlag[i][m] = flag; }
     1402  Bool getCpPresentFlag( Int i, Int m )           { return m_cpPresentFlag[i][m]; }   
     1403
     1404#else
    13281405  UInt getCamParPrecision    ()  { return m_uiCamParPrecision; }
    13291406  Bool getCamParPresent      ( Int viewIndex )  { return m_bCamParPresent[viewIndex]; }
     
    13311408  Bool hasCamParInSliceHeader( Int viewIndex )  { return m_bCamParInSliceHeader[viewIndex]; }
    13321409  Void setHasCamParInSliceHeader( Int viewIndex, Bool b )  { m_bCamParInSliceHeader[viewIndex] = b; }
     1410#endif
     1411
     1412
    13331413  Int* getCodedScale         ( Int viewIndex )  { return m_aaaiCodedScale [viewIndex][0]; }
    13341414  Int* getCodedOffset        ( Int viewIndex )  { return m_aaaiCodedOffset[viewIndex][0]; }
     
    18021882#if H_3D
    18031883  TComSps3dExtension m_sps3dExtension;
     1884#if !HHI_CAM_PARA_K0052
    18041885  UInt        m_uiCamParPrecision;
    18051886  Bool        m_bCamParInSliceHeader;
     1887#endif
    18061888  Int         m_aaiCodedScale [2][MAX_NUM_LAYERS];
    18071889  Int         m_aaiCodedOffset[2][MAX_NUM_LAYERS];
     
    24472529  Bool       m_inCmpPredFlag;
    24482530#endif
     2531#if HHI_CAM_PARA_K0052
     2532  Bool       m_cpAvailableFlag;
     2533  Int        m_numViews;
     2534#endif
    24492535  TComPic*   m_ivPicsCurrPoc [2][MAX_NUM_LAYERS]; 
    24502536  Int**      m_depthToDisparityB;
     
    25512637#if HHI_INTER_COMP_PRED_K0052
    25522638  Bool      getInCmpPredAvailFlag( )                             { return m_inCmpPredAvailFlag;    }
     2639#if HHI_CAM_PARA_K0052
     2640  Bool      getCpAvailableFlag( )                             { return m_cpAvailableFlag;    }
     2641#endif
    25532642  Bool      getInCompPredFlag( )                                 { return m_inCmpPredFlag;         }   
    25542643  Void      setInCompPredFlag( Bool b )                          { m_inCmpPredFlag = b;            }   
     
    27952884  Int*      getInvCodedScale      ()  { return m_aaiCodedScale [1]; }
    27962885  Int*      getInvCodedOffset     ()  { return m_aaiCodedOffset[1]; }
     2886#if HHI_CAM_PARA_K0052
     2887  Void      setCpScale( Int j, Int  val ) { m_aaiCodedScale[0][j] = val; }
     2888  Int       getCpScale( Int j ) { return m_aaiCodedScale[0][j]; }
     2889           
     2890  Void      setCpOff( Int j, Int  val ) { m_aaiCodedOffset[0][j] = val; }
     2891  Int       getCpOff( Int j ) { return m_aaiCodedOffset[0][j]; }
     2892           
     2893  Void      setCpInvScale( Int j, Int  val ) { m_aaiCodedScale[1][j] = val; }
     2894  Int       getCpInvScale( Int j ) { return m_aaiCodedScale[1][j]; }
     2895           
     2896  Void      setCpInvOff( Int j, Int  val ) { m_aaiCodedOffset[1][j] = val; }
     2897  Int       getCpInvOff( Int j ) { return m_aaiCodedOffset[1][j]; }
     2898#endif
     2899
    27972900#endif
    27982901#endif
     
    28012904  Void    setDepthToDisparityLUTs();
    28022905
     2906#if HHI_CAM_PARA_K0052
     2907  Int* getDepthToDisparityB( Int refViewIdx ) { return m_depthToDisparityB[ getVPS()->getVoiInVps( refViewIdx) ]; };
     2908  Int* getDepthToDisparityF( Int refViewIdx ) { return m_depthToDisparityF[ getVPS()->getVoiInVps( refViewIdx) ]; };
     2909#else
    28032910  Int* getDepthToDisparityB( Int refViewIdx ) { return m_depthToDisparityB[ refViewIdx ]; };
    28042911  Int* getDepthToDisparityF( Int refViewIdx ) { return m_depthToDisparityF[ refViewIdx ]; };
     2912#endif
    28052913#endif
    28062914#if H_3D_IC
     
    29223030    }
    29233031
    2924     // m_cpAvailableFlag = true;
     3032#if HHI_CAM_PARA_K0052
     3033    m_cpAvailableFlag = true;
     3034    m_inCmpRefViewIdcs.clear();
     3035#endif
    29253036    Bool allRefCmpLayersAvailFlag = true;
    29263037
     
    29283039    {
    29293040      m_inCmpRefViewIdcs.push_back( getVPS()->getViewOrderIdx( curCmpLIds[ i ] ));
    2930       //if( !getVPS()->getCpPresentFlag( getViewIdx(),  inCmpRefViewIdcs( i ) ) )
    2931       //{
    2932       //  m_cpAvailableFlag = false;
    2933       //}
     3041#if HHI_CAM_PARA_K0052
     3042      if( !getVPS()->getCpPresentFlag( getVPS()->getVoiInVps( getViewIndex() ),  getVPS()->getVoiInVps( m_inCmpRefViewIdcs[ i ] ) ) )
     3043      {
     3044        m_cpAvailableFlag = false;
     3045      }
     3046#endif
    29343047      Bool refCmpCurLIdAvailFlag = false;
    29353048      if( getVPS()->getViewCompLayerPresentFlag( m_inCmpRefViewIdcs[ i ], !getIsDepth() ) )
  • branches/HTM-13.1-dev0/source/Lib/TLibCommon/TypeDef.h

    r1171 r1172  
    334334#define HHI_INTER_COMP_PRED_K0052              1
    335335#define HHI_RES_PRED_K0052                     1
     336#define HHI_CAM_PARA_K0052                     1
    336337#define H_3D_ANNEX_SELECTION_FIX               1
    337 
    338338#endif
    339339#define H_MV_FIX_REF_LAYER_PIC_FLAG            1
  • branches/HTM-13.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r1170 r1172  
    9393TDecCavlc::TDecCavlc()
    9494{
     95#if !HHI_CAM_PARA_K0052
    9596#if H_3D
    9697  m_aaiTempScale            = new Int* [ MAX_NUM_LAYERS ];
     
    102103  }
    103104#endif
     105#endif
    104106}
    105107
    106108TDecCavlc::~TDecCavlc()
    107109{
     110#if !HHI_CAM_PARA_K0052
    108111#if H_3D
    109112  for( UInt uiVId = 0; uiVId < MAX_NUM_LAYERS; uiVId++ )
     
    114117  delete [] m_aaiTempScale;
    115118  delete [] m_aaiTempOffset;
     119#endif
    116120#endif
    117121}
     
    19251929Void TDecCavlc::parseVPS3dExtension( TComVPS* pcVPS )
    19261930{
     1931#if HHI_CAM_PARA_K0052
     1932  UInt uiCode;   
     1933  READ_UVLC( uiCode, "cp_precision"); pcVPS->setCpPrecision( uiCode ) ;
     1934 
     1935  for (Int n = 1; n < pcVPS->getNumViews(); n++)
     1936  {
     1937    Int i      = pcVPS->getViewOIdxList( n );
     1938    Int iInVps = pcVPS->getVoiInVps( i );
     1939    READ_CODE( 6, uiCode, "num_cp" ); pcVPS->setNumCp( iInVps, uiCode );
     1940
     1941    if( pcVPS->getNumCp( iInVps ) > 0 )
     1942    {
     1943      READ_FLAG( uiCode, "cp_in_slice_segment_header_flag" ); pcVPS->setCpInSliceSegmentHeaderFlag( iInVps, uiCode == 1 );
     1944      for( Int m = 0; m < pcVPS->getNumCp( iInVps ); m++ )
     1945      {
     1946        READ_UVLC( uiCode, "cp_ref_voi" ); pcVPS->setCpRefVoi( iInVps, m, uiCode );
     1947        if( !pcVPS->getCpInSliceSegmentHeaderFlag( iInVps ) )
     1948        {
     1949          Int j      = pcVPS->getCpRefVoi( iInVps, m );
     1950          Int jInVps = pcVPS->getVoiInVps( j );
     1951          Int iCode;
     1952          READ_SVLC( iCode, "vps_cp_scale" );                pcVPS->setVpsCpScale   ( iInVps, jInVps, iCode );
     1953          READ_SVLC( iCode, "vps_cp_off" );                  pcVPS->setVpsCpOff     ( iInVps, jInVps, iCode );
     1954          READ_SVLC( iCode, "vps_cp_inv_scale_plus_scale" ); pcVPS->setVpsCpInvScale( iInVps, jInVps, iCode - pcVPS->getVpsCpScale( iInVps, jInVps ) );
     1955          READ_SVLC( iCode, "vps_cp_inv_off_plus_off" );     pcVPS->setVpsCpInvOff  ( iInVps, jInVps, iCode - pcVPS->getVpsCpOff  ( iInVps, jInVps ) );
     1956        }
     1957      }
     1958    }   
     1959  }
     1960  pcVPS->deriveCpPresentFlag();
     1961#else
    19271962  UInt uiCode;
    1928 
    19291963
    19301964  UInt uiCamParPrecision = 0;
     
    19752009    }
    19762010  }
     2011#endif
    19772012}
    19782013#endif
     
    27312766    rpcSlice->setLFCrossSliceBoundaryFlag( (uiCode==1)?true:false);
    27322767
     2768#if HHI_CAM_PARA_K0052
     2769#if H_3D
     2770    if ( getDecTop()->decProcAnnexI() )
     2771    {
     2772      Int voiInVps = vps->getVoiInVps( rpcSlice->getViewIndex() );
     2773      if( vps->getCpInSliceSegmentHeaderFlag( voiInVps ) && !rpcSlice->getIsDepth() )
     2774      {
     2775        for( Int m = 0; m < vps->getNumCp( voiInVps ); m++ )
     2776        {
     2777          Int jInVps = vps->getVoiInVps( vps->getCpRefVoi( voiInVps, m ));
     2778          READ_SVLC( iCode, "cp_scale" );                rpcSlice->setCpScale   ( jInVps, iCode );
     2779          READ_SVLC( iCode, "cp_off" );                  rpcSlice->setCpOff     ( jInVps, iCode );
     2780          READ_SVLC( iCode, "cp_inv_scale_plus_scale" ); rpcSlice->setCpInvScale( jInVps, iCode - rpcSlice->getCpScale   ( jInVps ));
     2781          READ_SVLC( iCode, "cp_inv_off_plus_off" );     rpcSlice->setCpInvOff  ( jInVps, iCode - rpcSlice->getCpOff     ( jInVps ));
     2782        }
     2783      }
     2784    }
     2785#endif
     2786#endif
    27332787  }
    27342788 
     
    27542808  }
    27552809
     2810#if !HHI_CAM_PARA_K0052
    27562811#if H_3D
    27572812#if H_3D_FCO
     
    27712826    rpcSlice->setCamparaSlice( m_aaiTempScale, m_aaiTempOffset );
    27722827  }
     2828#endif
    27732829#endif
    27742830
  • branches/HTM-13.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.h

    r1170 r1172  
    6666  void  parseShortTermRefPicSet            (TComSPS* pcSPS, TComReferencePictureSet* pcRPS, Int idx);
    6767 
     68
     69#if !HHI_CAM_PARA_K0052
    6870#if H_3D
    6971  Int**    m_aaiTempScale;
    7072  Int**    m_aaiTempOffset;
     73#endif
    7174#endif
    7275#if H_3D_ANNEX_SELECTION_FIX
  • branches/HTM-13.1-dev0/source/Lib/TLibDecoder/TDecCu.cpp

    r1164 r1172  
    290290#if H_MV_ENC_DEC_TRAC
    291291  DTRACE_CU_S("=========== coding_unit ===========\n")
     292#if H_MV_ENC_DEC_TRAC
     293#if ENC_DEC_TRACE
     294    stopAtPos  ( pcCU->getSlice()->getPOC(),
     295    pcCU->getSlice()->getLayerId(),
     296    uiLPelX,
     297    uiTPelY,
     298    uiRPelX-uiLPelX+1,
     299    uiBPelY-uiTPelY+1);
     300#endif
     301#endif
     302
    292303#endif
    293304
     
    640651 
    641652  m_ppcCU[uiDepth]->copySubCU( pcCU, uiAbsPartIdx, uiDepth );
    642  
    643 #if H_MV_ENC_DEC_TRAC
    644 #if ENC_DEC_TRACE
    645   stopAtPos  ( m_ppcCU[uiDepth]->getSlice()->getPOC(),
    646     m_ppcCU[uiDepth]->getSlice()->getLayerId(),
    647     m_ppcCU[uiDepth]->getCUPelX(),
    648     m_ppcCU[uiDepth]->getCUPelY(),
    649     m_ppcCU[uiDepth]->getWidth(0),
    650     m_ppcCU[uiDepth]->getHeight(0) );
    651 #endif
    652 #endif
    653653
    654654  switch( m_ppcCU[uiDepth]->getPredictionMode(0) )
  • branches/HTM-13.1-dev0/source/Lib/TLibDecoder/TDecSbac.cpp

    r1169 r1172  
    22152215 
    22162216  m_pcTDecBinIf->decodeBin( uiSymbol, m_cDBBPFlagSCModel.get( 0, 0, 0 ) );
    2217  
     2217  DTRACE_CU("dbbp_flag", uiSymbol)
    22182218  PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx );
    22192219  AOF( ePartSize == SIZE_2NxN || ePartSize == SIZE_Nx2N );
  • branches/HTM-13.1-dev0/source/Lib/TLibDecoder/TDecTop.cpp

    r1171 r1172  
    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          }
  • branches/HTM-13.1-dev0/source/Lib/TLibDecoder/TDecTop.h

    r1170 r1172  
    9797  TComVPS* m_vps;
    9898  Int**    m_receivedIdc;
     99#if!HHI_CAM_PARA_K0052
    99100  Int      m_uiMaxViewIndex;
     101#endif
    100102  Int      m_lastPoc;
    101103  Int      m_firstReceivedPoc;
  • branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp

    r1170 r1172  
    16141614Void TEncCavlc::codeVPS3dExtension( TComVPS* pcVPS )
    16151615{
     1616#if HHI_CAM_PARA_K0052
     1617  WRITE_UVLC( pcVPS->getCpPrecision( ), "cp_precision" );
     1618  for (Int n = 1; n < pcVPS->getNumViews(); n++)
     1619  {
     1620    Int i      = pcVPS->getViewOIdxList( n );
     1621    Int iInVps = pcVPS->getVoiInVps( i );
     1622    WRITE_CODE( pcVPS->getNumCp( iInVps ), 6, "num_cp" );
     1623
     1624    if( pcVPS->getNumCp( iInVps ) > 0 )
     1625    {
     1626      WRITE_FLAG( pcVPS->getCpInSliceSegmentHeaderFlag( iInVps ) ? 1 : 0 , "cp_in_slice_segment_header_flag" );
     1627      for( Int m = 0; m < pcVPS->getNumCp( iInVps ); m++ )
     1628      {
     1629        WRITE_UVLC( pcVPS->getCpRefVoi( iInVps, m ), "cp_ref_voi" );
     1630        if( !pcVPS->getCpInSliceSegmentHeaderFlag( iInVps ) )
     1631        {
     1632          Int j      = pcVPS->getCpRefVoi( iInVps, m );
     1633          Int jInVps = pcVPS->getVoiInVps( j );
     1634          WRITE_SVLC( pcVPS->getVpsCpScale   ( iInVps, jInVps ), "vps_cp_scale" );
     1635          WRITE_SVLC( pcVPS->getVpsCpOff     ( iInVps, jInVps ), "vps_cp_off" );
     1636          WRITE_SVLC( pcVPS->getVpsCpInvScale( iInVps, jInVps ) + pcVPS->getVpsCpScale( iInVps, jInVps ), "vps_cp_inv_scale_plus_scale" );
     1637          WRITE_SVLC( pcVPS->getVpsCpInvOff  ( iInVps, jInVps ) + pcVPS->getVpsCpOff  ( iInVps, jInVps ), "vps_cp_inv_off_plus_off" );
     1638        }
     1639      }
     1640    }
     1641  } 
     1642#else
    16161643  WRITE_UVLC( pcVPS->getCamParPrecision(), "cp_precision" );
    16171644  for (UInt viewIndex=1; viewIndex<pcVPS->getNumViews(); viewIndex++)
     
    16331660    }
    16341661  }
     1662#endif
    16351663}
    16361664#endif
     
    21202148      WRITE_FLAG(pcSlice->getLFCrossSliceBoundaryFlag()?1:0, "slice_loop_filter_across_slices_enabled_flag");
    21212149    }
    2122   }
     2150#if HHI_CAM_PARA_K0052
     2151#if H_3D
     2152    if (getEncTop()->decProcAnnexI() )
     2153    {
     2154      Int voiInVps = vps->getVoiInVps( pcSlice->getViewIndex() );
     2155      if( vps->getCpInSliceSegmentHeaderFlag( voiInVps ) && !pcSlice->getIsDepth() )
     2156      {
     2157        for( Int m = 0; m < vps->getNumCp( voiInVps ); m++ )
     2158        {
     2159          Int jInVps = vps->getVoiInVps( vps->getCpRefVoi( voiInVps, m ));
     2160          WRITE_SVLC( pcSlice->getCpScale   ( jInVps )   , "cp_scale" );
     2161          WRITE_SVLC( pcSlice->getCpOff     ( jInVps )   , "cp_off" );
     2162          WRITE_SVLC( pcSlice->getCpInvScale( jInVps ) + pcSlice->getCpScale( jInVps ) , "cp_inv_scale_plus_scale" );
     2163          WRITE_SVLC( pcSlice->getCpInvOff  ( jInVps ) + pcSlice->getCpOff  ( jInVps ) , "cp_inv_off_plus_off" );
     2164        }
     2165      }
     2166    }
     2167#endif
     2168#endif
     2169  }
     2170
     2171#if !HHI_CAM_PARA_K0052 
    21232172#if H_3D
    21242173#if H_3D_FCO
     
    21362185    }
    21372186  }
     2187#endif
    21382188#endif
    21392189
  • branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncCfg.h

    r1170 r1172  
    380380
    381381  //====== Camera Parameters ======
     382#if !HHI_CAM_PARA_K0052
    382383  UInt      m_uiCamParPrecision;
    383384  Bool      m_bCamParInSliceHeader;
    384385  Int**     m_aaiCodedScale;
    385386  Int**     m_aaiCodedOffset;
     387#endif
    386388  TAppComCamPara* m_cameraParameters;
    387389 
     
    921923
    922924 //==== CAMERA PARAMETERS  ==========
     925#if !HHI_CAM_PARA_K0052
    923926  Void      setCamParPrecision              ( UInt  u )      { m_uiCamParPrecision      = u; }
    924927  Void      setCamParInSliceHeader          ( Bool  b )      { m_bCamParInSliceHeader   = b; }
    925928  Void      setCodedScale                   ( Int** p )      { m_aaiCodedScale          = p; }
    926929  Void      setCodedOffset                  ( Int** p )      { m_aaiCodedOffset         = p; }
     930#endif
    927931  Void      setCameraParameters             ( TAppComCamPara* c) { m_cameraParameters   = c; }
    928932
  • branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncCu.cpp

    r1169 r1172  
    25132513  m_pcPredSearch  ->estIntraPredDIS      ( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC, false );
    25142514
    2515 
     2515#if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC
     2516  Int oldTraceCopyBack = g_traceCopyBack;
     2517  g_traceCopyBack = false; 
     2518#endif
    25162519  m_ppcRecoYuvTemp[uiDepth]->copyToPicLuma(rpcTempCU->getPic()->getPicYuvRec(), rpcTempCU->getAddr(), rpcTempCU->getZorderIdxInCU() );
     2520  #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC 
     2521    g_traceCopyBack = oldTraceCopyBack;
     2522  #endif
    25172523
    25182524
  • branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncSbac.cpp

    r1169 r1172  
    23832383  UInt uiSymbol = pcCU->getDBBPFlag( uiAbsPartIdx ) ? 1 : 0;
    23842384  m_pcBinIf->encodeBin( uiSymbol, m_cDBBPFlagSCModel.get( 0, 0, 0 ) );
     2385  DTRACE_CU("dbbp_flag", uiSymbol)
    23852386}
    23862387#endif
  • branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncTop.cpp

    r1170 r1172  
    417417#endif
    418418#if H_3D
     419#if HHI_CAM_PARA_K0052
     420  pcPicCurr->setScaleOffset( m_cameraParameters->getCodedScale(), m_cameraParameters->getCodedOffset() );
     421#else
    419422  pcPicCurr->setScaleOffset( m_aaiCodedScale, m_aaiCodedOffset );
     423#endif
    420424#endif
    421425}
Note: See TracChangeset for help on using the changeset viewer.