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


Ignore:
Timestamp:
13 Nov 2015, 16:29:39 (9 years ago)
Author:
tech
Message:

Merged 15.1-dev1@1381.

File:
1 edited

Legend:

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

    r1356 r1386  
    147147#if NH_3D
    148148  xSetCamPara              ( vps );
     149#endif
     150#if NH_3D_VSO
    149151  m_ivPicLists.setVPS      ( &vps );
    150152#endif
     
    186188  for (Int d = 0; d < 2; d++)
    187189  { 
    188     m_sps3dExtension.setIvMvPredFlag          ( d, m_ivMvPredFlag[d]       );
    189     m_sps3dExtension.setIvMvScalingFlag       ( d, m_ivMvScalingFlag[d]    );
     190    m_sps3dExtension.setIvDiMcEnabledFlag          ( d, m_ivMvPredFlag[d]       );
     191    m_sps3dExtension.setIvMvScalEnabledFlag       ( d, m_ivMvScalingFlag[d]    );
    190192    if (d == 0 )
    191193    {   
    192       m_sps3dExtension.setLog2SubPbSizeMinus3   ( d, m_log2SubPbSizeMinus3   );
    193       m_sps3dExtension.setIvResPredFlag         ( d, m_ivResPredFlag         );
    194       m_sps3dExtension.setDepthRefinementFlag   ( d, m_depthRefinementFlag   );
    195       m_sps3dExtension.setViewSynthesisPredFlag ( d, m_viewSynthesisPredFlag );
    196       m_sps3dExtension.setDepthBasedBlkPartFlag ( d, m_depthBasedBlkPartFlag );
     194      m_sps3dExtension.setLog2IvmcSubPbSizeMinus3   ( d, m_log2SubPbSizeMinus3   );
     195      m_sps3dExtension.setIvResPredEnabledFlag         ( d, m_ivResPredFlag         );
     196      m_sps3dExtension.setDepthRefEnabledFlag   ( d, m_depthRefinementFlag   );
     197      m_sps3dExtension.setVspMcEnabledFlag ( d, m_viewSynthesisPredFlag );
     198      m_sps3dExtension.setDbbpEnabledFlag ( d, m_depthBasedBlkPartFlag );
    197199    }
    198200    else
    199201    {   
    200       m_sps3dExtension.setMpiFlag               ( d, m_mpiFlag               );
    201       m_sps3dExtension.setLog2MpiSubPbSizeMinus3( d, m_log2MpiSubPbSizeMinus3);
    202       m_sps3dExtension.setIntraContourFlag      ( d, m_intraContourFlag      );
    203       m_sps3dExtension.setIntraSdcWedgeFlag     ( d, m_intraSdcFlag || m_intraWedgeFlag     );
    204       m_sps3dExtension.setQtPredFlag            ( d, m_qtPredFlag            );
    205       m_sps3dExtension.setInterSdcFlag          ( d, m_interSdcFlag          );
    206       m_sps3dExtension.setDepthIntraSkipFlag    ( d, m_depthIntraSkipFlag    ); 
     202      m_sps3dExtension.setTexMcEnabledFlag               ( d, m_mpiFlag               );
     203      m_sps3dExtension.setLog2TexmcSubPbSizeMinus3( d, m_log2MpiSubPbSizeMinus3);
     204      m_sps3dExtension.setIntraContourEnabledFlag      ( d, m_intraContourFlag      );
     205      m_sps3dExtension.setIntraDcOnlyWedgeEnabledFlag     ( d, m_intraSdcFlag || m_intraWedgeFlag     );
     206      m_sps3dExtension.setCqtCuPartPredEnabledFlag            ( d, m_qtPredFlag            );
     207      m_sps3dExtension.setInterDcOnlyEnabledFlag          ( d, m_interSdcFlag          );
     208      m_sps3dExtension.setSkipIntraEnabledFlag    ( d, m_depthIntraSkipFlag    ); 
    207209    }
    208210  }
     
    276278    m_cTEncTop.setViewId                       ( vps.getViewId      (  layerId ) );
    277279    m_cTEncTop.setViewIndex                    ( vps.getViewIndex   (  layerId ) );
    278 #if NH_3D
    279     Bool isDepth = ( vps.getDepthId     ( layerId ) != 0 ) ;
    280     m_cTEncTop.setIsDepth                      ( isDepth );
     280#if NH_3D_VSO
     281    Bool isDepth    = ( vps.getDepthId     ( layerId ) != 0  ) ;
     282    Bool isAuxDepth = ( vps.getAuxId       ( layerId ) ==  2 ) ; // TBD: define 2 as AUX_DEPTH
     283    m_cTEncTop.setIsDepth                  ( isDepth    );
     284    m_cTEncTop.setIsAuxDepth               ( isAuxDepth );
    281285    //====== Camera Parameters =========
    282286    m_cTEncTop.setCameraParameters             ( &m_cCameraData );     
    283 #if NH_3D_VSO
    284287    //====== VSO =========
    285288    m_cTEncTop.setRenderModelParameters        ( &m_cRenModStrParser );
    286     m_cTEncTop.setForceLambdaScaleVSO          ( isDepth ? m_bForceLambdaScaleVSO : false );
    287     m_cTEncTop.setLambdaScaleVSO               ( isDepth ? m_dLambdaScaleVSO      : 1     );
    288     m_cTEncTop.setVSOMode                      ( isDepth ? m_uiVSOMode            : 0     );
    289 
    290     m_cTEncTop.setAllowNegDist                 ( isDepth ? m_bAllowNegDist        : false );
     289    m_cTEncTop.setForceLambdaScaleVSO          ( isDepth || isAuxDepth ? m_bForceLambdaScaleVSO : false );
     290    m_cTEncTop.setLambdaScaleVSO               ( isDepth || isAuxDepth ? m_dLambdaScaleVSO      : 1     );
     291    m_cTEncTop.setVSOMode                      ( isDepth || isAuxDepth ? m_uiVSOMode            : 0     );
     292
     293    m_cTEncTop.setAllowNegDist                 ( isDepth || isAuxDepth ? m_bAllowNegDist        : false );
    291294
    292295    // SAIT_VSO_EST_A0033
    293     m_cTEncTop.setUseEstimatedVSD              ( isDepth ? m_bUseEstimatedVSD     : false );
     296    m_cTEncTop.setUseEstimatedVSD              ( isDepth || isAuxDepth ? m_bUseEstimatedVSD     : false );
    294297
    295298    // LGE_WVSO_A0119
    296     m_cTEncTop.setUseWVSO                      ( isDepth ? m_bUseWVSO             : false );   
    297     m_cTEncTop.setVSOWeight                    ( isDepth ? m_iVSOWeight           : 0     );
    298     m_cTEncTop.setVSDWeight                    ( isDepth ? m_iVSDWeight           : 0     );
    299     m_cTEncTop.setDWeight                      ( isDepth ? m_iDWeight             : 0     );
     299    m_cTEncTop.setUseWVSO                      ( isDepth || isAuxDepth ? m_bUseWVSO             : false );   
     300    m_cTEncTop.setVSOWeight                    ( isDepth || isAuxDepth ? m_iVSOWeight           : 0     );
     301    m_cTEncTop.setVSDWeight                    ( isDepth || isAuxDepth ? m_iVSDWeight           : 0     );
     302    m_cTEncTop.setDWeight                      ( isDepth || isAuxDepth ? m_iDWeight             : 0     );
    300303#endif // H_3D_VSO
     304#if NH_3D
    301305#if NH_3D_IC
    302306    m_cTEncTop.setUseIC                        ( vps.getViewIndex( layerId ) == 0 || isDepth ? false : m_abUseIC );
     
    308312    m_cTEncTop.setUseSDC                       ( isDepth ? m_intraSdcFlag     : false );
    309313    m_cTEncTop.setUseDLT                       ( isDepth ? m_useDLT   : false );
    310     m_cTEncTop.setUseQTL                       ( isDepth ? m_bUseQTL  : false );
     314#endif
     315#if NH_3D_QTL
     316    m_cTEncTop.setUseQTL                       ( isDepth || isAuxDepth ? m_bUseQTL  : false );
     317#endif
     318#if NH_3D
    311319    m_cTEncTop.setSps3dExtension               ( m_sps3dExtension );
    312320#endif // NH_3D
     
    378386    m_cTEncTop.setLambdaModifier                                  ( uiLoop, m_adLambdaModifier[ uiLoop ] );
    379387  }
     388  m_cTEncTop.setIntraLambdaModifier                               ( m_adIntraLambdaModifier );
     389  m_cTEncTop.setIntraQpFactor                                     ( m_dIntraQpFactor );
     390
    380391#if NH_MV
    381392  m_cTEncTop.setQP                                                ( m_iQP[layerIdInVps] );
     
    385396
    386397  m_cTEncTop.setPad                                               ( m_aiPad );
    387 
     398  m_cTEncTop.setAccessUnitDelimiter                               ( m_AccessUnitDelimiter );
    388399#if NH_MV
    389400  m_cTEncTop.setMaxTempLayer                                      ( m_maxTempLayerMvc[layerIdInVps] );
     
    408419  //====== Motion search ========
    409420  m_cTEncTop.setDisableIntraPUsInInterSlices                      ( m_bDisableIntraPUsInInterSlices );
    410   m_cTEncTop.setFastSearch                                        ( m_iFastSearch  );
     421  m_cTEncTop.setMotionEstimationSearchMethod                      ( m_motionEstimationSearchMethod  );
    411422  m_cTEncTop.setSearchRange                                       ( m_iSearchRange );
    412423  m_cTEncTop.setBipredSearchRange                                 ( m_bipredSearchRange );
    413424  m_cTEncTop.setClipForBiPredMeEnabled                            ( m_bClipForBiPredMeEnabled );
    414425  m_cTEncTop.setFastMEAssumingSmootherMVEnabled                   ( m_bFastMEAssumingSmootherMVEnabled );
     426  m_cTEncTop.setMinSearchWindow                                   ( m_minSearchWindow );
     427  m_cTEncTop.setRestrictMESampling                                ( m_bRestrictMESampling );
    415428
    416429#if NH_MV
     
    439452  m_cTEncTop.setExtendedPrecisionProcessingFlag                   ( m_extendedPrecisionProcessingFlag );
    440453  m_cTEncTop.setHighPrecisionOffsetsEnabledFlag                   ( m_highPrecisionOffsetsEnabledFlag );
     454
     455  m_cTEncTop.setWeightedPredictionMethod( m_weightedPredictionMethod );
     456
    441457  //====== Tool list ========
    442458  m_cTEncTop.setDeltaQpRD                                         ( m_uiDeltaQpRD  );
     
    463479  m_cTEncTop.setQuadtreeTUMaxDepthInter                           ( m_uiQuadtreeTUMaxDepthInter );
    464480  m_cTEncTop.setQuadtreeTUMaxDepthIntra                           ( m_uiQuadtreeTUMaxDepthIntra );
    465   m_cTEncTop.setUseFastEnc                                        ( m_bUseFastEnc );
     481  m_cTEncTop.setFastInterSearchMode                               ( m_fastInterSearchMode );
    466482  m_cTEncTop.setUseEarlyCU                                        ( m_bUseEarlyCU  );
    467483  m_cTEncTop.setUseFastDecisionForMerge                           ( m_useFastDecisionForMerge  );
     
    513529
    514530  //====== Slice ========
    515   m_cTEncTop.setSliceMode                                         ( (SliceConstraint) m_sliceMode );
     531  m_cTEncTop.setSliceMode                                         ( m_sliceMode );
    516532  m_cTEncTop.setSliceArgument                                     ( m_sliceArgument            );
    517533
    518534  //====== Dependent Slice ========
    519   m_cTEncTop.setSliceSegmentMode                                  (  (SliceConstraint) m_sliceSegmentMode );
     535  m_cTEncTop.setSliceSegmentMode                                  ( m_sliceSegmentMode );
    520536  m_cTEncTop.setSliceSegmentArgument                              ( m_sliceSegmentArgument     );
    521537
     
    540556
    541557  m_cTEncTop.setIntraSmoothingDisabledFlag                        (!m_enableIntraReferenceSmoothing );
    542   m_cTEncTop.setDecodedPictureHashSEIEnabled                      ( m_decodedPictureHashSEIEnabled );
     558  m_cTEncTop.setDecodedPictureHashSEIType                         ( m_decodedPictureHashSEIType );
    543559  m_cTEncTop.setRecoveryPointSEIEnabled                           ( m_recoveryPointSEIEnabled );
    544560  m_cTEncTop.setBufferingPeriodSEIEnabled                         ( m_bufferingPeriodSEIEnabled );
     
    571587  m_cTEncTop.setTMISEINominalWhiteLevelLumaCodeValue              ( m_nominalWhiteLevelLumaCodeValue );
    572588  m_cTEncTop.setTMISEIExtendedWhiteLevelLumaCodeValue             ( m_extendedWhiteLevelLumaCodeValue );
    573   m_cTEncTop.setChromaSamplingFilterHintEnabled                   ( m_chromaSamplingFilterSEIenabled );
    574   m_cTEncTop.setChromaSamplingHorFilterIdc                        ( m_chromaSamplingHorFilterIdc );
    575   m_cTEncTop.setChromaSamplingVerFilterIdc                        ( m_chromaSamplingVerFilterIdc );
     589  m_cTEncTop.setChromaResamplingFilterHintEnabled                 ( m_chromaResamplingFilterSEIenabled );
     590  m_cTEncTop.setChromaResamplingHorFilterIdc                      ( m_chromaResamplingHorFilterIdc );
     591  m_cTEncTop.setChromaResamplingVerFilterIdc                      ( m_chromaResamplingVerFilterIdc );
    576592  m_cTEncTop.setFramePackingArrangementSEIEnabled                 ( m_framePackingSEIEnabled );
    577593  m_cTEncTop.setFramePackingArrangementSEIType                    ( m_framePackingSEIType );
     
    590606  m_cTEncTop.setSOPDescriptionSEIEnabled                          ( m_SOPDescriptionSEIEnabled );
    591607  m_cTEncTop.setScalableNestingSEIEnabled                         ( m_scalableNestingSEIEnabled );
    592 #if NH_MV
    593 #if !NH_MV_SEI
    594   m_cTEncTop.setSubBitstreamPropSEIEnabled                        ( m_subBistreamPropSEIEnabled );
    595   if( m_subBistreamPropSEIEnabled )                               
    596   {                                                               
    597     m_cTEncTop.setNumAdditionalSubStreams                         ( m_sbPropNumAdditionalSubStreams );
    598     m_cTEncTop.setSubBitstreamMode                                ( m_sbPropSubBitstreamMode );
    599     m_cTEncTop.setOutputLayerSetIdxToVps                          ( m_sbPropOutputLayerSetIdxToVps );
    600     m_cTEncTop.setHighestSublayerId                               ( m_sbPropHighestSublayerId );
    601     m_cTEncTop.setAvgBitRate                                      ( m_sbPropAvgBitRate );
    602     m_cTEncTop.setMaxBitRate                                      ( m_sbPropMaxBitRate );
    603   }
    604 #endif
    605 #endif
    606 
    607608  m_cTEncTop.setTMCTSSEIEnabled                                   ( m_tmctsSEIEnabled );
    608609  m_cTEncTop.setTimeCodeSEIEnabled                                ( m_timeCodeSEIEnabled );
     
    623624  m_cTEncTop.setKneeSEIInputKneePoint                             ( m_kneeSEIInputKneePoint );
    624625  m_cTEncTop.setKneeSEIOutputKneePoint                            ( m_kneeSEIOutputKneePoint );
     626  m_cTEncTop.setColourRemapInfoSEIFileRoot                        ( m_colourRemapSEIFileRoot );
    625627  m_cTEncTop.setMasteringDisplaySEI                               ( m_masteringDisplay );
    626628
    627 #if NH_MV_SEI
     629#if NH_MV
    628630  m_cTEncTop.setSeiMessages                                       ( &m_seiMessages );
    629631#endif
     
    644646  }
    645647  m_cTEncTop.setLFCrossTileBoundaryFlag                           ( m_bLFCrossTileBoundaryFlag );
    646   m_cTEncTop.setWaveFrontSynchro                                  ( m_iWaveFrontSynchro );
     648  m_cTEncTop.setEntropyCodingSyncEnabledFlag                      ( m_entropyCodingSyncEnabledFlag );
    647649  m_cTEncTop.setTMVPModeId                                        ( m_TMVPModeId );
    648650  m_cTEncTop.setUseScalingListId                                  ( m_useScalingListId  );
    649   m_cTEncTop.setScalingListFile                                   ( m_scalingListFile  );
     651  m_cTEncTop.setScalingListFileName                               ( m_scalingListFileName );
    650652  m_cTEncTop.setSignHideFlag                                      ( m_signHideFlag);
    651653#if KWU_RC_VIEWRC_E0227 || KWU_RC_MADPRED_E0227
     
    669671  m_cTEncTop.setInitialQP                                         ( m_RCInitialQP );
    670672  m_cTEncTop.setForceIntraQP                                      ( m_RCForceIntraQP );
     673#if U0132_TARGET_BITS_SATURATION
     674  m_cTEncTop.setCpbSaturationEnabled                              ( m_RCCpbSaturationEnabled );
     675  m_cTEncTop.setCpbSize                                           ( m_RCCpbSize );
     676  m_cTEncTop.setInitialCpbFullness                                ( m_RCInitialCpbFullness );
     677#endif
     678
    671679#if KWU_RC_MADPRED_E0227
    672680  if(m_cTEncTop.getUseRateCtrl() && !m_cTEncTop.getIsDepth())
     
    796804        TEncTop* pcEncTop =  m_acTEncTopList[ layer ];
    797805        Int iViewNum      = pcEncTop->getViewIndex();
    798         Int iContent      = pcEncTop->getIsDepth() ? 1 : 0;
     806        Int iContent      = pcEncTop->getIsDepth() || pcEncTop->getIsAuxDepth() ? 1 : 0;
    799807        Int iNumOfModels  = m_cRenModStrParser.getNumOfModelsForView(iViewNum, iContent);
    800808
     
    843851#else
    844852  // Video I/O
    845   m_cTVideoIOYuvInputFile.open( m_pchInputFile,     false, m_inputBitDepth, m_MSBExtendedBitDepth, m_internalBitDepth );  // read  mode
     853  m_cTVideoIOYuvInputFile.open( m_inputFileName,     false, m_inputBitDepth, m_MSBExtendedBitDepth, m_internalBitDepth );  // read  mode
    846854  m_cTVideoIOYuvInputFile.skipFrames(m_FrameSkip, m_iSourceWidth - m_aiPad[0], m_iSourceHeight - m_aiPad[1], m_InputChromaFormatIDC);
    847855
    848   if (m_pchReconFile)
    849   {
    850     m_cTVideoIOYuvReconFile.open(m_pchReconFile, true, m_outputBitDepth, m_outputBitDepth, m_internalBitDepth);  // write mode
     856  if (!m_reconFileName.empty())
     857  {
     858    m_cTVideoIOYuvReconFile.open(m_reconFileName, true, m_outputBitDepth, m_outputBitDepth, m_internalBitDepth);  // write mode
    851859  }
    852860
     
    917925Void TAppEncTop::encode()
    918926{
    919   fstream bitstreamFile(m_pchBitstreamFile, fstream::binary | fstream::out);
     927  fstream bitstreamFile(m_bitstreamFileName.c_str(), fstream::binary | fstream::out);
    920928  if (!bitstreamFile)
    921929  {
    922     fprintf(stderr, "\nfailed to open bitstream file `%s' for writing\n", m_pchBitstreamFile);
     930    fprintf(stderr, "\nfailed to open bitstream file `%s' for writing\n", m_bitstreamFileName.c_str());
    923931    exit(EXIT_FAILURE);
    924932  }
     
    10281036    for ( Int gopId=0; gopId < gopSize; gopId++ )
    10291037    {
    1030 #if NH_3D
     1038#if NH_3D_VSO
    10311039      UInt iNextPoc = m_acTEncTopList[0] -> getFrameId( gopId );
    10321040      if ( iNextPoc < m_framesToBeEncoded )
     
    11501158  printRateSummary();
    11511159
    1152 #if H_3D_REN_MAX_DEV_OUT
     1160#if NH_3D_REN_MAX_DEV_OUT
    11531161  Double dMaxDispDiff = m_cCameraData.getMaxShiftDeviation();
    11541162
     
    12951303  }
    12961304#else
    1297       if (m_pchReconFile)
     1305      if (!m_reconFileName.empty())
    12981306      {
    12991307        m_cTVideoIOYuvReconFile.write( pcPicYuvRecTop, pcPicYuvRecBottom, ipCSC, m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom, NUM_CHROMA_FORMAT, m_isTopFieldFirst );
     
    13521360  }
    13531361#else
    1354       if (m_pchReconFile)
     1362      if (!m_reconFileName.empty())
    13551363      {
    13561364        m_cTVideoIOYuvReconFile.write( pcPicYuvRec, ipCSC, m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom,
     
    16701678          if( m_depthFlag[ curLayerIdInVps ] && ( m_mpiFlag|| m_qtPredFlag || m_intraContourFlag ) )
    16711679          {         
    1672             Int nuhLayerIdTex = vps.getLayerIdInNuh( vps.getViewIndex( curLayerIdInNuh ), false );
     1680            Int nuhLayerIdTex = vps.getLayerIdInNuh( vps.getViewIndex( curLayerIdInNuh ), false, 0 );
    16731681            if ( nuhLayerIdTex == refLayerIdInNuh )
    16741682            {
     
    16961704                for (Int j = 0; j < geCur.m_numActiveRefLayerPics; j++ )
    16971705                {
    1698                   Int nuhLayerIdDep = vps.getLayerIdInNuh( vps.getViewIndex( vps.getIdRefListLayer( curLayerIdInNuh, geCur.m_interLayerPredLayerIdc[j] ) ), true );
     1706                  Int nuhLayerIdDep = vps.getLayerIdInNuh( vps.getViewIndex( vps.getIdRefListLayer( curLayerIdInNuh, geCur.m_interLayerPredLayerIdc[j] ) ), true, 0 );
    16991707                  if ( nuhLayerIdDep == refLayerIdInNuh )
    17001708                  {
     
    20632071      vps.setLayerIdIncludedFlag( false, lsIdx, layerId );
    20642072    }
    2065     for ( Int i = 0; i < m_layerIdsInSets[lsIdx].size(); i++)
     2073    for ( Int i = 0; i < m_layerIdxInVpsInSets[lsIdx].size(); i++)
    20662074    {       
    2067       vps.setLayerIdIncludedFlag( true, lsIdx, vps.getLayerIdInNuh( m_layerIdsInSets[lsIdx][i] ) );
     2075      vps.setLayerIdIncludedFlag( true, lsIdx, vps.getLayerIdInNuh( m_layerIdxInVpsInSets[lsIdx][i] ) );
    20682076    }
    20692077  }
Note: See TracChangeset for help on using the changeset viewer.