Changeset 467 in SHVCSoftware for branches/SHM-4.0-dev/source/Lib/TLibEncoder


Ignore:
Timestamp:
14 Nov 2013, 00:54:41 (11 years ago)
Author:
seregin
Message:

undelete the code from the previous revision

Location:
branches/SHM-4.0-dev/source/Lib/TLibEncoder
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r466 r467  
    359359  {
    360360    WRITE_FLAG(pcVUI->getTilesFixedStructureFlag(),             "tiles_fixed_structure_flag");
    361 #if M0464_TILE_BOUNDARY_ALIGNED_FLAG
    362     if ( pcSPS->getLayerId() > 0 )
    363     {
    364       WRITE_FLAG( pcVUI->getTileBoundariesAlignedFlag( ) ? 1 : 0 , "tile_boundaries_aligned_flag" );
    365     }
    366 #endif
    367361    WRITE_FLAG(pcVUI->getMotionVectorsOverPicBoundariesFlag(),  "motion_vectors_over_pic_boundaries_flag");
    368362    WRITE_FLAG(pcVUI->getRestrictedRefPicListsFlag(),           "restricted_ref_pic_lists_flag");
     
    454448#endif
    455449  WRITE_CODE( pcSPS->getVPSId (),          4,       "sps_video_parameter_set_id" );
    456 #if SPS_SUB_LAYER_INFO
     450#if SVC_EXTENSION
    457451  if(pcSPS->getLayerId() == 0)
    458452  {
     
    460454    WRITE_CODE( pcSPS->getMaxTLayers() - 1,  3,       "sps_max_sub_layers_minus1" );
    461455    WRITE_FLAG( pcSPS->getTemporalIdNestingFlag() ? 1 : 0,                             "sps_temporal_id_nesting_flag" );
    462 #if SPS_SUB_LAYER_INFO
     456#if SVC_EXTENSION
    463457  }
    464458#endif
     
    670664  WRITE_FLAG( 0, "inter_view_mv_vert_constraint_flag" );
    671665#endif
    672 #if SCALED_REF_LAYER_OFFSETS
    673666  if( pcSPS->getLayerId() > 0 )
    674667  {
     
    683676    }
    684677  }
    685 #endif
    686678#if M0463_VUI_EXT_ILP_REF
    687679  ////   sps_extension_vui_parameters( )
     
    828820}
    829821
     822#if SVC_EXTENSION
    830823#if VPS_EXTNS
    831824Void TEncCavlc::codeVPSExtension (TComVPS *vps)
     
    843836  }
    844837
    845 #if VPS_SPLIT_FLAG
    846838  for(j = 0; j < vps->getNumScalabilityTypes() - vps->getSplittingFlag(); j++)
    847 #else
    848   for(j = 0; j < vps->getNumScalabilityTypes(); j++)
    849 #endif
    850839  {
    851840    WRITE_CODE( vps->getDimensionIdLen(j) - 1, 3,      "dimension_id_len_minus1[j]" );
     
    871860      WRITE_CODE( vps->getLayerIdInNuh(i),     6,      "layer_id_in_nuh[i]" );
    872861    }
    873 #if VPS_SPLIT_FLAG
    874     if(!vps->getSplittingFlag())
    875 #endif
     862
     863    if( !vps->getSplittingFlag() )
     864    {
    876865    for(j = 0; j < vps->getNumScalabilityTypes(); j++)
    877866    {
     
    879868      WRITE_CODE( vps->getDimensionId(i, j),   bits,   "dimension_id[i][j]" );
    880869    }
     870  }
    881871  }
    882872#endif
     
    893883  }
    894884#endif
    895 #if VPS_MOVE_DIR_DEPENDENCY_FLAG
    896885#if VPS_EXTN_DIRECT_REF_LAYERS
    897886  for( Int layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++)
     
    902891    }
    903892  }
    904 #endif
    905893#endif
    906894#if JCTVC_M0203_INTERLAYER_PRED_IDC
     
    926914#if VPS_EXTN_PROFILE_INFO
    927915  // Profile-tier-level signalling
    928 #if VPS_PROFILE_OUTPUT_LAYERS
    929916  WRITE_CODE( vps->getNumLayerSets() - 1   , 10, "vps_number_layer_sets_minus1" );     
    930917  WRITE_CODE( vps->getNumProfileTierLevel() - 1,  6, "vps_num_profile_tier_level_minus1");
    931918  for(Int idx = 1; idx <= vps->getNumProfileTierLevel() - 1; idx++)
    932 #else
    933   for(Int idx = 1; idx <= vps->getNumLayerSets() - 1; idx++)
    934 #endif
    935919  {
    936920    WRITE_FLAG( vps->getProfilePresentFlag(idx),       "vps_profile_present_flag[i]" );
    937921    if( !vps->getProfilePresentFlag(idx) )
    938922    {
    939 #if VPS_PROFILE_OUTPUT_LAYERS
    940923      WRITE_CODE( vps->getProfileLayerSetRef(idx) - 1, 6, "profile_ref_minus1[i]" );
    941 #else
    942       WRITE_UVLC( vps->getProfileLayerSetRef(idx) - 1, "vps_profile_layer_set_ref_minus1[i]" );
    943 #endif
    944924    }
    945925    codePTL( vps->getPTLForExtn(idx), vps->getProfilePresentFlag(idx), vps->getMaxTLayers() - 1 );
     
    947927#endif
    948928
    949 #if VPS_PROFILE_OUTPUT_LAYERS
    950929  Int numOutputLayerSets = vps->getNumOutputLayerSets() ;
    951930  WRITE_FLAG(  (numOutputLayerSets > vps->getNumLayerSets()), "more_output_layer_sets_than_default_flag" );
     
    982961    WRITE_CODE( vps->getProfileLevelTierIdx(i), numBits, "profile_level_tier_idx[i]" );     
    983962  }
    984 #else
    985 #if VPS_EXTN_OP_LAYER_SETS
    986   // Target output layer signalling
    987   WRITE_UVLC( vps->getNumOutputLayerSets(),            "vps_num_output_layer_sets");
    988   for(i = 0; i < vps->getNumOutputLayerSets(); i++)
    989   {
    990 #if VPS_OUTPUT_LAYER_SET_IDX
    991     assert(vps->getOutputLayerSetIdx(i) > 0);
    992     WRITE_UVLC( vps->getOutputLayerSetIdx(i) - 1,           "vps_output_layer_set_idx_minus1[i]");
    993 #else
    994     WRITE_UVLC( vps->getOutputLayerSetIdx(i),           "vps_output_layer_set_idx[i]");
    995 #endif
    996     Int lsIdx = vps->getOutputLayerSetIdx(i);
    997     for(j = 0; j <= vps->getMaxLayerId(); j++)
    998     {
    999       if(vps->getLayerIdIncludedFlag(lsIdx, j))
    1000       {
    1001         WRITE_FLAG( vps->getOutputLayerFlag(lsIdx, j), "vps_output_layer_flag[lsIdx][j]");
    1002       }
    1003     }
    1004   }
    1005 #endif
    1006 #endif
    1007963
    1008964#if REPN_FORMAT_IN_VPS
     
    1040996      WRITE_FLAG(vps->getCrossLayerIrapAlignFlag(), "cross_layer_irap_aligned_flag");
    1041997#endif
    1042 #if !VPS_MOVE_DIR_DEPENDENCY_FLAG
    1043 #if VPS_EXTN_DIRECT_REF_LAYERS
    1044   for( Int layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++)
    1045   {
    1046     for( Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++)
    1047     {
    1048       WRITE_FLAG(vps->getDirectDependencyFlag(layerCtr, refLayerCtr), "direct_dependency_flag[i][j]" );
    1049     }
    1050   }
    1051 #endif
    1052 #endif
    1053998#if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS
    1054999  WRITE_UVLC( vps->getDirectDepTypeLen()-2,                           "direct_dep_type_len_minus2");
     
    11841129}
    11851130#endif
     1131#endif //SVC_EXTENSION
    11861132
    11871133Void TEncCavlc::codeSliceHeader         ( TComSlice* pcSlice )
     
    12291175  if ( !pcSlice->getDependentSliceSegmentFlag() )
    12301176  {
    1231 
     1177#if SVC_EXTENSION
    12321178#if POC_RESET_FLAG
    12331179    Int iBits = 0;
     
    12491195    }
    12501196#else
    1251 #if SH_DISCARDABLE_FLAG
    12521197    if (pcSlice->getPPS()->getNumExtraSliceHeaderBits()>0)
    12531198    {
     
    12601205      WRITE_FLAG(0, "slice_reserved_undetermined_flag[]");
    12611206    }
    1262 #else
     1207#endif
     1208#else //SVC_EXTENSION
    12631209    for (Int i = 0; i < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++)
    12641210    {
     
    12661212      WRITE_FLAG(0, "slice_reserved_undetermined_flag[]");
    12671213    }
    1268 #endif
    1269 #endif
     1214#endif //SVC_EXTENSION
    12701215
    12711216    WRITE_UVLC( pcSlice->getSliceType(),       "slice_type" );
  • branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r466 r467  
    753753    pcSlice->setNalUnitType(getNalUnitType(pocCurr, m_iLastIDR));
    754754#if SVC_EXTENSION
    755 #if ILR_RESTR && ILR_RESTR_FIX
     755    if (m_layerId > 0)
     756    {
    756757    Int interLayerPredLayerIdcTmp[MAX_VPS_LAYER_ID_PLUS1];
    757758    Int activeNumILRRefIdxTmp = 0;
    758 #endif
    759     if (m_layerId > 0)
    760     {
     759
    761760      for( Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ )
    762761      {
     
    769768        pcSlice->setBaseColPic( *cListPic, refLayerIdc );
    770769
    771 #if ILR_RESTR && ILR_RESTR_FIX
    772770        // Apply temporal layer restriction to inter-layer prediction
    773771        Int maxTidIlRefPicsPlus1 = m_pcEncTop->getVPS()->getMaxTidIlRefPicsPlus1(pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getLayerId());
     
    780778          continue; // ILP is not valid due to temporal layer restriction
    781779        }
    782 #endif
    783 
    784 #if SCALED_REF_LAYER_OFFSETS
     780
    785781        const Window &scalEL = m_pcEncTop->getScaledRefLayerWindow(refLayerIdc);
    786782
     
    790786        Int widthEL   = pcPic->getPicYuvRec()->getWidth()  - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset();
    791787        Int heightEL  = pcPic->getPicYuvRec()->getHeight() - scalEL.getWindowTopOffset()  - scalEL.getWindowBottomOffset();
    792 #else
    793         const Window &confBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getConformanceWindow();
    794         const Window &confEL = pcPic->getPicYuvRec()->getConformanceWindow();
    795 
    796         Int widthBL   = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();
    797         Int heightBL  = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();
    798 
    799         Int widthEL   = pcPic->getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset();
    800         Int heightEL  = pcPic->getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset();
    801 #endif
     788
    802789        g_mvScalingFactor[refLayerIdc][0] = widthEL  == widthBL  ? 4096 : Clip3(-4096, 4095, ((widthEL  << 8) + (widthBL  >> 1)) / widthBL);
    803790        g_mvScalingFactor[refLayerIdc][1] = heightEL == heightBL ? 4096 : Clip3(-4096, 4095, ((heightEL << 8) + (heightBL >> 1)) / heightBL);
     
    823810      }
    824811
    825 #if ILR_RESTR && ILR_RESTR_FIX
    826812      // Update the list of active inter-layer pictures
    827813      for ( Int i = 0; i < activeNumILRRefIdxTmp; i++)
     
    835821        pcSlice->setInterLayerPredEnabledFlag(false);
    836822      }
    837 #endif
    838823     
    839824      if( pocCurr % m_pcCfg->getIntraPeriod() == 0 )
     
    16161601          pcSlice->setSliceSegmentCurStartCUAddr  ( startCUAddrSlice      );
    16171602          pcSlice->setSliceBits(0);
     1603#if SVC_EXTENSION
     1604          // copy reference list modification info from the first slice, assuming that this information is the same across all slices in the picture
     1605          memcpy( pcSlice->getRefPicListModification(), pcPic->getSlice(0)->getRefPicListModification(), sizeof(TComRefPicListModification) );
     1606#endif
    16181607          uiNumSlices ++;
    16191608        }
  • branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r466 r467  
    8888  m_bMFMEnabledFlag = false;
    8989#endif
    90 #if SCALED_REF_LAYER_OFFSETS
    9190  m_numScaledRefLayerOffsets = 0;
    92 #endif
    93 #endif
    9491#if POC_RESET_FLAG
    9592  m_pocAdjustmentValue     = 0;
    9693#endif
     94#endif //SVC_EXTENSION
    9795}
    9896
     
    175173    }
    176174  }
     175
     176#if LAYER_CTB
     177  memcpy(g_auiLayerZscanToRaster[m_layerId], g_auiZscanToRaster, sizeof( g_auiZscanToRaster ) );
     178  memcpy(g_auiLayerRasterToZscan[m_layerId], g_auiRasterToZscan, sizeof( g_auiRasterToZscan ) );
     179  memcpy(g_auiLayerRasterToPelX[m_layerId],  g_auiRasterToPelX,  sizeof( g_auiRasterToPelX ) );
     180  memcpy(g_auiLayerRasterToPelY[m_layerId],  g_auiRasterToPelY,  sizeof( g_auiRasterToPelY ) );
     181#endif
    177182}
    178183
     
    871876#if SVC_EXTENSION
    872877  m_cSPS.setLayerId(m_layerId);
    873 #endif
    874878#if REF_IDX_MFM
    875879#if !M0457_COL_PICTURE_SIGNALING
     
    877881#endif
    878882#endif
    879 #if SCALED_REF_LAYER_OFFSETS
    880883  m_cSPS.setNumScaledRefLayerOffsets(m_numScaledRefLayerOffsets);
    881884  for(Int i = 0; i < m_cSPS.getNumScaledRefLayerOffsets(); i++)
     
    883886    m_cSPS.getScaledRefLayerWindow(i) = m_scaledRefLayerWindow[i];
    884887  }
    885 #endif
     888#endif //SVC_EXTENSION
    886889  ProfileTierLevel& profileTierLevel = *m_cSPS.getPTL()->getGeneralPTL();
    887890  profileTierLevel.setLevelIdc(m_level);
  • branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncTop.h

    r466 r467  
    140140  Int                     m_ilSampleOnlyPred;
    141141#endif
    142 #if SCALED_REF_LAYER_OFFSETS
    143142  UInt                    m_numScaledRefLayerOffsets;
    144143  Window                  m_scaledRefLayerWindow[MAX_LAYERS];
    145 #endif
    146144#if POC_RESET_FLAG
    147145  Int                     m_pocAdjustmentValue;
    148146#endif
    149 #endif
     147#endif //SVC_EXTENSION
    150148protected:
    151149  Void  xGetNewPicBuffer  ( TComPic*& rpcPic );           ///< get picture buffer which will be processed
     
    209207  Int                     getNumPicRcvd         () { return m_iNumPicRcvd;            }
    210208  Void                    setNumPicRcvd         ( Int num ) { m_iNumPicRcvd = num;      }
    211 #if SCALED_REF_LAYER_OFFSETS
    212209  Void                    setNumScaledRefLayerOffsets(Int x) { m_numScaledRefLayerOffsets = x; }
    213210  UInt                    getNumScaledRefLayerOffsets() { return m_numScaledRefLayerOffsets; }
    214211  Window&  getScaledRefLayerWindow(Int x)            { return m_scaledRefLayerWindow[x]; }
    215 #endif
    216 #endif
     212#endif //SVC_EXTENSION
    217213
    218214  // -------------------------------------------------------------------------------------------------------------------
  • branches/SHM-4.0-dev/source/Lib/TLibEncoder/WeightPredAnalysis.cpp

    r466 r467  
    293293#if O0194_WEIGHTED_PREDICTION_CGS
    294294        // make sure the reference frames other than ILR are not using weighted prediction
    295         if (!(slice->getRefPic(eRefPicList, refIdxTemp)->isILR(1))){
     295        if (!(slice->getRefPic(eRefPicList, refIdxTemp)->isILR(1)))
     296        {
    296297          continue;
    297298        }
Note: See TracChangeset for help on using the changeset viewer.