Changeset 1360 in 3DVCSoftware for branches/HTM-15.2-dev/source/App
- Timestamp:
- 28 Oct 2015, 17:46:00 (9 years ago)
- Location:
- branches/HTM-15.2-dev/source/App
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified branches/HTM-15.2-dev/source/App/TAppDecoder/TAppDecCfg.cpp ¶
r1356 r1360 62 62 \param argv array of arguments 63 63 */ 64 Bool TAppDecCfg::parseCfg( Int argc, Char* argv[] )64 Bool TAppDecCfg::parseCfg( Int argc, TChar* argv[] ) 65 65 { 66 66 Bool do_help = false; 67 string cfg_BitstreamFile;68 string cfg_ReconFile;69 67 string cfg_TargetDecLayerIdSetFile; 70 68 #if NH_3D … … 79 77 80 78 ("help", do_help, false, "this help text") 81 ("BitstreamFile,b", cfg_BitstreamFile,string(""), "bitstream input file name")82 ("ReconFile,o", cfg_ReconFile,string(""), "reconstructed YUV output file name\n"79 ("BitstreamFile,b", m_bitstreamFileName, string(""), "bitstream input file name") 80 ("ReconFile,o", m_reconFileName, string(""), "reconstructed YUV output file name\n" 83 81 "YUV writing is skipped if omitted") 84 82 #if NH_3D … … 106 104 ("PrintNalus,n", m_printReceivedNalus, false, "Print information on received NAL units") 107 105 #endif 106 ("SEIColourRemappingInfoFilename", m_colourRemapSEIFileName, string(""), "Colour Remapping YUV output file name. If empty, no remapping is applied (ignore SEI message)\n") 107 108 108 #if O0043_BEST_EFFORT_DECODING 109 109 ("ForceDecodeBitDepth", m_forceDecodeBitDepth, 0U, "Force the decoder to operate at a particular bit-depth (best effort decoding)") … … 119 119 po::setDefaults(opts); 120 120 po::ErrorReporter err; 121 const list<const Char*>& argv_unhandled = po::scanArgv(opts, argc, (constChar**) argv, err);122 123 for (list<const Char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++)121 const list<const TChar*>& argv_unhandled = po::scanArgv(opts, argc, (const TChar**) argv, err); 122 123 for (list<const TChar*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++) 124 124 { 125 125 fprintf(stderr, "Unhandled argument ignored: `%s'\n", *it); … … 148 148 } 149 149 150 /* convert std::string to c string for compatability */ 151 m_pchBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str()); 152 m_pchReconFile = cfg_ReconFile.empty() ? NULL : strdup(cfg_ReconFile.c_str()); 153 154 #if NH_3D 155 m_pchScaleOffsetFile = cfg_ScaleOffsetFile.empty() ? NULL : strdup(cfg_ScaleOffsetFile.c_str()); 156 #endif 157 158 if (!m_pchBitstreamFile) 150 if (m_bitstreamFileName.empty()) 159 151 { 160 152 fprintf(stderr, "No input file specified, aborting\n"); … … 217 209 218 210 #if NH_MV 219 Void TAppDecCfg::xAppendToFileNameEnd( Char* pchInputFileName, const Char* pchStringToAppend,Char*& rpchOutputFileName)211 Void TAppDecCfg::xAppendToFileNameEnd( const TChar* pchInputFileName, const TChar* pchStringToAppend, TChar*& rpchOutputFileName) 220 212 { 221 213 size_t iInLength = strlen(pchInputFileName); 222 214 size_t iAppendLength = strlen(pchStringToAppend); 223 215 224 rpchOutputFileName = ( Char*) malloc(iInLength+iAppendLength+1);225 Char* pCDot = strrchr(pchInputFileName,'.');216 rpchOutputFileName = (TChar*) malloc(iInLength+iAppendLength+1); 217 const TChar* pCDot = strrchr(pchInputFileName,'.'); 226 218 pCDot = pCDot ? pCDot : pchInputFileName + iInLength; 227 219 size_t iCharsToDot = pCDot - pchInputFileName ; -
TabularUnified branches/HTM-15.2-dev/source/App/TAppDecoder/TAppDecCfg.h ¶
r1356 r1360 60 60 { 61 61 protected: 62 Char* m_pchBitstreamFile;///< input bitstream file name63 Char* m_pchReconFile;///< output reconstruction file name62 std::string m_bitstreamFileName; ///< input bitstream file name 63 std::string m_reconFileName; ///< output reconstruction file name 64 64 Int m_iSkipFrame; ///< counter for frames prior to the random access point to skip 65 65 Int m_outputBitDepth[MAX_NUM_CHANNEL_TYPE]; ///< bit depth used for writing output … … 69 69 Int m_decodedPictureHashSEIEnabled; ///< Checksum(3)/CRC(2)/MD5(1)/disable(0) acting on decoded picture hash SEI message 70 70 Bool m_decodedNoDisplaySEIEnabled; ///< Enable(true)/disable(false) writing only pictures that get displayed based on the no display SEI message 71 std::string m_colourRemapSEIFileName; ///< output Colour Remapping file name 71 72 std::vector<Int> m_targetDecLayerIdSet; ///< set of LayerIds to be included in the sub-bitstream extraction process. 72 73 … … 78 79 Bool m_bClipOutputVideoToRec709Range; ///< If true, clip the output video to the Rec 709 range on saving. 79 80 #if NH_MV 80 std::vector< Char*> m_pchReconFiles;///< array of output reconstruction file name create from output reconstruction file name81 std::vector<TChar*> m_pchReconFiles; ///< array of output reconstruction file name create from output reconstruction file name 81 82 82 Int m_targetOptLayerSetIdx; 83 Int m_targetOptLayerSetIdx; ///< target output layer set index 83 84 Int m_targetDecLayerSetIdx; 84 85 Int m_baseLayerOutputFlag; 85 86 Int m_baseLayerPicOutputFlag; 86 87 Int m_auOutputFlag; 87 Int m_maxLayerId; 88 Int m_maxLayerId; ///< maximum nuh_layer_id decoded 88 89 std::ifstream m_bitstreamFile; 89 90 Int m_highestTid; 90 91 Bool m_targetDecLayerIdSetFileEmpty; ///< indication if target layers are given by file 91 92 92 Bool m_printVpsInfo; ///< Output VPS information93 Bool m_printVpsInfo; ///< Output VPS information 93 94 Bool m_printPicOutput; ///< Print information on picture output 94 95 Bool m_printReceivedNalus; ///< Print information on received NAL units 95 96 #if NH_3D 96 Char*m_pchScaleOffsetFile; ///< output coded scale and offset parameters97 TChar* m_pchScaleOffsetFile; ///< output coded scale and offset parameters 97 98 Bool m_depth420OutputFlag; ///< output depth layers in 4:2:0 98 99 #endif 99 100 100 Void xAppendToFileNameEnd( Char* pchInputFileName, const Char* pchStringToAppend,Char*& rpchOutputFileName); ///< create filenames101 Void xAppendToFileNameEnd( const TChar* pchInputFileName, const TChar* pchStringToAppend, TChar*& rpchOutputFileName); ///< create filenames 101 102 #endif 102 103 103 104 public: 104 105 TAppDecCfg() 105 : m_ pchBitstreamFile(NULL)106 , m_ pchReconFile(NULL)106 : m_bitstreamFileName() 107 , m_reconFileName() 107 108 , m_iSkipFrame(0) 109 // m_outputBitDepth array initialised below 108 110 , m_outputColourSpaceConvert(IPCOLOURSPACE_UNCHANGED) 109 111 , m_iMaxTemporalLayer(-1) 110 112 , m_decodedPictureHashSEIEnabled(0) 111 113 , m_decodedNoDisplaySEIEnabled(false) 114 , m_colourRemapSEIFileName() 115 , m_targetDecLayerIdSet() 112 116 , m_respectDefDispWindow(0) 113 117 #if O0043_BEST_EFFORT_DECODING 114 118 , m_forceDecodeBitDepth(0) 115 119 #endif 120 , m_outputDecodedSEIMessagesFilename() 121 , m_bClipOutputVideoToRec709Range(false) 116 122 #if NH_MV 117 123 , m_highestTid(-1) … … 131 137 virtual ~TAppDecCfg() {} 132 138 133 Bool parseCfg ( Int argc, Char* argv[] ); ///< initialize option class from configuration139 Bool parseCfg ( Int argc, TChar* argv[] ); ///< initialize option class from configuration 134 140 }; 135 141 -
TabularUnified branches/HTM-15.2-dev/source/App/TAppDecoder/TAppDecTop.cpp ¶
r1321 r1360 62 62 : m_numDecoders( 0 ) 63 63 #endif 64 ,m_pcSeiColourRemappingInfoPrevious(NULL) 64 65 { 65 66 #if NH_MV … … 118 119 xDestroyDecLib(); 119 120 #endif 120 121 if (m_pchBitstreamFile) 122 { 123 free (m_pchBitstreamFile); 124 m_pchBitstreamFile = NULL; 125 } 121 m_bitstreamFileName.clear(); 126 122 #if NH_MV 127 123 for (Int decIdx = 0; decIdx < m_numDecoders; decIdx++) … … 134 130 } 135 131 #endif 136 if (m_pchReconFile) 137 { 138 free (m_pchReconFile); 139 m_pchReconFile = NULL; 140 } 132 m_reconFileName.clear(); 141 133 #if NH_3D 142 134 if (m_pchScaleOffsetFile) … … 226 218 TComList<TComPic*>* pcListPic = NULL; 227 219 228 ifstream bitstreamFile(m_ pchBitstreamFile, ifstream::in | ifstream::binary);220 ifstream bitstreamFile(m_bitstreamFileName.c_str(), ifstream::in | ifstream::binary); 229 221 if (!bitstreamFile) 230 222 { 231 fprintf(stderr, "\nfailed to open bitstream file `%s' for reading\n", m_ pchBitstreamFile);223 fprintf(stderr, "\nfailed to open bitstream file `%s' for reading\n", m_bitstreamFileName.c_str()); 232 224 exit(EXIT_FAILURE); 233 225 } … … 250 242 251 243 m_iPOCLastDisplay += m_iSkipFrame; // set the last displayed POC correctly for skip forward. 244 245 // clear contents of colour-remap-information-SEI output file 246 if (!m_colourRemapSEIFileName.empty()) 247 { 248 std::ofstream ofile(m_colourRemapSEIFileName.c_str()); 249 if (!ofile.good() || !ofile.is_open()) 250 { 251 fprintf(stderr, "\nUnable to open file '%s' for writing colour-remap-information-SEI video\n", m_colourRemapSEIFileName.c_str()); 252 exit(EXIT_FAILURE); 253 } 254 } 252 255 253 256 // main decoder loop … … 336 339 if( pcListPic ) 337 340 { 338 if ( m_pchReconFile && !openedReconFile)341 if ( (!m_reconFileName.empty()) && (!openedReconFile) ) 339 342 { 340 343 const BitDepths &bitDepths=pcListPic->front()->getPicSym()->getSPS().getBitDepths(); // use bit depths of first reconstructed picture. … … 346 349 } 347 350 } 348 m_cTVideoIOYuvReconFile.open( m_pchReconFile, true, m_outputBitDepth, m_outputBitDepth, bitDepths.recon ); // write mode 351 352 m_cTVideoIOYuvReconFile.open( m_reconFileName, true, m_outputBitDepth, m_outputBitDepth, bitDepths.recon ); // write mode 349 353 openedReconFile = true; 350 354 } … … 436 440 } 437 441 #else 438 if ( m_pchReconFile)442 if ( !m_reconFileName.empty() ) 439 443 { 440 444 m_cTVideoIOYuvReconFile. close(); … … 444 448 m_cTDecTop.destroy(); 445 449 #endif 450 if (m_pcSeiColourRemappingInfoPrevious != NULL) 451 { 452 delete m_pcSeiColourRemappingInfoPrevious; 453 m_pcSeiColourRemappingInfoPrevious = NULL; 454 } 446 455 #if NH_3D 447 456 m_cCamParsCollector.uninit(); … … 474 483 } 475 484 #endif 485 if (m_pcSeiColourRemappingInfoPrevious != NULL) 486 { 487 delete m_pcSeiColourRemappingInfoPrevious; 488 m_pcSeiColourRemappingInfoPrevious = NULL; 489 } 476 490 } 477 491 … … 549 563 // write to file 550 564 numPicsNotYetDisplayed = numPicsNotYetDisplayed-2; 551 if ( m_pchReconFile)565 if ( !m_reconFileName.empty() ) 552 566 { 553 567 const Window &conf = pcPicTop->getConformanceWindow(); … … 617 631 dpbFullness--; 618 632 } 619 if ( m_pchReconFile)633 if ( !m_reconFileName.empty() ) 620 634 { 621 635 const Window &conf = pcPic->getConformanceWindow(); … … 631 645 } 632 646 647 if (!m_colourRemapSEIFileName.empty()) 648 { 649 xOutputColourRemapPic(pcPic); 650 } 651 633 652 // update POC of display order 634 653 m_iPOCLastDisplay = pcPic->getPOC(); … … 678 697 // write to file 679 698 680 if ( m_pchReconFile)699 if ( !m_reconFileName.empty() ) 681 700 { 682 701 const Window &conf = pcPicTop->getConformanceWindow(); … … 736 755 { 737 756 // write to file 738 if ( m_pchReconFile)757 if ( !m_reconFileName.empty() ) 739 758 { 740 759 const Window &conf = pcPic->getConformanceWindow(); … … 747 766 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), 748 767 NUM_CHROMA_FORMAT, m_bClipOutputVideoToRec709Range ); 768 } 769 770 if (!m_colourRemapSEIFileName.empty()) 771 { 772 xOutputColourRemapPic(pcPic); 749 773 } 750 774 … … 2671 2695 2672 2696 // create recon file related stuff 2673 Char* pchTempFilename = NULL;2674 if ( m_pchReconFile)2675 { 2676 Char buffer[4];2697 TChar* pchTempFilename = NULL; 2698 if ( !m_reconFileName.empty() ) 2699 { 2700 TChar buffer[4]; 2677 2701 sprintf(buffer,"_%i", layerId ); 2678 assert ( m_pchReconFile);2679 xAppendToFileNameEnd( m_ pchReconFile, buffer, pchTempFilename );2702 assert ( !m_reconFileName.empty() ); 2703 xAppendToFileNameEnd( m_reconFileName.c_str() , buffer, pchTempFilename ); 2680 2704 assert( m_pchReconFiles.size() == m_numDecoders ); 2681 2705 } … … 2870 2894 Void TAppDecTop::xInitFileIO() 2871 2895 { 2872 m_bitstreamFile.open(m_ pchBitstreamFile, ifstream::in | ifstream::binary);2896 m_bitstreamFile.open(m_bitstreamFileName.c_str(), ifstream::in | ifstream::binary); 2873 2897 2874 2898 if ( !m_bitstreamFile) 2875 2899 { 2876 fprintf(stderr, "\nUnable to open bitstream file `%s' for reading\n", m_ pchBitstreamFile);2900 fprintf(stderr, "\nUnable to open bitstream file `%s' for reading\n", m_bitstreamFileName.c_str()); 2877 2901 exit(EXIT_FAILURE); 2878 2902 } … … 2905 2929 Int decIdx = xGetDecoderIdx( curPic->getLayerId() ); 2906 2930 2907 if ( m_pchReconFile&& !m_reconOpen[decIdx] )2931 if ( !m_reconFileName.empty() && !m_reconOpen[decIdx] ) 2908 2932 { 2909 2933 const BitDepths &bitDepths= curPic->getPicSym()->getSPS().getBitDepths(); // use bit depths of first reconstructed picture. … … 3007 3031 3008 3032 #endif 3033 3034 Void TAppDecTop::xOutputColourRemapPic(TComPic* pcPic) 3035 { 3036 const TComSPS &sps=pcPic->getPicSym()->getSPS(); 3037 SEIMessages colourRemappingInfo = getSeisByType(pcPic->getSEIs(), SEI::COLOUR_REMAPPING_INFO ); 3038 SEIColourRemappingInfo *seiColourRemappingInfo = ( colourRemappingInfo.size() > 0 ) ? (SEIColourRemappingInfo*) *(colourRemappingInfo.begin()) : NULL; 3039 3040 if (colourRemappingInfo.size() > 1) 3041 { 3042 printf ("Warning: Got multiple Colour Remapping Information SEI messages. Using first."); 3043 } 3044 if (seiColourRemappingInfo) 3045 { 3046 applyColourRemapping(*pcPic->getPicYuvRec(), *seiColourRemappingInfo, sps); 3047 3048 // save the last CRI SEI received 3049 if (m_pcSeiColourRemappingInfoPrevious == NULL) 3050 { 3051 m_pcSeiColourRemappingInfoPrevious = new SEIColourRemappingInfo(); 3052 } 3053 m_pcSeiColourRemappingInfoPrevious->copyFrom(*seiColourRemappingInfo); 3054 } 3055 else // using the last CRI SEI received 3056 { 3057 // TODO: prevent persistence of CRI SEI across C(L)VS. 3058 if (m_pcSeiColourRemappingInfoPrevious != NULL) 3059 { 3060 if (m_pcSeiColourRemappingInfoPrevious->m_colourRemapPersistenceFlag == false) 3061 { 3062 printf("Warning No SEI-CRI message is present for the current picture, persistence of the CRI is not managed\n"); 3063 } 3064 applyColourRemapping(*pcPic->getPicYuvRec(), *m_pcSeiColourRemappingInfoPrevious, sps); 3065 } 3066 } 3067 } 3068 3069 // compute lut from SEI 3070 // use at lutPoints points aligned on a power of 2 value 3071 // SEI Lut must be in ascending values of coded Values 3072 static std::vector<Int> 3073 initColourRemappingInfoLut(const Int bitDepth_in, // bit-depth of the input values of the LUT 3074 const Int nbDecimalValues, // Position of the fixed point 3075 const std::vector<SEIColourRemappingInfo::CRIlut> &lut, 3076 const Int maxValue, // maximum output value 3077 const Int lutOffset) 3078 { 3079 const Int lutPoints = (1 << bitDepth_in) + 1 ; 3080 std::vector<Int> retLut(lutPoints); 3081 3082 // missing values: need to define default values before first definition (check codedValue[0] == 0) 3083 Int iTargetPrev = (lut.size() && lut[0].codedValue == 0) ? lut[0].targetValue: 0; 3084 Int startPivot = (lut.size())? ((lut[0].codedValue == 0)? 1: 0): 1; 3085 Int iCodedPrev = 0; 3086 // set max value with the coded bit-depth 3087 // + ((1 << nbDecimalValues) - 1) is for the added bits 3088 const Int maxValueFixedPoint = (maxValue << nbDecimalValues) + ((1 << nbDecimalValues) - 1); 3089 3090 Int iValue = 0; 3091 3092 for ( Int iPivot=startPivot ; iPivot < (Int)lut.size(); iPivot++ ) 3093 { 3094 Int iCodedNext = lut[iPivot].codedValue; 3095 Int iTargetNext = lut[iPivot].targetValue; 3096 3097 // ensure correct bit depth and avoid overflow in lut address 3098 Int iCodedNext_bitDepth = std::min(iCodedNext, (1 << bitDepth_in)); 3099 3100 const Int divValue = (iCodedNext - iCodedPrev > 0)? (iCodedNext - iCodedPrev): 1; 3101 const Int lutValInit = (lutOffset + iTargetPrev) << nbDecimalValues; 3102 const Int roundValue = divValue / 2; 3103 for ( ; iValue<iCodedNext_bitDepth; iValue++ ) 3104 { 3105 Int value = iValue; 3106 Int interpol = ((((value-iCodedPrev) * (iTargetNext - iTargetPrev)) << nbDecimalValues) + roundValue) / divValue; 3107 retLut[iValue] = std::min(lutValInit + interpol , maxValueFixedPoint); 3108 } 3109 iCodedPrev = iCodedNext; 3110 iTargetPrev = iTargetNext; 3111 } 3112 // fill missing values if necessary 3113 if(iCodedPrev < (1 << bitDepth_in)+1) 3114 { 3115 Int iCodedNext = (1 << bitDepth_in); 3116 Int iTargetNext = (1 << bitDepth_in) - 1; 3117 3118 const Int divValue = (iCodedNext - iCodedPrev > 0)? (iCodedNext - iCodedPrev): 1; 3119 const Int lutValInit = (lutOffset + iTargetPrev) << nbDecimalValues; 3120 const Int roundValue = divValue / 2; 3121 3122 for ( ; iValue<=iCodedNext; iValue++ ) 3123 { 3124 Int value = iValue; 3125 Int interpol = ((((value-iCodedPrev) * (iTargetNext - iTargetPrev)) << nbDecimalValues) + roundValue) / divValue; 3126 retLut[iValue] = std::min(lutValInit + interpol , maxValueFixedPoint); 3127 } 3128 } 3129 return retLut; 3130 } 3131 3132 static Void 3133 initColourRemappingInfoLuts(std::vector<Int> (&preLut)[3], 3134 std::vector<Int> (&postLut)[3], 3135 SEIColourRemappingInfo &pCriSEI, 3136 const Int maxBitDepth) 3137 { 3138 Int internalBitDepth = pCriSEI.m_colourRemapBitDepth; 3139 for ( Int c=0 ; c<3 ; c++ ) 3140 { 3141 std::sort(pCriSEI.m_preLut[c].begin(), pCriSEI.m_preLut[c].end()); // ensure preLut is ordered in ascending values of codedValues 3142 preLut[c] = initColourRemappingInfoLut(pCriSEI.m_colourRemapInputBitDepth, maxBitDepth - pCriSEI.m_colourRemapInputBitDepth, pCriSEI.m_preLut[c], ((1 << internalBitDepth) - 1), 0); //Fill preLut 3143 3144 std::sort(pCriSEI.m_postLut[c].begin(), pCriSEI.m_postLut[c].end()); // ensure postLut is ordered in ascending values of codedValues 3145 postLut[c] = initColourRemappingInfoLut(pCriSEI.m_colourRemapBitDepth, maxBitDepth - pCriSEI.m_colourRemapBitDepth, pCriSEI.m_postLut[c], (1 << internalBitDepth) - 1, 0); //Fill postLut 3146 } 3147 } 3148 3149 // apply lut. 3150 // Input lut values are aligned on power of 2 boundaries 3151 static Int 3152 applyColourRemappingInfoLut1D(Int inVal, const std::vector<Int> &lut, const Int inValPrecisionBits) 3153 { 3154 const Int roundValue = (inValPrecisionBits)? 1 << (inValPrecisionBits - 1): 0; 3155 inVal = std::min(std::max(0, inVal), (Int)(((lut.size()-1) << inValPrecisionBits))); 3156 Int index = (Int) std::min((inVal >> inValPrecisionBits), (Int)(lut.size()-2)); 3157 Int outVal = (( inVal - (index<<inValPrecisionBits) ) * (lut[index+1] - lut[index]) + roundValue) >> inValPrecisionBits; 3158 outVal += lut[index] ; 3159 3160 return outVal; 3161 } 3162 3163 static Int 3164 applyColourRemappingInfoMatrix(const Int (&colourRemapCoeffs)[3], const Int postOffsetShift, const Int p0, const Int p1, const Int p2, const Int offset) 3165 { 3166 Int YUVMat = (colourRemapCoeffs[0]* p0 + colourRemapCoeffs[1]* p1 + colourRemapCoeffs[2]* p2 + offset) >> postOffsetShift; 3167 return YUVMat; 3168 } 3169 3170 static Void 3171 setColourRemappingInfoMatrixOffset(Int (&matrixOffset)[3], Int offset0, Int offset1, Int offset2) 3172 { 3173 matrixOffset[0] = offset0; 3174 matrixOffset[1] = offset1; 3175 matrixOffset[2] = offset2; 3176 } 3177 3178 static Void 3179 setColourRemappingInfoMatrixOffsets( Int (&matrixInputOffset)[3], 3180 Int (&matrixOutputOffset)[3], 3181 const Int bitDepth, 3182 const Bool crInputFullRangeFlag, 3183 const Int crInputMatrixCoefficients, 3184 const Bool crFullRangeFlag, 3185 const Int crMatrixCoefficients) 3186 { 3187 // set static matrix offsets 3188 Int crInputOffsetLuma = (crInputFullRangeFlag)? 0:-(16 << (bitDepth-8)); 3189 Int crOffsetLuma = (crFullRangeFlag)? 0:(16 << (bitDepth-8)); 3190 Int crInputOffsetChroma = 0; 3191 Int crOffsetChroma = 0; 3192 3193 switch(crInputMatrixCoefficients) 3194 { 3195 case MATRIX_COEFFICIENTS_RGB: 3196 crInputOffsetChroma = 0; 3197 if(!crInputFullRangeFlag) 3198 { 3199 fprintf(stderr, "WARNING: crInputMatrixCoefficients set to MATRIX_COEFFICIENTS_RGB and crInputFullRangeFlag not set\n"); 3200 crInputOffsetLuma = 0; 3201 } 3202 break; 3203 case MATRIX_COEFFICIENTS_UNSPECIFIED: 3204 case MATRIX_COEFFICIENTS_BT709: 3205 case MATRIX_COEFFICIENTS_BT2020_NON_CONSTANT_LUMINANCE: 3206 crInputOffsetChroma = -(1 << (bitDepth-1)); 3207 break; 3208 default: 3209 fprintf(stderr, "WARNING: crInputMatrixCoefficients set to undefined value: %d\n", crInputMatrixCoefficients); 3210 } 3211 3212 switch(crMatrixCoefficients) 3213 { 3214 case MATRIX_COEFFICIENTS_RGB: 3215 crOffsetChroma = 0; 3216 if(!crFullRangeFlag) 3217 { 3218 fprintf(stderr, "WARNING: crMatrixCoefficients set to MATRIX_COEFFICIENTS_RGB and crInputFullRangeFlag not set\n"); 3219 crOffsetLuma = 0; 3220 } 3221 break; 3222 case MATRIX_COEFFICIENTS_UNSPECIFIED: 3223 case MATRIX_COEFFICIENTS_BT709: 3224 case MATRIX_COEFFICIENTS_BT2020_NON_CONSTANT_LUMINANCE: 3225 crOffsetChroma = (1 << (bitDepth-1)); 3226 break; 3227 default: 3228 fprintf(stderr, "WARNING: crMatrixCoefficients set to undefined value: %d\n", crMatrixCoefficients); 3229 } 3230 3231 setColourRemappingInfoMatrixOffset(matrixInputOffset, crInputOffsetLuma, crInputOffsetChroma, crInputOffsetChroma); 3232 setColourRemappingInfoMatrixOffset(matrixOutputOffset, crOffsetLuma, crOffsetChroma, crOffsetChroma); 3233 } 3234 3235 Void TAppDecTop::applyColourRemapping(const TComPicYuv& pic, SEIColourRemappingInfo& criSEI, const TComSPS &activeSPS) 3236 { 3237 const Int maxBitDepth = 16; 3238 3239 // create colour remapped picture 3240 if( !criSEI.m_colourRemapCancelFlag && pic.getChromaFormat()!=CHROMA_400) // 4:0:0 not supported. 3241 { 3242 const Int iHeight = pic.getHeight(COMPONENT_Y); 3243 const Int iWidth = pic.getWidth(COMPONENT_Y); 3244 const ChromaFormat chromaFormatIDC = pic.getChromaFormat(); 3245 3246 TComPicYuv picYuvColourRemapped; 3247 picYuvColourRemapped.createWithoutCUInfo( iWidth, iHeight, chromaFormatIDC ); 3248 3249 const Int iStrideIn = pic.getStride(COMPONENT_Y); 3250 const Int iCStrideIn = pic.getStride(COMPONENT_Cb); 3251 const Int iStrideOut = picYuvColourRemapped.getStride(COMPONENT_Y); 3252 const Int iCStrideOut = picYuvColourRemapped.getStride(COMPONENT_Cb); 3253 const Bool b444 = ( pic.getChromaFormat() == CHROMA_444 ); 3254 const Bool b422 = ( pic.getChromaFormat() == CHROMA_422 ); 3255 const Bool b420 = ( pic.getChromaFormat() == CHROMA_420 ); 3256 3257 std::vector<Int> preLut[3]; 3258 std::vector<Int> postLut[3]; 3259 Int matrixInputOffset[3]; 3260 Int matrixOutputOffset[3]; 3261 const Pel *YUVIn[MAX_NUM_COMPONENT]; 3262 Pel *YUVOut[MAX_NUM_COMPONENT]; 3263 YUVIn[COMPONENT_Y] = pic.getAddr(COMPONENT_Y); 3264 YUVIn[COMPONENT_Cb] = pic.getAddr(COMPONENT_Cb); 3265 YUVIn[COMPONENT_Cr] = pic.getAddr(COMPONENT_Cr); 3266 YUVOut[COMPONENT_Y] = picYuvColourRemapped.getAddr(COMPONENT_Y); 3267 YUVOut[COMPONENT_Cb] = picYuvColourRemapped.getAddr(COMPONENT_Cb); 3268 YUVOut[COMPONENT_Cr] = picYuvColourRemapped.getAddr(COMPONENT_Cr); 3269 3270 const Int bitDepth = criSEI.m_colourRemapBitDepth; 3271 BitDepths bitDepthsCriFile; 3272 bitDepthsCriFile.recon[CHANNEL_TYPE_LUMA] = bitDepth; 3273 bitDepthsCriFile.recon[CHANNEL_TYPE_CHROMA] = bitDepth; // Different bitdepth is not implemented 3274 3275 const Int postOffsetShift = criSEI.m_log2MatrixDenom; 3276 const Int matrixRound = 1 << (postOffsetShift - 1); 3277 const Int postLutInputPrecision = (maxBitDepth - criSEI.m_colourRemapBitDepth); 3278 3279 if ( ! criSEI.m_colourRemapVideoSignalInfoPresentFlag ) // setting default 3280 { 3281 setColourRemappingInfoMatrixOffsets(matrixInputOffset, matrixOutputOffset, maxBitDepth, 3282 activeSPS.getVuiParameters()->getVideoFullRangeFlag(), activeSPS.getVuiParameters()->getMatrixCoefficients(), 3283 activeSPS.getVuiParameters()->getVideoFullRangeFlag(), activeSPS.getVuiParameters()->getMatrixCoefficients()); 3284 } 3285 else 3286 { 3287 setColourRemappingInfoMatrixOffsets(matrixInputOffset, matrixOutputOffset, maxBitDepth, 3288 activeSPS.getVuiParameters()->getVideoFullRangeFlag(), activeSPS.getVuiParameters()->getMatrixCoefficients(), 3289 criSEI.m_colourRemapFullRangeFlag, criSEI.m_colourRemapMatrixCoefficients); 3290 } 3291 3292 // add matrix rounding to output matrix offsets 3293 matrixOutputOffset[0] = (matrixOutputOffset[0] << postOffsetShift) + matrixRound; 3294 matrixOutputOffset[1] = (matrixOutputOffset[1] << postOffsetShift) + matrixRound; 3295 matrixOutputOffset[2] = (matrixOutputOffset[2] << postOffsetShift) + matrixRound; 3296 3297 // Merge matrixInputOffset and matrixOutputOffset to matrixOutputOffset 3298 matrixOutputOffset[0] += applyColourRemappingInfoMatrix(criSEI.m_colourRemapCoeffs[0], 0, matrixInputOffset[0], matrixInputOffset[1], matrixInputOffset[2], 0); 3299 matrixOutputOffset[1] += applyColourRemappingInfoMatrix(criSEI.m_colourRemapCoeffs[1], 0, matrixInputOffset[0], matrixInputOffset[1], matrixInputOffset[2], 0); 3300 matrixOutputOffset[2] += applyColourRemappingInfoMatrix(criSEI.m_colourRemapCoeffs[2], 0, matrixInputOffset[0], matrixInputOffset[1], matrixInputOffset[2], 0); 3301 3302 // rescaling output: include CRI/output frame difference 3303 const Int scaleShiftOut_neg = abs(bitDepth - maxBitDepth); 3304 const Int scaleOut_round = 1 << (scaleShiftOut_neg-1); 3305 3306 initColourRemappingInfoLuts(preLut, postLut, criSEI, maxBitDepth); 3307 3308 assert(pic.getChromaFormat() != CHROMA_400); 3309 const Int hs = pic.getComponentScaleX(ComponentID(COMPONENT_Cb)); 3310 const Int maxOutputValue = (1 << bitDepth) - 1; 3311 3312 for( Int y = 0; y < iHeight; y++ ) 3313 { 3314 for( Int x = 0; x < iWidth; x++ ) 3315 { 3316 const Int xc = (x>>hs); 3317 Bool computeChroma = b444 || ((b422 || !(y&1)) && !(x&1)); 3318 3319 Int YUVPre_0 = applyColourRemappingInfoLut1D(YUVIn[COMPONENT_Y][x], preLut[0], 0); 3320 Int YUVPre_1 = applyColourRemappingInfoLut1D(YUVIn[COMPONENT_Cb][xc], preLut[1], 0); 3321 Int YUVPre_2 = applyColourRemappingInfoLut1D(YUVIn[COMPONENT_Cr][xc], preLut[2], 0); 3322 3323 Int YUVMat_0 = applyColourRemappingInfoMatrix(criSEI.m_colourRemapCoeffs[0], postOffsetShift, YUVPre_0, YUVPre_1, YUVPre_2, matrixOutputOffset[0]); 3324 Int YUVLutB_0 = applyColourRemappingInfoLut1D(YUVMat_0, postLut[0], postLutInputPrecision); 3325 YUVOut[COMPONENT_Y][x] = std::min(maxOutputValue, (YUVLutB_0 + scaleOut_round) >> scaleShiftOut_neg); 3326 3327 if( computeChroma ) 3328 { 3329 Int YUVMat_1 = applyColourRemappingInfoMatrix(criSEI.m_colourRemapCoeffs[1], postOffsetShift, YUVPre_0, YUVPre_1, YUVPre_2, matrixOutputOffset[1]); 3330 Int YUVLutB_1 = applyColourRemappingInfoLut1D(YUVMat_1, postLut[1], postLutInputPrecision); 3331 YUVOut[COMPONENT_Cb][xc] = std::min(maxOutputValue, (YUVLutB_1 + scaleOut_round) >> scaleShiftOut_neg); 3332 3333 Int YUVMat_2 = applyColourRemappingInfoMatrix(criSEI.m_colourRemapCoeffs[2], postOffsetShift, YUVPre_0, YUVPre_1, YUVPre_2, matrixOutputOffset[2]); 3334 Int YUVLutB_2 = applyColourRemappingInfoLut1D(YUVMat_2, postLut[2], postLutInputPrecision); 3335 YUVOut[COMPONENT_Cr][xc] = std::min(maxOutputValue, (YUVLutB_2 + scaleOut_round) >> scaleShiftOut_neg); 3336 } 3337 } 3338 3339 YUVIn[COMPONENT_Y] += iStrideIn; 3340 YUVOut[COMPONENT_Y] += iStrideOut; 3341 if( !(b420 && !(y&1)) ) 3342 { 3343 YUVIn[COMPONENT_Cb] += iCStrideIn; 3344 YUVIn[COMPONENT_Cr] += iCStrideIn; 3345 YUVOut[COMPONENT_Cb] += iCStrideOut; 3346 YUVOut[COMPONENT_Cr] += iCStrideOut; 3347 } 3348 } 3349 //Write remapped picture in display order 3350 picYuvColourRemapped.dump( m_colourRemapSEIFileName, bitDepthsCriFile, true ); 3351 picYuvColourRemapped.destroy(); 3352 } 3353 } 3009 3354 //! \} -
TabularUnified branches/HTM-15.2-dev/source/App/TAppDecoder/TAppDecTop.h ¶
r1321 r1360 128 128 #endif 129 129 std::ofstream m_seiMessageFileStream; ///< Used for outputing SEI messages. 130 131 SEIColourRemappingInfo* m_pcSeiColourRemappingInfoPrevious; 132 130 133 public: 131 134 TAppDecTop(); … … 206 209 Void xCropAndOutput ( TComPic* curPic ); 207 210 #endif 211 212 private: 213 Void applyColourRemapping(const TComPicYuv& pic, SEIColourRemappingInfo& pCriSEI, const TComSPS &activeSPS); 214 Void xOutputColourRemapPic(TComPic* pcPic); 208 215 }; 209 216 -
TabularUnified branches/HTM-15.2-dev/source/App/TAppEncoder/TAppEncCfg.cpp ¶
r1356 r1360 109 109 110 110 TAppEncCfg::TAppEncCfg() 111 #if NH_MV 112 : m_pchBitstreamFile() 113 #else 114 : m_pchInputFile() 115 , m_pchBitstreamFile() 116 , m_pchReconFile() 117 #endif 118 , m_inputColourSpaceConvert(IPCOLOURSPACE_UNCHANGED) 111 : m_inputColourSpaceConvert(IPCOLOURSPACE_UNCHANGED) 119 112 , m_snrInternalColourSpace(false) 120 113 , m_outputInternalColourSpace(false) 121 , m_pchdQPFile()122 , m_scalingListFile()123 114 { 124 115 #if !NH_MV … … 171 162 m_targetPivotValue = NULL; 172 163 } 173 #if !NH_MV174 free(m_pchInputFile);175 #endif176 free(m_pchBitstreamFile);177 164 #if NH_MV 178 165 for(Int i = 0; i< m_pchReconFileList.size(); i++ ) … … 181 168 free (m_pchReconFileList[i]); 182 169 } 183 #else 184 free(m_pchReconFile); 185 #endif 186 free(m_pchdQPFile); 187 free(m_scalingListFile); 188 #if NH_MV 170 189 171 for( Int i = 0; i < m_GOPListMvc.size(); i++ ) 190 172 { … … 196 178 } 197 179 #endif 180 198 181 #if NH_3D 199 182 #if NH_3D_VSO … … 302 285 } 303 286 304 Bool confirmPara(Bool bflag, const Char* message);287 Bool confirmPara(Bool bflag, const TChar* message); 305 288 306 289 static inline ChromaFormat numberToChromaFormat(const Int val) … … 318 301 static const struct MapStrToProfile 319 302 { 320 const Char* str;303 const TChar* str; 321 304 Profile::Name value; 322 305 } … … 340 323 static const struct MapStrToExtendedProfile 341 324 { 342 const Char* str;325 const TChar* str; 343 326 ExtendedProfileName value; 344 327 } … … 405 388 static const struct MapStrToTier 406 389 { 407 const Char* str;390 const TChar* str; 408 391 Level::Tier value; 409 392 } … … 416 399 static const struct MapStrToLevel 417 400 { 418 const Char* str;401 const TChar* str; 419 402 Level::Name value; 420 403 } … … 438 421 }; 439 422 423 #if U0132_TARGET_BITS_SATURATION 424 UInt g_uiMaxCpbSize[2][21] = 425 { 426 // LEVEL1, LEVEL2,LEVEL2_1, LEVEL3, LEVEL3_1, LEVEL4, LEVEL4_1, LEVEL5, LEVEL5_1, LEVEL5_2, LEVEL6, LEVEL6_1, LEVEL6_2 427 { 0, 0, 0, 350000, 0, 0, 1500000, 3000000, 0, 6000000, 10000000, 0, 12000000, 20000000, 0, 25000000, 40000000, 60000000, 60000000, 120000000, 240000000 }, 428 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30000000, 50000000, 0, 100000000, 160000000, 240000000, 240000000, 480000000, 800000000 } 429 }; 430 #endif 431 440 432 static const struct MapStrToCostMode 441 433 { 442 const Char* str;434 const TChar* str; 443 435 CostMode value; 444 436 } … … 453 445 static const struct MapStrToScalingListMode 454 446 { 455 const Char* str;447 const TChar* str; 456 448 ScalingListMode value; 457 449 } … … 533 525 { 534 526 const T minValIncl; 535 const T maxValIncl; // Use 0 for unlimited527 const T maxValIncl; 536 528 const std::size_t minNumValuesIncl; 537 529 const std::size_t maxNumValuesIncl; // Use 0 for unlimited … … 545 537 SMultiValueInput<T> &operator=(const std::vector<T> &userValues) { values=userValues; return *this; } 546 538 SMultiValueInput<T> &operator=(const SMultiValueInput<T> &userValues) { values=userValues.values; return *this; } 539 540 T readValue(const TChar *&pStr, Bool &bSuccess); 541 542 istream& readValues(std::istream &in); 547 543 }; 548 544 549 static inline istream& operator >> (istream &in, SMultiValueInput<UInt> &values) 545 template <class T> 546 static inline istream& operator >> (std::istream &in, SMultiValueInput<T> &values) 550 547 { 551 values.values.clear(); 548 return values.readValues(in); 549 } 550 551 template<> 552 UInt SMultiValueInput<UInt>::readValue(const TChar *&pStr, Bool &bSuccess) 553 { 554 TChar *eptr; 555 UInt val=strtoul(pStr, &eptr, 0); 556 pStr=eptr; 557 bSuccess=!(*eptr!=0 && !isspace(*eptr) && *eptr!=',') && !(val<minValIncl || val>maxValIncl); 558 return val; 559 } 560 561 template<> 562 Int SMultiValueInput<Int>::readValue(const TChar *&pStr, Bool &bSuccess) 563 { 564 TChar *eptr; 565 Int val=strtol(pStr, &eptr, 0); 566 pStr=eptr; 567 bSuccess=!(*eptr!=0 && !isspace(*eptr) && *eptr!=',') && !(val<minValIncl || val>maxValIncl); 568 return val; 569 } 570 571 template<> 572 Double SMultiValueInput<Double>::readValue(const TChar *&pStr, Bool &bSuccess) 573 { 574 TChar *eptr; 575 Double val=strtod(pStr, &eptr); 576 pStr=eptr; 577 bSuccess=!(*eptr!=0 && !isspace(*eptr) && *eptr!=',') && !(val<minValIncl || val>maxValIncl); 578 return val; 579 } 580 581 template<> 582 Bool SMultiValueInput<Bool>::readValue(const TChar *&pStr, Bool &bSuccess) 583 { 584 TChar *eptr; 585 Int val=strtol(pStr, &eptr, 0); 586 pStr=eptr; 587 bSuccess=!(*eptr!=0 && !isspace(*eptr) && *eptr!=',') && !(val<Int(minValIncl) || val>Int(maxValIncl)); 588 return val!=0; 589 } 590 591 template <class T> 592 istream& SMultiValueInput<T>::readValues(std::istream &in) 593 { 594 values.clear(); 552 595 string str; 553 596 while (!in.eof()) … … 557 600 if (!str.empty()) 558 601 { 559 const Char *pStr=str.c_str();602 const TChar *pStr=str.c_str(); 560 603 // soak up any whitespace 561 604 for(;isspace(*pStr);pStr++); … … 563 606 while (*pStr != 0) 564 607 { 565 Char *eptr;566 UInt val=strtoul(pStr, &eptr, 0);567 if ( *eptr!=0 && !isspace(*eptr) && *eptr!=',')608 Bool bSuccess=true; 609 T val=readValue(pStr, bSuccess); 610 if (!bSuccess) 568 611 { 569 612 in.setstate(ios::failbit); 570 613 break; 571 614 } 572 if (val<values.minValIncl || val>values.maxValIncl) 615 616 if (maxNumValuesIncl != 0 && values.size() >= maxNumValuesIncl) 573 617 { 574 618 in.setstate(ios::failbit); 575 619 break; 576 620 } 577 578 if (values.maxNumValuesIncl != 0 && values.values.size() >= values.maxNumValuesIncl) 579 { 580 in.setstate(ios::failbit); 581 break; 582 } 583 values.values.push_back(val); 621 values.push_back(val); 584 622 // soak up any whitespace and up to 1 comma. 585 pStr=eptr;586 623 for(;isspace(*pStr);pStr++); 587 624 if (*pStr == ',') … … 592 629 } 593 630 } 594 if (values.values.size() < values.minNumValuesIncl) 595 { 596 in.setstate(ios::failbit); 597 } 598 return in; 599 } 600 601 static inline istream& operator >> (istream &in, SMultiValueInput<Int> &values) 602 { 603 values.values.clear(); 604 string str; 605 while (!in.eof()) 606 { 607 string tmp; in >> tmp; str+=" " + tmp; 608 } 609 if (!str.empty()) 610 { 611 const Char *pStr=str.c_str(); 612 // soak up any whitespace 613 for(;isspace(*pStr);pStr++); 614 615 while (*pStr != 0) 616 { 617 Char *eptr; 618 Int val=strtol(pStr, &eptr, 0); 619 if (*eptr!=0 && !isspace(*eptr) && *eptr!=',') 620 { 621 in.setstate(ios::failbit); 622 break; 623 } 624 if (val<values.minValIncl || val>values.maxValIncl) 625 { 626 in.setstate(ios::failbit); 627 break; 628 } 629 630 if (values.maxNumValuesIncl != 0 && values.values.size() >= values.maxNumValuesIncl) 631 { 632 in.setstate(ios::failbit); 633 break; 634 } 635 values.values.push_back(val); 636 // soak up any whitespace and up to 1 comma. 637 pStr=eptr; 638 for(;isspace(*pStr);pStr++); 639 if (*pStr == ',') 640 { 641 pStr++; 642 } 643 for(;isspace(*pStr);pStr++); 644 } 645 } 646 if (values.values.size() < values.minNumValuesIncl) 647 { 648 in.setstate(ios::failbit); 649 } 650 return in; 651 } 652 653 static inline istream& operator >> (istream &in, SMultiValueInput<Bool> &values) 654 { 655 values.values.clear(); 656 string str; 657 while (!in.eof()) 658 { 659 string tmp; in >> tmp; str+=" " + tmp; 660 } 661 if (!str.empty()) 662 { 663 const Char *pStr=str.c_str(); 664 // soak up any whitespace 665 for(;isspace(*pStr);pStr++); 666 667 while (*pStr != 0) 668 { 669 Char *eptr; 670 Int val=strtol(pStr, &eptr, 0); 671 if (*eptr!=0 && !isspace(*eptr) && *eptr!=',') 672 { 673 in.setstate(ios::failbit); 674 break; 675 } 676 if (val<Int(values.minValIncl) || val>Int(values.maxValIncl)) 677 { 678 in.setstate(ios::failbit); 679 break; 680 } 681 682 if (values.maxNumValuesIncl != 0 && values.values.size() >= values.maxNumValuesIncl) 683 { 684 in.setstate(ios::failbit); 685 break; 686 } 687 values.values.push_back(val!=0); 688 // soak up any whitespace and up to 1 comma. 689 pStr=eptr; 690 for(;isspace(*pStr);pStr++); 691 if (*pStr == ',') 692 { 693 pStr++; 694 } 695 for(;isspace(*pStr);pStr++); 696 } 697 } 698 if (values.values.size() < values.minNumValuesIncl) 631 if (values.size() < minNumValuesIncl) 699 632 { 700 633 in.setstate(ios::failbit); … … 786 719 \retval true when success 787 720 */ 788 Bool TAppEncCfg::parseCfg( Int argc, Char* argv[] )721 Bool TAppEncCfg::parseCfg( Int argc, TChar* argv[] ) 789 722 { 790 723 Bool do_help = false; … … 815 748 Int tmpInputChromaFormat; 816 749 Int tmpConstraintChromaFormat; 750 Int tmpWeightedPredictionMethod; 751 Int tmpFastInterSearchMode; 752 Int tmpMotionEstimationSearchMethod; 753 Int tmpSliceMode; 754 Int tmpSliceSegmentMode; 755 Int tmpDecodedPictureHashSEIMappedType; 817 756 string inputColourSpaceConvert; 818 757 #if NH_MV … … 829 768 SMultiValueInput<Int> cfg_codedPivotValue (std::numeric_limits<Int>::min(), std::numeric_limits<Int>::max(), 0, 1<<16); 830 769 SMultiValueInput<Int> cfg_targetPivotValue (std::numeric_limits<Int>::min(), std::numeric_limits<Int>::max(), 0, 1<<16); 770 771 SMultiValueInput<Double> cfg_adIntraLambdaModifier (0, std::numeric_limits<Double>::max(), 0, MAX_TLAYER); ///< Lambda modifier for Intra pictures, one for each temporal layer. If size>temporalLayer, then use [temporalLayer], else if size>0, use [size()-1], else use m_adLambdaModifier. 772 831 773 832 774 const UInt defaultInputKneeCodes[3] = { 600, 800, 900 }; … … 866 808 ("InputFile_%d,i_%d", m_pchInputFileList, (char *) 0 , MAX_NUM_LAYER_IDS , "original Yuv input file name %d") 867 809 #else 868 ("InputFile,i", cfg_InputFile,string(""), "Original YUV input file name")869 #endif 870 ("BitstreamFile,b", cfg_BitstreamFile,string(""), "Bitstream output file name")810 ("InputFile,i", m_inputFileName, string(""), "Original YUV input file name") 811 #endif 812 ("BitstreamFile,b", m_bitstreamFileName, string(""), "Bitstream output file name") 871 813 #if NH_MV 872 814 ("ReconFile_%d,o_%d", m_pchReconFileList, (char *) 0 , MAX_NUM_LAYER_IDS , "reconstructed Yuv output file name %d") 873 815 #else 874 ("ReconFile,o", cfg_ReconFile,string(""), "Reconstructed YUV output file name")816 ("ReconFile,o", m_reconFileName, string(""), "Reconstructed YUV output file name") 875 817 #endif 876 818 #if NH_MV … … 941 883 ("ConfWinTop", m_confWinTop, 0, "Top offset for window conformance mode 3") 942 884 ("ConfWinBottom", m_confWinBottom, 0, "Bottom offset for window conformance mode 3") 885 ("AccessUnitDelimiter", m_AccessUnitDelimiter, false, "Enable Access Unit Delimiter NALUs") 943 886 ("FrameRate,-fr", m_iFrameRate, 0, "Frame rate") 944 887 ("FrameSkip,-fs", m_FrameSkip, 0u, "Number of frames to skip at start of input YUV") … … 1003 946 // motion search options 1004 947 ("DisableIntraInInter", m_bDisableIntraPUsInInterSlices, false, "Flag to disable intra PUs in inter slices") 1005 ("FastSearch", m_iFastSearch, 1, "0:Full search 1:Diamond 2:PMVFAST")948 ("FastSearch", tmpMotionEstimationSearchMethod, Int(MESEARCH_DIAMOND), "0:Full search 1:Diamond 2:Selective 3:Enhanced Diamond") 1006 949 ("SearchRange,-sr", m_iSearchRange, 96, "Motion search range") 1007 950 #if NH_MV … … 1010 953 #endif 1011 954 ("BipredSearchRange", m_bipredSearchRange, 4, "Motion search range for bipred refinement") 955 ("MinSearchWindow", m_minSearchWindow, 8, "Minimum motion search window size for the adaptive window ME") 956 ("RestrictMESampling", m_bRestrictMESampling, false, "Restrict ME Sampling for selective inter motion search") 1012 957 ("ClipForBiPredMEEnabled", m_bClipForBiPredMeEnabled, false, "Enables clipping in the Bi-Pred ME. It is disabled to reduce encoder run-time") 1013 958 ("FastMEAssumingSmootherMVEnabled", m_bFastMEAssumingSmootherMVEnabled, true, "Enables fast ME assuming a smoother MV.") … … 1017 962 1018 963 // Mode decision parameters 1019 ("LambdaModifier0,-LM0", m_adLambdaModifier[ 0 ], ( Double )1.0, "Lambda modifier for temporal layer 0") 1020 ("LambdaModifier1,-LM1", m_adLambdaModifier[ 1 ], ( Double )1.0, "Lambda modifier for temporal layer 1") 1021 ("LambdaModifier2,-LM2", m_adLambdaModifier[ 2 ], ( Double )1.0, "Lambda modifier for temporal layer 2") 1022 ("LambdaModifier3,-LM3", m_adLambdaModifier[ 3 ], ( Double )1.0, "Lambda modifier for temporal layer 3") 1023 ("LambdaModifier4,-LM4", m_adLambdaModifier[ 4 ], ( Double )1.0, "Lambda modifier for temporal layer 4") 1024 ("LambdaModifier5,-LM5", m_adLambdaModifier[ 5 ], ( Double )1.0, "Lambda modifier for temporal layer 5") 1025 ("LambdaModifier6,-LM6", m_adLambdaModifier[ 6 ], ( Double )1.0, "Lambda modifier for temporal layer 6") 964 ("LambdaModifier0,-LM0", m_adLambdaModifier[ 0 ], ( Double )1.0, "Lambda modifier for temporal layer 0. If LambdaModifierI is used, this will not affect intra pictures") 965 ("LambdaModifier1,-LM1", m_adLambdaModifier[ 1 ], ( Double )1.0, "Lambda modifier for temporal layer 1. If LambdaModifierI is used, this will not affect intra pictures") 966 ("LambdaModifier2,-LM2", m_adLambdaModifier[ 2 ], ( Double )1.0, "Lambda modifier for temporal layer 2. If LambdaModifierI is used, this will not affect intra pictures") 967 ("LambdaModifier3,-LM3", m_adLambdaModifier[ 3 ], ( Double )1.0, "Lambda modifier for temporal layer 3. If LambdaModifierI is used, this will not affect intra pictures") 968 ("LambdaModifier4,-LM4", m_adLambdaModifier[ 4 ], ( Double )1.0, "Lambda modifier for temporal layer 4. If LambdaModifierI is used, this will not affect intra pictures") 969 ("LambdaModifier5,-LM5", m_adLambdaModifier[ 5 ], ( Double )1.0, "Lambda modifier for temporal layer 5. If LambdaModifierI is used, this will not affect intra pictures") 970 ("LambdaModifier6,-LM6", m_adLambdaModifier[ 6 ], ( Double )1.0, "Lambda modifier for temporal layer 6. If LambdaModifierI is used, this will not affect intra pictures") 971 ("LambdaModifierI,-LMI", cfg_adIntraLambdaModifier, cfg_adIntraLambdaModifier, "Lambda modifiers for Intra pictures, comma separated, up to one the number of temporal layer. If entry for temporalLayer exists, then use it, else if some are specified, use the last, else use the standard LambdaModifiers.") 972 ("IQPFactor,-IQF", m_dIntraQpFactor, -1.0, "Intra QP Factor for Lambda Computation. If negative, use the default equation: 0.57*(1.0 - Clip3( 0.0, 0.5, 0.05*(Double)(isField ? (GopSize-1)/2 : GopSize-1) ))") 1026 973 1027 974 /* Quantization parameters */ … … 1046 993 ("AdaptiveQP,-aq", m_bUseAdaptiveQP, false, "QP adaptation based on a psycho-visual model") 1047 994 ("MaxQPAdaptationRange,-aqr", m_iQPAdaptationRange, 6, "QP adaptation range") 1048 ("dQPFile,m", cfg_dQPFile,string(""), "dQP file name")995 ("dQPFile,m", m_dQPFileName, string(""), "dQP file name") 1049 996 ("RDOQ", m_useRDOQ, true) 1050 997 ("RDOQTS", m_useRDOQTS, true) … … 1090 1037 ("MaxNumOffsetsPerPic", m_maxNumOffsetsPerPic, 2048, "Max number of SAO offset per picture (Default: 2048)") 1091 1038 ("SAOLcuBoundary", m_saoCtuBoundary, false, "0: right/bottom CTU boundary areas skipped from SAO parameter estimation, 1: non-deblocked pixels are used for those areas") 1092 ("SliceMode", m_sliceMode, 0, "0: Disable all Recon slice limits, 1: Enforce max # of CTUs, 2: Enforce max # of bytes, 3:specify tiles per dependent slice")1039 ("SliceMode", tmpSliceMode, Int(NO_SLICES), "0: Disable all Recon slice limits, 1: Enforce max # of CTUs, 2: Enforce max # of bytes, 3:specify tiles per dependent slice") 1093 1040 ("SliceArgument", m_sliceArgument, 0, "Depending on SliceMode being:" 1094 1041 "\t1: max number of CTUs per slice" 1095 1042 "\t2: max number of bytes per slice" 1096 1043 "\t3: max number of tiles per slice") 1097 ("SliceSegmentMode", m_sliceSegmentMode, 0, "0: Disable all slice segment limits, 1: Enforce max # of CTUs, 2: Enforce max # of bytes, 3:specify tiles per dependent slice")1044 ("SliceSegmentMode", tmpSliceSegmentMode, Int(NO_SLICES), "0: Disable all slice segment limits, 1: Enforce max # of CTUs, 2: Enforce max # of bytes, 3:specify tiles per dependent slice") 1098 1045 ("SliceSegmentArgument", m_sliceSegmentArgument, 0, "Depending on SliceSegmentMode being:" 1099 1046 "\t1: max number of CTUs per slice segment" … … 1112 1059 ("PCMInputBitDepthFlag", m_bPCMInputBitDepthFlag, true) 1113 1060 ("PCMFilterDisableFlag", m_bPCMFilterDisableFlag, false) 1114 ("IntraReferenceSmoothing", m_enableIntraReferenceSmoothing, true, "0: Disable use of intra reference smoothing . 1: Enable use of intra reference smoothing (not valid in V1 profiles)")1061 ("IntraReferenceSmoothing", m_enableIntraReferenceSmoothing, true, "0: Disable use of intra reference smoothing (not valid in V1 profiles). 1: Enable use of intra reference smoothing (same as V1)") 1115 1062 ("WeightedPredP,-wpP", m_useWeightedPred, false, "Use weighted prediction in P slices") 1116 1063 ("WeightedPredB,-wpB", m_useWeightedBiPred, false, "Use weighted (bidirectional) prediction in B slices") 1064 ("WeightedPredMethod,-wpM", tmpWeightedPredictionMethod, Int(WP_PER_PICTURE_WITH_SIMPLE_DC_COMBINED_COMPONENT), "Weighted prediction method") 1117 1065 ("Log2ParallelMergeLevel", m_log2ParallelMergeLevel, 2u, "Parallel merge estimation region") 1118 1066 //deprecated copies of renamed tile parameters … … 1127 1075 ("TileRowHeightArray", cfg_RowHeight, cfg_RowHeight, "Array containing tile row height values in units of CTU") 1128 1076 ("LFCrossTileBoundaryFlag", m_bLFCrossTileBoundaryFlag, true, "1: cross-tile-boundary loop filtering. 0:non-cross-tile-boundary loop filtering") 1129 ("WaveFrontSynchro", m_ iWaveFrontSynchro, 0, "0: no synchro; 1 synchro with top-right-right")1077 ("WaveFrontSynchro", m_entropyCodingSyncEnabledFlag, false, "0: entropy coding sync disabled; 1 entropy coding sync enabled") 1130 1078 ("ScalingList", m_useScalingListId, SCALING_LIST_OFF, "0/off: no scaling list, 1/default: default scaling lists, 2/file: scaling lists specified in ScalingListFile") 1131 ("ScalingListFile", cfg_ScalingListFile,string(""), "Scaling list file name. Use an empty string to produce help.")1079 ("ScalingListFile", m_scalingListFileName, string(""), "Scaling list file name. Use an empty string to produce help.") 1132 1080 ("SignHideFlag,-SBH", m_signHideFlag, true) 1133 1081 ("MaxNumMergeCand", m_maxNumMergeCand, 5u, "Maximum number of merge candidates") 1134 1082 /* Misc. */ 1135 ("SEIDecodedPictureHash", m_decodedPictureHashSEIEnabled,0, "Control generation of decode picture hash SEI messages\n"1083 ("SEIDecodedPictureHash", tmpDecodedPictureHashSEIMappedType, 0, "Control generation of decode picture hash SEI messages\n" 1136 1084 "\t3: checksum\n" 1137 1085 "\t2: CRC\n" … … 1139 1087 "\t0: disable") 1140 1088 ("TMVPMode", m_TMVPModeId, 1, "TMVP mode 0: TMVP disable for all slices. 1: TMVP enable for all slices (default) 2: TMVP enable for certain slices only") 1141 ("FEN", m_bUseFastEnc, false, "fast encoder setting")1089 ("FEN", tmpFastInterSearchMode, Int(FASTINTERSEARCH_DISABLED), "fast encoder setting") 1142 1090 ("ECU", m_bUseEarlyCU, false, "Early CU setting") 1143 1091 ("FDM", m_useFastDecisionForMerge, true, "Fast decision for Merge RD Cost") … … 1151 1099 ( "InitialQP", m_RCInitialQP, 0, "Rate control: initial QP" ) 1152 1100 ( "RCForceIntraQP", m_RCForceIntraQP, false, "Rate control: force intra QP to be equal to initial QP" ) 1101 1102 #if U0132_TARGET_BITS_SATURATION 1103 ( "RCCpbSaturation", m_RCCpbSaturationEnabled, false, "Rate control: enable target bits saturation to avoid CPB overflow and underflow" ) 1104 ( "RCCpbSize", m_RCCpbSize, 0u, "Rate control: CPB size" ) 1105 ( "RCInitialCpbFullness", m_RCInitialCpbFullness, 0.9, "Rate control: initial CPB fullness" ) 1106 #endif 1153 1107 1154 1108 #if KWU_RC_VIEWRC_E0227 … … 1227 1181 ("Log2MaxMvLengthHorizontal", m_log2MaxMvLengthHorizontal, 15, "Indicate the maximum absolute value of a decoded horizontal MV component in quarter-pel luma units") 1228 1182 ("Log2MaxMvLengthVertical", m_log2MaxMvLengthVertical, 15, "Indicate the maximum absolute value of a decoded vertical MV component in quarter-pel luma units") 1229 ("SEIRecoveryPoint", m_recoveryPointSEIEnabled, 0, "Control generation of recovery point SEI messages") 1230 ("SEIBufferingPeriod", m_bufferingPeriodSEIEnabled, 0, "Control generation of buffering period SEI messages") 1231 ("SEIPictureTiming", m_pictureTimingSEIEnabled, 0, "Control generation of picture timing SEI messages") 1183 ("SEIColourRemappingInfoFileRoot,-cri", m_colourRemapSEIFileRoot, string(""), "Colour Remapping Information SEI parameters root file name (wo num ext)") 1184 ("SEIRecoveryPoint", m_recoveryPointSEIEnabled, false, "Control generation of recovery point SEI messages") 1185 ("SEIBufferingPeriod", m_bufferingPeriodSEIEnabled, false, "Control generation of buffering period SEI messages") 1186 ("SEIPictureTiming", m_pictureTimingSEIEnabled, false, "Control generation of picture timing SEI messages") 1232 1187 ("SEIToneMappingInfo", m_toneMappingInfoSEIEnabled, false, "Control generation of Tone Mapping SEI messages") 1233 1188 ("SEIToneMapId", m_toneMapId, 0, "Specifies Id of Tone Mapping SEI message for a given session") … … 1262 1217 ("SEIToneMapNominalWhiteLevelLumaCodeValue", m_nominalWhiteLevelLumaCodeValue, 235, "Specifies luma sample value of the nominal white level assigned decoded pictures") 1263 1218 ("SEIToneMapExtendedWhiteLevelLumaCodeValue", m_extendedWhiteLevelLumaCodeValue, 300, "Specifies luma sample value of the extended dynamic range assigned decoded pictures") 1264 ("SEIChroma SamplingFilterHint", m_chromaSamplingFilterSEIenabled,false, "Control generation of the chroma sampling filter hint SEI message")1265 ("SEIChroma SamplingHorizontalFilterType", m_chromaSamplingHorFilterIdc,2, "Defines the Index of the chroma sampling horizontal filter\n"1219 ("SEIChromaResamplingFilterHint", m_chromaResamplingFilterSEIenabled, false, "Control generation of the chroma sampling filter hint SEI message") 1220 ("SEIChromaResamplingHorizontalFilterType", m_chromaResamplingHorFilterIdc, 2, "Defines the Index of the chroma sampling horizontal filter\n" 1266 1221 "\t0: unspecified - Chroma filter is unknown or is determined by the application" 1267 1222 "\t1: User-defined - Filter coefficients are specified in the chroma sampling filter hint SEI message" 1268 1223 "\t2: Standards-defined - ITU-T Rec. T.800 | ISO/IEC15444-1, 5/3 filter") 1269 ("SEIChroma SamplingVerticalFilterType", m_chromaSamplingVerFilterIdc, 2, "Defines the Index of the chroma sampling vertical filter\n"1224 ("SEIChromaResamplingVerticalFilterType", m_chromaResamplingVerFilterIdc, 2, "Defines the Index of the chroma sampling vertical filter\n" 1270 1225 "\t0: unspecified - Chroma filter is unknown or is determined by the application" 1271 1226 "\t1: User-defined - Filter coefficients are specified in the chroma sampling filter hint SEI message" 1272 1227 "\t2: Standards-defined - ITU-T Rec. T.800 | ISO/IEC15444-1, 5/3 filter") 1273 ("SEIFramePacking", m_framePackingSEIEnabled, 0, "Control generation of frame packing SEI messages")1228 ("SEIFramePacking", m_framePackingSEIEnabled, false, "Control generation of frame packing SEI messages") 1274 1229 ("SEIFramePackingType", m_framePackingSEIType, 0, "Define frame packing arrangement\n" 1275 1230 "\t3: side by side - frames are displayed horizontally\n" … … 1282 1237 "\t1: stereo pair, frame0 represents left view\n" 1283 1238 "\t2: stereo pair, frame0 represents right view") 1284 ("SEISegmentedRectFramePacking", m_segmentedRectFramePackingSEIEnabled, 0, "Controls generation of segmented rectangular frame packing SEI messages")1239 ("SEISegmentedRectFramePacking", m_segmentedRectFramePackingSEIEnabled, false, "Controls generation of segmented rectangular frame packing SEI messages") 1285 1240 ("SEISegmentedRectFramePackingCancel", m_segmentedRectFramePackingSEICancel, false, "If equal to 1, cancels the persistence of any previous SRFPA SEI message") 1286 1241 ("SEISegmentedRectFramePackingType", m_segmentedRectFramePackingSEIType, 0, "Specifies the arrangement of the frames in the reconstructed picture") … … 1289 1244 "\tN: 0 < N < (2^16 - 1) enable display orientation SEI message with anticlockwise_rotation = N and display_orientation_repetition_period = 1\n" 1290 1245 "\t0: disable") 1291 ("SEITemporalLevel0Index", m_temporalLevel0IndexSEIEnabled, 0, "Control generation of temporal level 0 index SEI messages")1292 ("SEIGradualDecodingRefreshInfo", m_gradualDecodingRefreshInfoEnabled, 0, "Control generation of gradual decoding refresh information SEI message")1246 ("SEITemporalLevel0Index", m_temporalLevel0IndexSEIEnabled, false, "Control generation of temporal level 0 index SEI messages") 1247 ("SEIGradualDecodingRefreshInfo", m_gradualDecodingRefreshInfoEnabled, false, "Control generation of gradual decoding refresh information SEI message") 1293 1248 ("SEINoDisplay", m_noDisplaySEITLayer, 0, "Control generation of no display SEI message\n" 1294 1249 "\tN: 0 < N enable no display SEI message for temporal layer N or higher\n" 1295 1250 "\t0: disable") 1296 ("SEIDecodingUnitInfo", m_decodingUnitInfoSEIEnabled, 0, "Control generation of decoding unit information SEI message.")1297 ("SEISOPDescription", m_SOPDescriptionSEIEnabled, 0, "Control generation of SOP description SEI messages")1298 ("SEIScalableNesting", m_scalableNestingSEIEnabled, 0, "Control generation of scalable nesting SEI messages")1251 ("SEIDecodingUnitInfo", m_decodingUnitInfoSEIEnabled, false, "Control generation of decoding unit information SEI message.") 1252 ("SEISOPDescription", m_SOPDescriptionSEIEnabled, false, "Control generation of SOP description SEI messages") 1253 ("SEIScalableNesting", m_scalableNestingSEIEnabled, false, "Control generation of scalable nesting SEI messages") 1299 1254 ("SEITempMotionConstrainedTileSets", m_tmctsSEIEnabled, false, "Control generation of temporal motion constrained tile sets SEI message") 1300 1255 ("SEITimeCodeEnabled", m_timeCodeSEIEnabled, false, "Control generation of time code information SEI message") … … 1341 1296 ("SEISubBitstreamMaxBitRate", m_sbPropMaxBitRate, IntAry1d (1,0) ,"Specifies maximum bit rate of the i-th sub-bitstream") 1342 1297 #else 1343 ("SeiCfgFileName_%d", m_seiCfgFileNames, ( Char *) 0 ,MAX_NUM_SEIS , "SEI cfg file name %d")1298 ("SeiCfgFileName_%d", m_seiCfgFileNames, (TChar *) 0 ,MAX_NUM_SEIS , "SEI cfg file name %d") 1344 1299 #endif 1345 1300 ("OutputVpsInfo", m_outputVpsInfo, false ,"Output information about the layer dependencies and layer sets") … … 1348 1303 /* Camera parameters */ 1349 1304 ("Depth420OutputFlag", m_depth420OutputFlag, true , "Output depth layers in 4:2:0 ") 1350 ("CameraParameterFile,cpf", m_pchCameraParameterFile, ( Char *) 0,"Camera Parameter File Name")1351 ("BaseViewCameraNumbers", m_pchBaseViewCameraNumbers, ( Char *) 0,"Numbers of base views")1305 ("CameraParameterFile,cpf", m_pchCameraParameterFile, (TChar *) 0 , "Camera Parameter File Name") 1306 ("BaseViewCameraNumbers", m_pchBaseViewCameraNumbers, (TChar *) 0 , "Numbers of base views") 1352 1307 ("CodedCamParsPrecision", m_iCodedCamParPrecision, STD_CAM_PARAMETERS_PRECISION, "precision for coding of camera parameters (in units of 2^(-x) luma samples)" ) 1353 1308 1354 1309 #if NH_3D_VSO 1355 1310 /* View Synthesis Optimization */ 1356 ("VSOConfig", m_pchVSOConfig , ( Char *) 0,"VSO configuration")1311 ("VSOConfig", m_pchVSOConfig , (TChar *) 0 ,"VSO configuration") 1357 1312 ("VSO", m_bUseVSO , false ,"Use VSO" ) 1358 1313 ("VSOMode", m_uiVSOMode , (UInt) 4 ,"VSO Mode") … … 1447 1402 po::setDefaults(opts); 1448 1403 po::ErrorReporter err; 1449 const list<const Char*>& argv_unhandled = po::scanArgv(opts, argc, (constChar**) argv, err);1450 1451 for (list<const Char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++)1404 const list<const TChar*>& argv_unhandled = po::scanArgv(opts, argc, (const TChar**) argv, err); 1405 1406 for (list<const TChar*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++) 1452 1407 { 1453 1408 fprintf(stderr, "Unhandled argument ignored: `%s'\n", *it); … … 1473 1428 * Set any derived parameters 1474 1429 */ 1475 /* convert std::string to c string for compatability */ 1476 #if !NH_MV 1477 m_pchInputFile = cfg_InputFile.empty() ? NULL : strdup(cfg_InputFile.c_str()); 1478 #endif 1479 m_pchBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str()); 1480 #if !NH_MV 1481 m_pchReconFile = cfg_ReconFile.empty() ? NULL : strdup(cfg_ReconFile.c_str()); 1482 #endif 1483 m_pchdQPFile = cfg_dQPFile.empty() ? NULL : strdup(cfg_dQPFile.c_str()); 1484 1430 m_adIntraLambdaModifier = cfg_adIntraLambdaModifier.values; 1485 1431 if(m_isField) 1486 1432 { … … 1545 1491 } 1546 1492 1547 m_scalingListFile = cfg_ScalingListFile.empty() ? NULL : strdup(cfg_ScalingListFile.c_str());1548 1549 1493 /* rules for input, output and internal bitdepths as per help text */ 1550 1494 if (m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA ] == 0) … … 1579 1523 m_InputChromaFormatIDC = numberToChromaFormat(tmpInputChromaFormat); 1580 1524 m_chromaFormatIDC = ((tmpChromaFormat == 0) ? (m_InputChromaFormatIDC) : (numberToChromaFormat(tmpChromaFormat))); 1525 1526 1527 assert(tmpWeightedPredictionMethod>=0 && tmpWeightedPredictionMethod<=WP_PER_PICTURE_WITH_HISTOGRAM_AND_PER_COMPONENT_AND_CLIPPING_AND_EXTENSION); 1528 if (!(tmpWeightedPredictionMethod>=0 && tmpWeightedPredictionMethod<=WP_PER_PICTURE_WITH_HISTOGRAM_AND_PER_COMPONENT_AND_CLIPPING_AND_EXTENSION)) 1529 { 1530 exit(EXIT_FAILURE); 1531 } 1532 m_weightedPredictionMethod = WeightedPredictionMethod(tmpWeightedPredictionMethod); 1533 1534 assert(tmpFastInterSearchMode>=0 && tmpFastInterSearchMode<=FASTINTERSEARCH_MODE3); 1535 if (tmpFastInterSearchMode<0 || tmpFastInterSearchMode>FASTINTERSEARCH_MODE3) 1536 { 1537 exit(EXIT_FAILURE); 1538 } 1539 m_fastInterSearchMode = FastInterSearchMode(tmpFastInterSearchMode); 1540 1541 assert(tmpMotionEstimationSearchMethod>=0 && tmpMotionEstimationSearchMethod<MESEARCH_NUMBER_OF_METHODS); 1542 if (tmpMotionEstimationSearchMethod<0 || tmpMotionEstimationSearchMethod>=MESEARCH_NUMBER_OF_METHODS) 1543 { 1544 exit(EXIT_FAILURE); 1545 } 1546 m_motionEstimationSearchMethod=MESearchMethod(tmpMotionEstimationSearchMethod); 1581 1547 1582 1548 #if NH_MV … … 1802 1768 } 1803 1769 1770 if (tmpSliceMode<0 || tmpSliceMode>=Int(NUMBER_OF_SLICE_CONSTRAINT_MODES)) 1771 { 1772 fprintf(stderr, "Error: bad slice mode\n"); 1773 exit(EXIT_FAILURE); 1774 } 1775 m_sliceMode = SliceConstraint(tmpSliceMode); 1776 if (tmpSliceSegmentMode<0 || tmpSliceSegmentMode>=Int(NUMBER_OF_SLICE_CONSTRAINT_MODES)) 1777 { 1778 fprintf(stderr, "Error: bad slice segment mode\n"); 1779 exit(EXIT_FAILURE); 1780 } 1781 m_sliceSegmentMode = SliceConstraint(tmpSliceSegmentMode); 1782 1783 if (tmpDecodedPictureHashSEIMappedType<0 || tmpDecodedPictureHashSEIMappedType>=Int(NUMBER_OF_HASHTYPES)) 1784 { 1785 fprintf(stderr, "Error: bad checksum mode\n"); 1786 exit(EXIT_FAILURE); 1787 } 1788 // Need to map values to match those of the SEI message: 1789 if (tmpDecodedPictureHashSEIMappedType==0) 1790 { 1791 m_decodedPictureHashSEIType=HASHTYPE_NONE; 1792 } 1793 else 1794 { 1795 m_decodedPictureHashSEIType=HashType(tmpDecodedPictureHashSEIMappedType-1); 1796 } 1797 1804 1798 // allocate slice-based dQP values 1805 1799 #if NH_MV … … 1923 1917 1924 1918 // reading external dQP description from file 1925 if ( m_pchdQPFile)1926 { 1927 FILE* fpt=fopen( m_ pchdQPFile, "r" );1919 if ( !m_dQPFileName.empty() ) 1920 { 1921 FILE* fpt=fopen( m_dQPFileName.c_str(), "r" ); 1928 1922 if ( fpt ) 1929 1923 { … … 2145 2139 Void TAppEncCfg::xCheckParameter() 2146 2140 { 2147 if ( !m_decodedPictureHashSEIEnabled)2141 if (m_decodedPictureHashSEIType==HASHTYPE_NONE) 2148 2142 { 2149 2143 fprintf(stderr, "******************************************************************\n"); … … 2173 2167 #define xConfirmPara(a,b) check_failed |= confirmPara(a,b) 2174 2168 2175 xConfirmPara(m_ pchBitstreamFile==NULL, "A bitstream file name must be specified (BitstreamFile)");2169 xConfirmPara(m_bitstreamFileName.empty(), "A bitstream file name must be specified (BitstreamFile)"); 2176 2170 const UInt maxBitDepth=(m_chromaFormatIDC==CHROMA_400) ? m_internalBitDepth[CHANNEL_TYPE_LUMA] : std::max(m_internalBitDepth[CHANNEL_TYPE_LUMA], m_internalBitDepth[CHANNEL_TYPE_CHROMA]); 2177 2171 xConfirmPara(m_bitDepthConstraint<maxBitDepth, "The internalBitDepth must not be greater than the bitDepthConstraint value"); … … 2544 2538 xConfirmPara( m_loopFilterBetaOffsetDiv2 < -6 || m_loopFilterBetaOffsetDiv2 > 6, "Loop Filter Beta Offset div. 2 exceeds supported range (-6 to 6)"); 2545 2539 xConfirmPara( m_loopFilterTcOffsetDiv2 < -6 || m_loopFilterTcOffsetDiv2 > 6, "Loop Filter Tc Offset div. 2 exceeds supported range (-6 to 6)"); 2546 xConfirmPara( m_iFastSearch < 0 || m_iFastSearch > 2, "Fast Search Mode is not supported value (0:Full search 1:Diamond 2:PMVFAST)" );2547 2540 xConfirmPara( m_iSearchRange < 0 , "Search Range must be more than 0" ); 2548 xConfirmPara( m_bipredSearchRange < 0 , "Search Range must be more than 0" ); 2541 xConfirmPara( m_bipredSearchRange < 0 , "Bi-prediction refinement search range must be more than 0" ); 2542 xConfirmPara( m_minSearchWindow < 0, "Minimum motion search window size for the adaptive window ME must be greater than or equal to 0" ); 2549 2543 #if NH_MV 2550 2544 xConfirmPara( m_iVerticalDisparitySearchRange <= 0 , "Vertical Disparity Search Range must be more than 0" ); … … 2624 2618 } 2625 2619 2626 xConfirmPara( m_sliceMode < 0 || m_sliceMode > 3, "SliceMode exceeds supported range (0 to 3)" ); 2627 if (m_sliceMode!=0) 2620 if (m_sliceMode!=NO_SLICES) 2628 2621 { 2629 2622 xConfirmPara( m_sliceArgument < 1 , "SliceArgument should be larger than or equal to 1" ); 2630 2623 } 2631 xConfirmPara( m_sliceSegmentMode < 0 || m_sliceSegmentMode > 3, "SliceSegmentMode exceeds supported range (0 to 3)" ); 2632 if (m_sliceSegmentMode!=0) 2624 if (m_sliceSegmentMode!=NO_SLICES) 2633 2625 { 2634 2626 xConfirmPara( m_sliceSegmentArgument < 1 , "SliceSegmentArgument should be larger than or equal to 1" ); … … 2638 2630 if (m_profile!=Profile::HIGHTHROUGHPUTREXT) 2639 2631 { 2640 xConfirmPara( tileFlag && m_ iWaveFrontSynchro, "Tile and Wavefrontcan not be applied together, except in the High Throughput Intra 4:4:4 16 profile");2632 xConfirmPara( tileFlag && m_entropyCodingSyncEnabledFlag, "Tiles and entropy-coding-sync (Wavefronts) can not be applied together, except in the High Throughput Intra 4:4:4 16 profile"); 2641 2633 } 2642 2634 … … 3237 3229 m_minSpatialSegmentationIdc = 4*PicSizeInSamplesY/maxSizeInSamplesY-4; 3238 3230 } 3239 else if(m_ iWaveFrontSynchro)3231 else if(m_entropyCodingSyncEnabledFlag) 3240 3232 { 3241 3233 m_minSpatialSegmentationIdc = 4*PicSizeInSamplesY/((2*m_iSourceHeight+m_iSourceWidth)*m_uiMaxCUHeight)-4; … … 3250 3242 } 3251 3243 } 3252 3253 xConfirmPara( m_iWaveFrontSynchro < 0, "WaveFrontSynchro cannot be negative" );3254 3255 xConfirmPara( m_decodedPictureHashSEIEnabled<0 || m_decodedPictureHashSEIEnabled>3, "this hash type is not correct!\n");3256 3244 3257 3245 if (m_toneMappingInfoSEIEnabled) … … 3282 3270 } 3283 3271 3272 if (m_chromaResamplingFilterSEIenabled) 3273 { 3274 xConfirmPara( (m_chromaFormatIDC == CHROMA_400 ), "chromaResamplingFilterSEI is not allowed to be present when ChromaFormatIDC is equal to zero (4:0:0)" ); 3275 xConfirmPara(m_vuiParametersPresentFlag && m_chromaLocInfoPresentFlag && (m_chromaSampleLocTypeTopField != m_chromaSampleLocTypeBottomField ), "When chromaResamplingFilterSEI is enabled, ChromaSampleLocTypeTopField has to be equal to ChromaSampleLocTypeBottomField" ); 3276 } 3277 3284 3278 if ( m_RCEnableRateControl ) 3285 3279 { … … 3293 3287 } 3294 3288 xConfirmPara( m_uiDeltaQpRD > 0, "Rate control cannot be used together with slice level multiple-QP optimization!\n" ); 3295 } 3289 #if U0132_TARGET_BITS_SATURATION 3290 #if NH_MV 3291 if ((m_RCCpbSaturationEnabled) && (m_level[0]!=Level::NONE) && (m_profile!=Profile::NONE)) 3292 { 3293 UInt uiLevelIdx = (m_level[0] / 10) + (UInt)((m_level[0] % 10) / 3); // (m_level / 30)*3 + ((m_level % 10) / 3); 3294 xConfirmPara(m_RCCpbSize > g_uiMaxCpbSize[m_levelTier[0]][uiLevelIdx], "RCCpbSize should be smaller than or equal to Max CPB size according to tier and level"); 3295 xConfirmPara(m_RCInitialCpbFullness > 1, "RCInitialCpbFullness should be smaller than or equal to 1"); 3296 } 3297 #else 3298 if ((m_RCCpbSaturationEnabled) && (m_level!=Level::NONE) && (m_profile!=Profile::NONE)) 3299 { 3300 UInt uiLevelIdx = (m_level / 10) + (UInt)((m_level % 10) / 3); // (m_level / 30)*3 + ((m_level % 10) / 3); 3301 xConfirmPara(m_RCCpbSize > g_uiMaxCpbSize[m_levelTier][uiLevelIdx], "RCCpbSize should be smaller than or equal to Max CPB size according to tier and level"); 3302 xConfirmPara(m_RCInitialCpbFullness > 1, "RCInitialCpbFullness should be smaller than or equal to 1"); 3303 } 3304 #endif 3305 #endif 3306 } 3307 #if U0132_TARGET_BITS_SATURATION 3308 else 3309 { 3310 xConfirmPara( m_RCCpbSaturationEnabled != 0, "Target bits saturation cannot be processed without Rate control" ); 3311 } 3312 #endif 3313 3296 3314 #if NH_MV 3297 3315 // VPS VUI … … 3351 3369 if (m_segmentedRectFramePackingSEIEnabled) 3352 3370 { 3353 xConfirmPara(m_framePackingSEIEnabled > 0, "SEISegmentedRectFramePacking must be 0 when SEIFramePacking is 1");3371 xConfirmPara(m_framePackingSEIEnabled , "SEISegmentedRectFramePacking must be 0 when SEIFramePacking is 1"); 3354 3372 } 3355 3373 … … 3372 3390 } 3373 3391 3374 const Char *profileToString(const Profile::Name profile)3392 const TChar *profileToString(const Profile::Name profile) 3375 3393 { 3376 3394 static const UInt numberOfProfiles = sizeof(strToProfile)/sizeof(*strToProfile); … … 3400 3418 } 3401 3419 #else 3402 printf("Input File : %s\n", m_pchInputFile);3403 #endif 3404 printf("Bitstream File : %s\n", m_pchBitstreamFile);3420 printf("Input File : %s\n", m_inputFileName.c_str() ); 3421 #endif 3422 printf("Bitstream File : %s\n", m_bitstreamFileName.c_str() ); 3405 3423 #if NH_MV 3406 3424 for( Int layer = 0; layer < m_numberOfLayers; layer++) … … 3409 3427 } 3410 3428 #else 3411 printf("Reconstruction File : %s\n", m_pchReconFile);3429 printf("Reconstruction File : %s\n", m_reconFileName.c_str() ); 3412 3430 #endif 3413 3431 #if NH_MV … … 3581 3599 3582 3600 printf("RateControl : %d\n", m_RCEnableRateControl ); 3601 printf("WPMethod : %d\n", Int(m_weightedPredictionMethod)); 3583 3602 3584 3603 if(m_RCEnableRateControl) … … 3590 3609 printf("InitialQP : %d\n", m_RCInitialQP ); 3591 3610 printf("ForceIntraQP : %d\n", m_RCForceIntraQP ); 3611 3612 #if U0132_TARGET_BITS_SATURATION 3613 printf("CpbSaturation : %d\n", m_RCCpbSaturationEnabled ); 3614 if (m_RCCpbSaturationEnabled) 3615 { 3616 printf("CpbSize : %d\n", m_RCCpbSize); 3617 printf("InitalCpbFullness : %.2f\n", m_RCInitialCpbFullness); 3618 } 3619 #endif 3592 3620 3593 3621 #if KWU_RC_MADPRED_E0227 … … 3648 3676 printf("SQP:%d ", m_uiDeltaQpRD ); 3649 3677 printf("ASR:%d ", m_bUseASR ); 3650 printf("FEN:%d ", m_bUseFastEnc ); 3678 printf("MinSearchWindow:%d ", m_minSearchWindow ); 3679 printf("RestrictMESampling:%d ", m_bRestrictMESampling ); 3680 printf("FEN:%d ", Int(m_fastInterSearchMode) ); 3651 3681 printf("ECU:%d ", m_bUseEarlyCU ); 3652 3682 printf("FDM:%d ", m_useFastDecisionForMerge ); … … 3657 3687 printf("TransformSkipFast:%d ", m_useTransformSkipFast ); 3658 3688 printf("TransformSkipLog2MaxSize:%d ", m_log2MaxTransformSkipBlockSize); 3659 printf("Slice: M=%d ", m_sliceMode);3689 printf("Slice: M=%d ", Int(m_sliceMode)); 3660 3690 if (m_sliceMode!=NO_SLICES) 3661 3691 { … … 3685 3715 printf("WPB:%d ", (Int)m_useWeightedBiPred); 3686 3716 printf("PME:%d ", m_log2ParallelMergeLevel); 3687 const Int iWaveFrontSubstreams = m_iWaveFrontSynchro ? (m_iSourceHeight + m_uiMaxCUHeight - 1) / m_uiMaxCUHeight : 1; 3688 printf(" WaveFrontSynchro:%d WaveFrontSubstreams:%d", 3689 m_iWaveFrontSynchro, iWaveFrontSubstreams); 3717 const Int iWaveFrontSubstreams = m_entropyCodingSyncEnabledFlag ? (m_iSourceHeight + m_uiMaxCUHeight - 1) / m_uiMaxCUHeight : 1; 3718 printf(" WaveFrontSynchro:%d WaveFrontSubstreams:%d", m_entropyCodingSyncEnabledFlag?1:0, iWaveFrontSubstreams); 3690 3719 printf(" ScalingList:%d ", m_useScalingListId ); 3691 3720 printf("TMVPMode:%d ", m_TMVPModeId ); … … 3730 3759 } 3731 3760 3732 Bool confirmPara(Bool bflag, const Char* message)3761 Bool confirmPara(Bool bflag, const TChar* message) 3733 3762 { 3734 3763 if (!bflag) -
TabularUnified branches/HTM-15.2-dev/source/App/TAppEncoder/TAppEncCfg.h ¶
r1356 r1360 62 62 // file I/O 63 63 #if NH_MV 64 std::vector< char*> m_pchInputFileList; ///< source file names65 #else 66 Char* m_pchInputFile;///< source file name67 #endif 68 Char* m_pchBitstreamFile;///< output bitstream file64 std::vector<TChar*> m_pchInputFileList; ///< source file names 65 #else 66 std::string m_inputFileName; ///< source file name 67 #endif 68 std::string m_bitstreamFileName; ///< output bitstream file 69 69 #if NH_MV 70 70 std::vector<char*> m_pchReconFileList; ///< output reconstruction file names … … 72 72 Int m_iNumberOfViews; ///< number of Layers that are views 73 73 #else 74 Char* m_pchReconFile;///< output reconstruction file74 std::string m_reconFileName; ///< output reconstruction file 75 75 #endif 76 76 #if NH_MV … … 112 112 Bool m_bitRatePresentVpsFlag; 113 113 Bool m_picRatePresentVpsFlag; 114 BoolAry2d m_bitRatePresentFlag; 115 BoolAry2d m_picRatePresentFlag; 116 IntAry2d m_avgBitRate; 117 IntAry2d m_maxBitRate; 118 IntAry2d m_constantPicRateIdc; 119 IntAry2d m_avgPicRate; 120 Bool m_tilesNotInUseFlag; 121 BoolAry1d m_tilesInUseFlag; 122 BoolAry1d m_loopFilterNotAcrossTilesFlag; 123 Bool m_wppNotInUseFlag; 124 BoolAry1d m_wppInUseFlag; 125 126 BoolAry2d m_tileBoundariesAlignedFlag; 127 Bool m_ilpRestrictedRefLayersFlag; 128 IntAry2d m_minSpatialSegmentOffsetPlus1; 129 BoolAry2d m_ctuBasedOffsetEnabledFlag; 130 IntAry2d m_minHorizontalCtuOffsetPlus1; 131 Bool m_singleLayerForNonIrapFlag; 132 Bool m_higherLayerIrapSkipFlag; 133 134 114 BoolAry2d m_bitRatePresentFlag; 115 BoolAry2d m_picRatePresentFlag; 116 IntAry2d m_avgBitRate; 117 IntAry2d m_maxBitRate; 118 IntAry2d m_constantPicRateIdc; 119 IntAry2d m_avgPicRate; 120 Bool m_tilesNotInUseFlag; 121 BoolAry1d m_tilesInUseFlag; 122 BoolAry1d m_loopFilterNotAcrossTilesFlag; 123 Bool m_wppNotInUseFlag; 124 BoolAry1d m_wppInUseFlag; 125 126 BoolAry2d m_tileBoundariesAlignedFlag; 127 Bool m_ilpRestrictedRefLayersFlag; 128 IntAry2d m_minSpatialSegmentOffsetPlus1; 129 BoolAry2d m_ctuBasedOffsetEnabledFlag; 130 IntAry2d m_minHorizontalCtuOffsetPlus1; 131 Bool m_singleLayerForNonIrapFlag; 132 Bool m_higherLayerIrapSkipFlag; 135 133 #if NH_3D 136 134 Bool m_abUseIC; 137 135 Bool m_bUseLowLatencyICEnc; 138 136 #endif 139 140 137 #endif 141 138 Double m_adLambdaModifier[ MAX_TLAYER ]; ///< Lambda modifier array for each temporal layer 139 std::vector<Double> m_adIntraLambdaModifier; ///< Lambda modifier for Intra pictures, one for each temporal layer. If size>temporalLayer, then use [temporalLayer], else if size>0, use [size()-1], else use m_adLambdaModifier. 140 Double m_dIntraQpFactor; ///< Intra Q Factor. If negative, use a default equation: 0.57*(1.0 - Clip3( 0.0, 0.5, 0.05*(Double)(isField ? (GopSize-1)/2 : GopSize-1) )) 141 142 142 // source specification 143 143 Int m_iFrameRate; ///< source frame-rates (Hz) … … 160 160 Int m_framesToBeEncoded; ///< number of encoded frames 161 161 Int m_aiPad[2]; ///< number of padded pixels for width and height 162 Bool m_AccessUnitDelimiter; ///< add Access Unit Delimiter NAL units 162 163 InputColourSpaceConversion m_inputColourSpaceConvert; ///< colour space conversion to apply to input video 163 164 Bool m_snrInternalColourSpace; ///< if true, then no colour space conversion is applied for snr calculation, otherwise inverse of input is applied. … … 237 238 Int m_iQP; ///< QP value of key-picture (integer) 238 239 #endif 239 Char* m_pchdQPFile;///< QP offset for each slice (initialized from external file)240 std::string m_dQPFileName; ///< QP offset for each slice (initialized from external file) 240 241 #if NH_MV 241 242 std::vector<Int*> m_aidQP; ///< array of slice QP values for each layer … … 338 339 Int m_rdPenalty; ///< RD-penalty for 32x32 TU for intra in non-intra slices (0: no RD-penalty, 1: RD-penalty, 2: maximum RD-penalty) 339 340 Bool m_bDisableIntraPUsInInterSlices; ///< Flag for disabling intra predicted PUs in inter slices. 340 Int m_iFastSearch; ///< ME mode, 0 = full, 1 = diamond, 2 = PMVFAST 341 MESearchMethod m_motionEstimationSearchMethod; 342 Bool m_bRestrictMESampling; ///< Restrict sampling for the Selective ME 341 343 Int m_iSearchRange; ///< ME search range 342 344 Int m_bipredSearchRange; ///< ME search range for bipred refinement 345 Int m_minSearchWindow; ///< ME minimum search window size for the Adaptive Window ME 343 346 Bool m_bClipForBiPredMeEnabled; ///< Enables clipping for Bi-Pred ME. 344 347 Bool m_bFastMEAssumingSmootherMVEnabled; ///< Enables fast ME assuming a smoother MV. … … 347 350 Int m_iVerticalDisparitySearchRange; ///< ME vertical search range for inter-view prediction 348 351 #endif 349 Bool m_bUseFastEnc; ///< flag for using fast encoder setting352 FastInterSearchMode m_fastInterSearchMode; ///< Parameter that controls fast encoder settings 350 353 Bool m_bUseEarlyCU; ///< flag for using Early CU setting 351 354 Bool m_useFastDecisionForMerge; ///< flag for using Fast Decision Merge RD-Cost 352 355 Bool m_bUseCbfFastMode; ///< flag for using Cbf Fast PU Mode Decision 353 356 Bool m_useEarlySkipDetection; ///< flag for using Early SKIP Detection 354 Int m_sliceMode; ///< 0: no slice limits, 1 : max number of CTBs per slice, 2: max number of bytes per slice, 355 ///< 3: max number of tiles per slice 357 SliceConstraint m_sliceMode; 356 358 Int m_sliceArgument; ///< argument according to selected slice mode 357 Int m_sliceSegmentMode; ///< 0: no slice segment limits, 1 : max number of CTBs per slice segment, 2: max number of bytes per slice segment, 358 ///< 3: max number of tiles per slice segment 359 SliceConstraint m_sliceSegmentMode; 359 360 Int m_sliceSegmentArgument; ///< argument according to selected slice segment mode 360 361 … … 366 367 std::vector<Int> m_tileColumnWidth; 367 368 std::vector<Int> m_tileRowHeight; 368 Int m_iWaveFrontSynchro; //< 0: no WPP. >= 1: WPP is enabled, the "Top right" from which inheritance occurs is this LCU offset in the line above the current. 369 Int m_iWaveFrontFlush; //< enable(1)/disable(0) the CABAC flush at the end of each line of LCUs. 369 Bool m_entropyCodingSyncEnabledFlag; 370 370 371 371 Bool m_bUseConstrainedIntraPred; ///< flag for using constrained intra prediction … … 374 374 Bool m_bUseBLambdaForNonKeyLowDelayPictures; 375 375 376 Int m_decodedPictureHashSEIEnabled; ///< Checksum(3)/CRC(2)/MD5(1)/disable(0) acting ondecoded picture hash SEI message377 Intm_recoveryPointSEIEnabled;378 Intm_bufferingPeriodSEIEnabled;379 Intm_pictureTimingSEIEnabled;376 HashType m_decodedPictureHashSEIType; ///< Checksum mode for decoded picture hash SEI message 377 Bool m_recoveryPointSEIEnabled; 378 Bool m_bufferingPeriodSEIEnabled; 379 Bool m_pictureTimingSEIEnabled; 380 380 Bool m_toneMappingInfoSEIEnabled; 381 Bool m_chroma SamplingFilterSEIenabled;382 Int m_chroma SamplingHorFilterIdc;383 Int m_chroma SamplingVerFilterIdc;381 Bool m_chromaResamplingFilterSEIenabled; 382 Int m_chromaResamplingHorFilterIdc; 383 Int m_chromaResamplingVerFilterIdc; 384 384 Int m_toneMapId; 385 385 Bool m_toneMapCancelFlag; … … 408 408 Int* m_codedPivotValue; 409 409 Int* m_targetPivotValue; 410 Intm_framePackingSEIEnabled;410 Bool m_framePackingSEIEnabled; 411 411 Int m_framePackingSEIType; 412 412 Int m_framePackingSEIId; 413 413 Int m_framePackingSEIQuincunx; 414 414 Int m_framePackingSEIInterpretation; 415 Intm_segmentedRectFramePackingSEIEnabled;415 Bool m_segmentedRectFramePackingSEIEnabled; 416 416 Bool m_segmentedRectFramePackingSEICancel; 417 417 Int m_segmentedRectFramePackingSEIType; 418 418 Bool m_segmentedRectFramePackingSEIPersistence; 419 419 Int m_displayOrientationSEIAngle; 420 Intm_temporalLevel0IndexSEIEnabled;421 Intm_gradualDecodingRefreshInfoEnabled;420 Bool m_temporalLevel0IndexSEIEnabled; 421 Bool m_gradualDecodingRefreshInfoEnabled; 422 422 Int m_noDisplaySEITLayer; 423 Intm_decodingUnitInfoSEIEnabled;424 Intm_SOPDescriptionSEIEnabled;425 Intm_scalableNestingSEIEnabled;423 Bool m_decodingUnitInfoSEIEnabled; 424 Bool m_SOPDescriptionSEIEnabled; 425 Bool m_scalableNestingSEIEnabled; 426 426 Bool m_tmctsSEIEnabled; 427 427 Bool m_timeCodeSEIEnabled; … … 442 442 Bool m_useWeightedPred; ///< Use of weighted prediction in P slices 443 443 Bool m_useWeightedBiPred; ///< Use of bi-directional weighted prediction in B slices 444 WeightedPredictionMethod m_weightedPredictionMethod; 444 445 445 446 UInt m_log2ParallelMergeLevel; ///< Parallel merge estimation region … … 455 456 Int m_RCInitialQP; ///< inital QP for rate control 456 457 Bool m_RCForceIntraQP; ///< force all intra picture to use initial QP or not 457 458 459 #if U0132_TARGET_BITS_SATURATION 460 Bool m_RCCpbSaturationEnabled; ///< enable target bits saturation to avoid CPB overflow and underflow 461 UInt m_RCCpbSize; ///< CPB size 462 Double m_RCInitialCpbFullness; ///< initial CPB fullness 463 #endif 464 458 465 #if KWU_RC_VIEWRC_E0227 459 466 vector<Int> m_viewTargetBits; … … 464 471 #endif 465 472 466 ScalingListMode m_useScalingListId; ///< using quantization matrix467 Char* m_scalingListFile;///< quantization matrix file name473 ScalingListMode m_useScalingListId; ///< using quantization matrix 474 std::string m_scalingListFileName; ///< quantization matrix file name 468 475 469 476 Bool m_TransquantBypassEnableFlag; ///< transquant_bypass_enable_flag setting in PPS. … … 509 516 Int m_log2MaxMvLengthHorizontal; ///< Indicate the maximum absolute value of a decoded horizontal MV component in quarter-pel luma units 510 517 Int m_log2MaxMvLengthVertical; ///< Indicate the maximum absolute value of a decoded vertical MV component in quarter-pel luma units 518 std::string m_colourRemapSEIFileRoot; 519 511 520 std::string m_summaryOutFilename; ///< filename to use for producing summary output file. 512 521 std::string m_summaryPicFilenameBase; ///< Base filename to use for producing summary picture output files. The actual filenames used will have I.txt, P.txt and B.txt appended. … … 528 537 Bool m_depth420OutputFlag; ///< Output depth layers in 4:2:0 format 529 538 // Camera parameters 530 Char*m_pchCameraParameterFile; ///< camera parameter file531 Char*m_pchBaseViewCameraNumbers;539 TChar* m_pchCameraParameterFile; ///< camera parameter file 540 TChar* m_pchBaseViewCameraNumbers; 532 541 TAppComCamPara m_cCameraData; 533 542 Int m_iCodedCamParPrecision; ///< precision for coding of camera parameters 534 543 #if NH_3D_VSO 535 Char*m_pchVSOConfig;544 TChar* m_pchVSOConfig; 536 545 Bool m_bUseVSO; ///< flag for using View Synthesis Optimization 537 546 Bool m_bVSOLSTable; ///< Depth QP dependent Lagrange parameter optimization (m23714) … … 674 683 Void create (); ///< create option handling class 675 684 Void destroy (); ///< destroy option handling class 676 Bool parseCfg ( Int argc, Char* argv[] );///< parse configuration file to fill member variables685 Bool parseCfg ( Int argc, TChar* argv[] ); ///< parse configuration file to fill member variables 677 686 678 687 };// END CLASS DEFINITION TAppEncCfg -
TabularUnified branches/HTM-15.2-dev/source/App/TAppEncoder/TAppEncTop.cpp ¶
r1356 r1360 378 378 m_cTEncTop.setLambdaModifier ( uiLoop, m_adLambdaModifier[ uiLoop ] ); 379 379 } 380 m_cTEncTop.setIntraLambdaModifier ( m_adIntraLambdaModifier ); 381 m_cTEncTop.setIntraQpFactor ( m_dIntraQpFactor ); 382 380 383 #if NH_MV 381 384 m_cTEncTop.setQP ( m_iQP[layerIdInVps] ); … … 385 388 386 389 m_cTEncTop.setPad ( m_aiPad ); 387 390 m_cTEncTop.setAccessUnitDelimiter ( m_AccessUnitDelimiter ); 388 391 #if NH_MV 389 392 m_cTEncTop.setMaxTempLayer ( m_maxTempLayerMvc[layerIdInVps] ); … … 408 411 //====== Motion search ======== 409 412 m_cTEncTop.setDisableIntraPUsInInterSlices ( m_bDisableIntraPUsInInterSlices ); 410 m_cTEncTop.set FastSearch ( m_iFastSearch);413 m_cTEncTop.setMotionEstimationSearchMethod ( m_motionEstimationSearchMethod ); 411 414 m_cTEncTop.setSearchRange ( m_iSearchRange ); 412 415 m_cTEncTop.setBipredSearchRange ( m_bipredSearchRange ); 413 416 m_cTEncTop.setClipForBiPredMeEnabled ( m_bClipForBiPredMeEnabled ); 414 417 m_cTEncTop.setFastMEAssumingSmootherMVEnabled ( m_bFastMEAssumingSmootherMVEnabled ); 418 m_cTEncTop.setMinSearchWindow ( m_minSearchWindow ); 419 m_cTEncTop.setRestrictMESampling ( m_bRestrictMESampling ); 415 420 416 421 #if NH_MV … … 439 444 m_cTEncTop.setExtendedPrecisionProcessingFlag ( m_extendedPrecisionProcessingFlag ); 440 445 m_cTEncTop.setHighPrecisionOffsetsEnabledFlag ( m_highPrecisionOffsetsEnabledFlag ); 446 447 m_cTEncTop.setWeightedPredictionMethod( m_weightedPredictionMethod ); 448 441 449 //====== Tool list ======== 442 450 m_cTEncTop.setDeltaQpRD ( m_uiDeltaQpRD ); … … 463 471 m_cTEncTop.setQuadtreeTUMaxDepthInter ( m_uiQuadtreeTUMaxDepthInter ); 464 472 m_cTEncTop.setQuadtreeTUMaxDepthIntra ( m_uiQuadtreeTUMaxDepthIntra ); 465 m_cTEncTop.set UseFastEnc ( m_bUseFastEnc);473 m_cTEncTop.setFastInterSearchMode ( m_fastInterSearchMode ); 466 474 m_cTEncTop.setUseEarlyCU ( m_bUseEarlyCU ); 467 475 m_cTEncTop.setUseFastDecisionForMerge ( m_useFastDecisionForMerge ); … … 513 521 514 522 //====== Slice ======== 515 m_cTEncTop.setSliceMode ( (SliceConstraint)m_sliceMode );523 m_cTEncTop.setSliceMode ( m_sliceMode ); 516 524 m_cTEncTop.setSliceArgument ( m_sliceArgument ); 517 525 518 526 //====== Dependent Slice ======== 519 m_cTEncTop.setSliceSegmentMode ( (SliceConstraint)m_sliceSegmentMode );527 m_cTEncTop.setSliceSegmentMode ( m_sliceSegmentMode ); 520 528 m_cTEncTop.setSliceSegmentArgument ( m_sliceSegmentArgument ); 521 529 … … 540 548 541 549 m_cTEncTop.setIntraSmoothingDisabledFlag (!m_enableIntraReferenceSmoothing ); 542 m_cTEncTop.setDecodedPictureHashSEI Enabled ( m_decodedPictureHashSEIEnabled);550 m_cTEncTop.setDecodedPictureHashSEIType ( m_decodedPictureHashSEIType ); 543 551 m_cTEncTop.setRecoveryPointSEIEnabled ( m_recoveryPointSEIEnabled ); 544 552 m_cTEncTop.setBufferingPeriodSEIEnabled ( m_bufferingPeriodSEIEnabled ); … … 571 579 m_cTEncTop.setTMISEINominalWhiteLevelLumaCodeValue ( m_nominalWhiteLevelLumaCodeValue ); 572 580 m_cTEncTop.setTMISEIExtendedWhiteLevelLumaCodeValue ( m_extendedWhiteLevelLumaCodeValue ); 573 m_cTEncTop.setChroma SamplingFilterHintEnabled ( m_chromaSamplingFilterSEIenabled );574 m_cTEncTop.setChroma SamplingHorFilterIdc ( m_chromaSamplingHorFilterIdc );575 m_cTEncTop.setChroma SamplingVerFilterIdc ( m_chromaSamplingVerFilterIdc );581 m_cTEncTop.setChromaResamplingFilterHintEnabled ( m_chromaResamplingFilterSEIenabled ); 582 m_cTEncTop.setChromaResamplingHorFilterIdc ( m_chromaResamplingHorFilterIdc ); 583 m_cTEncTop.setChromaResamplingVerFilterIdc ( m_chromaResamplingVerFilterIdc ); 576 584 m_cTEncTop.setFramePackingArrangementSEIEnabled ( m_framePackingSEIEnabled ); 577 585 m_cTEncTop.setFramePackingArrangementSEIType ( m_framePackingSEIType ); … … 623 631 m_cTEncTop.setKneeSEIInputKneePoint ( m_kneeSEIInputKneePoint ); 624 632 m_cTEncTop.setKneeSEIOutputKneePoint ( m_kneeSEIOutputKneePoint ); 633 m_cTEncTop.setColourRemapInfoSEIFileRoot ( m_colourRemapSEIFileRoot ); 625 634 m_cTEncTop.setMasteringDisplaySEI ( m_masteringDisplay ); 626 635 … … 644 653 } 645 654 m_cTEncTop.setLFCrossTileBoundaryFlag ( m_bLFCrossTileBoundaryFlag ); 646 m_cTEncTop.set WaveFrontSynchro ( m_iWaveFrontSynchro);655 m_cTEncTop.setEntropyCodingSyncEnabledFlag ( m_entropyCodingSyncEnabledFlag ); 647 656 m_cTEncTop.setTMVPModeId ( m_TMVPModeId ); 648 657 m_cTEncTop.setUseScalingListId ( m_useScalingListId ); 649 m_cTEncTop.setScalingListFile ( m_scalingListFile);658 m_cTEncTop.setScalingListFileName ( m_scalingListFileName ); 650 659 m_cTEncTop.setSignHideFlag ( m_signHideFlag); 651 660 #if KWU_RC_VIEWRC_E0227 || KWU_RC_MADPRED_E0227 … … 669 678 m_cTEncTop.setInitialQP ( m_RCInitialQP ); 670 679 m_cTEncTop.setForceIntraQP ( m_RCForceIntraQP ); 680 #if U0132_TARGET_BITS_SATURATION 681 m_cTEncTop.setCpbSaturationEnabled ( m_RCCpbSaturationEnabled ); 682 m_cTEncTop.setCpbSize ( m_RCCpbSize ); 683 m_cTEncTop.setInitialCpbFullness ( m_RCInitialCpbFullness ); 684 #endif 685 671 686 #if KWU_RC_MADPRED_E0227 672 687 if(m_cTEncTop.getUseRateCtrl() && !m_cTEncTop.getIsDepth()) … … 843 858 #else 844 859 // Video I/O 845 m_cTVideoIOYuvInputFile.open( m_ pchInputFile, false, m_inputBitDepth, m_MSBExtendedBitDepth, m_internalBitDepth ); // read mode860 m_cTVideoIOYuvInputFile.open( m_inputFileName, false, m_inputBitDepth, m_MSBExtendedBitDepth, m_internalBitDepth ); // read mode 846 861 m_cTVideoIOYuvInputFile.skipFrames(m_FrameSkip, m_iSourceWidth - m_aiPad[0], m_iSourceHeight - m_aiPad[1], m_InputChromaFormatIDC); 847 862 848 if ( m_pchReconFile)849 { 850 m_cTVideoIOYuvReconFile.open(m_ pchReconFile, true, m_outputBitDepth, m_outputBitDepth, m_internalBitDepth); // write mode863 if (!m_reconFileName.empty()) 864 { 865 m_cTVideoIOYuvReconFile.open(m_reconFileName, true, m_outputBitDepth, m_outputBitDepth, m_internalBitDepth); // write mode 851 866 } 852 867 … … 917 932 Void TAppEncTop::encode() 918 933 { 919 fstream bitstreamFile(m_ pchBitstreamFile, fstream::binary | fstream::out);934 fstream bitstreamFile(m_bitstreamFileName.c_str(), fstream::binary | fstream::out); 920 935 if (!bitstreamFile) 921 936 { 922 fprintf(stderr, "\nfailed to open bitstream file `%s' for writing\n", m_ pchBitstreamFile);937 fprintf(stderr, "\nfailed to open bitstream file `%s' for writing\n", m_bitstreamFileName.c_str()); 923 938 exit(EXIT_FAILURE); 924 939 } … … 1295 1310 } 1296 1311 #else 1297 if ( m_pchReconFile)1312 if (!m_reconFileName.empty()) 1298 1313 { 1299 1314 m_cTVideoIOYuvReconFile.write( pcPicYuvRecTop, pcPicYuvRecBottom, ipCSC, m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom, NUM_CHROMA_FORMAT, m_isTopFieldFirst ); … … 1352 1367 } 1353 1368 #else 1354 if ( m_pchReconFile)1369 if (!m_reconFileName.empty()) 1355 1370 { 1356 1371 m_cTVideoIOYuvReconFile.write( pcPicYuvRec, ipCSC, m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom, -
TabularUnified branches/HTM-15.2-dev/source/App/TAppExtractor/TAppExtrCfg.cpp ¶
r1179 r1360 58 58 \param argv array of arguments 59 59 */ 60 Bool TAppExtrCfg::parseCfg( Int argc, Char* argv[] )60 Bool TAppExtrCfg::parseCfg( Int argc, TChar* argv[] ) 61 61 { 62 62 bool do_help = false; -
TabularUnified branches/HTM-15.2-dev/source/App/TAppExtractor/TAppExtrCfg.h ¶
r1179 r1360 65 65 virtual ~TAppExtrCfg() {} 66 66 67 Bool parseCfg ( Int argc, Char* argv[] ); ///< initialize option class from configuration67 Bool parseCfg ( Int argc, TChar* argv[] ); ///< initialize option class from configuration 68 68 69 69 protected: -
TabularUnified branches/HTM-15.2-dev/source/App/TAppRenderer/TAppRendererCfg.cpp ¶
r1313 r1360 111 111 \retval true when success 112 112 */ 113 Bool TAppRendererCfg::parseCfg( Int argc, Char* argv[] )113 Bool TAppRendererCfg::parseCfg( Int argc, TChar* argv[] ) 114 114 { 115 115 bool do_help = false; … … 121 121 122 122 /* File I/O */ 123 ("VideoInputFileBaseName,v", m_pchVideoInputFileBaseName, ( Char*) 0, "Basename to generate video input file names")124 ("DepthInputFileBaseName,d", m_pchDepthInputFileBaseName, ( Char*) 0, "Basename to generate depth input file names")125 ("SynthOutputFileBaseName,s", m_pchSynthOutputFileBaseName, ( Char*) 0, "Basename to generate synthesized output file names")123 ("VideoInputFileBaseName,v", m_pchVideoInputFileBaseName, (TChar*) 0, "Basename to generate video input file names") 124 ("DepthInputFileBaseName,d", m_pchDepthInputFileBaseName, (TChar*) 0, "Basename to generate depth input file names") 125 ("SynthOutputFileBaseName,s", m_pchSynthOutputFileBaseName, (TChar*) 0, "Basename to generate synthesized output file names") 126 126 ("ContOutputFileNumbering", m_bContOutputFileNumbering , false , "Continuous Output File Numbering") 127 127 ("Sweep" , m_bSweep , false , "Store all views in first Output File") 128 128 129 ("VideoInputFile_%d,v_%d", m_pchVideoInputFileList , ( Char *) 0, MAX_INPUT_VIEW_NUM , "Original Yuv video input file name %d")130 ("DepthInputFile_%d,d_%d", m_pchDepthInputFileList , ( Char *) 0, MAX_INPUT_VIEW_NUM , "Original Yuv depth input file name %d")131 ("SynthOutputFile_%d,s_%d", m_pchSynthOutputFileList, ( Char *) 0, MAX_OUTPUT_VIEW_NUM, "Synthesized Yuv output file name %d")129 ("VideoInputFile_%d,v_%d", m_pchVideoInputFileList , (TChar *) 0, MAX_INPUT_VIEW_NUM , "Original Yuv video input file name %d") 130 ("DepthInputFile_%d,d_%d", m_pchDepthInputFileList , (TChar *) 0, MAX_INPUT_VIEW_NUM , "Original Yuv depth input file name %d") 131 ("SynthOutputFile_%d,s_%d", m_pchSynthOutputFileList, (TChar *) 0, MAX_OUTPUT_VIEW_NUM, "Synthesized Yuv output file name %d") 132 132 133 133 ("InputBitDepth", m_inputBitDepth[0], 8, "Bit-depth of input file") … … 146 146 147 147 /* Camera Specification */ 148 ("CameraParameterFile,-cpf", m_pchCameraParameterFile, (Char *) 0, "Camera Parameter File Name")149 ("BaseViewCameraNumbers" , m_pchBaseViewCameraNumbers, ( Char *) 0, "Numbers of base views")150 ("SynthViewCameraNumbers" , m_pchSynthViewCameraNumbers, ( Char *) 0, "Numbers of views to synthesis")151 ("ViewConfig" , m_pchViewConfig, ( Char *) 0, "View Configuration" )148 ("CameraParameterFile,-cpf", m_pchCameraParameterFile, (TChar *) 0, "Camera Parameter File Name") 149 ("BaseViewCameraNumbers" , m_pchBaseViewCameraNumbers, (TChar *) 0, "Numbers of base views") 150 ("SynthViewCameraNumbers" , m_pchSynthViewCameraNumbers, (TChar *) 0, "Numbers of views to synthesis") 151 ("ViewConfig" , m_pchViewConfig, (TChar *) 0, "View Configuration" ) 152 152 153 153 /* Renderer Modes */ … … 458 458 } 459 459 460 Void TAppRendererCfg::xAddNumberToFileName( Char* pchSourceFileName,Char*& rpchTargetFileName, Int iNumberToAdd, UInt uiPrecBefore, UInt uiPrecAfter )460 Void TAppRendererCfg::xAddNumberToFileName( TChar* pchSourceFileName, TChar*& rpchTargetFileName, Int iNumberToAdd, UInt uiPrecBefore, UInt uiPrecAfter ) 461 461 { 462 462 … … 468 468 } 469 469 470 Char pchNumberBuffer[2* LOG10_VIEW_NUM_PREC + 2];471 Char pchPrintBuffer[10];470 TChar pchNumberBuffer[2* LOG10_VIEW_NUM_PREC + 2]; 471 TChar pchPrintBuffer[10]; 472 472 473 473 Double dNumberToAdd = ( (Double) iNumberToAdd ) / VIEW_NUM_PREC; … … 488 488 size_t iAddLength = strlen(pchNumberBuffer); 489 489 490 rpchTargetFileName = ( Char*) malloc(iInLength+iAddLength+1);491 492 Char* pchPlaceHolder = strrchr(pchSourceFileName,'$');490 rpchTargetFileName = (TChar*) malloc(iInLength+iAddLength+1); 491 492 TChar* pchPlaceHolder = strrchr(pchSourceFileName,'$'); 493 493 assert( pchPlaceHolder ); 494 494 -
TabularUnified branches/HTM-15.2-dev/source/App/TAppRenderer/TAppRendererCfg.h ¶
r1313 r1360 59 59 60 60 //// file I/O //// 61 Char*m_pchVideoInputFileBaseName; ///< input video file base name, placeholder for numbering $$62 Char*m_pchDepthInputFileBaseName; ///< input depth file base name, placeholder for numbering $$63 Char*m_pchSynthOutputFileBaseName; ///< output synth file base name, placeholder for numbering $$61 TChar* m_pchVideoInputFileBaseName; ///< input video file base name, placeholder for numbering $$ 62 TChar* m_pchDepthInputFileBaseName; ///< input depth file base name, placeholder for numbering $$ 63 TChar* m_pchSynthOutputFileBaseName; ///< output synth file base name, placeholder for numbering $$ 64 64 Bool m_bContOutputFileNumbering; ///< use continous numbering instead of view numbering 65 65 Bool m_bSweep; ///< 1: Store view range in file … … 73 73 74 74 // derived 75 std::vector< Char*> m_pchVideoInputFileList;///< source file names76 std::vector< Char*> m_pchDepthInputFileList;///< source depth file names77 std::vector< Char*> m_pchSynthOutputFileList;///< output reconstruction file names75 std::vector<TChar*> m_pchVideoInputFileList; ///< source file names 76 std::vector<TChar*> m_pchDepthInputFileList; ///< source depth file names 77 std::vector<TChar*> m_pchSynthOutputFileList; ///< output reconstruction file names 78 78 79 79 //// source specification //// … … 84 84 85 85 ////camera specification //// 86 Char*m_pchCameraParameterFile; ///< camera parameter file87 Char*m_pchSynthViewCameraNumbers; ///< numbers of views to synthesize88 Char*m_pchViewConfig; ///< String to setup renderer89 Char*m_pchBaseViewCameraNumbers; ///< numbers of base views86 TChar* m_pchCameraParameterFile; ///< camera parameter file 87 TChar* m_pchSynthViewCameraNumbers; ///< numbers of views to synthesize 88 TChar* m_pchViewConfig; ///< String to setup renderer 89 TChar* m_pchBaseViewCameraNumbers; ///< numbers of base views 90 90 91 91 // derived … … 123 123 Void xCreateFileNames(); 124 124 Void xGetMaxPrecision( IntAry1d adIn, Int& iPrecBefore, Int& iPrecAfter ); 125 Void xAddNumberToFileName( Char* pchSourceFileName,Char*& rpchTargetFileName, Int iNumberToAdd, UInt uiPrecBefore, UInt uiPrecAfter );125 Void xAddNumberToFileName( TChar* pchSourceFileName, TChar*& rpchTargetFileName, Int iNumberToAdd, UInt uiPrecBefore, UInt uiPrecAfter ); 126 126 public: 127 127 TAppRendererCfg(); … … 131 131 Void create (); ///< create option handling class 132 132 Void destroy (); ///< destroy option handling class 133 Bool parseCfg ( Int argc, Char* argv[] ); ///< parse configuration file to fill member variables134 Bool xConfirmParameter(Bool bflag, const Char* message);133 Bool parseCfg ( Int argc, TChar* argv[] ); ///< parse configuration file to fill member variables 134 Bool xConfirmParameter(Bool bflag, const TChar* message); 135 135 136 136 -
TabularUnified branches/HTM-15.2-dev/source/App/utils/convert_NtoMbit_YCbCr.cpp ¶
r1313 r1360 105 105 106 106 TComPicYuv frame; 107 frame.create ( width, height, chromaFormatIDC, width, height, 0, false);107 frame.createWithoutCUInfo( width, height, chromaFormatIDC); 108 108 109 109 Int pad[2] = {0, 0}; 110 110 111 111 TComPicYuv cPicYuvTrueOrg; 112 cPicYuvTrueOrg.create ( width, height, chromaFormatIDC, width, height, 0, false);112 cPicYuvTrueOrg.createWithoutCUInfo( width, height, chromaFormatIDC ); 113 113 114 114 UInt num_frames_processed = 0;
Note: See TracChangeset for help on using the changeset viewer.