Ignore:
Timestamp:
13 Jul 2013, 15:51:26 (11 years ago)
Author:
tech
Message:

Update to HM 11.0.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-DEV-0.3-dev2/source/App/TAppEncoder/TAppEncCfg.cpp

    r534 r537  
    7979  m_aidQP = NULL;
    8080#endif
    81 #if J0149_TONE_MAPPING_SEI
    8281  m_startOfCodedInterval = NULL;
    8382  m_codedPivotValue = NULL;
    8483  m_targetPivotValue = NULL;
    85 #endif
    8684}
    8785
     
    108106  }
    109107#endif
    110 #if J0149_TONE_MAPPING_SEI
    111108  if ( m_startOfCodedInterval )
    112109  {
     
    124121    m_targetPivotValue = NULL;
    125122  }
    126 #endif
    127123#if !H_MV
    128124  free(m_pchInputFile);
     
    316312}
    317313
    318 #if SIGNAL_BITRATE_PICRATE_IN_VPS
    319 Void readBoolString(const string inpString, const Int numEntries, Bool* &memberArray, const char *elementName);
    320 Void readIntString(const string inpString, const Int numEntries, Int* &memberArray, const char *elementName);
    321 #endif
    322314// ====================================================================================================================
    323315// Public member functions
     
    352344  string cfg_RowHeight;
    353345  string cfg_ScalingListFile;
    354 #if J0149_TONE_MAPPING_SEI
    355346  string cfg_startOfCodedInterval;
    356347  string cfg_codedPivotValue;
    357348  string cfg_targetPivotValue;
    358 #endif
    359 #if SIGNAL_BITRATE_PICRATE_IN_VPS
    360   string cfg_bitRateInfoPresentFlag;
    361   string cfg_picRateInfoPresentFlag;
    362   string cfg_avgBitRate;
    363   string cfg_maxBitRate;
    364   string cfg_avgPicRate;
    365   string cfg_constantPicRateIdc;
    366 #endif
    367349  po::Options opts;
    368350  opts.addOptions()
     
    440422  ("Tier",    m_levelTier, Level::MAIN,   "Tier to use for interpretation of --Level")
    441423
    442 #if L0046_CONSTRAINT_FLAGS
    443424  ("ProgressiveSource", m_progressiveSourceFlag, false, "Indicate that source is progressive")
    444425  ("InterlacedSource",  m_interlacedSourceFlag,  false, "Indicate that source is interlaced")
    445426  ("NonPackedSource",   m_nonPackedConstraintFlag, false, "Indicate that source does not contain frame packing")
    446427  ("FrameOnly",         m_frameOnlyConstraintFlag, false, "Indicate that the bitstream contains only frames")
    447 #endif
    448428 
    449429  // Unit definition parameters
     
    465445  ("DecodingRefreshType,-dr", m_iDecodingRefreshType,       0, "Intra refresh type (0:none 1:CRA 2:IDR)")
    466446  ("GOPSize,g",               m_iGOPSize,                   1, "GOP size of temporal structure")
    467 #if !L0034_COMBINED_LIST_CLEANUP
    468   ("ListCombination,-lc",     m_bUseLComb,               true, "Combined reference list for uni-prediction estimation in B-slices")
    469 #endif
    470447  // motion options
    471448  ("FastSearch",              m_iFastSearch,                1, "0:Full search  1:Diamond  2:PMVFAST")
     
    507484  ("RDOQ",                          m_useRDOQ,                  true )
    508485  ("RDOQTS",                        m_useRDOQTS,                true )
    509 #if L0232_RD_PENALTY
    510486  ("RDpenalty",                     m_rdPenalty,                0,  "RD-penalty for 32x32 TU for intra in non-intra slices. 0:disbaled  1:RD-penalty  2:maximum RD-penalty")
    511 #endif
    512487  // Entropy coding parameters
    513488  ("SBACRD",                         m_bUseSBACRD,                      true, "SBAC based RD estimation")
     
    523498  ("LoopFilterTcOffset_div2",        m_loopFilterTcOffsetDiv2,             0 )
    524499  ("DeblockingFilterControlPresent", m_DeblockingFilterControlPresent, false )
    525 #if L0386_DB_METRIC
    526500  ("DeblockingFilterMetric",         m_DeblockingFilterMetric,         false )
    527 #endif
    528501
    529502#if H_3D_ARP
     
    598571  ( "RateControl",         m_RCEnableRateControl,   false, "Rate control: enable rate control" )
    599572  ( "TargetBitrate",       m_RCTargetBitrate,           0, "Rate control: target bitrate" )
     573#if M0036_RC_IMPROVEMENT
     574  ( "KeepHierarchicalBit", m_RCKeepHierarchicalBit,     0, "Rate control: 0: equal bit allocation; 1: fixed ratio bit allocation; 2: adaptive ratio bit allocation" )
     575#else
    600576  ( "KeepHierarchicalBit", m_RCKeepHierarchicalBit, false, "Rate control: keep hierarchical bit allocation in rate control algorithm" )
     577#endif
    601578  ( "LCULevelRateControl", m_RCLCULevelRC,           true, "Rate control: true: LCU level RC; false: picture level RC" )
    602579  ( "RCLCUSeparateModel",  m_RCUseLCUSeparateModel,  true, "Rate control: use LCU level separate R-lambda model" )
     
    650627  ("SEIBufferingPeriod",             m_bufferingPeriodSEIEnabled,              0, "Control generation of buffering period SEI messages")
    651628  ("SEIPictureTiming",               m_pictureTimingSEIEnabled,                0, "Control generation of picture timing SEI messages")
    652 #if J0149_TONE_MAPPING_SEI
    653629  ("SEIToneMappingInfo",                       m_toneMappingInfoSEIEnabled,    false, "Control generation of Tone Mapping SEI messages")
    654630  ("SEIToneMapId",                             m_toneMapId,                        0, "Specifies Id of Tone Mapping SEI message for a given session")
     
    681657  ("SEIToneMapNominalWhiteLevelLumaCodeValue",        m_nominalWhiteLevelLumaCodeValue,         235, "Specifies luma sample value of the nominal white level assigned decoded pictures")
    682658  ("SEIToneMapExtendedWhiteLevelLumaCodeValue",       m_extendedWhiteLevelLumaCodeValue,        300, "Specifies luma sample value of the extended dynamic range assigned decoded pictures")
    683 #endif
    684659  ("SEIFramePacking",                m_framePackingSEIEnabled,                 0, "Control generation of frame packing SEI messages")
    685660  ("SEIFramePackingType",            m_framePackingSEIType,                    0, "Define frame packing arrangement\n"
     
    702677  ("SEIGradualDecodingRefreshInfo",  m_gradualDecodingRefreshInfoEnabled,      0, "Control generation of gradual decoding refresh information SEI message")
    703678  ("SEIDecodingUnitInfo",             m_decodingUnitInfoSEIEnabled,                       0, "Control generation of decoding unit information SEI message.")
    704 #if L0208_SOP_DESCRIPTION_SEI
    705679  ("SEISOPDescription",              m_SOPDescriptionSEIEnabled,              0, "Control generation of SOP description SEI messages")
    706 #endif
    707 #if K0180_SCALABLE_NESTING_SEI
    708680  ("SEIScalableNesting",             m_scalableNestingSEIEnabled,              0, "Control generation of scalable nesting SEI messages")
    709 #endif
    710 #if SIGNAL_BITRATE_PICRATE_IN_VPS
    711   ("BitRatePicRateMaxTLayers",   m_bitRatePicRateMaxTLayers,           0, "Maximum number of sub-layers signalled; can be inferred otherwise; here for easy parsing of config. file")
    712   ("BitRateInfoPresent",         cfg_bitRateInfoPresentFlag,          string(""), "Control signalling of bit rate information of avg. bit rate and max. bit rate in VPS\n"
    713                                                                           "\t0: Do not sent bit rate info\n"
    714                                                                           "\tN (N > 0): Send bit rate info for N sub-layers. N should equal maxTempLayers.")                                                                     
    715   ("PicRateInfoPresent",         cfg_picRateInfoPresentFlag,          string(""), "Control signalling of picture rate information of avg. bit rate and max. bit rate in VPS\n"
    716                                                                           "\t0: Do not sent picture rate info\n"
    717                                                                           "\tN (N > 0): Send picture rate info for N sub-layers. N should equal maxTempLayers.")                                                                     
    718   ("AvgBitRate",                   cfg_avgBitRate,                    string(""), "List of avg. bit rates for the different sub-layers; include non-negative number even if corresponding flag is 0")
    719   ("MaxBitRate",                   cfg_maxBitRate,                    string(""), "List of max. bit rates for the different sub-layers; include non-negative number even if corresponding flag is 0")
    720   ("AvgPicRate",                   cfg_avgPicRate,                    string(""), "List of avg. picture rates for the different sub-layers; include non-negative number even if corresponding flag is 0")
    721   ("ConstantPicRateIdc",           cfg_constantPicRateIdc,            string(""), "List of constant picture rate IDCs; include non-negative number even if corresponding flag is 0")
    722 #endif
    723681#if H_3D
    724682  ("CameraParameterFile,cpf", m_pchCameraParameterFile,    (Char *) 0, "Camera Parameter File Name")
     
    759717#endif //H_3D
    760718  ;
    761  
    762 #if H_MV
     719  #if H_MV
    763720  // parse coding structure
    764721  for( Int k = 0; k < MAX_NUM_LAYERS; k++ )
     
    898855  free ( pRowHeight   );
    899856#endif
    900 #if SIGNAL_BITRATE_PICRATE_IN_VPS
    901   readBoolString(cfg_bitRateInfoPresentFlag, m_bitRatePicRateMaxTLayers, m_bitRateInfoPresentFlag, "bit rate info. present flag" );
    902   readIntString (cfg_avgBitRate,             m_bitRatePicRateMaxTLayers, m_avgBitRate,             "avg. bit rate"               );
    903   readIntString (cfg_maxBitRate,             m_bitRatePicRateMaxTLayers, m_maxBitRate,             "max. bit rate"               );
    904   readBoolString(cfg_picRateInfoPresentFlag, m_bitRatePicRateMaxTLayers, m_picRateInfoPresentFlag, "bit rate info. present flag" );
    905   readIntString (cfg_avgPicRate,             m_bitRatePicRateMaxTLayers, m_avgPicRate,             "avg. pic rate"               );
    906   readIntString (cfg_constantPicRateIdc,     m_bitRatePicRateMaxTLayers, m_constantPicRateIdc,     "constant pic rate Idc"       );
    907 #endif
    908857  m_scalingListFile = cfg_ScalingListFile.empty() ? NULL : strdup(cfg_ScalingListFile.c_str());
    909858 
     
    10711020  m_iWaveFrontSubstreams = m_iWaveFrontSynchro ? (m_iSourceHeight + m_uiMaxCUHeight - 1) / m_uiMaxCUHeight : 1;
    10721021
    1073 #if J0149_TONE_MAPPING_SEI
    10741022  if( m_toneMappingInfoSEIEnabled && !m_toneMapCancelFlag )
    10751023  {
     
    11301078    }
    11311079  }
    1132 #endif
    11331080#if H_3D
    11341081  // set global varibles
     
    12331180  return true;
    12341181}
    1235 #if SIGNAL_BITRATE_PICRATE_IN_VPS
    1236 Void readBoolString(const string inpString, const Int numEntries, Bool* &memberArray, const char *elementName)
    1237 {
    1238   Char* inpArray = inpString.empty() ? NULL : strdup(inpString.c_str());
    1239   Int i = 0;
    1240   if(numEntries)
    1241   {
    1242     Char* tempArray = strtok(inpArray, " ,-");
    1243     memberArray = new Bool[numEntries];
    1244     while( tempArray != NULL )
    1245     {
    1246       if( i >= numEntries )
    1247       {
    1248         printf( "The number of %s defined is larger than the allowed number\n", elementName );
    1249         exit( EXIT_FAILURE );
    1250       }
    1251       assert( (atoi(tempArray) == 0) || (atoi(tempArray) == 1) );
    1252       *( memberArray + i ) = atoi(tempArray);
    1253       tempArray = strtok(NULL, " ,-");
    1254       i++;
    1255     }
    1256     if( i < numEntries )
    1257     {
    1258       printf( "Some %s are not defined\n", elementName );
    1259       exit( EXIT_FAILURE );
    1260     }
    1261   }
    1262   else
    1263   {
    1264     memberArray = NULL;
    1265   }
    1266 }
    1267 
    1268 Void readIntString(const string inpString, const Int numEntries, Int* &memberArray, const char *elementName)
    1269 {
    1270   Char* inpArray = inpString.empty() ? NULL : strdup(inpString.c_str());
    1271   Int i = 0;
    1272   if(numEntries)
    1273   {
    1274     Char* tempArray = strtok(inpArray, " ,-");
    1275     memberArray = new Int[numEntries];
    1276     while( tempArray != NULL )
    1277     {
    1278       if( i >= numEntries )
    1279       {
    1280         printf( "The number of %s defined is larger than the allowed number\n", elementName );
    1281         exit( EXIT_FAILURE );
    1282       }
    1283       *( memberArray + i ) = atoi(tempArray);
    1284       tempArray = strtok(NULL, " ,-");
    1285       i++;
    1286     }
    1287     if( i < numEntries )
    1288     {
    1289       printf( "Some %s are not defined\n", elementName );
    1290       exit( EXIT_FAILURE );
    1291     }
    1292   }
    1293   else
    1294   {
    1295     memberArray = NULL;
    1296   }
    1297 }
    1298 #endif
    12991182// ====================================================================================================================
    13001183// Private member functions
     
    13121195    fprintf(stderr, "**          decoder requires this option to be enabled.         **\n");
    13131196    fprintf(stderr, "******************************************************************\n");
     1197  }
     1198  if( m_profile==Profile::NONE )
     1199  {
     1200    fprintf(stderr, "***************************************************************************\n");
     1201    fprintf(stderr, "** WARNING: For conforming bitstreams a valid Profile value must be set! **\n");
     1202    fprintf(stderr, "***************************************************************************\n");
     1203  }
     1204  if( m_level==Level::NONE )
     1205  {
     1206    fprintf(stderr, "***************************************************************************\n");
     1207    fprintf(stderr, "** WARNING: For conforming bitstreams a valid Level value must be set!   **\n");
     1208    fprintf(stderr, "***************************************************************************\n");
    13141209  }
    13151210
     
    14701365  xConfirmPara( m_iQP <  -6 * (m_internalBitDepthY - 8) || m_iQP > 51,                    "QP exceeds supported range (-QpBDOffsety to 51)" );
    14711366#endif
    1472   xConfirmPara( m_loopFilterBetaOffsetDiv2 < -13 || m_loopFilterBetaOffsetDiv2 > 13,          "Loop Filter Beta Offset div. 2 exceeds supported range (-13 to 13)");
    1473   xConfirmPara( m_loopFilterTcOffsetDiv2 < -13 || m_loopFilterTcOffsetDiv2 > 13,              "Loop Filter Tc Offset div. 2 exceeds supported range (-13 to 13)");
     1367  xConfirmPara( m_loopFilterBetaOffsetDiv2 < -6 || m_loopFilterBetaOffsetDiv2 > 6,          "Loop Filter Beta Offset div. 2 exceeds supported range (-6 to 6)");
     1368  xConfirmPara( m_loopFilterTcOffsetDiv2 < -6 || m_loopFilterTcOffsetDiv2 > 6,              "Loop Filter Tc Offset div. 2 exceeds supported range (-6 to 6)");
    14741369  xConfirmPara( m_iFastSearch < 0 || m_iFastSearch > 2,                                     "Fast Search Mode is not supported value (0:Full search  1:Diamond  2:PMVFAST)" );
    14751370  xConfirmPara( m_iSearchRange < 0 ,                                                        "Search Range must be more than 0" );
     
    15151410  xConfirmPara( ( 0 != m_uiUseAdvResPred ) &&  ( 1 != m_uiUseAdvResPred ), "UseAdvResPred must be 0 or 1." );
    15161411#endif
    1517 
    15181412#if ADAPTIVE_QP_SELECTION
    15191413#if H_MV
     
    19991893  {
    20001894    m_numReorderPics[i] = 0;
    2001 #if L0323_DPB
    20021895    m_maxDecPicBuffering[i] = 1;
    2003 #else
    2004     m_maxDecPicBuffering[i] = 0;
    2005 #endif
    20061896  }
    20071897  for(Int i=0; i<m_iGOPSize; i++)
    20081898  {
    2009 #if L0323_DPB
    20101899    if(m_GOPList[i].m_numRefPics+1 > m_maxDecPicBuffering[m_GOPList[i].m_temporalId])
    2011 #else
    2012     if(m_GOPList[i].m_numRefPics > m_maxDecPicBuffering[m_GOPList[i].m_temporalId])
    2013 #endif
    2014     {
    2015 #if L0323_DPB
     1900    {
    20161901      m_maxDecPicBuffering[m_GOPList[i].m_temporalId] = m_GOPList[i].m_numRefPics + 1;
    2017 #else
    2018       m_maxDecPicBuffering[m_GOPList[i].m_temporalId] = m_GOPList[i].m_numRefPics;
    2019 #endif
    20201902    }
    20211903    Int highestDecodingNumberWithLowerPOC = 0;
     
    20481930      m_numReorderPics[i+1] = m_numReorderPics[i];
    20491931    }
    2050 #if L0323_DPB
    20511932    // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ] - 1, inclusive
    20521933    if(m_numReorderPics[i] > m_maxDecPicBuffering[i] - 1)
     
    20541935      m_maxDecPicBuffering[i] = m_numReorderPics[i] + 1;
    20551936    }
    2056 #else
    2057     // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ], inclusive
    2058     if(m_numReorderPics[i] > m_maxDecPicBuffering[i])
    2059     {
    2060       m_maxDecPicBuffering[i] = m_numReorderPics[i];
    2061     }
    2062 #endif
    20631937    // a lower layer can not have higher value of m_uiMaxDecPicBuffering than a higher layer
    20641938    if(m_maxDecPicBuffering[i+1] < m_maxDecPicBuffering[i])
     
    20691943
    20701944
    2071 #if L0323_DPB
    20721945  // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ] -  1, inclusive
    20731946  if(m_numReorderPics[MAX_TLAYER-1] > m_maxDecPicBuffering[MAX_TLAYER-1] - 1)
     
    20751948    m_maxDecPicBuffering[MAX_TLAYER-1] = m_numReorderPics[MAX_TLAYER-1] + 1;
    20761949  }
    2077 #else
    2078   // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ], inclusive
    2079   if(m_numReorderPics[MAX_TLAYER-1] > m_maxDecPicBuffering[MAX_TLAYER-1])
    2080   {
    2081     m_maxDecPicBuffering[MAX_TLAYER-1] = m_numReorderPics[MAX_TLAYER-1];
    2082   }
    2083 #endif
    20841950
    20851951  if(m_vuiParametersPresentFlag && m_bitstreamRestrictionFlag)
     
    21562022    }
    21572023  }
    2158 #if !L0034_COMBINED_LIST_CLEANUP
    2159   xConfirmPara( m_bUseLComb==false && m_numReorderPics[MAX_TLAYER-1]!=0, "ListCombination can only be 0 in low delay coding (more precisely when L0 and L1 are identical)" );  // Note however this is not the full necessary condition as ref_pic_list_combination_flag can only be 0 if L0 == L1.
    2160 #endif
    21612024  xConfirmPara( m_iWaveFrontSynchro < 0, "WaveFrontSynchro cannot be negative" );
    21622025  xConfirmPara( m_iWaveFrontSubstreams <= 0, "WaveFrontSubstreams must be positive" );
     
    21652028  xConfirmPara( m_decodedPictureHashSEIEnabled<0 || m_decodedPictureHashSEIEnabled>3, "this hash type is not correct!\n");
    21662029
    2167 #if J0149_TONE_MAPPING_SEI
    21682030  if (m_toneMappingInfoSEIEnabled)
    21692031  {
     
    21762038    xConfirmPara( m_extendedWhiteLevelLumaCodeValue < m_nominalWhiteLevelLumaCodeValue, "SEIToneMapExtendedWhiteLevelLumaCodeValue shall be greater than or equal to SEIToneMapNominalWhiteLevelLumaCodeValue");
    21772039  }
    2178 #endif
    21792040
    21802041#if RATE_CONTROL_LAMBDA_DOMAIN
     
    22082069
    22092070  xConfirmPara(m_log2ParallelMergeLevel < 2, "Log2ParallelMergeLevel should be larger than or equal to 2");
    2210 #if L0444_FPA_TYPE
    22112071  if (m_framePackingSEIEnabled)
    22122072  {
    22132073    xConfirmPara(m_framePackingSEIType < 3 || m_framePackingSEIType > 5 , "SEIFramePackingType must be in rage 3 to 5");
    22142074  }
    2215 #endif
    2216 #if H_MV
    2217   }
    2218   }
    2219 #endif
    2220 
     2075
     2076#if H_MV
     2077  }
     2078  }
     2079#endif
    22212080#undef xConfirmPara
    22222081  if (check_failed)
     
    23562215  printf("RDQ:%d ", m_useRDOQ            );
    23572216  printf("RDQTS:%d ", m_useRDOQTS        );
    2358 #if L0232_RD_PENALTY
    23592217  printf("RDpenalty:%d ", m_rdPenalty  );
    2360 #endif
    23612218  printf("SQP:%d ", m_uiDeltaQpRD         );
    23622219  printf("ASR:%d ", m_bUseASR             );
    2363 #if !L0034_COMBINED_LIST_CLEANUP
    2364   printf("LComb:%d ", m_bUseLComb         );
    2365 #endif
    23662220  printf("FEN:%d ", m_bUseFastEnc         );
    23672221  printf("ECU:%d ", m_bUseEarlyCU         );
Note: See TracChangeset for help on using the changeset viewer.