Changeset 5 in 3DVCSoftware for trunk/source/App/TAppEncoder/TAppEncTop.cpp


Ignore:
Timestamp:
12 Dec 2011, 18:35:44 (13 years ago)
Author:
hhi
Message:

Clean version with cfg-files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/App/TAppEncoder/TAppEncTop.cpp

    r2 r5  
     1/* The copyright in this software is being made available under the BSD
     2 * License, included below. This software may be subject to other third party
     3 * and contributor rights, including patent rights, and no such rights are
     4 * granted under this license.
     5 *
     6 * Copyright (c) 2010-2011, ISO/IEC
     7 * All rights reserved.
     8 *
     9 * Redistribution and use in source and binary forms, with or without
     10 * modification, are permitted provided that the following conditions are met:
     11 *
     12 *  * Redistributions of source code must retain the above copyright notice,
     13 *    this list of conditions and the following disclaimer.
     14 *  * Redistributions in binary form must reproduce the above copyright notice,
     15 *    this list of conditions and the following disclaimer in the documentation
     16 *    and/or other materials provided with the distribution.
     17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
     18 *    be used to endorse or promote products derived from this software without
     19 *    specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
     25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31 * THE POSSIBILITY OF SUCH DAMAGE.
     32 */
     33
    134
    235
     
    1851TAppEncTop::TAppEncTop()
    1952{
    20 //GT VSO
     53#if HHI_VSO
    2154  m_iLastFramePutInERViewBuffer = -1;
    22 //GT VSO end
     55#endif
    2356}
    2457
     
    5588    m_acTEncTopList[iViewIdx]->setRateGOPSize                  ( m_iRateGOPSize );
    5689
    57 //  // SB
    5890    m_acTEncTopList[iViewIdx]->setSeqStructure                              ( m_cInputFormatString );
    5991
     
    79111    m_acTEncTopList[iViewIdx]->setMaxDeltaQP                   ( m_iMaxDeltaQP  );
    80112
     113#if HHI_VSO
    81114    //====== VSO =========
    82 //GT VSO
    83115    m_acTEncTopList[iViewIdx]->setForceLambdaScaleVSO          ( false );
    84116    m_acTEncTopList[iViewIdx]->setLambdaScaleVSO               ( 1     );
    85117    m_acTEncTopList[iViewIdx]->setVSOMode                      ( 0     );
    86 //GT VSO end
     118#endif
    87119
    88120    //====== Tool list ========
     
    109141    m_acTEncTopList[iViewIdx]->setUseFastEnc                   ( m_bUseFastEnc  );
    110142
    111 //GT VSO
     143#if HHI_VSO
    112144    m_acTEncTopList[iViewIdx]->setUseVSO                       ( false ); //GT: might be enabled later for VSO Mode 4
    113 //GT VSO end
     145#endif
    114146
    115147    m_acTEncTopList[iViewIdx]->setViewId                       ( (UInt)iViewIdx );
     
    120152    m_acTEncTopList[iViewIdx]->setCodedScale                   ( m_cCameraData.getCodedScale             () );
    121153    m_acTEncTopList[iViewIdx]->setCodedOffset                  ( m_cCameraData.getCodedOffset            () );
     154#if DEPTH_MAP_GENERATION
    122155    m_acTEncTopList[iViewIdx]->setPredDepthMapGeneration       ( m_uiPredDepthMapGeneration );
     156    m_acTEncTopList[iViewIdx]->setPdmPrecision                 ( (UInt)m_cCameraData.getPdmPrecision     () );
     157    m_acTEncTopList[iViewIdx]->setPdmScaleNomDelta             (       m_cCameraData.getPdmScaleNomDelta () );
     158    m_acTEncTopList[iViewIdx]->setPdmOffset                    (       m_cCameraData.getPdmOffset        () );
     159#endif
     160#if HHI_INTER_VIEW_MOTION_PRED
    123161    m_acTEncTopList[iViewIdx]->setMultiviewMvPredMode          ( m_uiMultiviewMvPredMode );
    124162    m_acTEncTopList[iViewIdx]->setMultiviewMvRegMode           ( iViewIdx ? m_uiMultiviewMvRegMode       : 0   );
    125163    m_acTEncTopList[iViewIdx]->setMultiviewMvRegLambdaScale    ( iViewIdx ? m_dMultiviewMvRegLambdaScale : 0.0 );
    126     m_acTEncTopList[iViewIdx]->setPdmPrecision                 ( (UInt)m_cCameraData.getPdmPrecision     () );
    127     m_acTEncTopList[iViewIdx]->setPdmScaleNomDelta             (       m_cCameraData.getPdmScaleNomDelta () );
    128     m_acTEncTopList[iViewIdx]->setPdmOffset                    (       m_cCameraData.getPdmOffset        () );
     164#endif
     165#if HHI_INTER_VIEW_RESIDUAL_PRED
    129166    m_acTEncTopList[iViewIdx]->setMultiviewResPredMode         ( m_uiMultiviewResPredMode );
    130 
    131 #if SB_INTERVIEW_SKIP
     167#endif
     168
     169
     170#if HHI_INTERVIEW_SKIP
    132171    m_acTEncTopList[iViewIdx]->setInterViewSkip            ( iViewIdx ? m_uiInterViewSkip : 0 );
    133 #if SB_INTERVIEW_SKIP_LAMBDA_SCALE
    134     m_acTEncTopList[iViewIdx]->setInterViewSkipLambdaScale ( iViewIdx ? m_dInterViewSkipLambdaScale : 1 );
     172#if HHI_INTERVIEW_SKIP_LAMBDA_SCALE
     173    m_acTEncTopList[iViewIdx]->setInterViewSkipLambdaScale ( iViewIdx ? (Int)m_dInterViewSkipLambdaScale : 1 );
    135174#endif
    136175#endif
     
    147186    m_acTEncTopList[iViewIdx]->setUseRoundingControlBipred(m_useRoundingControlBipred);
    148187#endif
    149 #if HHI_DMM_INTRA
    150     m_acTEncTopList[iViewIdx]->setUseDepthModelModes( false );
     188#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     189    m_acTEncTopList[iViewIdx]->setUseDMM( false );
    151190#endif
    152191#if CONSTRAINED_INTRA_PRED
     
    175214    m_acTEncTopList[iViewIdx]->setUseSAO               ( m_abUseSAO[0]     );
    176215#endif
     216#if HHI_MPI
    177217    m_acTEncTopList[iViewIdx]->setUseMVI( false );
     218#endif
    178219
    179220    m_acTEncTopList[iViewIdx]->setPictureDigestEnabled(m_pictureDigestEnabled);
    180     m_acTEncTopList[iViewIdx]->setOmitUnusedBlocks          ( m_bOmitUnusedBlocks && (iViewIdx != 0) );
    181 
    182221    m_acTEncTopList[iViewIdx]->setQpChangeFrame( m_iQpChangeFrame );
    183222    m_acTEncTopList[iViewIdx]->setQpChangeOffsetVideo( m_iQpChangeOffsetVideo );
     
    187226  {
    188227
    189 //GT VSO
     228#if HHI_VSO
    190229    for (Int iViewIdx=0; iViewIdx<m_iNumberOfExternalRefs; iViewIdx++)
    191230    {
    192231        m_acTVideoIOYuvERFileList.push_back(new TVideoIOYuv);
    193232    }
    194 //GT VSO end
     233#endif
    195234
    196235    for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++)
     
    219258      m_acTEncDepthTopList[iViewIdx]->setRateGOPSize                  ( m_iRateGOPSize );
    220259
    221 //  // SB
    222260      m_acTEncDepthTopList[iViewIdx]->setSeqStructure                              ( m_cInputFormatString );
    223261
     
    266304      m_acTEncDepthTopList[iViewIdx]->setUseFastEnc                   ( m_bUseFastEnc  );
    267305
    268 //GT VSO
     306#if HHI_VSO
    269307      m_acTEncDepthTopList[iViewIdx]->setUseVSO                       ( m_bUseVSO      ); //GT: might be enabled/disabled later for VSO Mode 4
    270308      m_acTEncDepthTopList[iViewIdx]->setForceLambdaScaleVSO          ( m_bForceLambdaScaleVSO );
    271309      m_acTEncDepthTopList[iViewIdx]->setLambdaScaleVSO               ( m_dLambdaScaleVSO );
    272 #if RDO_DIST_INT
     310#if HHI_VSO_DIST_INT
    273311      m_acTEncDepthTopList[iViewIdx]->setAllowNegDist                 ( m_bAllowNegDist );
    274312#endif
    275313      m_acTEncDepthTopList[iViewIdx]->setVSOMode                      ( m_uiVSOMode );
    276 //GT VSO end
     314#endif
    277315
    278316      m_acTEncDepthTopList[iViewIdx]->setViewId                       ( (UInt)iViewIdx );
     
    283321      m_acTEncDepthTopList[iViewIdx]->setCodedScale                   ( 0 );
    284322      m_acTEncDepthTopList[iViewIdx]->setCodedOffset                  ( 0 );
     323#if DEPTH_MAP_GENERATION
    285324      m_acTEncDepthTopList[iViewIdx]->setPredDepthMapGeneration       ( 0 );
     325#endif
     326#if HHI_INTER_VIEW_MOTION_PRED
    286327      m_acTEncDepthTopList[iViewIdx]->setMultiviewMvPredMode          ( 0 );
    287328      m_acTEncDepthTopList[iViewIdx]->setMultiviewMvRegMode           ( 0 );
    288329      m_acTEncDepthTopList[iViewIdx]->setMultiviewMvRegLambdaScale    ( 0.0 );
     330#endif
     331#if HHI_INTER_VIEW_RESIDUAL_PRED
    289332      m_acTEncDepthTopList[iViewIdx]->setMultiviewResPredMode         ( 0 );
    290 
    291 #if SB_INTERVIEW_SKIP
     333#endif
     334
     335#if HHI_INTERVIEW_SKIP
    292336      m_acTEncDepthTopList[iViewIdx]->setInterViewSkip            ( 0 );
    293 #if SB_INTERVIEW_SKIP_LAMBDA_SCALE
     337#if HHI_INTERVIEW_SKIP_LAMBDA_SCALE
    294338      m_acTEncDepthTopList[iViewIdx]->setInterViewSkipLambdaScale ( 1 );
    295339#endif
     
    307351      m_acTEncDepthTopList[iViewIdx]->setUseRoundingControlBipred(m_useRoundingControlBipred);
    308352#endif
    309 #if HHI_DMM_INTRA
    310       m_acTEncDepthTopList[iViewIdx]->setUseDepthModelModes( m_bUseDepthModelModes );
     353#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     354      m_acTEncDepthTopList[iViewIdx]->setUseDMM( m_bUseDMM );
    311355#endif
    312356#if CONSTRAINED_INTRA_PRED
     
    335379      m_acTEncDepthTopList[iViewIdx]->setUseSAO               ( m_abUseSAO[1]     );
    336380#endif
     381#if HHI_MPI
    337382      m_acTEncDepthTopList[iViewIdx]->setUseMVI( m_bUseMVI );
     383#endif
    338384
    339385      m_acTEncDepthTopList[iViewIdx]->setPictureDigestEnabled(m_pictureDigestEnabled);
    340       m_acTEncDepthTopList[iViewIdx]->setOmitUnusedBlocks        ( m_bOmitUnusedBlocks && (iViewIdx != 0) );
    341386
    342387      m_acTEncDepthTopList[iViewIdx]->setQpChangeFrame( m_iQpChangeFrame );
     
    345390    }
    346391  }
     392#if HHI_INTER_VIEW_MOTION_PRED
    347393  else if( m_uiMultiviewMvRegMode )
    348394  {
     
    352398    }
    353399  }
    354 
    355 //GT VSO
     400#endif
     401
     402#if HHI_VSO
    356403  if ( m_bUseVSO )
    357404  {
    358405    if ( m_uiVSOMode == 4 )
    359     {     
    360 #if GERHARD_RM_DEBUG_MM
    361       m_cMMCheckModel .create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, m_iSourceHeight, LOG2_DISP_PREC_LUT, 0 );
    362 #endif
     406    {
    363407      m_cRendererModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, m_iSourceHeight, LOG2_DISP_PREC_LUT, 0 );
    364408
     
    367411        for (Int iContent = 0; iContent < 2; iContent++ )
    368412        {
    369           Int iNumOfModels   = m_cRenModStrParser.getNumOfModelsForView(iViewNum, iContent); 
    370           Bool bUseVSO = (iNumOfModels != 0); 
    371 
    372           TEncTop* pcEncTop = ( iContent == 0 ) ? m_acTEncTopList[iViewNum] : m_acTEncDepthTopList[iViewNum]; 
    373           pcEncTop->setUseVSO( bUseVSO ); 
    374           pcEncTop->getRdCost()->setRenModel( bUseVSO ? &m_cRendererModel : NULL ); 
    375          
     413          Int iNumOfModels   = m_cRenModStrParser.getNumOfModelsForView(iViewNum, iContent);
     414          Bool bUseVSO = (iNumOfModels != 0);
     415
     416          TEncTop* pcEncTop = ( iContent == 0 ) ? m_acTEncTopList[iViewNum] : m_acTEncDepthTopList[iViewNum];
     417          pcEncTop->setUseVSO( bUseVSO );
     418          pcEncTop->getRdCost()->setRenModel( bUseVSO ? &m_cRendererModel : NULL );
     419
    376420          for (Int iCurModel = 0; iCurModel < iNumOfModels; iCurModel++ )
    377421          {
    378             Int iModelNum; Int iLeftViewNum; Int iRightViewNum; Int iDump; Int iOrgRefNum; Int iBlendMode;
    379 
    380             m_cRenModStrParser.getSingleModelData  ( iViewNum, iContent, iCurModel, iModelNum, iBlendMode, iLeftViewNum, iRightViewNum, iOrgRefNum, iDump ) ;
    381             m_cRendererModel  .createSingleModel   ( iViewNum, iContent, iModelNum, iLeftViewNum, iRightViewNum, (iOrgRefNum != -1), iBlendMode );
    382 #if GERHARD_RM_DEBUG_MM
    383             m_cMMCheckModel   .createSingleModel   ( iViewNum, iContent, iModelNum, iLeftViewNum, iRightViewNum, (iOrgRefNum != -1), iBlendMode );
    384 #endif
     422            Int iModelNum; Int iLeftViewNum; Int iRightViewNum; Int iDump; Int iOrgRefNum; Int iBlendMode;
     423
     424            m_cRenModStrParser.getSingleModelData  ( iViewNum, iContent, iCurModel, iModelNum, iBlendMode, iLeftViewNum, iRightViewNum, iOrgRefNum, iDump ) ;
     425            m_cRendererModel  .createSingleModel   ( iViewNum, iContent, iModelNum, iLeftViewNum, iRightViewNum, (iOrgRefNum != -1), iBlendMode );
    385426          }
    386427        }
     
    391432      m_cRendererTop.init(m_iSourceWidth, m_iSourceHeight,true,0,0,true, 0,0,0,0,0,0,0,1,0,0 );  //GT: simplest configuration
    392433    }
    393 
    394   }
    395 //GT VSO end
    396   m_cUsedPelsRenderer.init(m_iSourceWidth, m_iSourceHeight, true, 0, LOG2_DISP_PREC_LUT, true, 0, 0, 0, 0, 0, 6, 4, 1, 0, 6 );
     434  }
     435#endif
     436
     437#if HHI_INTERVIEW_SKIP
     438  m_cUsedPelsRenderer.init(m_iSourceWidth, m_iSourceHeight, true, 0, LOG2_DISP_PREC_LUT, true, 0, 0, 0, 0, 0, 6, 4, 1, 0, 6 );
     439#endif
    397440}
    398441
     
    421464      m_acTEncDepthTopList[iViewIdx]->create();
    422465    }
     466#if HHI_INTER_VIEW_MOTION_PRED
    423467    else if( m_uiMultiviewMvRegMode )
    424468    {
     
    426470      m_acTVideoIOYuvDepthInputFileList[iViewIdx]->skipFrames(m_FrameSkip, m_iSourceWidth, m_iSourceHeight);
    427471    }
    428   }
    429 
    430 //GT VSO
     472#endif
     473  }
     474
     475#if HHI_VSO
    431476  for(Int iViewIdx=0; iViewIdx < m_iNumberOfExternalRefs; iViewIdx++)
    432477  {
    433478    m_acTVideoIOYuvERFileList[iViewIdx]->open( m_pchERRefFileList[iViewIdx], false, m_uiInputBitDepth, m_uiInternalBitDepth ); // read mode
    434479  }
    435 //GT VSO end
     480#endif
    436481}
    437482
     
    441486  m_cTVideoIOBitsFile.closeBits();
    442487
    443 //GT VSO
     488#if HHI_VSO
    444489  for ( Int iViewIdx = 0; iViewIdx < m_iNumberOfExternalRefs; iViewIdx++ )
    445490  {
     
    448493    m_acTVideoIOYuvERFileList[iViewIdx] = 0;
    449494  };
    450 //GT VSO end
     495#endif
    451496
    452497  for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++)
     
    563608    pcDepthPicYuvOrg->create( m_iSourceWidth, m_iSourceHeight, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth );
    564609  }
     610#if HHI_INTER_VIEW_MOTION_PRED
    565611  if( m_uiMultiviewMvRegMode )
    566612  {
    567613    pcPdmDepthOrg->create( m_iSourceWidth, m_iSourceHeight, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth );
    568614  }
     615#endif
    569616
    570617  TComBitstream*    pcBitstream = new TComBitstream;
     
    589636        bAllEos = bAllEos|bEos[iViewIdx] ;
    590637
     638#if HHI_INTER_VIEW_MOTION_PRED
    591639        if( m_uiMultiviewMvRegMode && iViewIdx )
    592640        {
    593641          m_acTVideoIOYuvDepthInputFileList[iViewIdx]->read( pcPdmDepthOrg, m_aiPad, m_bUsingDepthMaps );
    594642        }
     643#endif
    595644
    596645        // increase number of received frames
     
    598647      }
    599648
     649#if HHI_INTER_VIEW_MOTION_PRED
    600650      m_acTEncTopList[iViewIdx]->receivePic( bEos[iViewIdx],  pcPicYuvOrg, m_cListPicYuvRecList[iViewIdx]->back(), ( m_uiMultiviewMvRegMode && iViewIdx ? pcPdmDepthOrg : 0 ) );
     651#else
     652      m_acTEncTopList[iViewIdx]->receivePic( bEos[iViewIdx],  pcPicYuvOrg, m_cListPicYuvRecList[iViewIdx]->back(), 0 );
     653#endif
    601654
    602655      if( m_bUsingDepthMaps )
     
    628681    }
    629682
    630 //GT VSO
     683#if HHI_VSO   
    631684    if ( m_bUseVSO && ( m_uiVSOMode != 4) )
    632685    {
     
    634687      xStoreVSORefPicsInBuffer();       //GT;
    635688    }
    636 //GT VSO end
     689#endif
    637690
    638691    //GT: Encode
     
    688741
    689742#if AMVP_BUFFERCOMPRESS
    690     // compress motion for entire access 
     743    // compress motion for entire access
    691744    if( bCurrPocCoded )
    692745    {
     
    729782  pcDepthPicYuvOrg = NULL ;
    730783
    731   // SB valgrid
    732784  pcBitstream->destroy();
    733785  delete pcBitstream;
     
    751803  if ( pcPdmDepthOrg )
    752804  {
    753     pcPdmDepthOrg->destroy(); 
    754     delete pcPdmDepthOrg; 
    755     pcPdmDepthOrg = NULL; 
     805    pcPdmDepthOrg->destroy();
     806    delete pcPdmDepthOrg;
     807    pcPdmDepthOrg = NULL;
    756808  }
    757809
     
    847899  // Delete ERFiles
    848900
    849 //GT VSO
     901#if HHI_VSO
    850902  std::map< Int,vector<TComPicYuv*> >::iterator iterMapPicExtRefView = m_cMapPicExtRefView.begin();
    851903  while ( iterMapPicExtRefView != m_cMapPicExtRefView.end() )
     
    861913    iterMapPicExtRefView++;
    862914  }
    863 //GT VSO end
     915#endif
    864916}
    865917
     
    920972TComPicYuv* TAppEncTop::xGetPicYuvFromView( Int iViewIdx, Int iPoc, Bool bDepth, Bool bRecon )
    921973{
    922   TComPic*    pcPic = xGetPicFromView( iViewIdx, iPoc, bDepth); 
    923   TComPicYuv* pcPicYuv = NULL; 
     974  TComPic*    pcPic = xGetPicFromView( iViewIdx, iPoc, bDepth);
     975  TComPicYuv* pcPicYuv = NULL;
    924976
    925977  if (pcPic != NULL)
     
    929981      if ( pcPic->getReconMark() )
    930982      {
    931         pcPicYuv = pcPic->getPicYuvRec(); 
     983        pcPicYuv = pcPic->getPicYuvRec();
    932984      }
    933985    }
    934986    else
    935987    {
    936       pcPicYuv = pcPic->getPicYuvOrg(); 
    937     }   
     988      pcPicYuv = pcPic->getPicYuvOrg();
     989    }
    938990  };
    939991
    940   return pcPicYuv;
    941 };
    942 
     992  return pcPicYuv;
     993};
     994
     995#if HHI_VSO
    943996Void TAppEncTop::xSetBasePicYuv( Int iViewIdx, Int iPoc, TComMVDRefData* pcRefInfo, InterViewReference eView, bool bDepth )
    944997{
     
    9751028  }
    9761029
    977 //GT campara
     1030
    9781031  xSetBaseLUT       (iViewIdx, iViewIdx-1  , pcMVDRefData, PREVVIEW );
    9791032  xSetBaseLUT       (iViewIdx, iViewIdx+1  , pcMVDRefData, NEXTVIEW );
    980 //GT campara end
    981 
    982 //GT VSO
     1033
     1034
    9831035  if ( m_bUseVSO && m_uiVSOMode != 4)
    9841036  {
     
    9871039    pcMVDRefData->setRefViewInd     (m_aaiBaseViewRefInd[iViewIdx], m_aaiERViewRefInd[iViewIdx], m_aaiERViewRefLutInd[iViewIdx]);
    9881040  }
    989 //GT VSO end
    990 
    9911041};
    9921042
    993 //GT campara
     1043
    9941044Void TAppEncTop::xSetBaseLUT( Int iViewIdxSource, Int iViewIdxTarget, TComMVDRefData* pcRefInfo, InterViewReference eView )
    9951045{
     
    9991049  pcRefInfo->setShiftLUTsBaseView(eView, m_cCameraData.getBaseViewShiftLUTD()[iViewIdxSource][iViewIdxTarget],m_cCameraData.getBaseViewShiftLUTI()[iViewIdxSource][iViewIdxTarget] );
    10001050};
    1001 //GT campara end
    1002 
    1003 
    1004 //GT VSO
     1051
    10051052Void TAppEncTop::xSetERPicYuvs( Int iViewIdx, Int iPoc, TComMVDRefData* pcReferenceInfo )
    10061053{
     
    10141061  pcReferenceInfo->setPicYuvERViews( cMapIt->second );
    10151062}
    1016 
    1017 
    10181063
    10191064Void TAppEncTop::xStoreVSORefPicsInBuffer()
     
    11301175  }
    11311176}
    1132 // GT VSO end
    1133 
     1177#endif
     1178
     1179#if HHI_INTERVIEW_SKIP
    11341180Void TAppEncTop::getUsedPelsMap( Int iViewIdx, Int iPoc, TComPicYuv* pcPicYuvUsedSplsMap )
    11351181{
    1136   AOT( iViewIdx <= 0); 
    1137   AOT( iViewIdx >= m_iNumberOfViews ); 
    1138   AOF( m_bOmitUnusedBlocks );
    1139   AOF( m_cCameraData.getCurFrameId() == iPoc ); 
    1140 
    1141   Int iViewSIdx      = m_cCameraData.getBaseId2SortedId()[iViewIdx]; 
    1142   Int iFirstViewSIdx = m_cCameraData.getBaseId2SortedId()[0]; 
     1182  AOT( iViewIdx <= 0);
     1183  AOT( iViewIdx >= m_iNumberOfViews );
     1184  AOF( m_uiInterViewSkip != 0 );
     1185  AOF( m_cCameraData.getCurFrameId() == iPoc );
     1186
     1187  Int iViewSIdx      = m_cCameraData.getBaseId2SortedId()[iViewIdx];
     1188  Int iFirstViewSIdx = m_cCameraData.getBaseId2SortedId()[0];
    11431189
    11441190  AOT( iViewSIdx == iFirstViewSIdx );
    11451191
    1146   Bool bFirstIsLeft = (iFirstViewSIdx < iViewSIdx); 
     1192  Bool bFirstIsLeft = (iFirstViewSIdx < iViewSIdx);
    11471193
    11481194    m_cUsedPelsRenderer.setShiftLUTs(
     
    11541200      m_cCameraData.getBaseViewShiftLUTI()[0][iViewIdx],
    11551201      -1
    1156       ); 
    1157  
     1202      );
     1203
    11581204
    11591205  TComPicYuv* pcPicYuvDepth = xGetPicYuvFromView(0, iPoc, true, true );
    1160   AOF( pcPicYuvDepth);
    1161 
    1162   m_cUsedPelsRenderer.getUsedSamplesMap( pcPicYuvDepth, pcPicYuvUsedSplsMap, bFirstIsLeft );
    1163 
    1164 }
    1165 
     1206  AOF( pcPicYuvDepth);
     1207
     1208  m_cUsedPelsRenderer.getUsedSamplesMap( pcPicYuvDepth, pcPicYuvUsedSplsMap, bFirstIsLeft );
     1209
     1210}
     1211#endif
     1212
     1213#if HHI_VSO
    11661214Void TAppEncTop::setupRenModel( Int iPoc, Int iEncViewIdx, Int iEncContent )
    11671215{
    1168   Int iEncViewSIdx = m_cCameraData.getBaseId2SortedId()[ iEncViewIdx ]; 
     1216  Int iEncViewSIdx = m_cCameraData.getBaseId2SortedId()[ iEncViewIdx ];
    11691217
    11701218  // setup base views
    1171   Int iNumOfBV = m_cRenModStrParser.getNumOfBaseViewsForView( iEncViewSIdx, iEncContent );         
     1219  Int iNumOfBV = m_cRenModStrParser.getNumOfBaseViewsForView( iEncViewSIdx, iEncContent );
    11721220
    11731221  for (Int iCurView = 0; iCurView < iNumOfBV; iCurView++ )
    1174   {       
    1175     Int iBaseViewSIdx;
    1176     Int iVideoDistMode;
    1177     Int iDepthDistMode;
    1178 
    1179     m_cRenModStrParser.getBaseViewData( iEncViewSIdx, iEncContent, iCurView, iBaseViewSIdx, iVideoDistMode, iDepthDistMode );
    1180 
    1181     AOT( iVideoDistMode < 0 || iVideoDistMode > 2 );
    1182 
    1183     Int iBaseViewIdx = m_cCameraData.getBaseSortedId2Id()[ iBaseViewSIdx ];
    1184 
    1185     TComPicYuv* pcPicYuvVideoRec  = xGetPicYuvFromView( iBaseViewIdx, iPoc, false, true  );
    1186     TComPicYuv* pcPicYuvDepthRec  = xGetPicYuvFromView( iBaseViewIdx, iPoc, true , true  ); 
    1187     TComPicYuv* pcPicYuvVideoOrg  = xGetPicYuvFromView( iBaseViewIdx, iPoc, false, false );
    1188     TComPicYuv* pcPicYuvDepthOrg  = xGetPicYuvFromView( iBaseViewIdx, iPoc, true , false ); 
    1189                                
    1190     TComPicYuv* pcPicYuvVideoRef  = ( iVideoDistMode == 2 ) ? pcPicYuvVideoOrg  : NULL;       
    1191     TComPicYuv* pcPicYuvDepthRef  = ( iDepthDistMode == 2 ) ? pcPicYuvDepthOrg  : NULL;   
    1192          
    1193     TComPicYuv* pcPicYuvVideoTest = ( iVideoDistMode == 0 ) ? pcPicYuvVideoOrg  : pcPicYuvVideoRec;
    1194     TComPicYuv* pcPicYuvDepthTest = ( iDepthDistMode == 0 ) ? pcPicYuvDepthOrg  : pcPicYuvDepthRec;
    1195 
    1196     AOT( (iVideoDistMode == 2) != (pcPicYuvVideoRef != NULL) );
    1197     AOT( (iDepthDistMode == 2) != (pcPicYuvDepthRef != NULL) );     
    1198     AOT( pcPicYuvDepthTest == NULL );
    1199     AOT( pcPicYuvVideoTest == NULL );
    1200 
    1201     m_cRendererModel.setBaseView( iBaseViewSIdx, pcPicYuvVideoTest, pcPicYuvDepthTest, pcPicYuvVideoRef, pcPicYuvDepthRef );
    1202 #if GERHARD_RM_DEBUG_MM
    1203     m_cMMCheckModel .setBaseView( iBaseViewSIdx, pcPicYuvVideoTest, pcPicYuvDepthTest, pcPicYuvVideoRef, pcPicYuvDepthRef );
    1204 #endif
    1205   }
    1206 
    1207   m_cRendererModel.setErrorMode( iEncViewSIdx, iEncContent, 0 );
    1208 #if GERHARD_RM_DEBUG_MM
    1209   m_cMMCheckModel .setErrorMode( iEncViewSIdx, iEncContent, 0 );
    1210 #endif
    1211 
     1222  {
     1223    Int iBaseViewSIdx;
     1224    Int iVideoDistMode;
     1225    Int iDepthDistMode;
     1226
     1227    m_cRenModStrParser.getBaseViewData( iEncViewSIdx, iEncContent, iCurView, iBaseViewSIdx, iVideoDistMode, iDepthDistMode );
     1228
     1229    AOT( iVideoDistMode < 0 || iVideoDistMode > 2 );
     1230
     1231    Int iBaseViewIdx = m_cCameraData.getBaseSortedId2Id()[ iBaseViewSIdx ];
     1232
     1233    TComPicYuv* pcPicYuvVideoRec  = xGetPicYuvFromView( iBaseViewIdx, iPoc, false, true  );
     1234    TComPicYuv* pcPicYuvDepthRec  = xGetPicYuvFromView( iBaseViewIdx, iPoc, true , true  );
     1235    TComPicYuv* pcPicYuvVideoOrg  = xGetPicYuvFromView( iBaseViewIdx, iPoc, false, false );
     1236    TComPicYuv* pcPicYuvDepthOrg  = xGetPicYuvFromView( iBaseViewIdx, iPoc, true , false );
     1237
     1238    TComPicYuv* pcPicYuvVideoRef  = ( iVideoDistMode == 2 ) ? pcPicYuvVideoOrg  : NULL;
     1239    TComPicYuv* pcPicYuvDepthRef  = ( iDepthDistMode == 2 ) ? pcPicYuvDepthOrg  : NULL;
     1240
     1241    TComPicYuv* pcPicYuvVideoTest = ( iVideoDistMode == 0 ) ? pcPicYuvVideoOrg  : pcPicYuvVideoRec;
     1242    TComPicYuv* pcPicYuvDepthTest = ( iDepthDistMode == 0 ) ? pcPicYuvDepthOrg  : pcPicYuvDepthRec;
     1243
     1244    AOT( (iVideoDistMode == 2) != (pcPicYuvVideoRef != NULL) );
     1245    AOT( (iDepthDistMode == 2) != (pcPicYuvDepthRef != NULL) );
     1246    AOT( pcPicYuvDepthTest == NULL );
     1247    AOT( pcPicYuvVideoTest == NULL );
     1248
     1249    m_cRendererModel.setBaseView( iBaseViewSIdx, pcPicYuvVideoTest, pcPicYuvDepthTest, pcPicYuvVideoRef, pcPicYuvDepthRef );
     1250  }
     1251
     1252  m_cRendererModel.setErrorMode( iEncViewSIdx, iEncContent, 0 );
    12121253  // setup virtual views
    1213   Int iNumOfSV  = m_cRenModStrParser.getNumOfModelsForView( iEncViewSIdx, iEncContent );     
     1254  Int iNumOfSV  = m_cRenModStrParser.getNumOfModelsForView( iEncViewSIdx, iEncContent );
    12141255  for (Int iCurView = 0; iCurView < iNumOfSV; iCurView++ )
    1215   { 
    1216     Int iOrgRefBaseViewSIdx; 
    1217     Int iLeftBaseViewSIdx; 
    1218     Int iRightBaseViewSIdx; 
    1219     Int iSynthViewRelNum; 
    1220     Int iModelNum; 
    1221     Int iBlendMode; 
    1222     m_cRenModStrParser.getSingleModelData(iEncViewSIdx, iEncContent, iCurView, iModelNum, iBlendMode,iLeftBaseViewSIdx, iRightBaseViewSIdx, iOrgRefBaseViewSIdx, iSynthViewRelNum ); 
    1223 
    1224     Int iLeftBaseViewIdx    = -1;   
    1225     Int iRightBaseViewIdx   = -1;       
    1226 
    1227     TComPicYuv* pcPicYuvOrgRef  = NULL; 
    1228     Int**      ppiShiftLUTLeft  = NULL; 
    1229     Int**      ppiShiftLUTRight = NULL;       
    1230     Int**      ppiBaseShiftLUTLeft  = NULL; 
    1231     Int**      ppiBaseShiftLUTRight = NULL;       
    1232 
    1233 
    1234     Int        iDistToLeft      = -1; 
    1235 
    1236     Int iSynthViewIdx = m_cCameraData.synthRelNum2Idx( iSynthViewRelNum ); 
     1256  {
     1257    Int iOrgRefBaseViewSIdx;
     1258    Int iLeftBaseViewSIdx;
     1259    Int iRightBaseViewSIdx;
     1260    Int iSynthViewRelNum;
     1261    Int iModelNum;
     1262    Int iBlendMode;
     1263    m_cRenModStrParser.getSingleModelData(iEncViewSIdx, iEncContent, iCurView, iModelNum, iBlendMode,iLeftBaseViewSIdx, iRightBaseViewSIdx, iOrgRefBaseViewSIdx, iSynthViewRelNum );
     1264
     1265    Int iLeftBaseViewIdx    = -1;
     1266    Int iRightBaseViewIdx   = -1;
     1267
     1268    TComPicYuv* pcPicYuvOrgRef  = NULL;
     1269    Int**      ppiShiftLUTLeft  = NULL;
     1270    Int**      ppiShiftLUTRight = NULL;
     1271    Int**      ppiBaseShiftLUTLeft  = NULL;
     1272    Int**      ppiBaseShiftLUTRight = NULL;
     1273
     1274
     1275    Int        iDistToLeft      = -1;
     1276
     1277    Int iSynthViewIdx = m_cCameraData.synthRelNum2Idx( iSynthViewRelNum );
    12371278
    12381279    if ( iLeftBaseViewSIdx != -1 )
    12391280    {
    1240       iLeftBaseViewIdx   = m_cCameraData.getBaseSortedId2Id()   [ iLeftBaseViewSIdx ]; 
     1281      iLeftBaseViewIdx   = m_cCameraData.getBaseSortedId2Id()   [ iLeftBaseViewSIdx ];
    12411282      ppiShiftLUTLeft    = m_cCameraData.getSynthViewShiftLUTI()[ iLeftBaseViewIdx  ][ iSynthViewIdx  ];
    12421283    }
     
    12441285    if ( iRightBaseViewSIdx != -1 )
    12451286    {
    1246       iRightBaseViewIdx  = m_cCameraData.getBaseSortedId2Id()   [iRightBaseViewSIdx ]; 
     1287      iRightBaseViewIdx  = m_cCameraData.getBaseSortedId2Id()   [iRightBaseViewSIdx ];
    12471288      ppiShiftLUTRight   = m_cCameraData.getSynthViewShiftLUTI()[ iRightBaseViewIdx ][ iSynthViewIdx ];
    12481289    }
    12491290
    12501291    if ( iRightBaseViewSIdx != -1 && iLeftBaseViewSIdx != -1 )
    1251     { 
    1252       iDistToLeft    = m_cCameraData.getRelDistLeft(  iSynthViewIdx , iLeftBaseViewIdx, iRightBaseViewIdx); 
     1292    {
     1293      iDistToLeft    = m_cCameraData.getRelDistLeft(  iSynthViewIdx , iLeftBaseViewIdx, iRightBaseViewIdx);
    12531294      ppiBaseShiftLUTLeft  = m_cCameraData.getBaseViewShiftLUTI() [ iLeftBaseViewIdx  ][ iRightBaseViewIdx ];
    12541295      ppiBaseShiftLUTRight = m_cCameraData.getBaseViewShiftLUTI() [ iRightBaseViewIdx ][ iLeftBaseViewIdx  ];
     
    12581299    if ( iOrgRefBaseViewSIdx != -1 )
    12591300    {
    1260       pcPicYuvOrgRef = xGetPicYuvFromView( m_cCameraData.getBaseSortedId2Id()[ iOrgRefBaseViewSIdx ] , iPoc, false, false );
    1261       AOF ( pcPicYuvOrgRef );
    1262     }     
    1263 
    1264     m_cRendererModel.setSingleModel( iModelNum, ppiShiftLUTLeft, ppiBaseShiftLUTLeft, ppiShiftLUTRight, ppiBaseShiftLUTRight, iDistToLeft, pcPicYuvOrgRef );
    1265 #if GERHARD_RM_DEBUG_MM
    1266     m_cMMCheckModel .setSingleModel( iModelNum, ppiShiftLUTLeft, ppiBaseShiftLUTLeft, ppiShiftLUTRight, ppiBaseShiftLUTRight, iDistToLeft, pcPicYuvOrgRef );
    1267 #endif
    1268   }
    1269 }
    1270 
    1271 // GT VSO end
     1301      pcPicYuvOrgRef = xGetPicYuvFromView( m_cCameraData.getBaseSortedId2Id()[ iOrgRefBaseViewSIdx ] , iPoc, false, false );
     1302      AOF ( pcPicYuvOrgRef );
     1303    }
     1304
     1305    m_cRendererModel.setSingleModel( iModelNum, ppiShiftLUTLeft, ppiBaseShiftLUTLeft, ppiShiftLUTRight, ppiBaseShiftLUTRight, iDistToLeft, pcPicYuvOrgRef );
     1306  }
     1307}
     1308#endif
     1309
Note: See TracChangeset for help on using the changeset viewer.