Changeset 446 in 3DVCSoftware for branches/HTM-DEV-0.2-dev/source/App/TAppEncoder
- Timestamp:
- 26 May 2013, 16:22:23 (11 years ago)
- Location:
- branches/HTM-DEV-0.2-dev/source/App/TAppEncoder
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.2-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r438 r446 79 79 m_aidQP = NULL; 80 80 #endif 81 #if J0149_TONE_MAPPING_SEI 82 m_startOfCodedInterval = NULL; 83 m_codedPivotValue = NULL; 84 m_targetPivotValue = NULL; 85 #endif 81 86 } 82 87 … … 102 107 delete[] m_aidQP; 103 108 } 109 #endif 110 #if J0149_TONE_MAPPING_SEI 111 if ( m_startOfCodedInterval ) 112 { 113 delete[] m_startOfCodedInterval; 114 m_startOfCodedInterval = NULL; 115 } 116 if ( m_codedPivotValue ) 117 { 118 delete[] m_codedPivotValue; 119 m_codedPivotValue = NULL; 120 } 121 if ( m_targetPivotValue ) 122 { 123 delete[] m_targetPivotValue; 124 m_targetPivotValue = NULL; 125 } 126 #endif 127 #if !H_MV 104 128 free(m_pchInputFile); 105 129 #endif 106 107 130 free(m_pchBitstreamFile); 108 109 131 #if H_MV 110 132 for(Int i = 0; i< m_pchReconFileList.size(); i++ ) … … 116 138 free(m_pchReconFile); 117 139 #endif 118 119 140 free(m_pchdQPFile); 120 141 free(m_pColumnWidth); 121 142 free(m_pRowHeight); 122 143 free(m_scalingListFile); 123 124 144 #if H_MV 125 145 for( Int i = 0; i < m_GOPListMvc.size(); i++ ) … … 131 151 } 132 152 } 153 #endif 154 #if H_3D 155 #if H_3D_VSO 156 if ( m_pchVSOConfig != NULL) 157 free ( m_pchVSOConfig ); 158 #endif 159 if ( m_pchCameraParameterFile != NULL ) 160 free ( m_pchCameraParameterFile ); 161 162 if ( m_pchBaseViewCameraNumbers != NULL ) 163 free ( m_pchBaseViewCameraNumbers ); 133 164 #endif 134 165 } … … 300 331 string cfg_InputFile; 301 332 #endif 302 303 333 string cfg_BitstreamFile; 304 305 334 #if !H_MV 306 335 string cfg_ReconFile; 307 336 #endif 308 309 337 #if H_MV 310 338 vector<Int> cfg_dimensionLength; … … 316 344 #endif 317 345 #endif 318 319 346 string cfg_dQPFile; 320 347 string cfg_ColumnWidth; 321 348 string cfg_RowHeight; 322 349 string cfg_ScalingListFile; 350 #if J0149_TONE_MAPPING_SEI 351 string cfg_startOfCodedInterval; 352 string cfg_codedPivotValue; 353 string cfg_targetPivotValue; 354 #endif 323 355 #if SIGNAL_BITRATE_PICRATE_IN_VPS 324 356 string cfg_bitRateInfoPresentFlag; … … 335 367 336 368 // File, I/O and source parameters 337 338 369 #if H_MV 339 370 ("InputFile_%d,i_%d", m_pchInputFileList, (char *) 0 , MAX_NUM_LAYER_IDS , "original Yuv input file name %d") … … 341 372 ("InputFile,i", cfg_InputFile, string(""), "Original YUV input file name") 342 373 #endif 343 344 374 ("BitstreamFile,b", cfg_BitstreamFile, string(""), "Bitstream output file name") 345 346 375 #if H_MV 347 376 ("ReconFile_%d,o_%d", m_pchReconFileList, (char *) 0 , MAX_NUM_LAYER_IDS , "reconstructed Yuv output file name %d") … … 349 378 ("ReconFile,o", cfg_ReconFile, string(""), "Reconstructed YUV output file name") 350 379 #endif 351 352 380 #if H_MV 353 381 ("NumberOfLayers", m_numberOfLayers , 1, "Number of layers") … … 365 393 ("SplittingFlag", m_splittingFlag , false , "Splitting Flag") 366 394 #endif 367 368 395 ("SourceWidth,-wdt", m_iSourceWidth, 0, "Source picture width") 369 396 ("SourceHeight,-hgt", m_iSourceHeight, 0, "Source picture height") … … 387 414 388 415 // Profile and level 389 390 416 ("Profile", m_profile, Profile::NONE, "Profile to be used when encoding (Incomplete)") 391 417 ("Level", m_level, Level::NONE, "Level limit to be used, eg 5.1 (Incomplete)") … … 417 443 ("DecodingRefreshType,-dr", m_iDecodingRefreshType, 0, "Intra refresh type (0:none 1:CRA 2:IDR)") 418 444 ("GOPSize,g", m_iGOPSize, 1, "GOP size of temporal structure") 445 #if !L0034_COMBINED_LIST_CLEANUP 419 446 ("ListCombination,-lc", m_bUseLComb, true, "Combined reference list for uni-prediction estimation in B-slices") 447 #endif 420 448 // motion options 421 449 ("FastSearch", m_iFastSearch, 1, "0:Full search 1:Diamond 2:PMVFAST") … … 473 501 ("LoopFilterTcOffset_div2", m_loopFilterTcOffsetDiv2, 0 ) 474 502 ("DeblockingFilterControlPresent", m_DeblockingFilterControlPresent, false ) 503 #if L0386_DB_METRIC 504 ("DeblockingFilterMetric", m_DeblockingFilterMetric, false ) 505 #endif 475 506 476 507 // Coding tools … … 591 622 ("SEIBufferingPeriod", m_bufferingPeriodSEIEnabled, 0, "Control generation of buffering period SEI messages") 592 623 ("SEIPictureTiming", m_pictureTimingSEIEnabled, 0, "Control generation of picture timing SEI messages") 624 #if J0149_TONE_MAPPING_SEI 625 ("SEIToneMappingInfo", m_toneMappingInfoSEIEnabled, false, "Control generation of Tone Mapping SEI messages") 626 ("SEIToneMapId", m_toneMapId, 0, "Specifies Id of Tone Mapping SEI message for a given session") 627 ("SEIToneMapCancelFlag", m_toneMapCancelFlag, false, "Indicates that Tone Mapping SEI message cancels the persistance or follows") 628 ("SEIToneMapPersistenceFlag", m_toneMapPersistenceFlag, true, "Specifies the persistence of the Tone Mapping SEI message") 629 ("SEIToneMapCodedDataBitDepth", m_toneMapCodedDataBitDepth, 8, "Specifies Coded Data BitDepth of Tone Mapping SEI messages") 630 ("SEIToneMapTargetBitDepth", m_toneMapTargetBitDepth, 8, "Specifies Output BitDepth of Tome mapping function") 631 ("SEIToneMapModelId", m_toneMapModelId, 0, "Specifies Model utilized for mapping coded data into target_bit_depth range\n" 632 "\t0: linear mapping with clipping\n" 633 "\t1: sigmoidal mapping\n" 634 "\t2: user-defined table mapping\n" 635 "\t3: piece-wise linear mapping\n" 636 "\t4: luminance dynamic range information ") 637 ("SEIToneMapMinValue", m_toneMapMinValue, 0, "Specifies the minimum value in mode 0") 638 ("SEIToneMapMaxValue", m_toneMapMaxValue, 1023, "Specifies the maxmum value in mode 0") 639 ("SEIToneMapSigmoidMidpoint", m_sigmoidMidpoint, 512, "Specifies the centre point in mode 1") 640 ("SEIToneMapSigmoidWidth", m_sigmoidWidth, 960, "Specifies the distance between 5% and 95% values of the target_bit_depth in mode 1") 641 ("SEIToneMapStartOfCodedInterval", cfg_startOfCodedInterval, string(""), "Array of user-defined mapping table") 642 ("SEIToneMapNumPivots", m_numPivots, 0, "Specifies the number of pivot points in mode 3") 643 ("SEIToneMapCodedPivotValue", cfg_codedPivotValue, string(""), "Array of pivot point") 644 ("SEIToneMapTargetPivotValue", cfg_targetPivotValue, string(""), "Array of pivot point") 645 ("SEIToneMapCameraIsoSpeedIdc", m_cameraIsoSpeedIdc, 0, "Indicates the camera ISO speed for daylight illumination") 646 ("SEIToneMapCameraIsoSpeedValue", m_cameraIsoSpeedValue, 400, "Specifies the camera ISO speed for daylight illumination of Extended_ISO") 647 ("SEIToneMapExposureCompensationValueSignFlag", m_exposureCompensationValueSignFlag, 0, "Specifies the sign of ExposureCompensationValue") 648 ("SEIToneMapExposureCompensationValueNumerator", m_exposureCompensationValueNumerator, 0, "Specifies the numerator of ExposureCompensationValue") 649 ("SEIToneMapExposureCompensationValueDenomIdc", m_exposureCompensationValueDenomIdc, 2, "Specifies the denominator of ExposureCompensationValue") 650 ("SEIToneMapRefScreenLuminanceWhite", m_refScreenLuminanceWhite, 350, "Specifies reference screen brightness setting in units of candela per square metre") 651 ("SEIToneMapExtendedRangeWhiteLevel", m_extendedRangeWhiteLevel, 800, "Indicates the luminance dynamic range") 652 ("SEIToneMapNominalBlackLevelLumaCodeValue", m_nominalBlackLevelLumaCodeValue, 16, "Specifies luma sample value of the nominal black level assigned decoded pictures") 653 ("SEIToneMapNominalWhiteLevelLumaCodeValue", m_nominalWhiteLevelLumaCodeValue, 235, "Specifies luma sample value of the nominal white level assigned decoded pictures") 654 ("SEIToneMapExtendedWhiteLevelLumaCodeValue", m_extendedWhiteLevelLumaCodeValue, 300, "Specifies luma sample value of the extended dynamic range assigned decoded pictures") 655 #endif 593 656 ("SEIFramePacking", m_framePackingSEIEnabled, 0, "Control generation of frame packing SEI messages") 594 657 ("SEIFramePackingType", m_framePackingSEIType, 0, "Define frame packing arrangement\n" … … 611 674 ("SEIGradualDecodingRefreshInfo", m_gradualDecodingRefreshInfoEnabled, 0, "Control generation of gradual decoding refresh information SEI message") 612 675 ("SEIDecodingUnitInfo", m_decodingUnitInfoSEIEnabled, 0, "Control generation of decoding unit information SEI message.") 676 #if L0208_SOP_DESCRIPTION_SEI 677 ("SEISOPDescription", m_SOPDescriptionSEIEnabled, 0, "Control generation of SOP description SEI messages") 678 #endif 679 #if K0180_SCALABLE_NESTING_SEI 680 ("SEIScalableNesting", m_scalableNestingSEIEnabled, 0, "Control generation of scalable nesting SEI messages") 681 #endif 613 682 #if SIGNAL_BITRATE_PICRATE_IN_VPS 614 683 ("BitRatePicRateMaxTLayers", m_bitRatePicRateMaxTLayers, 0, "Maximum number of sub-layers signalled; can be inferred otherwise; here for easy parsing of config. file") … … 624 693 ("ConstantPicRateIdc", cfg_constantPicRateIdc, string(""), "List of constant picture rate IDCs; include non-negative number even if corresponding flag is 0") 625 694 #endif 695 #if H_3D 696 ("CameraParameterFile,cpf", m_pchCameraParameterFile, (Char *) 0, "Camera Parameter File Name") 697 ("BaseViewCameraNumbers" , m_pchBaseViewCameraNumbers, (Char *) 0, "Numbers of base views") 698 ("CodedCamParsPrecision", m_iCodedCamParPrecision, STD_CAM_PARAMETERS_PRECISION, "precision for coding of camera parameters (in units of 2^(-x) luma samples)" ) 699 /* View Synthesis Optimization */ 700 701 #if H_3D_VSO 702 ("VSOConfig", m_pchVSOConfig , (Char *) 0 , "VSO configuration") 703 ("VSO", m_bUseVSO , false , "Use VSO" ) 704 ("VSOMode", m_uiVSOMode , (UInt) 4 , "VSO Mode") 705 ("LambdaScaleVSO", m_dLambdaScaleVSO , (Double) 1 , "Lambda Scaling for VSO") 706 ("VSOLSTable", m_bVSOLSTable , true , "Depth QP dependent video/depth rate allocation by Lagrange multiplier" ) 707 ("ForceLambdaScaleVSO", m_bForceLambdaScaleVSO , false , "Force using Lambda Scale VSO also in non-VSO-Mode") 708 ("AllowNegDist", m_bAllowNegDist , true , "Allow negative Distortion in VSO") 709 710 ("UseEstimatedVSD", m_bUseEstimatedVSD , true , "Model based VSD estimation instead of rendering based for some encoder decisions" ) 711 ("VSOEarlySkip", m_bVSOEarlySkip , true , "Early skip of VSO computation if synthesis error assumed to be zero" ) 712 713 ("WVSO", m_bUseWVSO , true , "Use depth fidelity term for VSO" ) 714 ("VSOWeight", m_iVSOWeight , 10 , "Synthesized View Distortion Change weight" ) 715 ("VSDWeight", m_iVSDWeight , 1 , "View Synthesis Distortion estimate weight" ) 716 ("DWeight", m_iDWeight , 1 , "Depth Distortion weight" ) 717 718 #endif //HHI_VSO 719 #endif //H_3D 626 720 ; 627 721 … … 661 755 } 662 756 #endif 663 664 757 po::setDefaults(opts); 665 758 const list<const Char*>& argv_unhandled = po::scanArgv(opts, argc, (const Char**) argv); … … 681 774 */ 682 775 /* convert std::string to c string for compatability */ 683 684 776 #if !H_MV 685 777 m_pchInputFile = cfg_InputFile.empty() ? NULL : strdup(cfg_InputFile.c_str()); 686 778 #endif 687 688 779 m_pchBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str()); 689 690 780 #if !H_MV 691 781 m_pchReconFile = cfg_ReconFile.empty() ? NULL : strdup(cfg_ReconFile.c_str()); 692 782 #endif 693 694 783 m_pchdQPFile = cfg_dQPFile.empty() ? NULL : strdup(cfg_dQPFile.c_str()); 695 784 … … 755 844 free ( pRowHeight ); 756 845 #endif 757 758 846 #if SIGNAL_BITRATE_PICRATE_IN_VPS 759 847 readBoolString(cfg_bitRateInfoPresentFlag, m_bitRatePicRateMaxTLayers, m_bitRateInfoPresentFlag, "bit rate info. present flag" ); … … 839 927 #if H_3D 840 928 xResizeVector( m_depthFlag ); 929 930 std::vector<Int> uniqueViewIds; 931 for( Int layer = 0; layer < m_numberOfLayers; layer++ ) 932 { 933 Bool isIn = false; 934 for ( Int i = 0 ; i < uniqueViewIds.size(); i++ ) 935 { 936 isIn = isIn || ( m_viewId[ layer ] == uniqueViewIds[ i ] ); 937 } 938 if ( !isIn ) 939 { 940 uniqueViewIds.push_back( m_viewId[ layer ] ); 941 } 942 } 943 m_iNumberOfViews = (Int) uniqueViewIds.size(); 841 944 #endif 842 945 … … 914 1017 m_iWaveFrontSubstreams = m_iWaveFrontSynchro ? (m_iSourceHeight + m_uiMaxCUHeight - 1) / m_uiMaxCUHeight : 1; 915 1018 1019 #if J0149_TONE_MAPPING_SEI 1020 if( m_toneMappingInfoSEIEnabled && !m_toneMapCancelFlag ) 1021 { 1022 Char* pcStartOfCodedInterval = cfg_startOfCodedInterval.empty() ? NULL: strdup(cfg_startOfCodedInterval.c_str()); 1023 Char* pcCodedPivotValue = cfg_codedPivotValue.empty() ? NULL: strdup(cfg_codedPivotValue.c_str()); 1024 Char* pcTargetPivotValue = cfg_targetPivotValue.empty() ? NULL: strdup(cfg_targetPivotValue.c_str()); 1025 if( m_toneMapModelId == 2 && pcStartOfCodedInterval ) 1026 { 1027 char *startOfCodedInterval; 1028 UInt num = 1u<< m_toneMapTargetBitDepth; 1029 m_startOfCodedInterval = new Int[num]; 1030 ::memset( m_startOfCodedInterval, 0, sizeof(Int)*num ); 1031 startOfCodedInterval = strtok(pcStartOfCodedInterval, " ."); 1032 int i = 0; 1033 while( startOfCodedInterval && ( i < num ) ) 1034 { 1035 m_startOfCodedInterval[i] = atoi( startOfCodedInterval ); 1036 startOfCodedInterval = strtok(NULL, " ."); 1037 i++; 1038 } 1039 } 1040 else 1041 { 1042 m_startOfCodedInterval = NULL; 1043 } 1044 if( ( m_toneMapModelId == 3 ) && ( m_numPivots > 0 ) ) 1045 { 1046 if( pcCodedPivotValue && pcTargetPivotValue ) 1047 { 1048 char *codedPivotValue; 1049 char *targetPivotValue; 1050 m_codedPivotValue = new Int[m_numPivots]; 1051 m_targetPivotValue = new Int[m_numPivots]; 1052 ::memset( m_codedPivotValue, 0, sizeof(Int)*( m_numPivots ) ); 1053 ::memset( m_targetPivotValue, 0, sizeof(Int)*( m_numPivots ) ); 1054 codedPivotValue = strtok(pcCodedPivotValue, " ."); 1055 int i=0; 1056 while(codedPivotValue&&i<m_numPivots) 1057 { 1058 m_codedPivotValue[i] = atoi( codedPivotValue ); 1059 codedPivotValue = strtok(NULL, " ."); 1060 i++; 1061 } 1062 i=0; 1063 targetPivotValue = strtok(pcTargetPivotValue, " ."); 1064 while(targetPivotValue&&i<m_numPivots) 1065 { 1066 m_targetPivotValue[i]= atoi( targetPivotValue ); 1067 targetPivotValue = strtok(NULL, " ."); 1068 i++; 1069 } 1070 } 1071 } 1072 else 1073 { 1074 m_codedPivotValue = NULL; 1075 m_targetPivotValue = NULL; 1076 } 1077 } 1078 #endif 1079 #if H_3D 1080 // set global varibles 1081 xSetGlobal(); 1082 #if H_3D_VSO 1083 // Table base optimization 1084 // Q&D 1085 Double adLambdaScaleTable[] = 1086 { 0.031250, 0.031639, 0.032029, 0.032418, 0.032808, 0.033197, 0.033586, 0.033976, 0.034365, 0.034755, 1087 0.035144, 0.035533, 0.035923, 0.036312, 0.036702, 0.037091, 0.037480, 0.037870, 0.038259, 0.038648, 1088 0.039038, 0.039427, 0.039817, 0.040206, 0.040595, 0.040985, 0.041374, 0.041764, 0.042153, 0.042542, 1089 0.042932, 0.043321, 0.043711, 0.044100, 0.044194, 0.053033, 0.061872, 0.070711, 0.079550, 0.088388, 1090 0.117851, 0.147314, 0.176777, 0.235702, 0.294628, 0.353553, 0.471405, 0.589256, 0.707107, 0.707100, 1091 0.753550, 0.800000 1092 }; 1093 if ( m_bVSOLSTable ) 1094 { 1095 Int firstDepthLayer = -1; 1096 for (Int layer = 0; layer < m_numberOfLayers; layer++ ) 1097 { 1098 if ( m_depthFlag[ layer ]) 1099 { 1100 firstDepthLayer = layer; 1101 break; 1102 } 1103 } 1104 AOT( firstDepthLayer == -1 ); 1105 AOT( (m_iQP[firstDepthLayer] < 0) || (m_iQP[firstDepthLayer] > 51)); 1106 m_dLambdaScaleVSO *= adLambdaScaleTable[m_iQP[firstDepthLayer]]; 1107 } 1108 #endif 1109 #if H_3D_VSO 1110 if ( m_bUseVSO && m_uiVSOMode == 4) 1111 { 1112 m_cRenModStrParser.setString( m_iNumberOfViews, m_pchVSOConfig ); 1113 m_cCameraData .init ( ((UInt) m_iNumberOfViews ), 1114 g_bitDepthY, 1115 (UInt)m_iCodedCamParPrecision, 1116 m_FrameSkip, 1117 (UInt)m_framesToBeEncoded, 1118 m_pchCameraParameterFile, 1119 m_pchBaseViewCameraNumbers, 1120 NULL, 1121 m_cRenModStrParser.getSynthViews(), 1122 LOG2_DISP_PREC_LUT ); 1123 } 1124 else if ( m_bUseVSO && m_uiVSOMode != 4 ) 1125 { 1126 m_cCameraData .init ( ((UInt) m_iNumberOfViews ), 1127 g_bitDepthY, 1128 (UInt)m_iCodedCamParPrecision, 1129 m_FrameSkip, 1130 (UInt)m_framesToBeEncoded, 1131 m_pchCameraParameterFile, 1132 m_pchBaseViewCameraNumbers, 1133 m_pchVSOConfig, 1134 NULL, 1135 LOG2_DISP_PREC_LUT ); 1136 } 1137 else 1138 { 1139 m_cCameraData .init ( ((UInt) m_iNumberOfViews ), 1140 g_bitDepthY, 1141 (UInt) m_iCodedCamParPrecision, 1142 m_FrameSkip, 1143 (UInt) m_framesToBeEncoded, 1144 m_pchCameraParameterFile, 1145 m_pchBaseViewCameraNumbers, 1146 NULL, 1147 NULL, 1148 LOG2_DISP_PREC_LUT ); 1149 } 1150 #else 1151 m_cCameraData .init ( ((UInt) m_iNumberOfViews ), 1152 g_bitDepthY, 1153 (UInt) m_iCodedCamParPrecision, 1154 m_FrameSkip, 1155 (UInt) m_framesToBeEncoded, 1156 m_pchCameraParameterFile, 1157 m_pchBaseViewCameraNumbers, 1158 NULL, 1159 NULL, 1160 LOG2_DISP_PREC_LUT ); 1161 #endif 1162 m_cCameraData.check( false, true ); 1163 #endif 916 1164 // check validity of input parameters 917 1165 xCheckParameter(); 918 1166 1167 #if !H_3D 919 1168 // set global varibles 920 1169 xSetGlobal(); 1170 #endif 921 1171 922 1172 // print-out parameters … … 1013 1263 xConfirmPara( m_iFrameRate <= 0, "Frame rate must be more than 1" ); 1014 1264 xConfirmPara( m_framesToBeEncoded <= 0, "Total Number Of Frames encoded must be more than 0" ); 1015 1016 1265 #if H_MV 1017 1266 xConfirmPara( m_numberOfLayers > MAX_NUM_LAYER_IDS , "NumberOfLayers must be less than or equal to MAX_NUM_LAYER_IDS"); … … 1026 1275 xConfirmPara( m_scalabilityMask != 1 , "Scalability Mask must be equal to 1. "); 1027 1276 #endif 1028 1277 1029 1278 m_dimIds.push_back( m_viewId ); 1279 const Int viewDimPosition = 0; 1030 1280 #if H_3D 1031 1281 if ( m_scalabilityMask & ( 1 << DEPTH_ID ) ) … … 1037 1287 for( Int dim = 0; dim < m_dimIds.size(); dim++ ) 1038 1288 { 1039 xConfirmPara( m_dimIds[dim].size() < m_numberOfLayers, "DimensionId must be given for all layers and all dimensions. "); 1040 xConfirmPara( m_dimIds[dim][0] != 0, "DimensionId of layer 0 must be 0 in all dimensions. " );1289 xConfirmPara( m_dimIds[dim].size() < m_numberOfLayers, "DimensionId must be given for all layers and all dimensions. "); 1290 xConfirmPara( ( dim != viewDimPosition ) && (m_dimIds[dim][0] != 0), "DimensionId of layer 0 must be 0. " ); 1041 1291 xConfirmPara( m_dimensionIdLen[dim] < 1 || m_dimensionIdLen[dim] > 8, "DimensionIdLen must be greater than 0 and less than 9 in all dimensions. " ); 1042 1292 for( Int i = 1; i < m_numberOfLayers; i++ ) … … 1073 1323 { 1074 1324 Bool inc = m_dimIds[ lastDiff ][ i ] > m_dimIds[ lastDiff ][ j ]; 1075 if ( !inc ) 1325 Bool shallBeButIsNotIncreasing = ( !inc && ( lastDiff != viewDimPosition ) ) ; 1326 if ( shallBeButIsNotIncreasing ) 1076 1327 { 1077 1328 printf( "\nError: Positions of Layers %d and %d is not increasing in dimension %d \n", i, j, lastDiff); 1078 1329 } 1079 xConfirmPara( !inc, "DimensionIds shall be increasing within one dimension. " );1330 xConfirmPara( shallBeButIsNotIncreasing && ( lastDiff != viewDimPosition ), "DimensionIds shall be increasing within one dimension. " ); 1080 1331 } 1081 1332 } … … 1083 1334 1084 1335 #endif 1085 1086 1087 1336 xConfirmPara( m_iGOPSize < 1 , "GOP Size must be greater or equal to 1" ); 1088 1337 xConfirmPara( m_iGOPSize > 1 && m_iGOPSize % 2, "GOP Size must be a multiple of 2, if GOP Size is greater than 1" ); … … 1185 1434 xConfirmPara( m_confBottom % TComSPS::getWinUnitY(CHROMA_420) != 0, "Bottom conformance window offset must be an integer multiple of the specified chroma subsampling"); 1186 1435 1436 #if H_3D 1437 xConfirmPara( m_pchCameraParameterFile == 0 , "CameraParameterFile must be given"); 1438 xConfirmPara( m_pchBaseViewCameraNumbers == 0 , "BaseViewCameraNumbers must be given" ); 1439 xConfirmPara( ((UInt) m_numberOfLayers >> 1 ) != m_cCameraData.getBaseViewNumbers().size(), "Number of Views in BaseViewCameraNumbers must be equal to NumberOfViews" ); 1440 xConfirmPara ( m_iCodedCamParPrecision < 0 || m_iCodedCamParPrecision > 5, "CodedCamParsPrecision must be in range of 0..5" ); 1441 #if H_3D_VSO 1442 if( m_bUseVSO ) 1443 { 1444 xConfirmPara( m_pchVSOConfig == 0 , "VSO Setup string must be given"); 1445 xConfirmPara( m_uiVSOMode > 4 , "VSO Mode must be less than 5"); 1446 } 1447 #endif 1448 #endif 1187 1449 // max CU width and height should be power of 2 1188 1450 UInt ui = m_uiMaxCUWidth; … … 1348 1610 Int* m_numReorderPics = m_numReorderPicsMvc [layer]; // It is not a member, but this name helps avoiding code duplication !!! 1349 1611 #endif 1350 1351 1612 /* if this is an intra-only sequence, ie IntraPeriod=1, don't verify the GOP structure 1352 1613 * This permits the ability to omit a GOP structure specification */ … … 1609 1870 { 1610 1871 m_numReorderPics[i] = 0; 1872 #if L0323_DPB 1873 m_maxDecPicBuffering[i] = 1; 1874 #else 1611 1875 m_maxDecPicBuffering[i] = 0; 1876 #endif 1612 1877 } 1613 1878 for(Int i=0; i<m_iGOPSize; i++) 1614 1879 { 1880 #if L0323_DPB 1881 if(m_GOPList[i].m_numRefPics+1 > m_maxDecPicBuffering[m_GOPList[i].m_temporalId]) 1882 #else 1615 1883 if(m_GOPList[i].m_numRefPics > m_maxDecPicBuffering[m_GOPList[i].m_temporalId]) 1616 { 1884 #endif 1885 { 1886 #if L0323_DPB 1887 m_maxDecPicBuffering[m_GOPList[i].m_temporalId] = m_GOPList[i].m_numRefPics + 1; 1888 #else 1617 1889 m_maxDecPicBuffering[m_GOPList[i].m_temporalId] = m_GOPList[i].m_numRefPics; 1890 #endif 1618 1891 } 1619 1892 Int highestDecodingNumberWithLowerPOC = 0; … … 1646 1919 m_numReorderPics[i+1] = m_numReorderPics[i]; 1647 1920 } 1921 #if L0323_DPB 1922 // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ] - 1, inclusive 1923 if(m_numReorderPics[i] > m_maxDecPicBuffering[i] - 1) 1924 { 1925 m_maxDecPicBuffering[i] = m_numReorderPics[i] + 1; 1926 } 1927 #else 1648 1928 // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ], inclusive 1649 1929 if(m_numReorderPics[i] > m_maxDecPicBuffering[i]) … … 1651 1931 m_maxDecPicBuffering[i] = m_numReorderPics[i]; 1652 1932 } 1933 #endif 1653 1934 // a lower layer can not have higher value of m_uiMaxDecPicBuffering than a higher layer 1654 1935 if(m_maxDecPicBuffering[i+1] < m_maxDecPicBuffering[i]) … … 1657 1938 } 1658 1939 } 1940 1941 1942 #if L0323_DPB 1943 // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ] - 1, inclusive 1944 if(m_numReorderPics[MAX_TLAYER-1] > m_maxDecPicBuffering[MAX_TLAYER-1] - 1) 1945 { 1946 m_maxDecPicBuffering[MAX_TLAYER-1] = m_numReorderPics[MAX_TLAYER-1] + 1; 1947 } 1948 #else 1659 1949 // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ], inclusive 1660 1950 if(m_numReorderPics[MAX_TLAYER-1] > m_maxDecPicBuffering[MAX_TLAYER-1]) … … 1662 1952 m_maxDecPicBuffering[MAX_TLAYER-1] = m_numReorderPics[MAX_TLAYER-1]; 1663 1953 } 1954 #endif 1664 1955 1665 1956 if(m_vuiParametersPresentFlag && m_bitstreamRestrictionFlag) … … 1736 2027 } 1737 2028 } 2029 #if !L0034_COMBINED_LIST_CLEANUP 1738 2030 xConfirmPara( m_bUseLComb==false && m_numReorderPics[MAX_TLAYER-1]!=0, "ListCombination can only be 0 in low delay coding (more precisely when L0 and L1 are identical)" ); // Note however this is not the full necessary condition as ref_pic_list_combination_flag can only be 0 if L0 == L1. 2031 #endif 1739 2032 xConfirmPara( m_iWaveFrontSynchro < 0, "WaveFrontSynchro cannot be negative" ); 1740 2033 xConfirmPara( m_iWaveFrontSubstreams <= 0, "WaveFrontSubstreams must be positive" ); … … 1743 2036 xConfirmPara( m_decodedPictureHashSEIEnabled<0 || m_decodedPictureHashSEIEnabled>3, "this hash type is not correct!\n"); 1744 2037 2038 #if J0149_TONE_MAPPING_SEI 2039 if (m_toneMappingInfoSEIEnabled) 2040 { 2041 xConfirmPara( m_toneMapCodedDataBitDepth < 8 || m_toneMapCodedDataBitDepth > 14 , "SEIToneMapCodedDataBitDepth must be in rage 8 to 14"); 2042 xConfirmPara( m_toneMapTargetBitDepth < 1 || (m_toneMapTargetBitDepth > 16 && m_toneMapTargetBitDepth < 255) , "SEIToneMapTargetBitDepth must be in rage 1 to 16 or equal to 255"); 2043 xConfirmPara( m_toneMapModelId < 0 || m_toneMapModelId > 4 , "SEIToneMapModelId must be in rage 0 to 4"); 2044 xConfirmPara( m_cameraIsoSpeedValue == 0, "SEIToneMapCameraIsoSpeedValue shall not be equal to 0"); 2045 xConfirmPara( m_extendedRangeWhiteLevel < 100, "SEIToneMapExtendedRangeWhiteLevel should be greater than or equal to 100"); 2046 xConfirmPara( m_nominalBlackLevelLumaCodeValue >= m_nominalWhiteLevelLumaCodeValue, "SEIToneMapNominalWhiteLevelLumaCodeValue shall be greater than SEIToneMapNominalBlackLevelLumaCodeValue"); 2047 xConfirmPara( m_extendedWhiteLevelLumaCodeValue < m_nominalWhiteLevelLumaCodeValue, "SEIToneMapExtendedWhiteLevelLumaCodeValue shall be greater than or equal to SEIToneMapNominalWhiteLevelLumaCodeValue"); 2048 } 2049 #endif 2050 1745 2051 #if RATE_CONTROL_LAMBDA_DOMAIN 1746 2052 if ( m_RCEnableRateControl ) … … 1779 2085 } 1780 2086 #endif 1781 1782 2087 #if H_MV 1783 2088 } … … 1827 2132 printf("Input File : %s\n", m_pchInputFile ); 1828 2133 #endif 1829 1830 2134 printf("Bitstream File : %s\n", m_pchBitstreamFile ); 1831 1832 2135 #if H_MV 1833 2136 for( Int layer = 0; layer < m_numberOfLayers; layer++) … … 1838 2141 printf("Reconstruction File : %s\n", m_pchReconFile ); 1839 2142 #endif 1840 1841 #if H_MV 1842 xPrintParaVector( "ViewId", m_viewId ); 1843 #endif 1844 2143 #if H_MV 2144 xPrintParaVector( "ViewId", m_viewId ); 2145 #endif 1845 2146 #if H_3D 1846 xPrintParaVector( "DepthFlag", m_depthFlag );1847 #endif 1848 2147 xPrintParaVector( "DepthFlag", m_depthFlag ); 2148 printf("Coded Camera Param. Precision: %d\n", m_iCodedCamParPrecision); 2149 #endif 1849 2150 #if H_MV 1850 2151 xPrintParaVector( "QP" , m_fQP ); … … 1895 2196 #endif 1896 2197 printf("Max Num Merge Candidates : %d\n", m_maxNumMergeCand); 2198 #if H_3D 2199 printf("BaseViewCameraNumbers : %s\n", m_pchBaseViewCameraNumbers ); 2200 printf("Coded Camera Param. Precision: %d\n", m_iCodedCamParPrecision); 2201 #if H_3D_VSO 2202 printf("Force use of Lambda Scale : %d\n", m_bForceLambdaScaleVSO ); 2203 2204 if ( m_bUseVSO ) 2205 { 2206 printf("VSO Lambda Scale : %5.2f\n", m_dLambdaScaleVSO ); 2207 printf("VSO Mode : %d\n", m_uiVSOMode ); 2208 printf("VSO Config : %s\n", m_pchVSOConfig ); 2209 printf("VSO Negative Distortion : %d\n", m_bAllowNegDist ? 1 : 0); 2210 printf("VSO LS Table : %d\n", m_bVSOLSTable ? 1 : 0); 2211 printf("VSO Estimated VSD : %d\n", m_bUseEstimatedVSD ? 1 : 0); 2212 printf("VSO Early Skip : %d\n", m_bVSOEarlySkip ? 1 : 0); 2213 if ( m_bUseWVSO ) 2214 printf("Dist. Weights (VSO/VSD/SAD) : %d/%d/%d\n ", m_iVSOWeight, m_iVSDWeight, m_iDWeight ); 2215 } 2216 #endif //HHI_VSO 2217 #endif //H_3D 1897 2218 printf("\n"); 1898 2219 #if H_MV 2220 printf("TOOL CFG General: "); 2221 #else 1899 2222 printf("TOOL CFG: "); 2223 #endif 1900 2224 printf("IBD:%d ", g_bitDepthY > m_inputBitDepthY || g_bitDepthC > m_inputBitDepthC); 1901 2225 printf("HAD:%d ", m_bUseHADME ); … … 1908 2232 printf("SQP:%d ", m_uiDeltaQpRD ); 1909 2233 printf("ASR:%d ", m_bUseASR ); 2234 #if !L0034_COMBINED_LIST_CLEANUP 1910 2235 printf("LComb:%d ", m_bUseLComb ); 2236 #endif 1911 2237 printf("FEN:%d ", m_bUseFastEnc ); 1912 2238 printf("ECU:%d ", m_bUseEarlyCU ); … … 1943 2269 printf("TMVPMode:%d ", m_TMVPModeId ); 1944 2270 #if ADAPTIVE_QP_SELECTION 1945 printf("AQpS:%d ", m_bUseAdaptQpSelect );2271 printf("AQpS:%d ", m_bUseAdaptQpSelect ); 1946 2272 #endif 1947 2273 1948 2274 printf(" SignBitHidingFlag:%d ", m_signHideFlag); 1949 printf("RecalQP:%d", m_recalculateQPAccordingToLambda ? 1 : 0 ); 1950 printf("\n\n"); 1951 2275 printf("RecalQP:%d ", m_recalculateQPAccordingToLambda ? 1 : 0 ); 2276 #if H_3D_VSO 2277 printf("VSO:%d ", m_bUseVSO ); 2278 printf("WVSO:%d ", m_bUseWVSO ); 2279 #endif 2280 printf("\n\n"); 2281 1952 2282 fflush(stdout); 1953 2283 } -
branches/HTM-DEV-0.2-dev/source/App/TAppEncoder/TAppEncCfg.h
r438 r446 43 43 #include "TLibEncoder/TEncCfg.h" 44 44 #include <sstream> 45 #if H_3D 46 #include "TAppCommon/TAppComCamPara.h" 47 #include "TLibRenderer/TRenModel.h" 48 #include "TLibRenderer/TRenModSetupStrParser.h" 49 #endif 45 50 //! \ingroup TAppEncoder 46 51 //! \{ … … 60 65 Char* m_pchInputFile; ///< source file name 61 66 #endif 62 63 67 Char* m_pchBitstreamFile; ///< output bitstream file 64 65 68 #if H_MV 66 69 std::vector<char*> m_pchReconFileList; ///< output reconstruction file names 67 70 Int m_numberOfLayers; ///< number of Layers to Encode 71 #if H_3D 72 Int m_iNumberOfViews; ///< number of Layers that are views 73 #endif 68 74 #else 69 75 Char* m_pchReconFile; ///< output reconstruction file 70 76 #endif 71 72 73 // VPS specification 74 #if H_MV 77 #if H_MV 78 // VPS specification 75 79 std::vector< std::vector<Int> > m_dimIds; ///< dimension ids ( pointers to m_viewId and m_depthFlag 76 80 std::vector<Int> m_viewId; ///< view id … … 83 87 std::vector<Int> m_dimensionIdLen; ///< Length of scalability dimension s 84 88 #endif 85 86 87 89 Double m_adLambdaModifier[ MAX_TLAYER ]; ///< Lambda modifier array for each temporal layer 88 90 // source specification … … 103 105 Level::Tier m_levelTier; 104 106 Level::Name m_level; 105 106 107 #if L0046_CONSTRAINT_FLAGS 107 108 Bool m_progressiveSourceFlag; … … 124 125 GOPEntry m_GOPList[MAX_GOP]; ///< the coding structure entries from the config file 125 126 Int m_numReorderPics[MAX_TLAYER]; ///< total number of reorder pictures 127 #if L0323_DPB 128 Int m_maxDecPicBuffering[MAX_TLAYER]; ///< total number of pictures in the decoded picture buffer 129 #else 126 130 Int m_maxDecPicBuffering[MAX_TLAYER]; ///< total number of reference pictures needed for decoding 127 131 #endif 132 #endif 133 #if !L0034_COMBINED_LIST_CLEANUP 128 134 Bool m_bUseLComb; ///< flag for using combined reference list for uni-prediction in B-slices (JCTVC-D421) 135 #endif 129 136 Bool m_useTransformSkip; ///< flag for enabling intra transform skipping 130 137 Bool m_useTransformSkipFast; ///< flag for enabling fast intra transform skipping … … 207 214 Int m_loopFilterTcOffsetDiv2; ///< tc offset for deblocking filter 208 215 Bool m_DeblockingFilterControlPresent; ///< deblocking filter control present flag in PPS 216 #if L0386_DB_METRIC 217 Bool m_DeblockingFilterMetric; ///< blockiness metric in encoder 218 #endif 209 219 210 220 // coding tools (PCM) … … 256 266 Int m_bufferingPeriodSEIEnabled; 257 267 Int m_pictureTimingSEIEnabled; 268 #if J0149_TONE_MAPPING_SEI 269 Bool m_toneMappingInfoSEIEnabled; 270 Int m_toneMapId; 271 Bool m_toneMapCancelFlag; 272 Bool m_toneMapPersistenceFlag; 273 Int m_toneMapCodedDataBitDepth; 274 Int m_toneMapTargetBitDepth; 275 Int m_toneMapModelId; 276 Int m_toneMapMinValue; 277 Int m_toneMapMaxValue; 278 Int m_sigmoidMidpoint; 279 Int m_sigmoidWidth; 280 Int m_numPivots; 281 Int m_cameraIsoSpeedIdc; 282 Int m_cameraIsoSpeedValue; 283 Int m_exposureCompensationValueSignFlag; 284 Int m_exposureCompensationValueNumerator; 285 Int m_exposureCompensationValueDenomIdc; 286 Int m_refScreenLuminanceWhite; 287 Int m_extendedRangeWhiteLevel; 288 Int m_nominalBlackLevelLumaCodeValue; 289 Int m_nominalWhiteLevelLumaCodeValue; 290 Int m_extendedWhiteLevelLumaCodeValue; 291 Int* m_startOfCodedInterval; 292 Int* m_codedPivotValue; 293 Int* m_targetPivotValue; 294 #endif 258 295 Int m_framePackingSEIEnabled; 259 296 Int m_framePackingSEIType; … … 265 302 Int m_gradualDecodingRefreshInfoEnabled; 266 303 Int m_decodingUnitInfoSEIEnabled; 304 #if L0208_SOP_DESCRIPTION_SEI 305 Int m_SOPDescriptionSEIEnabled; 306 #endif 307 #if K0180_SCALABLE_NESTING_SEI 308 Int m_scalableNestingSEIEnabled; 309 #endif 267 310 // weighted prediction 268 311 Bool m_useWeightedPred; ///< Use of weighted prediction in P slices … … 332 375 Int m_log2MaxMvLengthVertical; ///< Indicate the maximum absolute value of a decoded vertical MV component in quarter-pel luma units 333 376 377 #if H_3D 378 // Camera parameters 379 Char* m_pchCameraParameterFile; ///< camera parameter file 380 Char* m_pchBaseViewCameraNumbers; 381 TAppComCamPara m_cCameraData; 382 Int m_iCodedCamParPrecision; ///< precision for coding of camera parameters 383 #if H_3D_VSO 384 Char* m_pchVSOConfig; 385 Bool m_bUseVSO; ///< flag for using View Synthesis Optimization 386 Bool m_bVSOLSTable; ///< Depth QP dependent Lagrange parameter optimization (m23714) 387 Bool m_bVSOEarlySkip; ///< Early skip of VSO computation (JCT3V-A0093 modification 4) 388 389 //// Used for development by GT, might be removed later 390 Double m_dLambdaScaleVSO; ///< Scaling factor for Lambda in VSO mode 391 Bool m_bForceLambdaScaleVSO; ///< Use Lambda Scale for depth even if VSO is turned off 392 Bool m_bAllowNegDist; ///< Allow negative distortion in VSO 393 UInt m_uiVSOMode; ///< Number of VSO Mode, 1 = , 2 = simple, org vs. ren, 3 = simple, ren vs. ren, 4 = full 394 395 // SAIT_VSO_EST_A0033 396 Bool m_bUseEstimatedVSD; ///< Flag for using model based VSD estimation instead of VSO for some encoder decisions (JCT3V-A0033 modification 3) 397 398 // LGE_WVSO_A0119 399 Bool m_bUseWVSO; ///< flag for using View Synthesis Optimization 400 Int m_iVSOWeight; 401 Int m_iVSDWeight; 402 Int m_iDWeight; 403 404 // Ren Model String 405 TRenModSetupStrParser m_cRenModStrParser; 406 #endif 407 #endif 334 408 // internal member functions 335 409 Void xSetGlobal (); ///< set global variables … … 337 411 Void xPrintParameter (); ///< print configuration values 338 412 Void xPrintUsage (); ///< print usage 339 340 413 #if H_MV 341 414 template <typename T> … … 388 461 Int* m_constantPicRateIdc; ///< Indicates constant picture rate idc for various sub-layers 389 462 #endif 390 391 463 #if H_MV 392 464 Int getGOPSize() { return m_iGOPSize; } -
branches/HTM-DEV-0.2-dev/source/App/TAppEncoder/TAppEncTop.cpp
r438 r446 70 70 Void TAppEncTop::xInitLibCfg() 71 71 { 72 #if H_MV 73 TComVPS& vps = m_vps; 74 #else 72 75 TComVPS vps; 76 #endif 73 77 74 78 #if H_MV … … 111 115 } 112 116 #endif 113 114 117 #if H_MV 115 118 xSetLayerIds ( vps ); 116 119 xSetDimensionIdAndLength ( vps ); 117 120 xSetDirectDependencyFlags( vps ); 121 #if H_3D 122 vps.initViewIndex(); 123 m_ivPicLists.setVPS ( &vps ); 124 #endif 118 125 119 126 for(Int layer = 0; layer < m_numberOfLayers; layer++) … … 128 135 TEncTop& m_cTEncTop = *m_acTEncTopList[ layer ]; // It is not a member, but this name helps avoiding code duplication !!! 129 136 130 m_cTEncTop.setLayerIdInVps ( layer );131 m_cTEncTop.setLayerId ( vps.getLayerIdInNuh( layer ) );132 m_cTEncTop.setViewId ( vps.getViewId ( layer ) );137 m_cTEncTop.setLayerIdInVps ( layer ); 138 m_cTEncTop.setLayerId ( vps.getLayerIdInNuh( layer ) ); 139 m_cTEncTop.setViewId ( vps.getViewId ( layer ) ); 133 140 #if H_3D 134 m_cTEncTop.setIsDepth ( vps.getDepthId ( layer ) != 0 ); 135 #endif 136 m_cTEncTop.setIvPicLists ( &m_ivPicLists ); 137 #endif 138 141 Bool isDepth = ( vps.getDepthId ( layer ) != 0 ) ; 142 m_cTEncTop.setViewIndex ( vps.getViewIndex ( layer ) ); 143 m_cTEncTop.setIsDepth ( isDepth ); 144 //====== Camera Parameters ========= 145 m_cTEncTop.setCameraParameters ( &m_cCameraData ); 146 m_cTEncTop.setCamParPrecision ( isDepth ? false : m_cCameraData.getCamParsCodedPrecision () ); 147 m_cTEncTop.setCamParInSliceHeader ( isDepth ? 0 : m_cCameraData.getVaryingCameraParameters() ); 148 m_cTEncTop.setCodedScale ( isDepth ? 0 : m_cCameraData.getCodedScale () ); 149 m_cTEncTop.setCodedOffset ( isDepth ? 0 : m_cCameraData.getCodedOffset () ); 150 #if H_3D_VSO 151 //====== VSO ========= 152 m_cTEncTop.setRenderModelParameters ( &m_cRenModStrParser ); 153 m_cTEncTop.setForceLambdaScaleVSO ( isDepth ? m_bForceLambdaScaleVSO : false ); 154 m_cTEncTop.setLambdaScaleVSO ( isDepth ? m_dLambdaScaleVSO : 1 ); 155 m_cTEncTop.setVSOMode ( isDepth ? m_uiVSOMode : 0 ); 156 157 m_cTEncTop.setAllowNegDist ( isDepth ? m_bAllowNegDist : false ); 158 159 // SAIT_VSO_EST_A0033 160 m_cTEncTop.setUseEstimatedVSD ( isDepth ? m_bUseEstimatedVSD : false ); 161 162 // LGE_WVSO_A0119 163 m_cTEncTop.setUseWVSO ( isDepth ? m_bUseWVSO : false ); 164 m_cTEncTop.setVSOWeight ( isDepth ? m_iVSOWeight : 0 ); 165 m_cTEncTop.setVSDWeight ( isDepth ? m_iVSDWeight : 0 ); 166 m_cTEncTop.setDWeight ( isDepth ? m_iDWeight : 0 ); 167 #endif // H_3D_VSO 168 #endif // H_3D 169 170 m_cTEncTop.setIvPicLists ( &m_ivPicLists ); 171 #endif // H_MV 139 172 m_cTEncTop.setVPS(&vps); 140 173 141 174 m_cTEncTop.setProfile(m_profile); 142 175 m_cTEncTop.setLevel(m_levelTier, m_level); 143 144 176 #if L0046_CONSTRAINT_FLAGS 145 177 m_cTEncTop.setProgressiveSourceFlag(m_progressiveSourceFlag); … … 186 218 m_cTEncTop.setQP ( m_iQP ); 187 219 #endif 220 188 221 m_cTEncTop.setPad ( m_aiPad ); 189 222 190 223 #if H_MV 191 224 m_cTEncTop.setMaxTempLayer ( m_maxTempLayerMvc[layer] ); … … 207 240 m_cTEncTop.setLoopFilterTcOffset ( m_loopFilterTcOffsetDiv2 ); 208 241 m_cTEncTop.setDeblockingFilterControlPresent( m_DeblockingFilterControlPresent); 242 #if L0386_DB_METRIC 243 m_cTEncTop.setDeblockingFilterMetric ( m_DeblockingFilterMetric ); 244 #endif 209 245 210 246 //====== Motion search ======== … … 226 262 Int lowestQP; 227 263 lowestQP = - 6*(g_bitDepthY - 8); // XXX: check 264 228 265 #if H_MV 229 266 if ((m_iMaxDeltaQP == 0 ) && (m_iQP[layer] == lowestQP) && (m_useLossless == true)) … … 243 280 m_cTEncTop.setUseHADME ( m_bUseHADME ); 244 281 m_cTEncTop.setUseLossless ( m_useLossless ); 282 #if !L0034_COMBINED_LIST_CLEANUP 245 283 m_cTEncTop.setUseLComb ( m_bUseLComb ); 284 #endif 246 285 #if H_MV 247 286 m_cTEncTop.setdQPs ( m_aidQP[layer] ); … … 321 360 m_cTEncTop.setBufferingPeriodSEIEnabled( m_bufferingPeriodSEIEnabled ); 322 361 m_cTEncTop.setPictureTimingSEIEnabled( m_pictureTimingSEIEnabled ); 362 #if J0149_TONE_MAPPING_SEI 363 m_cTEncTop.setToneMappingInfoSEIEnabled ( m_toneMappingInfoSEIEnabled ); 364 m_cTEncTop.setTMISEIToneMapId ( m_toneMapId ); 365 m_cTEncTop.setTMISEIToneMapCancelFlag ( m_toneMapCancelFlag ); 366 m_cTEncTop.setTMISEIToneMapPersistenceFlag ( m_toneMapPersistenceFlag ); 367 m_cTEncTop.setTMISEICodedDataBitDepth ( m_toneMapCodedDataBitDepth ); 368 m_cTEncTop.setTMISEITargetBitDepth ( m_toneMapTargetBitDepth ); 369 m_cTEncTop.setTMISEIModelID ( m_toneMapModelId ); 370 m_cTEncTop.setTMISEIMinValue ( m_toneMapMinValue ); 371 m_cTEncTop.setTMISEIMaxValue ( m_toneMapMaxValue ); 372 m_cTEncTop.setTMISEISigmoidMidpoint ( m_sigmoidMidpoint ); 373 m_cTEncTop.setTMISEISigmoidWidth ( m_sigmoidWidth ); 374 m_cTEncTop.setTMISEIStartOfCodedInterva ( m_startOfCodedInterval ); 375 m_cTEncTop.setTMISEINumPivots ( m_numPivots ); 376 m_cTEncTop.setTMISEICodedPivotValue ( m_codedPivotValue ); 377 m_cTEncTop.setTMISEITargetPivotValue ( m_targetPivotValue ); 378 m_cTEncTop.setTMISEICameraIsoSpeedIdc ( m_cameraIsoSpeedIdc ); 379 m_cTEncTop.setTMISEICameraIsoSpeedValue ( m_cameraIsoSpeedValue ); 380 m_cTEncTop.setTMISEIExposureCompensationValueSignFlag ( m_exposureCompensationValueSignFlag ); 381 m_cTEncTop.setTMISEIExposureCompensationValueNumerator ( m_exposureCompensationValueNumerator ); 382 m_cTEncTop.setTMISEIExposureCompensationValueDenomIdc ( m_exposureCompensationValueDenomIdc ); 383 m_cTEncTop.setTMISEIRefScreenLuminanceWhite ( m_refScreenLuminanceWhite ); 384 m_cTEncTop.setTMISEIExtendedRangeWhiteLevel ( m_extendedRangeWhiteLevel ); 385 m_cTEncTop.setTMISEINominalBlackLevelLumaCodeValue ( m_nominalBlackLevelLumaCodeValue ); 386 m_cTEncTop.setTMISEINominalWhiteLevelLumaCodeValue ( m_nominalWhiteLevelLumaCodeValue ); 387 m_cTEncTop.setTMISEIExtendedWhiteLevelLumaCodeValue ( m_extendedWhiteLevelLumaCodeValue ); 388 #endif 323 389 m_cTEncTop.setFramePackingArrangementSEIEnabled( m_framePackingSEIEnabled ); 324 390 m_cTEncTop.setFramePackingArrangementSEIType( m_framePackingSEIType ); … … 330 396 m_cTEncTop.setGradualDecodingRefreshInfoEnabled( m_gradualDecodingRefreshInfoEnabled ); 331 397 m_cTEncTop.setDecodingUnitInfoSEIEnabled( m_decodingUnitInfoSEIEnabled ); 398 #if L0208_SOP_DESCRIPTION_SEI 399 m_cTEncTop.setSOPDescriptionSEIEnabled( m_SOPDescriptionSEIEnabled ); 400 #endif 401 #if K0180_SCALABLE_NESTING_SEI 402 m_cTEncTop.setScalableNestingSEIEnabled( m_scalableNestingSEIEnabled ); 403 #endif 332 404 m_cTEncTop.setUniformSpacingIdr ( m_iUniformSpacingIdr ); 333 405 m_cTEncTop.setNumColumnsMinus1 ( m_iNumColumnsMinus1 ); … … 424 496 } 425 497 #endif 426 427 #if H_MV 428 } 429 #endif 430 498 #if H_MV 499 } 500 #endif 501 #if H_3D_VSO 502 if ( m_bUseVSO ) 503 { 504 if ( m_uiVSOMode == 4 ) 505 { 506 #if H_3D_VSO_EARLY_SKIP 507 m_cRendererModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, g_uiMaxCUHeight , LOG2_DISP_PREC_LUT, 0, m_bVSOEarlySkip ); 508 #else 509 m_cRendererModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, g_uiMaxCUHeight , LOG2_DISP_PREC_LUT, 0 ); 510 #endif 511 for ( Int layer = 0; layer < m_numberOfLayers ; layer++ ) 512 { 513 TEncTop* pcEncTop = m_acTEncTopList[ layer ]; 514 Int iViewNum = pcEncTop->getViewIndex(); 515 Int iContent = pcEncTop->getIsDepth() ? 1 : 0; 516 Int iNumOfModels = m_cRenModStrParser.getNumOfModelsForView(iViewNum, iContent); 517 518 Bool bUseVSO = (iNumOfModels != 0); 519 520 pcEncTop->setUseVSO( bUseVSO ); 521 pcEncTop->getRdCost()->setRenModel( bUseVSO ? &m_cRendererModel : NULL ); 522 523 for (Int iCurModel = 0; iCurModel < iNumOfModels; iCurModel++ ) 524 { 525 Int iModelNum; Int iLeftViewNum; Int iRightViewNum; Int iDump; Int iOrgRefNum; Int iBlendMode; 526 527 m_cRenModStrParser.getSingleModelData ( iViewNum, iContent, iCurModel, iModelNum, iBlendMode, iLeftViewNum, iRightViewNum, iOrgRefNum, iDump ) ; 528 m_cRendererModel .createSingleModel ( iViewNum, iContent, iModelNum, iLeftViewNum, iRightViewNum, (iOrgRefNum != -1), iBlendMode ); 529 } 530 } 531 } 532 else 533 { 534 AOT(true); 535 } 536 } 537 #endif 431 538 } 432 539 … … 579 686 580 687 eos[layer] = (m_frameRcvd[layer] == m_framesToBeEncoded); 581 allEos = allEos| eos[layer];688 allEos = allEos||eos[layer]; 582 689 583 690 // if end of file (which is only detected on a read failure) flush the encoder of any queued pictures … … 585 692 { 586 693 flush [layer] = true; 587 eos [layer] 694 eos [layer] = true; 588 695 m_frameRcvd [layer]--; 589 696 m_acTEncTopList[layer]->setFramesToBeEncoded(m_frameRcvd[layer]); … … 593 700 for ( Int gopId=0; gopId < gopSize; gopId++ ) 594 701 { 702 #if H_3D 703 UInt iNextPoc = m_acTEncTopList[0] -> getFrameId( gopId ); 704 if ( iNextPoc < m_framesToBeEncoded ) 705 { 706 m_cCameraData.update( iNextPoc ); 707 } 708 #endif 595 709 for(Int layer=0; layer < m_numberOfLayers; layer++ ) 596 710 { 711 #if H_3D_VSO 712 if( m_bUseVSO && m_bUseEstimatedVSD && iNextPoc < m_framesToBeEncoded ) 713 { 714 m_cCameraData.setDispCoeff( iNextPoc, m_acTEncTopList[layer]->getViewIndex() ); 715 m_acTEncTopList[layer] ->setDispCoeff( m_cCameraData.getDispCoeff() ); 716 } 717 #endif 597 718 Int iNumEncoded = 0; 598 719 … … 602 723 outputAccessUnits.clear(); 603 724 } 604 605 725 } 606 726 gopSize = maxGopSize; … … 666 786 return; 667 787 } 668 669 #if H_3D670 TEncTop* TAppEncTop::getTEncTopView( Int viewId, Bool isDepth )671 {672 TEncTop* encoder = NULL;673 for( Int layer = 0; layer < m_acTEncTopList.size(); layer++ )674 {675 if( m_acTEncTopList[layer]->getViewId() == viewId &&676 m_acTEncTopList[layer]->getIsDepth() == isDepth )677 {678 encoder = m_acTEncTopList[layer];679 break;680 }681 }682 return encoder;683 }684 #endif685 788 686 789 // ==================================================================================================================== … … 694 797 . 695 798 */ 696 697 799 #if H_MV 698 800 Void TAppEncTop::xGetBuffer( TComPicYuv*& rpcPicYuvRec, UInt layer) … … 722 824 723 825 } 724 725 826 #if H_MV 726 827 m_picYuvRec[layer]->pushBack( rpcPicYuvRec ); … … 732 833 Void TAppEncTop::xDeleteBuffer( ) 733 834 { 734 735 835 #if H_MV 736 836 for(Int layer=0; layer<m_picYuvRec.size(); layer++) … … 757 857 } 758 858 #endif 759 760 859 } 761 860 … … 787 886 { 788 887 TComPicYuv* pcPicYuvRec = *(iterPicYuvRec++); 789 790 888 #if H_MV 791 889 if (m_pchReconFileList[layerId]) … … 815 913 } 816 914 #endif 817 818 915 } 819 916 … … 832 929 case NAL_UNIT_CODED_SLICE_TRAIL_R: 833 930 case NAL_UNIT_CODED_SLICE_TRAIL_N: 834 case NAL_UNIT_CODED_SLICE_TLA :931 case NAL_UNIT_CODED_SLICE_TLA_R: 835 932 case NAL_UNIT_CODED_SLICE_TSA_N: 836 933 case NAL_UNIT_CODED_SLICE_STSA_R: 837 934 case NAL_UNIT_CODED_SLICE_STSA_N: 838 case NAL_UNIT_CODED_SLICE_BLA :839 case NAL_UNIT_CODED_SLICE_BLA NT:935 case NAL_UNIT_CODED_SLICE_BLA_W_LP: 936 case NAL_UNIT_CODED_SLICE_BLA_W_RADL: 840 937 case NAL_UNIT_CODED_SLICE_BLA_N_LP: 841 case NAL_UNIT_CODED_SLICE_IDR :938 case NAL_UNIT_CODED_SLICE_IDR_W_RADL: 842 939 case NAL_UNIT_CODED_SLICE_IDR_N_LP: 843 940 case NAL_UNIT_CODED_SLICE_CRA: 844 941 case NAL_UNIT_CODED_SLICE_RADL_N: 845 case NAL_UNIT_CODED_SLICE_ DLP:942 case NAL_UNIT_CODED_SLICE_RADL_R: 846 943 case NAL_UNIT_CODED_SLICE_RASL_N: 847 case NAL_UNIT_CODED_SLICE_ TFD:944 case NAL_UNIT_CODED_SLICE_RASL_R: 848 945 case NAL_UNIT_VPS: 849 946 case NAL_UNIT_SPS: … … 861 958 void TAppEncTop::printRateSummary() 862 959 { 863 864 960 #if H_MV 865 961 Double time = (Double) m_frameRcvd[0] / m_iFrameRate; … … 868 964 Double time = (Double) m_iFrameRcvd / m_iFrameRate; 869 965 #endif 870 871 966 printf("Bytes written to file: %u (%.3f kbps)\n", m_totalBytes, 0.008 * m_totalBytes / time); 872 967 #if VERBOSE_RATE … … 881 976 for( Int dim = 0; dim < m_dimIds.size(); dim++ ) 882 977 { 883 884 for( Int layer = 1; layer < vps.getMaxLayers(); layer++ )885 886 887 978 vps.setDimensionIdLen( dim, m_dimensionIdLen[ dim ] ); 979 for( Int layer = 0; layer < vps.getMaxLayers(); layer++ ) 980 { 981 vps.setDimensionId( layer, dim, m_dimIds[ dim ][ layer ] ); 982 } 888 983 } 889 984 } … … 937 1032 } 938 1033 #endif 939 940 1034 //! \} -
branches/HTM-DEV-0.2-dev/source/App/TAppEncoder/TAppEncTop.h
r438 r446 46 46 #include "TLibCommon/AccessUnit.h" 47 47 #include "TAppEncCfg.h" 48 #if H_3D 49 #include "../../Lib/TLibRenderer/TRenTop.h" 50 #endif 48 51 49 52 //! \ingroup TAppEncoder … … 59 62 private: 60 63 // class interface 61 62 64 #if H_MV 63 65 std::vector<TEncTop*> m_acTEncTopList ; ///< encoder class per layer … … 70 72 71 73 TComPicLists m_ivPicLists; ///< picture buffers of encoder instances 74 TComVPS m_vps; ///< vps 72 75 #else 73 76 TEncTop m_cTEncTop; ///< encoder class … … 82 85 UInt m_essentialBytes; 83 86 UInt m_totalBytes; 87 #if H_3D_VSO 88 TRenTop m_cRendererTop; 89 TRenModel m_cRendererModel; 90 #endif 84 91 protected: 85 92 // initialization … … 91 98 /// obtain required buffers 92 99 #if H_MV 93 Void xGetBuffer(TComPicYuv*& rpcPicYuvRec, UInt layer);100 Void xGetBuffer(TComPicYuv*& rpcPicYuvRec, UInt layer); 94 101 #else 95 102 Void xGetBuffer(TComPicYuv*& rpcPicYuvRec); … … 100 107 101 108 // file I/O 102 103 109 #if H_MV 104 110 Void xWriteOutput(std::ostream& bitstreamFile, Int iNumEncoded, std::list<AccessUnit>& accessUnits, UInt layerId); ///< write bitstream to file … … 106 112 Void xWriteOutput(std::ostream& bitstreamFile, Int iNumEncoded, const std::list<AccessUnit>& accessUnits); ///< write bitstream to file 107 113 #endif 108 109 114 void rateStatsAccum(const AccessUnit& au, const std::vector<UInt>& stats); 110 115 void printRateSummary(); … … 116 121 Int xGetMax( std::vector<Int>& vec); 117 122 #endif 118 119 123 public: 120 124 TAppEncTop(); … … 122 126 123 127 Void encode (); ///< main encoding function 124 125 128 #if H_MV 126 TEncTop* getTEncTopLayer(UInt layer) { return m_acTEncTopList[layer]; } ///< return pointer to encoder class for specific layer 127 #if H_3D 128 TEncTop* getTEncTopView( Int viewId, Bool isDepth ); ///< return pointer to encoder class for specific view Id and texture or depth 129 #endif 129 TEncTop* getTEncTop( UInt layer ) { return m_acTEncTopList[layer]; } ///< return pointer to encoder class for specific layer 130 130 #else 131 131 TEncTop& getTEncTop () { return m_cTEncTop; } ///< return encoder class pointer reference 132 132 #endif 133 134 133 };// END CLASS DEFINITION TAppEncTop 135 134 -
branches/HTM-DEV-0.2-dev/source/App/TAppEncoder/encmain.cpp
r438 r446 62 62 fprintf( stdout, "HM software: Encoder Version [%s]", NV_VERSION ); 63 63 #endif 64 65 64 fprintf( stdout, NVM_ONOS ); 66 65 fprintf( stdout, NVM_COMPILEDBY );
Note: See TracChangeset for help on using the changeset viewer.