Changeset 655 in 3DVCSoftware for trunk/source/App/TAppEncoder/TAppEncCfg.cpp


Ignore:
Timestamp:
23 Oct 2013, 23:01:30 (11 years ago)
Author:
tech
Message:

Merged 8.1-Cleanup@654

File:
1 edited

Legend:

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

    r622 r655  
    8282  m_codedPivotValue = NULL;
    8383  m_targetPivotValue = NULL;
     84
     85#if KWU_RC_MADPRED_E0227
     86  m_depthMADPred = 0;
     87#endif
    8488}
    8589
     
    224228    in>>entry.m_interViewRefPosL[1][i];
    225229  }
    226 #if !H_MV5
    227   if (entry.m_numActiveRefLayerPics > 0 )
    228   {
    229     in>>entry.m_collocatedRefLayerIdx;
    230   }
    231 #endif
    232230#endif
    233231  return in;
     
    369367  ("NumberOfLayers",        m_numberOfLayers     , 1,                     "Number of layers")
    370368#if !H_3D
    371 #if H_MV5
    372369  ("ScalabilityMask",       m_scalabilityMask    , 2                    , "Scalability Mask")   
    373 #else
    374   ("ScalabilityMask",       m_scalabilityMask    , 1                    , "Scalability Mask")   
    375 #endif
    376370#else
    377371  ("ScalabilityMask",       m_scalabilityMask    , 3                    , "Scalability Mask, 1: Texture 3: Texture + Depth ")   
    378372#endif 
    379373  ("DimensionIdLen",        m_dimensionIdLen     , cfg_dimensionLength  , "Number of bits used to store dimensions Id")
    380 #if H_MV5
    381374  ("ViewOrderIndex",        m_viewOrderIndex     , std::vector<Int>(1,0), "View Order Index per layer")
    382375  ("ViewId",                m_viewId             , std::vector<Int>(1,0), "View Id per View Order Index")
    383 #else
    384   ("ViewId",                m_viewId             , std::vector<Int>(1,0), "View Id")
    385 #endif
    386376#if H_3D
    387377  ("DepthFlag",             m_depthFlag          , std::vector<Int>(1,0), "Depth Flag")
     
    428418  ("FramesToBeEncoded,f",   m_framesToBeEncoded,   0, "Number of frames to be encoded (default=all)")
    429419
     420  //Field coding parameters
     421  ("FieldCoding", m_isField, false, "Signals if it's a field based coding")
     422  ("TopFieldFirst, Tff", m_isTopFieldFirst, false, "In case of field based coding, signals whether if it's a top field first or not")
     423 
    430424  // Profile and level
    431425  ("Profile", m_profile,   Profile::NONE, "Profile to be used when encoding (Incomplete)")
     
    517511  ("IlluCompEnable",           m_abUseIC, std::vector<Bool>(2, true), "Enable illumination compensation")
    518512#endif
    519 #if LGE_INTER_SDC_E0156
     513#if H_3D_INTER_SDC
    520514  ("InterSDC",                 m_bDepthInterSDCFlag,        true, "Enable depth inter SDC")
    521515#endif
     
    594588  ( "InitialQP",           m_RCInitialQP,               0, "Rate control: initial QP" )
    595589  ( "RCForceIntraQP",      m_RCForceIntraQP,        false, "Rate control: force intra QP to be equal to initial QP" )
     590
     591#if KWU_RC_VIEWRC_E0227
     592  ("ViewWiseTargetBits, -vtbr" ,  m_viewTargetBits,  std::vector<Int>(1, 32), "View-wise target bit-rate setting")
     593  ("TargetBitAssign, -ta", m_viewWiseRateCtrl, false, "View-wise rate control on/off")
     594#endif
     595#if KWU_RC_MADPRED_E0227
     596  ("DepthMADPred, -dm", m_depthMADPred, (UInt)0, "Depth based MAD prediction on/off")
     597#endif
    596598#else
    597599  ("RateCtrl,-rc", m_enableRateCtrl, false, "Rate control on/off")
    598600  ("TargetBitrate,-tbr", m_targetBitrate, 0, "Input target bitrate")
    599601  ("NumLCUInUnit,-nu", m_numLCUInUnit, 0, "Number of LCUs in an Unit")
    600 #endif
    601 
    602 #if H_MV5
     602
     603#if KWU_RC_VIEWRC_E0227
     604  ("ViewWiseTargetBits, -vtbr" ,  m_viewTargetBits,  std::vector<Int>(1, 32), "View-wise target bit-rate setting")
     605  ("TargetBitAssign, -ta", m_viewWiseRateCtrl, false, "View-wise rate control on/off")
     606#endif
     607#if KWU_RC_MADPRED_E0227
     608  ("DepthMADPred, -dm", m_depthMADPred, (UInt)0, "Depth based MAD prediction on/off")
     609#endif
     610#endif
     611
    603612#if H_MV
    604613  // VPS VUI
     
    617626  ("CtuBasedOffsetEnabledFlag"   , m_ctuBasedOffsetEnabledFlag   , std::vector< Bool >(1,0)  ,MAX_NUM_LAYERS       , "CtuBasedOffsetEnabledFlag    per direct reference for the N-th layer")
    618627  ("MinHorizontalCtuOffsetPlus1" , m_minHorizontalCtuOffsetPlus1 , std::vector< Int  >(1,0)  ,MAX_NUM_LAYERS       , "MinHorizontalCtuOffsetPlus1  per direct reference for the N-th layer")
    619 #endif
    620628#endif
    621629
     
    762770    if( k == 0 )
    763771    {
    764 #if H_MV5
    765772      m_GOPListMvc[0][0].m_sliceType = 'I';
    766 #endif
    767773      for( Int i = 1; i < MAX_GOP + 1; i++ )
    768774      {
     
    810816  const list<const Char*>& argv_unhandled = po::scanArgv(opts, argc, (const Char**) argv);
    811817
     818  if(m_isField)
     819  {
     820    //Frame height
     821    m_iSourceHeightOrg = m_iSourceHeight;
     822    //Field height
     823    m_iSourceHeight = m_iSourceHeight >> 1;
     824    //number of fields to encode
     825    m_framesToBeEncoded *= 2;
     826  }
     827 
    812828  for (list<const Char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++)
    813829  {
     
    928944        m_aiPad[1] = m_confBottom = ((m_iSourceHeight / minCuSize) + 1) * minCuSize - m_iSourceHeight;
    929945        m_iSourceHeight += m_confBottom;
     946        if ( m_isField )
     947        {
     948          m_iSourceHeightOrg += m_confBottom << 1;
     949          m_aiPad[1] = m_confBottom << 1;
     950        }
    930951      }
    931952      if (m_aiPad[0] % TComSPS::getWinUnitX(CHROMA_420) != 0)
     
    968989  // allocate slice-based dQP values
    969990#if H_MV
    970 #if H_MV5
    971991  xResizeVector( m_viewOrderIndex    );
    972992
     
    9881008#if H_3D
    9891009  xResizeVector( m_depthFlag );
    990 #endif
    991 #else
    992   xResizeVector( m_viewId    );
    993 #if H_3D
    994   xResizeVector( m_depthFlag );
    995 
    996   std::vector<Int> uniqueViewIds;
    997   for( Int layer = 0; layer < m_numberOfLayers; layer++ )
    998   {   
    999     Bool isIn = false;
    1000     for ( Int i = 0 ; i < uniqueViewIds.size(); i++ )
    1001     {
    1002       isIn = isIn || ( m_viewId[ layer ] == uniqueViewIds[ i ] );
    1003     }
    1004     if ( !isIn )
    1005     {
    1006       uniqueViewIds.push_back( m_viewId[ layer ] );
    1007     }
    1008   }
    1009   m_iNumberOfViews = (Int) uniqueViewIds.size();
    1010 #endif
    1011 
    10121010#endif
    10131011  xResizeVector( m_fQP );
     
    12831281  xConfirmPara( (m_layerIdInNuh.size()!=1) && (m_layerIdInNuh.size() < m_numberOfLayers) , "LayerIdInNuh must be given for all layers. ");
    12841282 
    1285 #if H_MV5
    12861283#if H_3D
    12871284  xConfirmPara( m_scalabilityMask != 2 && m_scalabilityMask != 3, "Scalability Mask must be equal to 2 or 3. ");
     
    12981295
    12991296  m_dimIds.push_back( m_viewOrderIndex );   
    1300 #else
    1301 #if H_3D
    1302   xConfirmPara( m_scalabilityMask != 1 && m_scalabilityMask != 3, "Scalability Mask must be equal to 1 or 3. ");
    1303 #else
    1304   xConfirmPara( m_scalabilityMask != 1 , "Scalability Mask must be equal to 1. ");
    1305 #endif
    1306  
    1307   m_dimIds.push_back( m_viewId );
    1308   const Int viewDimPosition = 0;
    1309 #if H_3D
    1310   if ( m_scalabilityMask & ( 1 << DEPTH_ID ) )
    1311     m_dimIds.push_back( m_depthFlag );
    1312 #endif
    1313 
    1314 #endif
    13151297  xConfirmPara(  m_dimensionIdLen.size() < m_dimIds.size(), "DimensionIdLen must be given for all dimensions. "   );   Int dimBitOffset[MAX_NUM_SCALABILITY_TYPES+1];
    13161298
     
    13291311  {   
    13301312    xConfirmPara( m_dimIds[j].size() < m_numberOfLayers,  "DimensionId must be given for all layers and all dimensions. ");   
    1331 #if H_MV5   
    13321313    xConfirmPara( (m_dimIds[j][0] != 0)                 , "DimensionId of layer 0 must be 0. " );
    1333 #else
    1334     xConfirmPara( ( j != viewDimPosition ) &&  (m_dimIds[j][0] != 0), "DimensionId of layer 0 must be 0. " );
    1335 #endif
    13361314    xConfirmPara( m_dimensionIdLen[j] < 1 || m_dimensionIdLen[j] > 8, "DimensionIdLen must be greater than 0 and less than 9 in all dimensions. " );
    13371315     
     
    13721350     xConfirmPara( allEqual , "Each layer shall have a different position in scalability space." );
    13731351
     1352#if !H_3D_FCO
    13741353     if ( numDiff  == 1 )
    13751354     {
    13761355       Bool inc = m_dimIds[ lastDiff ][ i ] > m_dimIds[ lastDiff ][ j ];
    1377 #if H_MV5
    13781356       Bool shallBeButIsNotIncreasing = ( !inc  ) ;
    1379 #else
    1380        Bool shallBeButIsNotIncreasing = ( !inc && ( lastDiff != viewDimPosition ) ) ;
    1381 #endif
    13821357       if ( shallBeButIsNotIncreasing )
    13831358       {       
    13841359         printf( "\nError: Positions of Layers %d and %d is not increasing in dimension %d \n", i, j, lastDiff);       
    13851360       }
    1386 #if H_MV5
    13871361       xConfirmPara( shallBeButIsNotIncreasing,  "DimensionIds shall be increasing within one dimension. " );
    1388 #else
    1389        xConfirmPara( shallBeButIsNotIncreasing && ( lastDiff != viewDimPosition ),  "DimensionIds shall be increasing within one dimension. " );
    1390 #endif
    13911362     }
     1363#endif
    13921364   }
    13931365 }
    13941366
    1395 #if H_MV5
    13961367 /// ViewId
    13971368 xConfirmPara( m_viewId.size() != m_iNumberOfViews, "The number of ViewIds must be equal to the number of views." );
     
    13991370  /// Layer sets
    14001371  xConfirmPara( m_vpsNumLayerSets < 0 || m_vpsNumLayerSets > 1024, "VpsNumLayerSets must be greater than 0 and less than 1025. ") ;
    1401 #else
    1402   xConfirmPara( m_vpsNumLayerSets < 0 || m_vpsNumLayerSets > 1024, "VpsNumLayerSets must be greater than 0 and less than 1025") ;
    1403 #endif
    14041372  for( Int lsIdx = 0; lsIdx < m_vpsNumLayerSets; lsIdx++ )
    14051373  {
     
    17431711  Bool errorGOP=false;
    17441712  Int checkGOP=1;
    1745   Int numRefs = 1;
     1713  Int numRefs = m_isField ? 2 : 1;
    17461714  Int refList[MAX_NUM_REF_PICS+1];
    17471715  refList[0]=0;
     1716  if(m_isField)
     1717  {
     1718    refList[1] = 1;
     1719  }
    17481720  Bool isOK[MAX_GOP];
    17491721  for(Int i=0; i<MAX_GOP; i++)
     
    21572129    xConfirmPara( (numLCUInPic % m_numLCUInUnit) != 0, "total number of LCUs in a frame should be completely divided by NumLCUInUnit" );
    21582130
     2131#if !KWU_FIX_URQ
    21592132    m_iMaxDeltaQP       = MAX_DELTA_QP;
     2133#endif
    21602134    m_iMaxCuDQPDepth    = MAX_CUDQP_DEPTH;
    21612135  }
    21622136#endif
    2163 #if H_MV5
    21642137#if H_MV
    21652138  // VPS VUI
     
    21842157  }
    21852158#endif
    2186 #endif
    21872159
    21882160  xConfirmPara(!m_TransquantBypassEnableFlag && m_CUTransquantBypassFlagValue, "CUTransquantBypassFlagValue cannot be 1 when TransquantBypassEnableFlag is 0");
     
    22502222#endif
    22512223#if H_MV
    2252 #if H_MV5
    22532224  xPrintParaVector( "ViewIdVal"     , m_viewId );
    22542225  xPrintParaVector( "ViewOrderIndex", m_viewOrderIndex );
    2255 #else
    2256   xPrintParaVector( "ViewId", m_viewId );
    2257 #endif
    22582226#endif
    22592227#if H_3D
     
    22682236  printf("Real     Format              : %dx%d %dHz\n", m_iSourceWidth - m_confLeft - m_confRight, m_iSourceHeight - m_confTop - m_confBottom, m_iFrameRate );
    22692237  printf("Internal Format              : %dx%d %dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate );
     2238  if (m_isField)
     2239  {
     2240    printf("Frame/Field          : Field based coding\n");
     2241    printf("Field index          : %u - %d (%d fields)\n", m_FrameSkip, m_FrameSkip+m_framesToBeEncoded-1, m_framesToBeEncoded );
     2242    if (m_isTopFieldFirst)
     2243    {
     2244      printf("Field Order            : Top field first\n");
     2245    }
     2246    else
     2247    {
     2248      printf("Field Order            : Bottom field first\n");
     2249    }
     2250  }
     2251  else
     2252  {
     2253    printf("Frame/Field                  : Frame based coding\n");
    22702254  printf("Frame index                  : %u - %d (%d frames)\n", m_FrameSkip, m_FrameSkip+m_framesToBeEncoded-1, m_framesToBeEncoded );
     2255  }
    22712256  printf("CU size / depth              : %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth );
    22722257  printf("RQT trans. size (min / max)  : %d / %d\n", 1 << m_uiQuadtreeTULog2MinSize, 1 << m_uiQuadtreeTULog2MaxSize );
     
    22992284    printf("InitialQP                    : %d\n", m_RCInitialQP );
    23002285    printf("ForceIntraQP                 : %d\n", m_RCForceIntraQP );
     2286
     2287#if KWU_RC_MADPRED_E0227
     2288    printf("Depth based MAD prediction   : %d\n", m_depthMADPred);
     2289#endif
     2290#if KWU_RC_VIEWRC_E0227
     2291    printf("View-wise Rate control       : %d\n", m_viewWiseRateCtrl);
     2292    if(m_viewWiseRateCtrl)
     2293    {
     2294
     2295      printf("ViewWiseTargetBits           : ");
     2296      for (Int i = 0 ; i < m_iNumberOfViews ; i++)
     2297        printf("%d ", m_viewTargetBits[i]);
     2298      printf("\n");
     2299    }
     2300    else
     2301    {
     2302      printf("TargetBitrate                : %d\n", m_RCTargetBitrate );
     2303    }
     2304#endif
    23012305  }
    23022306#else
     
    23062310    printf("TargetBitrate                : %d\n", m_targetBitrate);
    23072311    printf("NumLCUInUnit                 : %d\n", m_numLCUInUnit);
     2312
     2313#if KWU_RC_MADPRED_E0227
     2314    printf("Depth based MAD prediction   : %d\n", m_depthMADPred);
     2315#endif
     2316#if KWU_RC_VIEWRC_E0227
     2317    printf("View-wise Rate control       : %d\n", m_viewWiseRateCtrl);
     2318    if(m_viewWiseRateCtrl)
     2319    {
     2320
     2321      printf("ViewWiseTargetBits           : ");
     2322      for (Int i = 0 ; i < m_iNumberOfViews ; i++)
     2323        printf("%d ", m_viewTargetBits[i]);
     2324      printf("\n");
     2325    }
     2326    else
     2327    {
     2328      printf("TargetBitrate                : %d\n", m_targetBitrate );
     2329    }
     2330#endif
    23082331  }
    23092332#endif
     
    24142437  printf("DLT:%d ", m_useDLT );
    24152438#endif
    2416 #if LGE_INTER_SDC_E0156
     2439#if H_3D_INTER_SDC
    24172440  printf( "interSDC: %d ", m_bDepthInterSDCFlag ? 1 : 0 );
    24182441#endif
Note: See TracChangeset for help on using the changeset viewer.