Ignore:
Timestamp:
23 May 2013, 15:40:36 (12 years ago)
Author:
tech
Message:

Integrated 3D encoder control, camera parameters, renderer and MV fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-DEV-0.2-dev/source/App/TAppEncoder/TAppEncCfg.cpp

    r368 r438  
    7979  m_aidQP = NULL;
    8080#endif
    81 #if J0149_TONE_MAPPING_SEI
    82   m_startOfCodedInterval = NULL;
    83   m_codedPivotValue = NULL;
    84   m_targetPivotValue = NULL;
    85 #endif
    8681}
    8782
     
    107102    delete[] m_aidQP;
    108103  }
    109 #endif
    110 #if J0149_TONE_MAPPING_SEI
    111   if ( m_startOfCodedInterval )
    112   {
    113     delete[] m_startOfCodedInterval;
    114     m_startOfCodedInterval = NULL;
    115   }
    116    if ( m_codedPivotValue )
    117   {
    118     delete[] m_codedPivotValue;
    119     m_codedPivotValue = NULL;
    120   }
    121   if ( m_targetPivotValue )
    122   {
    123     delete[] m_targetPivotValue;
    124     m_targetPivotValue = NULL;
    125   }
    126 #endif
    127 #if !H_MV
    128104  free(m_pchInputFile);
    129105#endif
     106
    130107  free(m_pchBitstreamFile);
     108
    131109#if H_MV
    132110  for(Int i = 0; i< m_pchReconFileList.size(); i++ )
     
    138116  free(m_pchReconFile);
    139117#endif
     118
    140119  free(m_pchdQPFile);
    141120  free(m_pColumnWidth);
    142121  free(m_pRowHeight);
    143122  free(m_scalingListFile);
     123
    144124#if H_MV
    145125  for( Int i = 0; i < m_GOPListMvc.size(); i++ )
     
    320300  string cfg_InputFile;
    321301#endif
     302
    322303  string cfg_BitstreamFile;
     304
    323305#if !H_MV
    324306  string cfg_ReconFile;
    325307#endif
     308
    326309#if H_MV
    327310  vector<Int>   cfg_dimensionLength;
     
    333316#endif
    334317#endif
     318
    335319  string cfg_dQPFile;
    336320  string cfg_ColumnWidth;
    337321  string cfg_RowHeight;
    338322  string cfg_ScalingListFile;
    339 #if J0149_TONE_MAPPING_SEI
    340   string cfg_startOfCodedInterval;
    341   string cfg_codedPivotValue;
    342   string cfg_targetPivotValue;
    343 #endif
    344323#if SIGNAL_BITRATE_PICRATE_IN_VPS
    345324  string cfg_bitRateInfoPresentFlag;
     
    356335 
    357336  // File, I/O and source parameters
     337
    358338#if H_MV
    359339  ("InputFile_%d,i_%d",       m_pchInputFileList,       (char *) 0 , MAX_NUM_LAYER_IDS , "original Yuv input file name %d")
     
    361341  ("InputFile,i",           cfg_InputFile,     string(""), "Original YUV input file name")
    362342#endif
     343
    363344  ("BitstreamFile,b",       cfg_BitstreamFile, string(""), "Bitstream output file name")
     345
    364346#if H_MV
    365347  ("ReconFile_%d,o_%d",       m_pchReconFileList,       (char *) 0 , MAX_NUM_LAYER_IDS , "reconstructed Yuv output file name %d")
     
    367349  ("ReconFile,o",           cfg_ReconFile,     string(""), "Reconstructed YUV output file name")
    368350#endif
     351
    369352#if H_MV
    370353  ("NumberOfLayers",        m_numberOfLayers     , 1,                     "Number of layers")
     
    382365  ("SplittingFlag",         m_splittingFlag      , false                , "Splitting Flag")   
    383366#endif
     367
    384368  ("SourceWidth,-wdt",      m_iSourceWidth,        0, "Source picture width")
    385369  ("SourceHeight,-hgt",     m_iSourceHeight,       0, "Source picture height")
     
    403387
    404388  // Profile and level
     389
    405390  ("Profile", m_profile,   Profile::NONE, "Profile to be used when encoding (Incomplete)")
    406391  ("Level",   m_level,     Level::NONE,   "Level limit to be used, eg 5.1 (Incomplete)")
     
    432417  ("DecodingRefreshType,-dr", m_iDecodingRefreshType,       0, "Intra refresh type (0:none 1:CRA 2:IDR)")
    433418  ("GOPSize,g",               m_iGOPSize,                   1, "GOP size of temporal structure")
    434 #if !L0034_COMBINED_LIST_CLEANUP
    435419  ("ListCombination,-lc",     m_bUseLComb,               true, "Combined reference list for uni-prediction estimation in B-slices")
    436 #endif
    437420  // motion options
    438421  ("FastSearch",              m_iFastSearch,                1, "0:Full search  1:Diamond  2:PMVFAST")
     
    490473  ("LoopFilterTcOffset_div2",        m_loopFilterTcOffsetDiv2,             0 )
    491474  ("DeblockingFilterControlPresent", m_DeblockingFilterControlPresent, false )
    492 #if L0386_DB_METRIC
    493   ("DeblockingFilterMetric",         m_DeblockingFilterMetric,         false )
    494 #endif
    495475
    496476  // Coding tools
     
    611591  ("SEIBufferingPeriod",             m_bufferingPeriodSEIEnabled,              0, "Control generation of buffering period SEI messages")
    612592  ("SEIPictureTiming",               m_pictureTimingSEIEnabled,                0, "Control generation of picture timing SEI messages")
    613 #if J0149_TONE_MAPPING_SEI
    614   ("SEIToneMappingInfo",                       m_toneMappingInfoSEIEnabled,    false, "Control generation of Tone Mapping SEI messages")
    615   ("SEIToneMapId",                             m_toneMapId,                        0, "Specifies Id of Tone Mapping SEI message for a given session")
    616   ("SEIToneMapCancelFlag",                     m_toneMapCancelFlag,            false, "Indicates that Tone Mapping SEI message cancels the persistance or follows")
    617   ("SEIToneMapPersistenceFlag",                m_toneMapPersistenceFlag,        true, "Specifies the persistence of the Tone Mapping SEI message")
    618   ("SEIToneMapCodedDataBitDepth",              m_toneMapCodedDataBitDepth,         8, "Specifies Coded Data BitDepth of Tone Mapping SEI messages")
    619   ("SEIToneMapTargetBitDepth",                 m_toneMapTargetBitDepth,            8, "Specifies Output BitDepth of Tome mapping function")
    620   ("SEIToneMapModelId",                        m_toneMapModelId,                   0, "Specifies Model utilized for mapping coded data into target_bit_depth range\n"
    621                                                                                       "\t0:  linear mapping with clipping\n"
    622                                                                                       "\t1:  sigmoidal mapping\n"
    623                                                                                       "\t2:  user-defined table mapping\n"
    624                                                                                       "\t3:  piece-wise linear mapping\n"
    625                                                                                       "\t4:  luminance dynamic range information ")
    626   ("SEIToneMapMinValue",                              m_toneMapMinValue,                          0, "Specifies the minimum value in mode 0")
    627   ("SEIToneMapMaxValue",                              m_toneMapMaxValue,                       1023, "Specifies the maxmum value in mode 0")
    628   ("SEIToneMapSigmoidMidpoint",                       m_sigmoidMidpoint,                        512, "Specifies the centre point in mode 1")
    629   ("SEIToneMapSigmoidWidth",                          m_sigmoidWidth,                           960, "Specifies the distance between 5% and 95% values of the target_bit_depth in mode 1")
    630   ("SEIToneMapStartOfCodedInterval",                  cfg_startOfCodedInterval,          string(""), "Array of user-defined mapping table")
    631   ("SEIToneMapNumPivots",                             m_numPivots,                                0, "Specifies the number of pivot points in mode 3")
    632   ("SEIToneMapCodedPivotValue",                       cfg_codedPivotValue,               string(""), "Array of pivot point")
    633   ("SEIToneMapTargetPivotValue",                      cfg_targetPivotValue,              string(""), "Array of pivot point")
    634   ("SEIToneMapCameraIsoSpeedIdc",                     m_cameraIsoSpeedIdc,                        0, "Indicates the camera ISO speed for daylight illumination")
    635   ("SEIToneMapCameraIsoSpeedValue",                   m_cameraIsoSpeedValue,                    400, "Specifies the camera ISO speed for daylight illumination of Extended_ISO")
    636   ("SEIToneMapExposureCompensationValueSignFlag",     m_exposureCompensationValueSignFlag,        0, "Specifies the sign of ExposureCompensationValue")
    637   ("SEIToneMapExposureCompensationValueNumerator",    m_exposureCompensationValueNumerator,       0, "Specifies the numerator of ExposureCompensationValue")
    638   ("SEIToneMapExposureCompensationValueDenomIdc",     m_exposureCompensationValueDenomIdc,        2, "Specifies the denominator of ExposureCompensationValue")
    639   ("SEIToneMapRefScreenLuminanceWhite",               m_refScreenLuminanceWhite,                350, "Specifies reference screen brightness setting in units of candela per square metre")
    640   ("SEIToneMapExtendedRangeWhiteLevel",               m_extendedRangeWhiteLevel,                800, "Indicates the luminance dynamic range")
    641   ("SEIToneMapNominalBlackLevelLumaCodeValue",        m_nominalBlackLevelLumaCodeValue,          16, "Specifies luma sample value of the nominal black level assigned decoded pictures")
    642   ("SEIToneMapNominalWhiteLevelLumaCodeValue",        m_nominalWhiteLevelLumaCodeValue,         235, "Specifies luma sample value of the nominal white level assigned decoded pictures")
    643   ("SEIToneMapExtendedWhiteLevelLumaCodeValue",       m_extendedWhiteLevelLumaCodeValue,        300, "Specifies luma sample value of the extended dynamic range assigned decoded pictures")
    644 #endif
    645593  ("SEIFramePacking",                m_framePackingSEIEnabled,                 0, "Control generation of frame packing SEI messages")
    646594  ("SEIFramePackingType",            m_framePackingSEIType,                    0, "Define frame packing arrangement\n"
     
    663611  ("SEIGradualDecodingRefreshInfo",  m_gradualDecodingRefreshInfoEnabled,      0, "Control generation of gradual decoding refresh information SEI message")
    664612  ("SEIDecodingUnitInfo",             m_decodingUnitInfoSEIEnabled,                       0, "Control generation of decoding unit information SEI message.")
    665 #if L0208_SOP_DESCRIPTION_SEI
    666   ("SEISOPDescription",              m_SOPDescriptionSEIEnabled,              0, "Control generation of SOP description SEI messages")
    667 #endif
    668 #if K0180_SCALABLE_NESTING_SEI
    669   ("SEIScalableNesting",             m_scalableNestingSEIEnabled,              0, "Control generation of scalable nesting SEI messages")
    670 #endif
    671613#if SIGNAL_BITRATE_PICRATE_IN_VPS
    672614  ("BitRatePicRateMaxTLayers",   m_bitRatePicRateMaxTLayers,           0, "Maximum number of sub-layers signalled; can be inferred otherwise; here for easy parsing of config. file")
     
    719661  }
    720662#endif
     663
    721664  po::setDefaults(opts);
    722665  const list<const Char*>& argv_unhandled = po::scanArgv(opts, argc, (const Char**) argv);
     
    738681   */
    739682  /* convert std::string to c string for compatability */
     683
    740684#if !H_MV
    741685  m_pchInputFile = cfg_InputFile.empty() ? NULL : strdup(cfg_InputFile.c_str());
    742686#endif
     687
    743688  m_pchBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str());
     689
    744690#if !H_MV
    745691  m_pchReconFile = cfg_ReconFile.empty() ? NULL : strdup(cfg_ReconFile.c_str());
    746692#endif
     693
    747694  m_pchdQPFile = cfg_dQPFile.empty() ? NULL : strdup(cfg_dQPFile.c_str());
    748695 
     
    808755  free ( pRowHeight   );
    809756#endif
     757
    810758#if SIGNAL_BITRATE_PICRATE_IN_VPS
    811759  readBoolString(cfg_bitRateInfoPresentFlag, m_bitRatePicRateMaxTLayers, m_bitRateInfoPresentFlag, "bit rate info. present flag" );
     
    966914  m_iWaveFrontSubstreams = m_iWaveFrontSynchro ? (m_iSourceHeight + m_uiMaxCUHeight - 1) / m_uiMaxCUHeight : 1;
    967915
    968 #if J0149_TONE_MAPPING_SEI
    969   if( m_toneMappingInfoSEIEnabled && !m_toneMapCancelFlag )
    970   {
    971     Char* pcStartOfCodedInterval = cfg_startOfCodedInterval.empty() ? NULL: strdup(cfg_startOfCodedInterval.c_str());
    972     Char* pcCodedPivotValue = cfg_codedPivotValue.empty() ? NULL: strdup(cfg_codedPivotValue.c_str());
    973     Char* pcTargetPivotValue = cfg_targetPivotValue.empty() ? NULL: strdup(cfg_targetPivotValue.c_str());
    974     if( m_toneMapModelId == 2 && pcStartOfCodedInterval )
    975     {
    976       char *startOfCodedInterval;
    977       UInt num = 1u<< m_toneMapTargetBitDepth;
    978       m_startOfCodedInterval = new Int[num];
    979       ::memset( m_startOfCodedInterval, 0, sizeof(Int)*num );
    980       startOfCodedInterval = strtok(pcStartOfCodedInterval, " .");
    981       int i = 0;
    982       while( startOfCodedInterval && ( i < num ) )
    983       {
    984         m_startOfCodedInterval[i] = atoi( startOfCodedInterval );
    985         startOfCodedInterval = strtok(NULL, " .");
    986         i++;
    987       }
    988     }
    989     else
    990     {
    991       m_startOfCodedInterval = NULL;
    992     }
    993     if( ( m_toneMapModelId == 3 ) && ( m_numPivots > 0 ) )
    994     {
    995       if( pcCodedPivotValue && pcTargetPivotValue )
    996       {
    997         char *codedPivotValue;
    998         char *targetPivotValue;
    999         m_codedPivotValue = new Int[m_numPivots];
    1000         m_targetPivotValue = new Int[m_numPivots];
    1001         ::memset( m_codedPivotValue, 0, sizeof(Int)*( m_numPivots ) );
    1002         ::memset( m_targetPivotValue, 0, sizeof(Int)*( m_numPivots ) );
    1003         codedPivotValue = strtok(pcCodedPivotValue, " .");
    1004         int i=0;
    1005         while(codedPivotValue&&i<m_numPivots)
    1006         {
    1007           m_codedPivotValue[i] = atoi( codedPivotValue );
    1008           codedPivotValue = strtok(NULL, " .");
    1009           i++;
    1010         }
    1011         i=0;
    1012         targetPivotValue = strtok(pcTargetPivotValue, " .");
    1013         while(targetPivotValue&&i<m_numPivots)
    1014         {
    1015           m_targetPivotValue[i]= atoi( targetPivotValue );
    1016           targetPivotValue = strtok(NULL, " .");
    1017           i++;
    1018         }
    1019       }
    1020     }
    1021     else
    1022     {
    1023       m_codedPivotValue = NULL;
    1024       m_targetPivotValue = NULL;
    1025     }
    1026   }
    1027 #endif
    1028916  // check validity of input parameters
    1029917  xCheckParameter();
     
    11251013  xConfirmPara( m_iFrameRate <= 0,                                                          "Frame rate must be more than 1" );
    11261014  xConfirmPara( m_framesToBeEncoded <= 0,                                                   "Total Number Of Frames encoded must be more than 0" );
     1015
    11271016#if H_MV
    11281017  xConfirmPara( m_numberOfLayers > MAX_NUM_LAYER_IDS ,                                      "NumberOfLayers must be less than or equal to MAX_NUM_LAYER_IDS");
     
    11371026  xConfirmPara( m_scalabilityMask != 1 , "Scalability Mask must be equal to 1. ");
    11381027#endif
    1139  
     1028  
    11401029  m_dimIds.push_back( m_viewId );
    11411030#if H_3D
     
    11941083
    11951084#endif
     1085
     1086
    11961087  xConfirmPara( m_iGOPSize < 1 ,                                                            "GOP Size must be greater or equal to 1" );
    11971088  xConfirmPara( m_iGOPSize > 1 &&  m_iGOPSize % 2,                                          "GOP Size must be a multiple of 2, if GOP Size is greater than 1" );
     
    14571348      Int*      m_numReorderPics     = m_numReorderPicsMvc    [layer]; // It is not a member, but this name helps avoiding code duplication !!!
    14581349#endif
     1350
    14591351  /* if this is an intra-only sequence, ie IntraPeriod=1, don't verify the GOP structure
    14601352   * This permits the ability to omit a GOP structure specification */
     
    17171609  {
    17181610    m_numReorderPics[i] = 0;
    1719 #if L0323_DPB
    1720     m_maxDecPicBuffering[i] = 1;
    1721 #else
    17221611    m_maxDecPicBuffering[i] = 0;
    1723 #endif
    17241612  }
    17251613  for(Int i=0; i<m_iGOPSize; i++)
    17261614  {
    1727 #if L0323_DPB
    1728     if(m_GOPList[i].m_numRefPics+1 > m_maxDecPicBuffering[m_GOPList[i].m_temporalId])
    1729 #else
    17301615    if(m_GOPList[i].m_numRefPics > m_maxDecPicBuffering[m_GOPList[i].m_temporalId])
    1731 #endif
    1732     {
    1733 #if L0323_DPB
    1734       m_maxDecPicBuffering[m_GOPList[i].m_temporalId] = m_GOPList[i].m_numRefPics + 1;
    1735 #else
     1616    {
    17361617      m_maxDecPicBuffering[m_GOPList[i].m_temporalId] = m_GOPList[i].m_numRefPics;
    1737 #endif
    17381618    }
    17391619    Int highestDecodingNumberWithLowerPOC = 0;
     
    17661646      m_numReorderPics[i+1] = m_numReorderPics[i];
    17671647    }
    1768 #if L0323_DPB
    1769     // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ] - 1, inclusive
    1770     if(m_numReorderPics[i] > m_maxDecPicBuffering[i] - 1)
    1771     {
    1772       m_maxDecPicBuffering[i] = m_numReorderPics[i] + 1;
    1773     }
    1774 #else
    17751648    // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ], inclusive
    17761649    if(m_numReorderPics[i] > m_maxDecPicBuffering[i])
     
    17781651      m_maxDecPicBuffering[i] = m_numReorderPics[i];
    17791652    }
    1780 #endif
    17811653    // a lower layer can not have higher value of m_uiMaxDecPicBuffering than a higher layer
    17821654    if(m_maxDecPicBuffering[i+1] < m_maxDecPicBuffering[i])
     
    17851657    }
    17861658  }
    1787 
    1788 
    1789 #if L0323_DPB
    1790   // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ] -  1, inclusive
    1791   if(m_numReorderPics[MAX_TLAYER-1] > m_maxDecPicBuffering[MAX_TLAYER-1] - 1)
    1792   {
    1793     m_maxDecPicBuffering[MAX_TLAYER-1] = m_numReorderPics[MAX_TLAYER-1] + 1;
    1794   }
    1795 #else
    17961659  // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ], inclusive
    17971660  if(m_numReorderPics[MAX_TLAYER-1] > m_maxDecPicBuffering[MAX_TLAYER-1])
     
    17991662    m_maxDecPicBuffering[MAX_TLAYER-1] = m_numReorderPics[MAX_TLAYER-1];
    18001663  }
    1801 #endif
    18021664
    18031665  if(m_vuiParametersPresentFlag && m_bitstreamRestrictionFlag)
     
    18741736    }
    18751737  }
    1876 #if !L0034_COMBINED_LIST_CLEANUP
    18771738  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.
    1878 #endif
    18791739  xConfirmPara( m_iWaveFrontSynchro < 0, "WaveFrontSynchro cannot be negative" );
    18801740  xConfirmPara( m_iWaveFrontSubstreams <= 0, "WaveFrontSubstreams must be positive" );
     
    18831743  xConfirmPara( m_decodedPictureHashSEIEnabled<0 || m_decodedPictureHashSEIEnabled>3, "this hash type is not correct!\n");
    18841744
    1885 #if J0149_TONE_MAPPING_SEI
    1886   if (m_toneMappingInfoSEIEnabled)
    1887   {
    1888     xConfirmPara( m_toneMapCodedDataBitDepth < 8 || m_toneMapCodedDataBitDepth > 14 , "SEIToneMapCodedDataBitDepth must be in rage 8 to 14");
    1889     xConfirmPara( m_toneMapTargetBitDepth < 1 || (m_toneMapTargetBitDepth > 16 && m_toneMapTargetBitDepth < 255) , "SEIToneMapTargetBitDepth must be in rage 1 to 16 or equal to 255");
    1890     xConfirmPara( m_toneMapModelId < 0 || m_toneMapModelId > 4 , "SEIToneMapModelId must be in rage 0 to 4");
    1891     xConfirmPara( m_cameraIsoSpeedValue == 0, "SEIToneMapCameraIsoSpeedValue shall not be equal to 0");
    1892     xConfirmPara( m_extendedRangeWhiteLevel < 100, "SEIToneMapExtendedRangeWhiteLevel should be greater than or equal to 100");
    1893     xConfirmPara( m_nominalBlackLevelLumaCodeValue >= m_nominalWhiteLevelLumaCodeValue, "SEIToneMapNominalWhiteLevelLumaCodeValue shall be greater than SEIToneMapNominalBlackLevelLumaCodeValue");
    1894     xConfirmPara( m_extendedWhiteLevelLumaCodeValue < m_nominalWhiteLevelLumaCodeValue, "SEIToneMapExtendedWhiteLevelLumaCodeValue shall be greater than or equal to SEIToneMapNominalWhiteLevelLumaCodeValue");
    1895   }
    1896 #endif
    1897 
    18981745#if RATE_CONTROL_LAMBDA_DOMAIN
    18991746  if ( m_RCEnableRateControl )
     
    19321779  }
    19331780#endif
     1781
    19341782#if H_MV
    19351783  }
     
    19791827  printf("Input          File          : %s\n", m_pchInputFile          );
    19801828#endif
     1829
    19811830  printf("Bitstream      File          : %s\n", m_pchBitstreamFile      );
     1831
    19821832#if H_MV
    19831833  for( Int layer = 0; layer < m_numberOfLayers; layer++)
     
    19881838  printf("Reconstruction File          : %s\n", m_pchReconFile          );
    19891839#endif
     1840
    19901841#if H_MV
    19911842 xPrintParaVector( "ViewId", m_viewId );
    19921843#endif
     1844
    19931845#if H_3D
    19941846 xPrintParaVector( "DepthFlag", m_depthFlag );
    19951847#endif
     1848
    19961849#if H_MV 
    19971850  xPrintParaVector( "QP"               , m_fQP                );
     
    20551908  printf("SQP:%d ", m_uiDeltaQpRD         );
    20561909  printf("ASR:%d ", m_bUseASR             );
    2057 #if !L0034_COMBINED_LIST_CLEANUP
    20581910  printf("LComb:%d ", m_bUseLComb         );
    2059 #endif
    20601911  printf("FEN:%d ", m_bUseFastEnc         );
    20611912  printf("ECU:%d ", m_bUseEarlyCU         );
Note: See TracChangeset for help on using the changeset viewer.