Changeset 906 in SHVCSoftware for trunk/source/App
- Timestamp:
- 15 Oct 2014, 07:25:10 (10 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/SHM-dev (added) merged: 817-905
- Property svn:mergeinfo changed
-
trunk/source
- Property svn:mergeinfo changed
/branches/SHM-dev/source (added) merged: 818-875,877-905
- Property svn:mergeinfo changed
-
trunk/source/App/TAppDecoder/TAppDecCfg.cpp
r815 r906 78 78 string cfg_ReconFile; 79 79 #endif 80 #if AVC_SYNTAX || SYNTAX_OUTPUT 81 string cfg_BLSyntaxFile; 82 #endif 80 83 81 string cfg_TargetDecLayerIdSetFile; 84 82 … … 96 94 ("BLSourceHeight,-hgt", m_iBLSourceHeight, 0, "BL source picture height") 97 95 #endif 98 #if AVC_SYNTAX99 ("BLSyntaxFile,-ibs", cfg_BLSyntaxFile, string(""), "BL syntax input file name")100 #endif101 96 #endif 102 97 #else 103 98 ("ReconFile,o", cfg_ReconFile, string(""), "reconstructed YUV output file name\n" 104 99 "YUV writing is skipped if omitted") 105 #endif106 #if SYNTAX_OUTPUT107 ("BLSyntaxFile,-ibs", cfg_BLSyntaxFile, string(""), "BL syntax input file name")108 ("BLSourceWidth,-wdt", m_iBLSourceWidth, 0, "BL source picture width")109 ("BLSourceHeight,-hgt", m_iBLSourceHeight, 0, "BL source picture height")110 ("BLFrames,-fr", m_iBLFrames, 0, "BL number of frames")111 100 #endif 112 101 ("SkipFrames,s", m_iSkipFrame, 0, "number of frames to skip before random access") … … 126 115 ("TarDecLayerIdSetFile,l", cfg_TargetDecLayerIdSetFile, string(""), "targetDecLayerIdSet file name. The file should include white space separated LayerId values to be decoded. Omitting the option or a value of -1 in the file decodes all layers.") 127 116 ("RespectDefDispWindow,w", m_respectDefDispWindow, 0, "Only output content inside the default display window\n") 117 #if Q0074_COLOUR_REMAPPING_SEI 118 ("SEIColourRemappingInfo", m_colourRemapSEIEnabled, false, "Control handling of Colour Remapping Information SEI messages\n" 119 "\t1: apply colour remapping on decoded pictures if available in the bitstream\n" 120 "\t0: ignore SEI message") 121 #endif 128 122 ; 129 123 po::setDefaults(opts); … … 163 157 #else 164 158 m_pchReconFile = cfg_ReconFile.empty() ? NULL : strdup(cfg_ReconFile.c_str()); 165 #endif166 #if AVC_SYNTAX || SYNTAX_OUTPUT167 m_pchBLSyntaxFile = cfg_BLSyntaxFile.empty() ? NULL : strdup(cfg_BLSyntaxFile.c_str());168 159 #endif 169 160 -
trunk/source/App/TAppDecoder/TAppDecCfg.h
r713 r906 69 69 Int m_iMaxTemporalLayer; ///< maximum temporal layer to be decoded 70 70 Int m_decodedPictureHashSEIEnabled; ///< Checksum(3)/CRC(2)/MD5(1)/disable(0) acting on decoded picture hash SEI message 71 #if Q0074_COLOUR_REMAPPING_SEI 72 Bool m_colourRemapSEIEnabled; ///< Enable the Colour Remapping Information SEI message if available (remapping decoded pictures) 73 #endif 71 74 72 75 #if SVC_EXTENSION … … 78 81 Int m_iBLSourceHeight; 79 82 #endif 80 #if AVC_SYNTAX81 Char* m_pchBLSyntaxFile; ///< input BL syntax file name82 83 #endif 83 #endif84 #endif85 86 #if SYNTAX_OUTPUT87 Char* m_pchBLSyntaxFile; ///< input BL syntax file name88 #if !REPN_FORMAT_IN_VPS89 Int m_iBLSourceWidth;90 Int m_iBLSourceHeight;91 #endif92 Int m_iBLFrames;93 84 #endif 94 85 … … 110 101 , m_iMaxTemporalLayer(-1) 111 102 , m_decodedPictureHashSEIEnabled(0) 103 #if Q0074_COLOUR_REMAPPING_SEI 104 , m_colourRemapSEIEnabled(0) 105 #endif 112 106 #if SVC_EXTENSION 113 107 , m_tgtLayerId(0) … … 115 109 , m_iBLSourceWidth(0) 116 110 , m_iBLSourceHeight(0) 117 #endif118 #if SYNTAX_OUTPUT119 , m_iBLSourceWidth(0)120 , m_iBLSourceHeight(0)121 , m_iBLFrames(0)122 111 #endif 123 112 #endif -
trunk/source/App/TAppDecoder/TAppDecTop.cpp
r815 r906 102 102 } 103 103 #endif 104 #if AVC_SYNTAX || SYNTAX_OUTPUT105 if( m_pchBLSyntaxFile )106 {107 free ( m_pchBLSyntaxFile );108 m_pchBLSyntaxFile = NULL;109 }110 #endif111 104 } 112 105 … … 163 156 } 164 157 TComList<TComPic*> *cListPic = m_acTDecTop[0].getListPic(); 165 #if AVC_SYNTAX || !REPN_FORMAT_IN_VPS166 m_acTDecTop[0].setBLsize( m_iBLSourceWidth, m_iBLSourceHeight );167 #endif168 158 m_acTDecTop[0].setBLReconFile( &streamYUV ); 169 159 pcBLPic.setLayerId( 0 ); 170 160 cListPic->pushBack( &pcBLPic ); 171 #if AVC_SYNTAX172 fstream streamSyntaxFile;173 if( m_pchBLSyntaxFile )174 {175 streamSyntaxFile.open( m_pchBLSyntaxFile, fstream::in | fstream::binary );176 }177 m_acTDecTop[0].setBLSyntaxFile( &streamSyntaxFile );178 #endif179 161 #endif 180 162 … … 363 345 streamYUV.close(); 364 346 } 365 #if AVC_SYNTAX366 if( streamSyntaxFile.is_open() )367 {368 streamSyntaxFile.close();369 }370 #endif371 347 pcBLPic.destroy(); 372 348 … … 405 381 Bool openedReconFile = false; // reconstruction file not yet opened. (must be performed after SPS is seen) 406 382 Bool loopFiltered = false; 407 408 #if SYNTAX_OUTPUT409 if( !m_pchBLSyntaxFile )410 {411 printf( "Wrong base layer syntax file\n" );412 exit(EXIT_FAILURE);413 }414 fstream streamSyntaxFile( m_pchBLSyntaxFile, fstream::out | fstream::binary );415 if( !streamSyntaxFile.good() )416 {417 printf( "Base layer syntax input reading error\n" );418 exit(EXIT_FAILURE);419 }420 m_cTDecTop.setBLSyntaxFile( &streamSyntaxFile );421 422 for( Int i = m_iBLFrames * m_iBLSourceWidth * m_iBLSourceHeight * SYNTAX_BYTES / 16; i >= 0; i-- )423 {424 streamSyntaxFile.put( 0 );425 }426 streamSyntaxFile.seekp( 0 );427 #endif428 383 429 384 while (!!bitstreamFile) … … 543 498 } 544 499 545 #if SYNTAX_OUTPUT546 if( streamSyntaxFile.is_open() )547 {548 streamSyntaxFile.close();549 }550 #endif551 552 500 xFlushOutput( pcListPic ); 553 501 // delete buffers … … 620 568 m_acTDecTop[layer].init(); 621 569 m_acTDecTop[layer].setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled); 570 #if Q0074_COLOUR_REMAPPING_SEI 571 m_acTDecTop[layer].setColourRemappingInfoSEIEnabled(m_colourRemapSEIEnabled); 572 #endif 622 573 m_acTDecTop[layer].setNumLayer( m_tgtLayerId + 1 ); 623 574 #if OUTPUT_LAYER_SET_INDEX … … 625 576 #endif 626 577 } 627 628 578 #else 629 579 m_cTDecTop.init(); 630 580 m_cTDecTop.setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled); 581 #if Q0074_COLOUR_REMAPPING_SEI 582 m_cTDecTop.setColourRemappingInfoSEIEnabled(m_colourRemapSEIEnabled); 583 #endif 631 584 #endif 632 585 } … … 727 680 TComPicYuv* pPicCYuvRecTop = pcPicTop->getPicYuvRec(); 728 681 TComPicYuv* pPicCYuvRecBot = pcPicBottom->getPicYuvRec(); 729 #if Q0074_SEI_COLOR_MAPPING730 if( m_acTDecTop[layerId].m_ColorMapping->getColorMappingFlag() )731 {732 pPicCYuvRecTop = m_acTDecTop[layerId].m_ColorMapping->getColorMapping( pPicCYuvRecTop, 0, layerId );733 pPicCYuvRecBot = m_acTDecTop[layerId].m_ColorMapping->getColorMapping( pPicCYuvRecBot, 1, layerId );734 }735 #endif736 682 #if REPN_FORMAT_IN_VPS 737 683 UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc(); … … 762 708 TComPicYuv* pPicCYuvRecTop = pcPicTop->getPicYuvRec(); 763 709 TComPicYuv* pPicCYuvRecBot = pcPicBottom->getPicYuvRec(); 764 #if Q0074_SEI_COLOR_MAPPING765 if ( m_cTDecTop.m_ColorMapping->getColorMappingFlag() )766 {767 pPicCYuvRecTop = m_cTDecTop.m_ColorMapping->getColorMapping( pPicCYuvRecTop, 0 );768 pPicCYuvRecBot = m_cTDecTop.m_ColorMapping->getColorMapping( pPicCYuvRecBot, 1 );769 }770 #endif771 710 m_cTVideoIOYuvReconFile.write( pPicCYuvRecTop, pPicCYuvRecBot, 772 711 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), … … 843 782 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 844 783 TComPicYuv* pPicCYuvRec = pcPic->getPicYuvRec(); 845 #if Q0074_SEI_COLOR_MAPPING846 if ( m_acTDecTop[layerId].m_ColorMapping->getColorMappingFlag() )847 {848 pPicCYuvRec = m_acTDecTop[layerId].m_ColorMapping->getColorMapping( pPicCYuvRec, 0, layerId );849 }850 #endif851 852 784 #if REPN_FORMAT_IN_VPS 853 785 UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc(); … … 873 805 if ( m_pchReconFile ) 874 806 { 875 #if SYNTAX_OUTPUT876 TComPicYuv* pPicCYuvRec = pcPic->getPicYuvRec();877 #if Q0074_SEI_COLOR_MAPPING878 if( m_acTDecTop[layerIdx].m_ColorMapping->getColorMappingFlag() )879 {880 pPicCYuvRec = m_acTDecTop[layerIdx].m_ColorMapping->getColorMapping( pPicCYuvRec, 0, layerIdx );881 }882 #endif883 807 const Window &conf = pcPic->getConformanceWindow(); 884 808 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 885 m_cTVideoIOYuvReconFile.write( pPicCYuvRec, 886 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 887 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 888 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 889 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 890 #endif 809 m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(), 810 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 811 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 812 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 813 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 891 814 } 892 815 … … 959 882 TComPicYuv* pPicCYuvRecTop = pcPicTop->getPicYuvRec(); 960 883 TComPicYuv* pPicCYuvRecBot = pcPicBottom->getPicYuvRec(); 961 #if Q0074_SEI_COLOR_MAPPING962 if( m_acTDecTop[layerId].m_ColorMapping->getColorMappingFlag() )963 {964 pPicCYuvRecTop = m_acTDecTop[layerId].m_ColorMapping->getColorMapping( pPicCYuvRecTop, 0, layerId );965 pPicCYuvRecBot = m_acTDecTop[layerId].m_ColorMapping->getColorMapping( pPicCYuvRecBot, 1, layerId );966 }967 #endif968 884 #if REPN_FORMAT_IN_VPS 969 885 UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc(); … … 994 910 TComPicYuv* pPicCYuvRecTop = pcPicTop->getPicYuvRec(); 995 911 TComPicYuv* pPicCYuvRecBot = pcPicBottom->getPicYuvRec(); 996 #if Q0074_SEI_COLOR_MAPPING997 if( m_cTDecTop.m_ColorMapping->getColorMappingFlag() )998 {999 pPicCYuvRecTop = m_cTDecTop.m_ColorMapping->getColorMapping( pPicCYuvRecTop, 0 );1000 pPicCYuvRecBot = m_cTDecTop.m_ColorMapping->getColorMapping( pPicCYuvRecBot, 1 );1001 }1002 #endif1003 912 m_cTVideoIOYuvReconFile.write( pPicCYuvRecTop, pPicCYuvRecBot, 1004 913 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), … … 1078 987 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 1079 988 TComPicYuv* pPicCYuvRec = pcPic->getPicYuvRec(); 1080 #if Q0074_SEI_COLOR_MAPPING1081 if( m_acTDecTop[layerId].m_ColorMapping->getColorMappingFlag() )1082 {1083 pPicCYuvRec = m_acTDecTop[layerId].m_ColorMapping->getColorMapping( pPicCYuvRec, 0, layerId );1084 }1085 #endif1086 989 #if REPN_FORMAT_IN_VPS 1087 990 UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc(); … … 1110 1013 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 1111 1014 TComPicYuv* pPicCYuvRec = pcPic->getPicYuvRec(); 1112 #if Q0074_SEI_COLOR_MAPPING1113 if( m_cTDecTop.m_ColorMapping->getColorMappingFlag() )1114 {1115 pPicCYuvRec = m_cTDecTop.m_ColorMapping->getColorMapping( pPicCYuvRec );1116 }1117 #endif1118 1015 m_cTVideoIOYuvReconFile.write( pPicCYuvRec, 1119 1016 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), … … 1198 1095 #endif 1199 1096 TComPicYuv* pPicCYuvRec = pic->getPicYuvRec(); 1200 #if Q0074_SEI_COLOR_MAPPING1201 pPicCYuvRec = m_acTDecTop[layerIdx].m_ColorMapping->getColorMapping( pPicCYuvRec, 0, layerIdx );1202 #endif1203 1097 m_acTVideoIOYuvReconFile[layerIdx].write( pPicCYuvRec, 1204 1098 conf.getWindowLeftOffset() * xScal + defDisp.getWindowLeftOffset(), … … 1221 1115 pic->getPicYuvRec()->setBorderExtension( false ); 1222 1116 1117 #if RESOLUTION_BASED_DPB 1223 1118 dpbStatus.m_numPicsInLayer[layerIdx]--; 1119 #endif 1120 dpbStatus.m_numPicsInSubDpb[layerIdx]--; 1224 1121 } 1225 1122 } … … 1285 1182 for(Int i = 0; i < MAX_LAYERS; i++) 1286 1183 { 1287 m _acTDecTop[i].getListPic()->clear();1184 markAllPicturesAsErased(i); 1288 1185 } 1289 1186 } … … 1291 1188 Void TAppDecTop::markAllPicturesAsErased(Int layerIdx) 1292 1189 { 1190 TComList<TComPic*>::iterator iterPic = m_acTDecTop[layerIdx].getListPic()->begin(); 1191 Int iSize = Int( m_acTDecTop[layerIdx].getListPic()->size() ); 1192 1193 for (Int i = 0; i < iSize; i++ ) 1194 { 1195 TComPic* pcPic = *(iterPic++); 1196 1197 if( pcPic ) 1198 { 1199 pcPic->destroy(); 1200 1201 // pcPic is statically created for the external (AVC) base layer, no need to delete it 1202 #if VPS_AVC_BL_FLAG_REMOVAL 1203 if( !m_acTDecTop[layerIdx].getParameterSetManager()->getActiveVPS()->getNonHEVCBaseLayerFlag() || layerIdx ) 1204 #else 1205 if( !m_acTDecTop[layerIdx].getParameterSetManager()->getActiveVPS()->getAvcBaseLayerFlag() || layerIdx ) 1206 #endif 1207 { 1208 delete pcPic; 1209 pcPic = NULL; 1210 } 1211 } 1212 } 1213 1293 1214 m_acTDecTop[layerIdx].getListPic()->clear(); 1294 1215 } … … 1434 1355 maxDpbLimit.m_maxLatencyPictures = sps->getMaxLatencyIncrease( highestTId ) + sps->getNumReorderPics( highestTId ) - 1; 1435 1356 } 1357 #if RESOLUTION_BASED_DPB 1436 1358 maxDpbLimit.m_numPicsInLayer[0] = sps->getMaxDecPicBuffering( highestTId ); 1359 #endif 1437 1360 maxDpbLimit.m_numPicsInSubDpb[0] = sps->getMaxDecPicBuffering( highestTId ); 1438 1361 } … … 1582 1505 if( pic->getSlice(0)->isReferenced() || pic->getOutputMark() ) 1583 1506 { 1507 #if RESOLUTION_BASED_DPB 1584 1508 dpbStatus.m_numPicsInLayer[i]++; // Count pictures that are "used for reference" or "needed for output" 1509 #else 1510 dpbStatus.m_numPicsInSubDpb[i]++; // Count pictures that are "used for reference" or "needed for output" 1511 #endif 1585 1512 } 1586 1513 #if POC_RESET_IDC_DECODER … … 1607 1534 #if RESOLUTION_BASED_DPB 1608 1535 dpbStatus.m_numPicsInSubDpb[vps->getSubDpbAssigned(targetLsIdx,i)] += dpbStatus.m_numPicsInLayer[i]; 1609 #else1610 1536 dpbStatus.m_numPicsInSubDpb[i] += dpbStatus.m_numPicsInLayer[i]; 1611 1537 #endif -
trunk/source/App/TAppDecoder/TAppDecTop.h
r815 r906 135 135 Int m_numAUsNotDisplayed; 136 136 Int m_numPicsNotDisplayedInLayer[MAX_LAYERS]; 137 #if RESOLUTION_BASED_DPB 137 138 Int m_numPicsInLayer[MAX_LAYERS]; // Pictures marked as used_for_reference or needed for output in the layer 139 #endif 138 140 Int m_numPicsInSubDpb[MAX_LAYERS]; // Pictures marked as used_for_reference or needed for output in the sub-DPB 139 141 Bool m_maxLatencyIncrease; … … 152 154 m_maxLatencyIncrease = false; 153 155 m_maxLatencyPictures = 0; 156 #if RESOLUTION_BASED_DPB 154 157 ::memset( m_numPicsInLayer, 0, sizeof(m_numPicsInLayer) ); 158 #endif 155 159 ::memset( m_numPicsInSubDpb, 0, sizeof(m_numPicsInSubDpb) ); 156 160 ::memset(m_numPicsNotDisplayedInLayer, 0, sizeof(m_numPicsNotDisplayedInLayer) ); -
trunk/source/App/TAppEncoder/TAppEncCfg.cpp
r815 r906 67 67 : m_pBitstreamFile() 68 68 #if AVC_BASE 69 #if VPS_AVC_BL_FLAG_REMOVAL 70 , m_nonHEVCBaseLayerFlag(0) 71 #else 69 72 , m_avcBaseLayerFlag(0) 70 73 #endif 74 #endif 71 75 , m_maxTidRefPresentFlag(1) 72 , m_pColumnWidth() 73 , m_pRowHeight() 76 #if OUTPUT_LAYER_SETS_CONFIG 77 , m_defaultTargetOutputLayerIdc (-1) 78 , m_numOutputLayerSets (-1) 79 #endif 74 80 , m_scalingListFile() 75 81 , m_elRapSliceBEnabled(0) … … 87 93 , m_pchReconFile() 88 94 , m_pchdQPFile() 89 , m_pColumnWidth()90 , m_pRowHeight()91 95 , m_scalingListFile() 92 96 { … … 95 99 m_codedPivotValue = NULL; 96 100 m_targetPivotValue = NULL; 101 #if Q0074_COLOUR_REMAPPING_SEI 102 for( Int c=0 ; c<3 ; c++) 103 { 104 m_colourRemapSEIPreLutCodedValue[c] = NULL; 105 m_colourRemapSEIPreLutTargetValue[c] = NULL; 106 m_colourRemapSEIPostLutCodedValue[c] = NULL; 107 m_colourRemapSEIPostLutTargetValue[c] = NULL; 108 } 109 #endif 97 110 } 98 111 #endif … … 101 114 { 102 115 #if SVC_EXTENSION 103 free(m_pBitstreamFile); 116 if( m_pBitstreamFile ) 117 { 118 free(m_pBitstreamFile); 119 m_pBitstreamFile = NULL; 120 } 104 121 #else 105 122 if ( m_aidQP ) … … 128 145 free(m_pchReconFile); 129 146 free(m_pchdQPFile); 130 #endif 131 free(m_pColumnWidth); 132 free(m_pRowHeight); 147 #if Q0074_COLOUR_REMAPPING_SEI 148 for( Int c=0 ; c<3 ; c++) 149 { 150 if ( m_colourRemapSEIPreLutCodedValue[c] ) 151 { 152 delete[] m_colourRemapSEIPreLutCodedValue[c]; 153 } 154 if ( m_colourRemapSEIPreLutTargetValue[c] ) 155 { 156 delete[] m_colourRemapSEIPreLutTargetValue[c]; 157 } 158 if ( m_colourRemapSEIPostLutCodedValue[c] ) 159 { 160 delete[] m_colourRemapSEIPostLutCodedValue[c]; 161 } 162 if ( m_colourRemapSEIPostLutTargetValue[c] ) 163 { 164 delete[] m_colourRemapSEIPostLutTargetValue[c]; 165 } 166 } 167 #endif 168 #endif 133 169 free(m_scalingListFile); 134 170 } … … 337 373 string* cfg_ReconFile [MAX_LAYERS]; 338 374 Double* cfg_fQP [MAX_LAYERS]; 339 #if Q0074_SEI_COLOR_MAPPING340 string* cfg_seiColorMappingFile[MAX_LAYERS];341 #endif342 343 375 #if REPN_FORMAT_IN_VPS 344 376 Int* cfg_repFormatIdx [MAX_LAYERS]; … … 386 418 string cfg_scaledRefLayerBottomOffset [MAX_LAYERS]; 387 419 Int* cfg_numScaledRefLayerOffsets[MAX_LAYERS]; 420 #if REF_REGION_OFFSET 421 string cfg_scaledRefLayerOffsetPresentFlag [MAX_LAYERS]; 422 string cfg_refRegionOffsetPresentFlag [MAX_LAYERS]; 423 string cfg_refRegionLeftOffset [MAX_LAYERS]; 424 string cfg_refRegionTopOffset [MAX_LAYERS]; 425 string cfg_refRegionRightOffset [MAX_LAYERS]; 426 string cfg_refRegionBottomOffset [MAX_LAYERS]; 427 #endif 428 #if R0209_GENERIC_PHASE 429 string cfg_resamplePhaseSetPresentFlag [MAX_LAYERS]; 430 string cfg_phaseHorLuma [MAX_LAYERS]; 431 string cfg_phaseVerLuma [MAX_LAYERS]; 432 string cfg_phaseHorChroma [MAX_LAYERS]; 433 string cfg_phaseVerChroma [MAX_LAYERS]; 434 #else 388 435 #if P0312_VERT_PHASE_ADJ 389 436 string cfg_vertPhasePositionEnableFlag[MAX_LAYERS]; 437 #endif 390 438 #endif 391 439 … … 397 445 string* cfg_scaledRefLayerRightOffsetPtr [MAX_LAYERS]; 398 446 string* cfg_scaledRefLayerBottomOffsetPtr [MAX_LAYERS]; 447 #if REF_REGION_OFFSET 448 string* cfg_scaledRefLayerOffsetPresentFlagPtr [MAX_LAYERS]; 449 string* cfg_refRegionOffsetPresentFlagPtr [MAX_LAYERS]; 450 string* cfg_refRegionLeftOffsetPtr [MAX_LAYERS]; 451 string* cfg_refRegionTopOffsetPtr [MAX_LAYERS]; 452 string* cfg_refRegionRightOffsetPtr [MAX_LAYERS]; 453 string* cfg_refRegionBottomOffsetPtr [MAX_LAYERS]; 454 #endif 455 #if R0209_GENERIC_PHASE 456 string* cfg_resamplePhaseSetPresentFlagPtr [MAX_LAYERS]; 457 string* cfg_phaseHorLumaPtr [MAX_LAYERS]; 458 string* cfg_phaseVerLumaPtr [MAX_LAYERS]; 459 string* cfg_phaseHorChromaPtr [MAX_LAYERS]; 460 string* cfg_phaseVerChromaPtr [MAX_LAYERS]; 461 #endif 399 462 #if P0312_VERT_PHASE_ADJ 400 463 string* cfg_vertPhasePositionEnableFlagPtr[MAX_LAYERS]; … … 419 482 #endif 420 483 Int* cfg_maxTidIlRefPicsPlus1[MAX_LAYERS]; 484 #if Q0074_COLOUR_REMAPPING_SEI 485 string* cfg_colourRemapSEIFile[MAX_LAYERS]; 486 #endif 487 Int* cfg_waveFrontSynchro[MAX_LAYERS]; 488 421 489 for(UInt layer = 0; layer < MAX_LAYERS; layer++) 422 490 { … … 424 492 cfg_ReconFile[layer] = &m_acLayerCfg[layer].m_cReconFile; 425 493 cfg_fQP[layer] = &m_acLayerCfg[layer].m_fQP; 494 #if Q0074_COLOUR_REMAPPING_SEI 495 cfg_colourRemapSEIFile[layer] = &m_acLayerCfg[layer].m_colourRemapSEIFile; 496 #endif 426 497 #if REPN_FORMAT_IN_VPS 427 498 cfg_repFormatIdx[layer] = &m_acLayerCfg[layer].m_repFormatIdx; … … 432 503 cfg_IntraPeriod[layer] = &m_acLayerCfg[layer].m_iIntraPeriod; 433 504 cfg_conformanceMode[layer] = &m_acLayerCfg[layer].m_conformanceMode; 434 #if Q0074_SEI_COLOR_MAPPING435 cfg_seiColorMappingFile[layer] = &m_acLayerCfg[layer].m_cSeiColorMappingFile;436 #endif437 505 #if LAYER_CTB 438 506 // coding unit (CU) definition … … 457 525 #endif 458 526 cfg_numScaledRefLayerOffsets [layer] = &m_acLayerCfg[layer].m_numScaledRefLayerOffsets; 527 cfg_waveFrontSynchro[layer] = &m_acLayerCfg[layer].m_waveFrontSynchro; 459 528 for(Int i = 0; i < MAX_LAYERS; i++) 460 529 { … … 468 537 #if P0312_VERT_PHASE_ADJ 469 538 cfg_vertPhasePositionEnableFlagPtr[layer] = &cfg_vertPhasePositionEnableFlag[layer]; 539 #endif 540 #if REF_REGION_OFFSET 541 cfg_scaledRefLayerOffsetPresentFlagPtr [layer] = &cfg_scaledRefLayerOffsetPresentFlag [layer]; 542 cfg_refRegionOffsetPresentFlagPtr [layer] = &cfg_refRegionOffsetPresentFlag [layer]; 543 cfg_refRegionLeftOffsetPtr [layer] = &cfg_refRegionLeftOffset [layer]; 544 cfg_refRegionTopOffsetPtr [layer] = &cfg_refRegionTopOffset [layer]; 545 cfg_refRegionRightOffsetPtr [layer] = &cfg_refRegionRightOffset [layer]; 546 cfg_refRegionBottomOffsetPtr[layer] = &cfg_refRegionBottomOffset[layer]; 547 #endif 548 #if R0209_GENERIC_PHASE 549 cfg_resamplePhaseSetPresentFlagPtr [layer] = &cfg_resamplePhaseSetPresentFlag [layer]; 550 cfg_phaseHorLumaPtr [layer] = &cfg_phaseHorLuma [layer]; 551 cfg_phaseVerLumaPtr [layer] = &cfg_phaseVerLuma [layer]; 552 cfg_phaseHorChromaPtr [layer] = &cfg_phaseHorChroma [layer]; 553 cfg_phaseVerChromaPtr [layer] = &cfg_phaseVerChroma [layer]; 470 554 #endif 471 555 } … … 507 591 } 508 592 #endif 593 #if OUTPUT_LAYER_SETS_CONFIG 594 string* cfg_numLayersInOutputLayerSet = new string; 595 string* cfg_listOfOutputLayers = new string[MAX_VPS_OUTPUT_LAYER_SETS_PLUS1]; 596 string* cfg_outputLayerSetIdx = new string; 597 #endif 509 598 #if AVC_BASE 510 599 string cfg_BLInputFile; 511 #endif512 #if AVC_SYNTAX513 string cfg_BLSyntaxFile;514 600 #endif 515 601 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI … … 521 607 string cfg_ReconFile; 522 608 string cfg_dQPFile; 609 #if Q0074_COLOUR_REMAPPING_SEI 610 string cfg_colourRemapSEIFile; 611 #endif 523 612 #endif //SVC_EXTENSION 524 string cfg _ColumnWidth;525 string cfg _RowHeight;613 string cfgColumnWidth; 614 string cfgRowHeight; 526 615 string cfg_ScalingListFile; 527 616 string cfg_startOfCodedInterval; … … 532 621 string cfg_kneeSEIOutputKneePointValue; 533 622 #endif 623 534 624 po::Options opts; 535 625 opts.addOptions() … … 562 652 ("NumLayers", m_numLayers, 1, "Number of layers to code") 563 653 #if Q0078_ADD_LAYER_SETS 654 #if OUTPUT_LAYER_SETS_CONFIG 655 ("NumLayerSets", m_numLayerSets, 1, "Number of layer sets") 656 #else 564 657 ("NumLayerSets", m_numLayerSets, 0, "Number of layer sets") 658 #endif 565 659 ("NumLayerInIdList%d", cfg_numLayerInIdList, 0, MAX_VPS_LAYER_ID_PLUS1, "Number of layers in the set") 566 660 ("LayerSetLayerIdList%d", cfg_layerSetLayerIdListPtr, string(""), MAX_VPS_LAYER_ID_PLUS1, "Layer IDs for the set") … … 568 662 ("NumHighestLayerIdx%d", cfg_numHighestLayerIdx, 0, MAX_VPS_LAYER_ID_PLUS1, "Number of highest layer idx") 569 663 ("HighestLayerIdx%d", cfg_highestLayerIdxPtr, string(""), MAX_VPS_LAYER_ID_PLUS1, "Highest layer idx for an additional layer set") 664 #endif 665 #if OUTPUT_LAYER_SETS_CONFIG 666 ("DefaultTargetOutputLayerIdc", m_defaultTargetOutputLayerIdc, 1, "Default target output layers. 0: All layers are output layer, 1: Only highest layer is output layer, 2 or 3: No default output layers") 667 ("NumOutputLayerSets", m_numOutputLayerSets, 1, "Number of output layer sets excluding the 0-th output layer set") 668 ("NumLayersInOutputLayerSet", cfg_numLayersInOutputLayerSet, string(""), 1 , "List containing number of output layers in the output layer sets") 669 ("ListOfOutputLayers%d", cfg_listOfOutputLayers, string(""), MAX_VPS_LAYER_ID_PLUS1, "Layer IDs for the set, in terms of layer ID in the output layer set Range: [0..NumLayersInOutputLayerSet-1]") 670 ("OutputLayerSetIdx", cfg_outputLayerSetIdx, string(""), 1, "Corresponding layer set index, only for non-default output layer sets") 570 671 #endif 571 672 #if AUXILIARY_PICTURES … … 602 703 ("ScaledRefLayerBottomOffset%d", cfg_scaledRefLayerBottomOffsetPtr,string(""), MAX_LAYERS, "Vertical offset of bottom-right luma sample of scaled base layer picture with respect to" 603 704 " bottom-right luma sample of the EL picture, in units of two luma samples") 705 #if REF_REGION_OFFSET 706 ("ScaledRefLayerOffsetPresentFlag%d", cfg_scaledRefLayerOffsetPresentFlagPtr, string(""), MAX_LAYERS, "presense flag of scaled reference layer offsets") 707 ("RefRegionOffsetPresentFlag%d", cfg_refRegionOffsetPresentFlagPtr, string(""), MAX_LAYERS, "presense flag of reference region offsets") 708 ("RefRegionLeftOffset%d", cfg_refRegionLeftOffsetPtr, string(""), MAX_LAYERS, "Horizontal offset of top-left luma sample of ref region with respect to" 709 " top-left luma sample of the BL picture, in units of two luma samples") 710 ("RefRegionTopOffset%d", cfg_refRegionTopOffsetPtr, string(""), MAX_LAYERS, "Vertical offset of top-left luma sample of ref region with respect to" 711 " top-left luma sample of the BL picture, in units of two luma samples") 712 ("RefRegionRightOffset%d", cfg_refRegionRightOffsetPtr, string(""), MAX_LAYERS, "Horizontal offset of bottom-right luma sample of ref region with respect to" 713 " bottom-right luma sample of the BL picture, in units of two luma samples") 714 ("RefRegionBottomOffset%d", cfg_refRegionBottomOffsetPtr,string(""), MAX_LAYERS, "Vertical offset of bottom-right luma sample of ref region with respect to" 715 " bottom-right luma sample of the BL picture, in units of two luma samples") 716 #endif 717 #if R0209_GENERIC_PHASE 718 ("ResamplePhaseSetPresentFlag%d", cfg_resamplePhaseSetPresentFlagPtr, string(""), MAX_LAYERS, "presense flag of resample phase set") 719 ("PhaseHorLuma%d", cfg_phaseHorLumaPtr, string(""), MAX_LAYERS, "luma shift in the horizontal direction used in resampling proces") 720 ("PhaseVerLuma%d", cfg_phaseVerLumaPtr, string(""), MAX_LAYERS, "luma shift in the vertical direction used in resampling proces") 721 ("PhaseHorChroma%d", cfg_phaseHorChromaPtr, string(""), MAX_LAYERS, "chroma shift in the horizontal direction used in resampling proces") 722 ("PhaseVerChroma%d", cfg_phaseVerChromaPtr, string(""), MAX_LAYERS, "chroma shift in the vertical direction used in resampling proces") 723 #endif 604 724 #if P0312_VERT_PHASE_ADJ 605 725 ("VertPhasePositionEnableFlag%d", cfg_vertPhasePositionEnableFlagPtr,string(""), MAX_LAYERS, "VertPhasePositionEnableFlag for layer %d") 726 #endif 727 #if Q0074_COLOUR_REMAPPING_SEI 728 ("SEIColourRemappingInfoFile%d", cfg_colourRemapSEIFile, string(""), MAX_LAYERS, "Colour Remapping Information SEI parameters file name for layer %d") 606 729 #endif 607 730 #if O0194_DIFFERENT_BITDEPTH_EL_BL … … 627 750 #endif 628 751 #if AVC_BASE 752 #if VPS_AVC_BL_FLAG_REMOVAL 753 ("NonHEVCBase,-nonhevc", m_nonHEVCBaseLayerFlag, 0, "BL is available but not internal") 754 #else 629 755 ("AvcBase,-avc", m_avcBaseLayerFlag, 0, "avc_base_layer_flag") 756 #endif 630 757 ("InputBLFile,-ibl", cfg_BLInputFile, string(""), "Base layer rec YUV input file name") 631 #if AVC_SYNTAX632 ("InputBLSyntaxFile,-ibs", cfg_BLSyntaxFile, string(""), "Base layer syntax input file name")633 #endif634 758 #endif 635 759 ("EnableElRapB,-use-rap-b", m_elRapSliceBEnabled, 0, "Set ILP over base-layer I picture to B picture (default is P picture)") 636 #if Q0074_SEI_COLOR_MAPPING637 ("SEIColorMappingFile%d", cfg_seiColorMappingFile, string(""), MAX_LAYERS, "File Containing SEI Color Mapping data")638 #endif639 760 #else //SVC_EXTENSION 640 761 ("InputFile,i", cfg_InputFile, string(""), "Original YUV input file name") … … 654 775 ("ChromaFormatIDC,-cf", tmpChromaFormat, 0, "ChromaFormatIDC (400|420|422|444 or set 0 (default) for same as InputChromaFormat)") 655 776 #endif 656 ("ConformanceMode", m_conformanceMode, 0, "Window conformance mode (0: no window, 1:automatic padding, 2:padding, 3:conformance") 657 ("HorizontalPadding,-pdx",m_aiPad[0], 0, "Horizontal source padding for conformance window mode 2") 658 ("VerticalPadding,-pdy", m_aiPad[1], 0, "Vertical source padding for conformance window mode 2") 659 ("ConfLeft", m_confLeft, 0, "Left offset for window conformance mode 3") 660 ("ConfRight", m_confRight, 0, "Right offset for window conformance mode 3") 661 ("ConfTop", m_confTop, 0, "Top offset for window conformance mode 3") 662 ("ConfBottom", m_confBottom, 0, "Bottom offset for window conformance mode 3") 777 ("ConformanceMode", m_conformanceWindowMode, 0, "Deprecated alias of ConformanceWindowMode") 778 ("ConformanceWindowMode", m_conformanceWindowMode, 0, "Window conformance mode (0: no window, 1:automatic padding, 2:padding, 3:conformance") 779 ("HorizontalPadding,-pdx",m_aiPad[0], 0, "Horizontal source padding for conformance window mode 2") 780 ("VerticalPadding,-pdy", m_aiPad[1], 0, "Vertical source padding for conformance window mode 2") 781 ("ConfLeft", m_confWinLeft, 0, "Deprecated alias of ConfWinLeft") 782 ("ConfRight", m_confWinRight, 0, "Deprecated alias of ConfWinRight") 783 ("ConfTop", m_confWinTop, 0, "Deprecated alias of ConfWinTop") 784 ("ConfBottom", m_confWinBottom, 0, "Deprecated alias of ConfWinBottom") 785 ("ConfWinLeft", m_confWinLeft, 0, "Left offset for window conformance mode 3") 786 ("ConfWinRight", m_confWinRight, 0, "Right offset for window conformance mode 3") 787 ("ConfWinTop", m_confWinTop, 0, "Top offset for window conformance mode 3") 788 ("ConfWinBottom", m_confWinBottom, 0, "Bottom offset for window conformance mode 3") 663 789 ("FrameRate,-fr", m_iFrameRate, 0, "Frame rate") 790 #if Q0074_COLOUR_REMAPPING_SEI 791 ("SEIColourRemappingInfoFile", cfg_colourRemapSEIFile, string(""), "Colour Remapping Information SEI parameters file name") 792 #endif 664 793 #endif //SVC_EXTENSION 665 794 ("FrameSkip,-fs", m_FrameSkip, 0u, "Number of frames to skip at start of input YUV") … … 821 950 ("WeightedPredB,-wpB", m_useWeightedBiPred, false, "Use weighted (bidirectional) prediction in B slices") 822 951 ("Log2ParallelMergeLevel", m_log2ParallelMergeLevel, 2u, "Parallel merge estimation region") 823 ("UniformSpacingIdc", m_iUniformSpacingIdr, 0, "Indicates if the column and row boundaries are distributed uniformly") 824 ("NumTileColumnsMinus1", m_iNumColumnsMinus1, 0, "Number of columns in a picture minus 1") 825 ("ColumnWidthArray", cfg_ColumnWidth, string(""), "Array containing ColumnWidth values in units of LCU") 826 ("NumTileRowsMinus1", m_iNumRowsMinus1, 0, "Number of rows in a picture minus 1") 827 ("RowHeightArray", cfg_RowHeight, string(""), "Array containing RowHeight values in units of LCU") 952 953 //deprecated copies of renamed tile parameters 954 ("UniformSpacingIdc", m_tileUniformSpacingFlag, false, "deprecated alias of TileUniformSpacing") 955 ("ColumnWidthArray", cfgColumnWidth, string(""), "deprecated alias of TileColumnWidthArray") 956 ("RowHeightArray", cfgRowHeight, string(""), "deprecated alias of TileRowHeightArray") 957 958 ("TileUniformSpacing", m_tileUniformSpacingFlag, false, "Indicates that tile columns and rows are distributed uniformly") 959 ("NumTileColumnsMinus1", m_numTileColumnsMinus1, 0, "Number of tile columns in a picture minus 1") 960 ("NumTileRowsMinus1", m_numTileRowsMinus1, 0, "Number of rows in a picture minus 1") 961 ("TileColumnWidthArray", cfgColumnWidth, string(""), "Array containing tile column width values in units of LCU") 962 ("TileRowHeightArray", cfgRowHeight, string(""), "Array containing tile row height values in units of LCU") 828 963 ("LFCrossTileBoundaryFlag", m_bLFCrossTileBoundaryFlag, true, "1: cross-tile-boundary loop filtering. 0:non-cross-tile-boundary loop filtering") 964 #if SVC_EXTENSION 965 ("WaveFrontSynchro%d", cfg_waveFrontSynchro, 0, MAX_LAYERS, "0: no synchro; 1 synchro with TR; 2 TRR etc") 966 #else 829 967 ("WaveFrontSynchro", m_iWaveFrontSynchro, 0, "0: no synchro; 1 synchro with TR; 2 TRR etc") 968 #endif 830 969 ("ScalingList", m_useScalingListId, 0, "0: no scaling list, 1: default scaling lists, 2: scaling lists specified in ScalingListFile") 831 970 ("ScalingListFile", cfg_ScalingListFile, string(""), "Scaling list file name") … … 884 1023 ("ColourDescriptionPresent", m_colourDescriptionPresentFlag, false, "Signals whether colour_primaries, transfer_characteristics and matrix_coefficients are present") 885 1024 ("ColourPrimaries", m_colourPrimaries, 2, "Indicates chromaticity coordinates of the source primaries") 886 ("TransferChara teristics",m_transferCharacteristics, 2, "Indicates the opto-electronic transfer characteristics of the source")1025 ("TransferCharacteristics", m_transferCharacteristics, 2, "Indicates the opto-electronic transfer characteristics of the source") 887 1026 ("MatrixCoefficients", m_matrixCoefficients, 2, "Describes the matrix coefficients used in deriving luma and chroma from RGB primaries") 888 1027 ("ChromaLocInfoPresent", m_chromaLocInfoPresentFlag, false, "Signals whether chroma_sample_loc_type_top_field and chroma_sample_loc_type_bottom_field are present") … … 1004 1143 ("CGSMaxYPartNumLog", m_nCGSMaxYPartNumLog2 , 2, "max Y part number ") 1005 1144 ("CGSLUTBit", m_nCGSLUTBit , 12, "bit depth of CGS LUT") 1145 #if R0151_CGS_3D_ASYMLUT_IMPROVE 1146 ("CGSAdaptC", m_nCGSAdaptiveChroma , 1, "adaptive chroma partition (only for the case of two chroma partitions)") 1147 #endif 1148 #if R0179_ENC_OPT_3DLUT_SIZE 1149 ("CGSSizeRDO", m_nCGSLutSizeRDO , 0, "RDOpt selection of best table size (effective when large maximum table size such as 8x8x8 is used)") 1150 #endif 1006 1151 #endif 1007 1152 #if Q0108_TSA_STSA … … 1089 1234 #if SVC_EXTENSION 1090 1235 #if AVC_BASE 1236 #if VPS_AVC_BL_FLAG_REMOVAL 1237 if( m_nonHEVCBaseLayerFlag ) 1238 #else 1091 1239 if( m_avcBaseLayerFlag ) 1240 #endif 1092 1241 { 1093 1242 *cfg_InputFile[0] = cfg_BLInputFile; … … 1095 1244 #endif 1096 1245 m_pBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str()); 1097 #if AVC_SYNTAX1098 m_BLSyntaxFile = cfg_BLSyntaxFile.empty() ? NULL : strdup(cfg_BLSyntaxFile.c_str());1099 #endif1100 1246 #else //SVC_EXTENSION 1101 1247 m_pchInputFile = cfg_InputFile.empty() ? NULL : strdup(cfg_InputFile.c_str()); … … 1103 1249 m_pchReconFile = cfg_ReconFile.empty() ? NULL : strdup(cfg_ReconFile.c_str()); 1104 1250 m_pchdQPFile = cfg_dQPFile.empty() ? NULL : strdup(cfg_dQPFile.c_str()); 1105 #endif //SVC_EXTENSION 1106 1107 Char* pColumnWidth = cfg_ColumnWidth.empty() ? NULL: strdup(cfg_ColumnWidth.c_str()); 1108 Char* pRowHeight = cfg_RowHeight.empty() ? NULL : strdup(cfg_RowHeight.c_str()); 1109 if( m_iUniformSpacingIdr == 0 && m_iNumColumnsMinus1 > 0 ) 1110 { 1111 char *columnWidth; 1251 #if Q0074_COLOUR_REMAPPING_SEI 1252 m_colourRemapSEIFile = cfg_colourRemapSEIFile.empty() ? NULL : strdup(cfg_colourRemapSEIFile.c_str()); 1253 #endif 1254 #endif //SVC_EXTENSION 1255 1256 1257 Char* pColumnWidth = cfgColumnWidth.empty() ? NULL: strdup(cfgColumnWidth.c_str()); 1258 Char* pRowHeight = cfgRowHeight.empty() ? NULL : strdup(cfgRowHeight.c_str()); 1259 1260 if( !m_tileUniformSpacingFlag && m_numTileColumnsMinus1 > 0 ) 1261 { 1262 char *str; 1112 1263 int i=0; 1113 m_ pColumnWidth = new UInt[m_iNumColumnsMinus1];1114 columnWidth= strtok(pColumnWidth, " ,-");1115 while( columnWidth!=NULL)1116 { 1117 if( i >=m_iNumColumnsMinus1 )1264 m_tileColumnWidth.resize( m_numTileColumnsMinus1 ); 1265 str = strtok(pColumnWidth, " ,-"); 1266 while(str!=NULL) 1267 { 1268 if( i >= m_numTileColumnsMinus1 ) 1118 1269 { 1119 1270 printf( "The number of columns whose width are defined is larger than the allowed number of columns.\n" ); 1120 1271 exit( EXIT_FAILURE ); 1121 1272 } 1122 *( m_pColumnWidth + i ) = atoi( columnWidth);1123 columnWidth= strtok(NULL, " ,-");1273 m_tileColumnWidth[i] = atoi( str ); 1274 str = strtok(NULL, " ,-"); 1124 1275 i++; 1125 1276 } 1126 if( i <m_iNumColumnsMinus1 )1277 if( i < m_numTileColumnsMinus1 ) 1127 1278 { 1128 1279 printf( "The width of some columns is not defined.\n" ); … … 1132 1283 else 1133 1284 { 1134 m_ pColumnWidth = NULL;1135 } 1136 1137 if( m_iUniformSpacingIdr == 0 && m_iNumRowsMinus1 > 0 )1138 { 1139 char * rowHeight;1285 m_tileColumnWidth.clear(); 1286 } 1287 1288 if( !m_tileUniformSpacingFlag && m_numTileRowsMinus1 > 0 ) 1289 { 1290 char *str; 1140 1291 int i=0; 1141 m_ pRowHeight = new UInt[m_iNumRowsMinus1];1142 rowHeight= strtok(pRowHeight, " ,-");1143 while( rowHeight!=NULL)1144 { 1145 if( i>=m_ iNumRowsMinus1 )1292 m_tileRowHeight.resize(m_numTileRowsMinus1); 1293 str = strtok(pRowHeight, " ,-"); 1294 while(str!=NULL) 1295 { 1296 if( i>=m_numTileRowsMinus1 ) 1146 1297 { 1147 1298 printf( "The number of rows whose height are defined is larger than the allowed number of rows.\n" ); 1148 1299 exit( EXIT_FAILURE ); 1149 1300 } 1150 *( m_pRowHeight + i ) = atoi( rowHeight);1151 rowHeight= strtok(NULL, " ,-");1301 m_tileRowHeight[i] = atoi( str ); 1302 str = strtok(NULL, " ,-"); 1152 1303 i++; 1153 1304 } 1154 if( i <m_iNumRowsMinus1 )1305 if( i < m_numTileRowsMinus1 ) 1155 1306 { 1156 1307 printf( "The height of some rows is not defined.\n" ); … … 1160 1311 else 1161 1312 { 1162 m_ pRowHeight = NULL;1313 m_tileRowHeight.clear(); 1163 1314 } 1164 1315 #if SVC_EXTENSION 1316 if( pColumnWidth ) 1317 { 1318 free( pColumnWidth ); 1319 pColumnWidth = NULL; 1320 } 1321 1322 if( pRowHeight ) 1323 { 1324 free( pRowHeight ); 1325 pRowHeight = NULL; 1326 } 1327 1165 1328 for(Int layer = 0; layer < MAX_LAYERS; layer++) 1166 1329 { … … 1171 1334 assert( strcmp(cfg_scaledRefLayerId[layer].c_str(), "")); 1172 1335 #endif 1336 #if REF_REGION_OFFSET 1337 Bool srloFlag = 1338 strcmp(cfg_scaledRefLayerLeftOffset [layer].c_str(), "") || 1339 strcmp(cfg_scaledRefLayerRightOffset [layer].c_str(), "") || 1340 strcmp(cfg_scaledRefLayerTopOffset [layer].c_str(), "") || 1341 strcmp(cfg_scaledRefLayerBottomOffset [layer].c_str(), ""); 1342 Bool rroFlag = 1343 strcmp(cfg_refRegionLeftOffset [layer].c_str(), "") || 1344 strcmp(cfg_refRegionRightOffset [layer].c_str(), "") || 1345 strcmp(cfg_refRegionTopOffset [layer].c_str(), "") || 1346 strcmp(cfg_refRegionBottomOffset [layer].c_str(), ""); 1347 #if R0209_GENERIC_PHASE 1348 Bool phaseSetFlag = 1349 strcmp(cfg_phaseHorLuma [layer].c_str(), "") || 1350 strcmp(cfg_phaseVerLuma [layer].c_str(), "") || 1351 strcmp(cfg_phaseHorChroma [layer].c_str(), "") || 1352 strcmp(cfg_phaseVerChroma [layer].c_str(), ""); 1353 assert( srloFlag || rroFlag || phaseSetFlag); 1354 #else 1355 assert( srloFlag || rroFlag ); 1356 #endif 1357 #else 1173 1358 #if P0312_VERT_PHASE_ADJ 1174 1359 assert( strcmp(cfg_scaledRefLayerLeftOffset[layer].c_str(), "") || … … 1183 1368 strcmp(cfg_scaledRefLayerBottomOffset[layer].c_str(),"") ); 1184 1369 #endif 1370 #endif 1185 1371 } 1186 1372 … … 1203 1389 #endif 1204 1390 1391 #if REF_REGION_OFFSET 1392 // Presense Flag // 1393 if(strcmp(cfg_scaledRefLayerOffsetPresentFlag[layer].c_str(), "")) 1394 { 1395 cfgStringToArray( &tempArray, cfg_scaledRefLayerOffsetPresentFlag[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "ScaledRefLayerOffsetPresentFlag"); 1396 if(tempArray) 1397 { 1398 for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++) 1399 { 1400 m_acLayerCfg[layer].m_scaledRefLayerOffsetPresentFlag[i] = tempArray[i]; 1401 } 1402 delete [] tempArray; tempArray = NULL; 1403 } 1404 } 1405 #endif 1406 1205 1407 // Left offset // 1206 1408 if(strcmp(cfg_scaledRefLayerLeftOffset[layer].c_str(), "")) … … 1273 1475 } 1274 1476 #endif 1275 } 1477 #if REF_REGION_OFFSET 1478 // Presense Flag // 1479 if(strcmp(cfg_refRegionOffsetPresentFlag[layer].c_str(), "")) 1480 { 1481 cfgStringToArray( &tempArray, cfg_refRegionOffsetPresentFlag[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "RefRegionOffsetPresentFlag"); 1482 if(tempArray) 1483 { 1484 for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++) 1485 { 1486 m_acLayerCfg[layer].m_refRegionOffsetPresentFlag[i] = tempArray[i]; 1487 } 1488 delete [] tempArray; tempArray = NULL; 1489 } 1490 } 1491 1492 // Left offset // 1493 if(strcmp(cfg_refRegionLeftOffset[layer].c_str(), "")) 1494 { 1495 cfgStringToArray( &tempArray, cfg_refRegionLeftOffset[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "RefRegionLeftOffset"); 1496 if(tempArray) 1497 { 1498 for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++) 1499 { 1500 m_acLayerCfg[layer].m_refRegionLeftOffset[i] = tempArray[i]; 1501 } 1502 delete [] tempArray; tempArray = NULL; 1503 } 1504 } 1505 1506 // Top offset // 1507 if(strcmp(cfg_refRegionTopOffset[layer].c_str(), "")) 1508 { 1509 cfgStringToArray( &tempArray, cfg_refRegionTopOffset[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "RefRegionTopOffset"); 1510 if(tempArray) 1511 { 1512 for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++) 1513 { 1514 m_acLayerCfg[layer].m_refRegionTopOffset[i] = tempArray[i]; 1515 } 1516 delete [] tempArray; tempArray = NULL; 1517 } 1518 } 1519 1520 // Right offset // 1521 if(strcmp(cfg_refRegionRightOffset[layer].c_str(), "")) 1522 { 1523 cfgStringToArray( &tempArray, cfg_refRegionRightOffset[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "RefRegionRightOffset"); 1524 if(tempArray) 1525 { 1526 for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++) 1527 { 1528 m_acLayerCfg[layer].m_refRegionRightOffset[i] = tempArray[i]; 1529 } 1530 delete [] tempArray; tempArray = NULL; 1531 } 1532 } 1533 1534 // Bottom offset // 1535 if(strcmp(cfg_refRegionBottomOffset[layer].c_str(), "")) 1536 { 1537 cfgStringToArray( &tempArray, cfg_refRegionBottomOffset[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "RefRegionBottomOffset"); 1538 if(tempArray) 1539 { 1540 for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++) 1541 { 1542 m_acLayerCfg[layer].m_refRegionBottomOffset[i] = tempArray[i]; 1543 } 1544 delete [] tempArray; tempArray = NULL; 1545 } 1546 } 1547 #endif 1548 #if R0209_GENERIC_PHASE 1549 Int numPhaseSet = m_acLayerCfg[layer].m_numScaledRefLayerOffsets; 1550 1551 // Presense Flag // 1552 if(strcmp(cfg_resamplePhaseSetPresentFlag[layer].c_str(), "")) 1553 { 1554 cfgStringToArray( &tempArray, cfg_resamplePhaseSetPresentFlag[layer], numPhaseSet, "resamplePhaseSetPresentFlag"); 1555 if(tempArray) 1556 { 1557 for(Int i = 0; i < numPhaseSet; i++) 1558 { 1559 m_acLayerCfg[layer].m_resamplePhaseSetPresentFlag[i] = tempArray[i]; 1560 } 1561 delete [] tempArray; tempArray = NULL; 1562 } 1563 } 1564 1565 // Luma horizontal phase // 1566 if(strcmp(cfg_phaseHorLuma[layer].c_str(), "")) 1567 { 1568 cfgStringToArray( &tempArray, cfg_phaseHorLuma[layer], numPhaseSet, "phaseHorLuma"); 1569 if(tempArray) 1570 { 1571 for(Int i = 0; i < numPhaseSet; i++) 1572 { 1573 m_acLayerCfg[layer].m_phaseHorLuma[i] = tempArray[i]; 1574 } 1575 delete [] tempArray; tempArray = NULL; 1576 } 1577 } 1578 1579 // Luma vertical phase // 1580 if(strcmp(cfg_phaseVerLuma[layer].c_str(), "")) 1581 { 1582 cfgStringToArray( &tempArray, cfg_phaseVerLuma[layer], numPhaseSet, "phaseVerLuma"); 1583 if(tempArray) 1584 { 1585 for(Int i = 0; i < numPhaseSet; i++) 1586 { 1587 m_acLayerCfg[layer].m_phaseVerLuma[i] = tempArray[i]; 1588 } 1589 delete [] tempArray; tempArray = NULL; 1590 } 1591 } 1592 1593 // Chroma horizontal phase // 1594 if(strcmp(cfg_phaseHorChroma[layer].c_str(), "")) 1595 { 1596 cfgStringToArray( &tempArray, cfg_phaseHorChroma[layer], numPhaseSet, "phaseHorChroma"); 1597 if(tempArray) 1598 { 1599 for(Int i = 0; i < numPhaseSet; i++) 1600 { 1601 m_acLayerCfg[layer].m_phaseHorChroma[i] = tempArray[i]; 1602 } 1603 delete [] tempArray; tempArray = NULL; 1604 } 1605 } 1606 1607 // Chroma vertical phase // 1608 if(strcmp(cfg_phaseVerChroma[layer].c_str(), "")) 1609 { 1610 cfgStringToArray( &tempArray, cfg_phaseVerChroma[layer], numPhaseSet, "phaseVerChroma"); 1611 if(tempArray) 1612 { 1613 for(Int i = 0; i < numPhaseSet; i++) 1614 { 1615 m_acLayerCfg[layer].m_phaseVerChroma[i] = tempArray[i]; 1616 } 1617 delete [] tempArray; tempArray = NULL; 1618 } 1619 } 1620 #endif 1621 } 1622 1276 1623 #if VPS_EXTN_DIRECT_REF_LAYERS 1277 1624 for(Int layer = 0; layer < MAX_LAYERS; layer++) … … 1305 1652 m_acLayerCfg[layer].m_samplePredRefLayerIds = NULL; 1306 1653 } 1654 1655 if( pSamplePredRefLayerIds ) 1656 { 1657 free( pSamplePredRefLayerIds ); 1658 pSamplePredRefLayerIds = NULL; 1659 } 1307 1660 } 1308 1661 for(Int layer = 0; layer < MAX_LAYERS; layer++) … … 1336 1689 m_acLayerCfg[layer].m_motionPredRefLayerIds = NULL; 1337 1690 } 1691 1692 if( pMotionPredRefLayerIds ) 1693 { 1694 free( pMotionPredRefLayerIds ); 1695 pMotionPredRefLayerIds = NULL; 1696 } 1338 1697 } 1339 1698 … … 1375 1734 m_acLayerCfg[layer].m_predLayerIds = NULL; 1376 1735 } 1736 1737 if( pPredLayerIds ) 1738 { 1739 free( pPredLayerIds ); 1740 pPredLayerIds = NULL; 1741 } 1377 1742 } 1378 1743 #endif 1379 1744 #if Q0078_ADD_LAYER_SETS 1745 #if OUTPUT_LAYER_SETS_CONFIG 1746 for (Int layerSet = 1; layerSet < m_numLayerSets; layerSet++) 1747 { 1748 // Simplifying the code in the #else section, and allowing 0-th layer set t 1749 assert( scanStringToArray( cfg_layerSetLayerIdList[layerSet], m_numLayerInIdList[layerSet], "NumLayerInIdList", m_layerSetLayerIdList[layerSet] ) ); 1750 #else 1380 1751 for (Int layerSet = 0; layerSet < m_numLayerSets; layerSet++) 1381 1752 { … … 1396 1767 i++; 1397 1768 } 1398 } 1769 1770 if( layerSetLayerIdListDup ) 1771 { 1772 free( layerSetLayerIdListDup ); 1773 layerSetLayerIdListDup = NULL; 1774 } 1775 } 1776 #endif 1399 1777 } 1400 1778 for (Int addLayerSet = 0; addLayerSet < m_numAddLayerSets; addLayerSet++) 1401 1779 { 1780 #if OUTPUT_LAYER_SETS_CONFIG 1781 // Simplifying the code in the #else section 1782 assert( scanStringToArray( cfg_layerSetLayerIdList[addLayerSet], m_numLayerInIdList[addLayerSet], "NumLayerInIdList", m_highestLayerIdx[addLayerSet] ) ); 1783 #else 1402 1784 if (m_numHighestLayerIdx[addLayerSet] > 0) 1403 1785 { … … 1416 1798 i++; 1417 1799 } 1418 } 1419 } 1800 1801 if( highestLayrIdxListDup ) 1802 { 1803 free( highestLayrIdxListDup ); 1804 highestLayrIdxListDup = NULL; 1805 } 1806 } 1807 #endif 1808 } 1809 #endif 1810 #if OUTPUT_LAYER_SETS_CONFIG 1811 if( m_defaultTargetOutputLayerIdc != -1 ) 1812 { 1813 assert( m_defaultTargetOutputLayerIdc >= 0 && m_defaultTargetOutputLayerIdc <= 3 ); 1814 } 1815 assert( m_numOutputLayerSets != 0 ); 1816 assert( m_numOutputLayerSets >= m_numLayerSets + m_numAddLayerSets ); // Number of output layer sets must be at least as many as layer sets. 1817 1818 // If output layer Set Idx is specified, only specify it for the non-default output layer sets 1819 Int numNonDefaultOls = m_numOutputLayerSets - (m_numLayerSets + m_numAddLayerSets); 1820 if( numNonDefaultOls ) 1821 { 1822 assert( scanStringToArray( *cfg_outputLayerSetIdx, numNonDefaultOls, "OutputLayerSetIdx", m_outputLayerSetIdx ) ); 1823 for(Int i = 0; i < numNonDefaultOls; i++) 1824 { 1825 assert( m_outputLayerSetIdx[i] >= 0 && m_outputLayerSetIdx[i] < (m_numLayerSets + m_numAddLayerSets) ); 1826 } 1827 } 1828 1829 // Number of output layers in output layer sets 1830 scanStringToArray( *cfg_numLayersInOutputLayerSet, m_numOutputLayerSets - 1, "NumLayersInOutputLayerSets", m_numLayersInOutputLayerSet ); 1831 m_numLayersInOutputLayerSet.insert(m_numLayersInOutputLayerSet.begin(), 1); 1832 // Layers in the output layer set 1833 m_listOfOutputLayers.resize(m_numOutputLayerSets); 1834 Int startOlsCtr = 1; 1835 if( m_defaultTargetOutputLayerIdc == 0 || m_defaultTargetOutputLayerIdc == 1 ) 1836 { 1837 // Default output layer sets defined 1838 startOlsCtr = m_numLayerSets + m_numAddLayerSets; 1839 } 1840 for( Int olsCtr = 1; olsCtr < m_numOutputLayerSets; olsCtr++ ) 1841 { 1842 if( olsCtr < startOlsCtr ) 1843 { 1844 if(scanStringToArray( cfg_listOfOutputLayers[olsCtr], m_numLayersInOutputLayerSet[olsCtr], "ListOfOutputLayers", m_listOfOutputLayers[olsCtr] ) ) 1845 { 1846 std::cout << "Default OLS defined. Ignoring ListOfOutputLayers" << olsCtr << endl; 1847 } 1848 } 1849 else 1850 { 1851 assert( scanStringToArray( cfg_listOfOutputLayers[olsCtr], m_numLayersInOutputLayerSet[olsCtr], "ListOfOutputLayers", m_listOfOutputLayers[olsCtr] ) ); 1852 } 1853 } 1854 delete cfg_numLayersInOutputLayerSet; 1855 delete [] cfg_listOfOutputLayers; 1856 delete cfg_outputLayerSetIdx; 1420 1857 #endif 1421 1858 #endif //SVC_EXTENSION … … 1442 1879 #if !SVC_EXTENSION 1443 1880 // TODO:ChromaFmt assumes 4:2:0 below 1444 switch (m_conformance Mode)1881 switch (m_conformanceWindowMode) 1445 1882 { 1446 1883 case 0: 1447 1884 { 1448 1885 // no conformance or padding 1449 m_conf Left = m_confRight = m_confTop = m_confBottom = 0;1886 m_confWinLeft = m_confWinRight = m_confWinTop = m_confWinBottom = 0; 1450 1887 m_aiPad[1] = m_aiPad[0] = 0; 1451 1888 break; … … 1457 1894 if (m_iSourceWidth % minCuSize) 1458 1895 { 1459 m_aiPad[0] = m_conf Right = ((m_iSourceWidth / minCuSize) + 1) * minCuSize - m_iSourceWidth;1460 m_iSourceWidth += m_conf Right;1896 m_aiPad[0] = m_confWinRight = ((m_iSourceWidth / minCuSize) + 1) * minCuSize - m_iSourceWidth; 1897 m_iSourceWidth += m_confWinRight; 1461 1898 } 1462 1899 if (m_iSourceHeight % minCuSize) 1463 1900 { 1464 m_aiPad[1] = m_conf Bottom = ((m_iSourceHeight / minCuSize) + 1) * minCuSize - m_iSourceHeight;1465 m_iSourceHeight += m_conf Bottom;1901 m_aiPad[1] = m_confWinBottom = ((m_iSourceHeight / minCuSize) + 1) * minCuSize - m_iSourceHeight; 1902 m_iSourceHeight += m_confWinBottom; 1466 1903 if ( m_isField ) 1467 1904 { 1468 m_iSourceHeightOrg += m_conf Bottom << 1;1469 m_aiPad[1] = m_conf Bottom << 1;1905 m_iSourceHeightOrg += m_confWinBottom << 1; 1906 m_aiPad[1] = m_confWinBottom << 1; 1470 1907 } 1471 1908 } … … 1487 1924 m_iSourceWidth += m_aiPad[0]; 1488 1925 m_iSourceHeight += m_aiPad[1]; 1489 m_conf Right = m_aiPad[0];1490 m_conf Bottom = m_aiPad[1];1926 m_confWinRight = m_aiPad[0]; 1927 m_confWinBottom = m_aiPad[1]; 1491 1928 break; 1492 1929 } … … 1494 1931 { 1495 1932 // conformance 1496 if ((m_conf Left == 0) && (m_confRight == 0) && (m_confTop == 0) && (m_confBottom == 0))1933 if ((m_confWinLeft == 0) && (m_confWinRight == 0) && (m_confWinTop == 0) && (m_confWinBottom == 0)) 1497 1934 { 1498 1935 fprintf(stderr, "Warning: Conformance window enabled, but all conformance window parameters set to zero\n"); … … 1601 2038 m_targetPivotValue = NULL; 1602 2039 } 2040 2041 if( pcStartOfCodedInterval ) 2042 { 2043 free( pcStartOfCodedInterval ); 2044 pcStartOfCodedInterval = NULL; 2045 } 2046 2047 if( pcCodedPivotValue ) 2048 { 2049 free( pcCodedPivotValue ); 2050 pcCodedPivotValue = NULL; 2051 } 2052 2053 if( pcTargetPivotValue ) 2054 { 2055 free( pcTargetPivotValue ); 2056 pcTargetPivotValue = NULL; 2057 } 1603 2058 } 1604 2059 #if P0050_KNEE_FUNCTION_SEI … … 1626 2081 i++; 1627 2082 } 1628 } 1629 #endif 1630 2083 2084 if( pcInputKneePointValue ) 2085 { 2086 free( pcInputKneePointValue ); 2087 pcInputKneePointValue = NULL; 2088 } 2089 2090 if( pcOutputKneePointValue ) 2091 { 2092 free( pcOutputKneePointValue ); 2093 pcOutputKneePointValue = NULL; 2094 } 2095 } 2096 #endif 2097 #if Q0074_COLOUR_REMAPPING_SEI 2098 #if !SVC_EXTENSION 2099 // reading external Colour Remapping Information SEI message parameters from file 2100 if( m_colourRemapSEIFile.size() > 0 ) 2101 { 2102 FILE* fic; 2103 Int retval; 2104 if((fic = fopen(m_colourRemapSEIFile.c_str(),"r")) == (FILE*)NULL) 2105 { 2106 fprintf(stderr, "Can't open Colour Remapping Information SEI parameters file %s\n", m_colourRemapSEIFile.c_str()); 2107 exit(EXIT_FAILURE); 2108 } 2109 2110 retval = fscanf( fic, "%d", &m_colourRemapSEIId ); 2111 retval = fscanf( fic, "%d", &m_colourRemapSEICancelFlag ); 2112 if( !m_colourRemapSEICancelFlag ) 2113 { 2114 retval = fscanf( fic, "%d", &m_colourRemapSEIPersistenceFlag ); 2115 retval = fscanf( fic, "%d", &m_colourRemapSEIVideoSignalInfoPresentFlag); 2116 if( m_colourRemapSEIVideoSignalInfoPresentFlag ) 2117 { 2118 retval = fscanf( fic, "%d", &m_colourRemapSEIFullRangeFlag ); 2119 retval = fscanf( fic, "%d", &m_colourRemapSEIPrimaries ); 2120 retval = fscanf( fic, "%d", &m_colourRemapSEITransferFunction ); 2121 retval = fscanf( fic, "%d", &m_colourRemapSEIMatrixCoefficients ); 2122 } 2123 2124 retval = fscanf( fic, "%d", &m_colourRemapSEIInputBitDepth ); 2125 retval = fscanf( fic, "%d", &m_colourRemapSEIBitDepth ); 2126 2127 for( Int c=0 ; c<3 ; c++ ) 2128 { 2129 retval = fscanf( fic, "%d", &m_colourRemapSEIPreLutNumValMinus1[c] ); 2130 if( m_colourRemapSEIPreLutNumValMinus1[c]>0 ) 2131 { 2132 m_colourRemapSEIPreLutCodedValue[c] = new Int[m_colourRemapSEIPreLutNumValMinus1[c]+1]; 2133 m_colourRemapSEIPreLutTargetValue[c] = new Int[m_colourRemapSEIPreLutNumValMinus1[c]+1]; 2134 for( Int i=0 ; i<=m_colourRemapSEIPreLutNumValMinus1[c] ; i++ ) 2135 { 2136 retval = fscanf( fic, "%d", &m_colourRemapSEIPreLutCodedValue[c][i] ); 2137 retval = fscanf( fic, "%d", &m_colourRemapSEIPreLutTargetValue[c][i] ); 2138 } 2139 } 2140 } 2141 2142 retval = fscanf( fic, "%d", &m_colourRemapSEIMatrixPresentFlag ); 2143 if( m_colourRemapSEIMatrixPresentFlag ) 2144 { 2145 retval = fscanf( fic, "%d", &m_colourRemapSEILog2MatrixDenom ); 2146 for( Int c=0 ; c<3 ; c++ ) 2147 for( Int i=0 ; i<3 ; i++ ) 2148 retval = fscanf( fic, "%d", &m_colourRemapSEICoeffs[c][i] ); 2149 } 2150 2151 for( Int c=0 ; c<3 ; c++ ) 2152 { 2153 retval = fscanf( fic, "%d", &m_colourRemapSEIPostLutNumValMinus1[c] ); 2154 if( m_colourRemapSEIPostLutNumValMinus1[c]>0 ) 2155 { 2156 m_colourRemapSEIPostLutCodedValue[c] = new Int[m_colourRemapSEIPostLutNumValMinus1[c]+1]; 2157 m_colourRemapSEIPostLutTargetValue[c] = new Int[m_colourRemapSEIPostLutNumValMinus1[c]+1]; 2158 for( Int i=0 ; i<=m_colourRemapSEIPostLutNumValMinus1[c] ; i++ ) 2159 { 2160 retval = fscanf( fic, "%d", &m_colourRemapSEIPostLutCodedValue[c][i] ); 2161 retval = fscanf( fic, "%d", &m_colourRemapSEIPostLutTargetValue[c][i] ); 2162 } 2163 } 2164 } 2165 } 2166 2167 fclose( fic ); 2168 if( retval != 1 ) 2169 { 2170 fprintf(stderr, "Error while reading Colour Remapping Information SEI parameters file\n"); 2171 exit(EXIT_FAILURE); 2172 } 2173 } 2174 #else 2175 // Reading external Colour Remapping Information SEI message parameters from file 2176 // It seems that TAppEncLayerCfg::parseCfg is not used 2177 for(UInt layer = 0; layer < m_numLayers; layer++) 2178 { 2179 if( cfg_colourRemapSEIFile[layer]->length() ) 2180 { 2181 FILE* fic; 2182 Int retval; 2183 if((fic = fopen(cfg_colourRemapSEIFile[layer]->c_str(),"r")) == (FILE*)NULL) 2184 { 2185 fprintf(stderr, "Can't open Colour Remapping Information SEI parameters file %s\n", cfg_colourRemapSEIFile[layer]->c_str()); 2186 exit(EXIT_FAILURE); 2187 } 2188 Int tempCode; 2189 retval = fscanf( fic, "%d", &m_acLayerCfg[layer].m_colourRemapSEIId ); 2190 retval = fscanf( fic, "%d", &tempCode ); m_acLayerCfg[layer].m_colourRemapSEICancelFlag = tempCode ? 1 : 0; 2191 if( !m_acLayerCfg[layer].m_colourRemapSEICancelFlag ) 2192 { 2193 retval = fscanf( fic, "%d", &tempCode ); m_acLayerCfg[layer].m_colourRemapSEIPersistenceFlag = tempCode ? 1 : 0; 2194 retval = fscanf( fic, "%d", &tempCode ); m_acLayerCfg[layer].m_colourRemapSEIVideoSignalInfoPresentFlag = tempCode ? 1 : 0; 2195 if( m_acLayerCfg[layer].m_colourRemapSEIVideoSignalInfoPresentFlag ) 2196 { 2197 retval = fscanf( fic, "%d", &tempCode ); m_acLayerCfg[layer].m_colourRemapSEIFullRangeFlag = tempCode ? 1 : 0; 2198 retval = fscanf( fic, "%d", &m_acLayerCfg[layer].m_colourRemapSEIPrimaries ); 2199 retval = fscanf( fic, "%d", &m_acLayerCfg[layer].m_colourRemapSEITransferFunction ); 2200 retval = fscanf( fic, "%d", &m_acLayerCfg[layer].m_colourRemapSEIMatrixCoefficients ); 2201 } 2202 2203 retval = fscanf( fic, "%d", &m_acLayerCfg[layer].m_colourRemapSEIInputBitDepth ); 2204 retval = fscanf( fic, "%d", &m_acLayerCfg[layer].m_colourRemapSEIBitDepth ); 2205 2206 for( Int c=0 ; c<3 ; c++ ) 2207 { 2208 retval = fscanf( fic, "%d", &m_acLayerCfg[layer].m_colourRemapSEIPreLutNumValMinus1[c] ); 2209 if( m_acLayerCfg[layer].m_colourRemapSEIPreLutNumValMinus1[c]>0 ) 2210 { 2211 m_acLayerCfg[layer].m_colourRemapSEIPreLutCodedValue[c] = new Int[m_acLayerCfg[layer].m_colourRemapSEIPreLutNumValMinus1[c]+1]; 2212 m_acLayerCfg[layer].m_colourRemapSEIPreLutTargetValue[c] = new Int[m_acLayerCfg[layer].m_colourRemapSEIPreLutNumValMinus1[c]+1]; 2213 for( Int i=0 ; i<=m_acLayerCfg[layer].m_colourRemapSEIPreLutNumValMinus1[c] ; i++ ) 2214 { 2215 retval = fscanf( fic, "%d", &m_acLayerCfg[layer].m_colourRemapSEIPreLutCodedValue[c][i] ); 2216 retval = fscanf( fic, "%d", &m_acLayerCfg[layer].m_colourRemapSEIPreLutTargetValue[c][i] ); 2217 } 2218 } 2219 } 2220 2221 retval = fscanf( fic, "%d", &tempCode ); m_acLayerCfg[layer].m_colourRemapSEIMatrixPresentFlag = tempCode ? 1 : 0; 2222 if( m_acLayerCfg[layer].m_colourRemapSEIMatrixPresentFlag ) 2223 { 2224 retval = fscanf( fic, "%d", &m_acLayerCfg[layer].m_colourRemapSEILog2MatrixDenom ); 2225 for( Int c=0 ; c<3 ; c++ ) 2226 for( Int i=0 ; i<3 ; i++ ) 2227 retval = fscanf( fic, "%d", &m_acLayerCfg[layer].m_colourRemapSEICoeffs[c][i] ); 2228 } 2229 2230 for( Int c=0 ; c<3 ; c++ ) 2231 { 2232 retval = fscanf( fic, "%d", &m_acLayerCfg[layer].m_colourRemapSEIPostLutNumValMinus1[c] ); 2233 if( m_acLayerCfg[layer].m_colourRemapSEIPostLutNumValMinus1[c]>0 ) 2234 { 2235 m_acLayerCfg[layer].m_colourRemapSEIPostLutCodedValue[c] = new Int[m_acLayerCfg[layer].m_colourRemapSEIPostLutNumValMinus1[c]+1]; 2236 m_acLayerCfg[layer].m_colourRemapSEIPostLutTargetValue[c] = new Int[m_acLayerCfg[layer].m_colourRemapSEIPostLutNumValMinus1[c]+1]; 2237 for( Int i=0 ; i<=m_acLayerCfg[layer].m_colourRemapSEIPostLutNumValMinus1[c] ; i++ ) 2238 { 2239 retval = fscanf( fic, "%d", &m_acLayerCfg[layer].m_colourRemapSEIPostLutCodedValue[c][i] ); 2240 retval = fscanf( fic, "%d", &m_acLayerCfg[layer].m_colourRemapSEIPostLutTargetValue[c][i] ); 2241 } 2242 } 2243 } 2244 } 2245 2246 fclose( fic ); 2247 if( retval != 1 ) 2248 { 2249 fprintf(stderr, "Error while reading Colour Remapping Information SEI parameters file\n"); 2250 exit(EXIT_FAILURE); 2251 } 2252 } 2253 } 2254 #endif 2255 #endif 1631 2256 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 1632 2257 if (m_interLayerConstrainedTileSetsSEIEnabled) 1633 2258 { 1634 if (m_ iNumColumnsMinus1 == 0 && m_iNumRowsMinus1 == 0)2259 if (m_numTileColumnsMinus1 == 0 && m_numTileRowsMinus1 == 0) 1635 2260 { 1636 2261 printf( "Tiles are not defined (needed for inter-layer comnstrained tile sets SEI).\n" ); … … 1671 2296 } 1672 2297 m_skippedTileSetPresentFlag = false; 2298 2299 if( pTileSets ) 2300 { 2301 free( pTileSets ); 2302 pTileSets = NULL; 2303 } 1673 2304 } 1674 2305 #endif … … 1837 2468 } 1838 2469 1839 Bool tileFlag = (m_iNumColumnsMinus1 > 0 || m_iNumRowsMinus1 > 0 ); 2470 #if !SVC_EXTENSION 2471 Bool tileFlag = (m_numTileColumnsMinus1 > 0 || m_numTileRowsMinus1 > 0 ); 1840 2472 xConfirmPara( tileFlag && m_iWaveFrontSynchro, "Tile and Wavefront can not be applied together"); 1841 2473 1842 2474 //TODO:ChromaFmt assumes 4:2:0 below 1843 #if !SVC_EXTENSION1844 2475 xConfirmPara( m_iSourceWidth % TComSPS::getWinUnitX(CHROMA_420) != 0, "Picture width must be an integer multiple of the specified chroma subsampling"); 1845 2476 xConfirmPara( m_iSourceHeight % TComSPS::getWinUnitY(CHROMA_420) != 0, "Picture height must be an integer multiple of the specified chroma subsampling"); … … 1848 2479 xConfirmPara( m_aiPad[1] % TComSPS::getWinUnitY(CHROMA_420) != 0, "Vertical padding must be an integer multiple of the specified chroma subsampling"); 1849 2480 1850 xConfirmPara( m_confLeft % TComSPS::getWinUnitX(CHROMA_420) != 0, "Left conformance window offset must be an integer multiple of the specified chroma subsampling"); 1851 xConfirmPara( m_confRight % TComSPS::getWinUnitX(CHROMA_420) != 0, "Right conformance window offset must be an integer multiple of the specified chroma subsampling"); 1852 xConfirmPara( m_confTop % TComSPS::getWinUnitY(CHROMA_420) != 0, "Top conformance window offset must be an integer multiple of the specified chroma subsampling"); 1853 xConfirmPara( m_confBottom % TComSPS::getWinUnitY(CHROMA_420) != 0, "Bottom conformance window offset must be an integer multiple of the specified chroma subsampling"); 2481 xConfirmPara( m_confWinLeft % TComSPS::getWinUnitX(CHROMA_420) != 0, "Left conformance window offset must be an integer multiple of the specified chroma subsampling"); 2482 xConfirmPara( m_confWinRight % TComSPS::getWinUnitX(CHROMA_420) != 0, "Right conformance window offset must be an integer multiple of the specified chroma subsampling"); 2483 xConfirmPara( m_confWinTop % TComSPS::getWinUnitY(CHROMA_420) != 0, "Top conformance window offset must be an integer multiple of the specified chroma subsampling"); 2484 xConfirmPara( m_confWinBottom % TComSPS::getWinUnitY(CHROMA_420) != 0, "Bottom conformance window offset must be an integer multiple of the specified chroma subsampling"); 2485 2486 xConfirmPara( m_defaultDisplayWindowFlag && !m_vuiParametersPresentFlag, "VUI needs to be enabled for default display window"); 2487 2488 if (m_defaultDisplayWindowFlag) 2489 { 2490 xConfirmPara( m_defDispWinLeftOffset % TComSPS::getWinUnitX(CHROMA_420) != 0, "Left default display window offset must be an integer multiple of the specified chroma subsampling"); 2491 xConfirmPara( m_defDispWinRightOffset % TComSPS::getWinUnitX(CHROMA_420) != 0, "Right default display window offset must be an integer multiple of the specified chroma subsampling"); 2492 xConfirmPara( m_defDispWinTopOffset % TComSPS::getWinUnitY(CHROMA_420) != 0, "Top default display window offset must be an integer multiple of the specified chroma subsampling"); 2493 xConfirmPara( m_defDispWinBottomOffset % TComSPS::getWinUnitY(CHROMA_420) != 0, "Bottom default display window offset must be an integer multiple of the specified chroma subsampling"); 2494 } 1854 2495 #endif 1855 2496 … … 1955 2596 1956 2597 // it can be updated after AVC BL support will be added to the WD 2598 #if VPS_AVC_BL_FLAG_REMOVAL 2599 if( m_nonHEVCBaseLayerFlag ) 2600 #else 1957 2601 if( m_avcBaseLayerFlag ) 2602 #endif 1958 2603 { 1959 2604 m_crossLayerIrapAlignFlag = false; … … 2593 3238 Int m_uiMaxCUHeight = m_acLayerCfg[layer].m_uiMaxCUHeight; 2594 3239 #endif 2595 #endif 3240 3241 Bool tileFlag = (m_numTileColumnsMinus1 > 0 || m_numTileRowsMinus1 > 0 ); 3242 Int m_iWaveFrontSynchro = m_acLayerCfg[layer].m_waveFrontSynchro; 3243 xConfirmPara( tileFlag && m_iWaveFrontSynchro, "Tile and Wavefront can not be applied together"); 3244 #endif 3245 2596 3246 if(m_vuiParametersPresentFlag && m_bitstreamRestrictionFlag) 2597 3247 { … … 2603 3253 Int widthInCU = (m_iSourceWidth % m_uiMaxCUWidth) ? m_iSourceWidth/m_uiMaxCUWidth + 1: m_iSourceWidth/m_uiMaxCUWidth; 2604 3254 Int heightInCU = (m_iSourceHeight % m_uiMaxCUHeight) ? m_iSourceHeight/m_uiMaxCUHeight + 1: m_iSourceHeight/m_uiMaxCUHeight; 2605 if(m_ iUniformSpacingIdr)2606 { 2607 maxTileWidth = m_uiMaxCUWidth*((widthInCU+m_ iNumColumnsMinus1)/(m_iNumColumnsMinus1+1));2608 maxTileHeight = m_uiMaxCUHeight*((heightInCU+m_ iNumRowsMinus1)/(m_iNumRowsMinus1+1));3255 if(m_tileUniformSpacingFlag) 3256 { 3257 maxTileWidth = m_uiMaxCUWidth*((widthInCU+m_numTileColumnsMinus1)/(m_numTileColumnsMinus1+1)); 3258 maxTileHeight = m_uiMaxCUHeight*((heightInCU+m_numTileRowsMinus1)/(m_numTileRowsMinus1+1)); 2609 3259 // if only the last tile-row is one treeblock higher than the others 2610 3260 // the maxTileHeight becomes smaller if the last row of treeblocks has lower height than the others 2611 if(!((heightInCU-1)%(m_ iNumRowsMinus1+1)))3261 if(!((heightInCU-1)%(m_numTileRowsMinus1+1))) 2612 3262 { 2613 3263 maxTileHeight = maxTileHeight - m_uiMaxCUHeight + (m_iSourceHeight % m_uiMaxCUHeight); … … 2615 3265 // if only the last tile-column is one treeblock wider than the others 2616 3266 // the maxTileWidth becomes smaller if the last column of treeblocks has lower width than the others 2617 if(!((widthInCU-1)%(m_ iNumColumnsMinus1+1)))3267 if(!((widthInCU-1)%(m_numTileColumnsMinus1+1))) 2618 3268 { 2619 3269 maxTileWidth = maxTileWidth - m_uiMaxCUWidth + (m_iSourceWidth % m_uiMaxCUWidth); … … 2622 3272 else // not uniform spacing 2623 3273 { 2624 if(m_ iNumColumnsMinus1<1)3274 if(m_numTileColumnsMinus1<1) 2625 3275 { 2626 3276 maxTileWidth = m_iSourceWidth; … … 2629 3279 { 2630 3280 Int accColumnWidth = 0; 2631 for(Int col=0; col<(m_ iNumColumnsMinus1); col++)3281 for(Int col=0; col<(m_numTileColumnsMinus1); col++) 2632 3282 { 2633 maxTileWidth = m_ pColumnWidth[col]>maxTileWidth ? m_pColumnWidth[col]:maxTileWidth;2634 accColumnWidth += m_ pColumnWidth[col];3283 maxTileWidth = m_tileColumnWidth[col]>maxTileWidth ? m_tileColumnWidth[col]:maxTileWidth; 3284 accColumnWidth += m_tileColumnWidth[col]; 2635 3285 } 2636 3286 maxTileWidth = (widthInCU-accColumnWidth)>maxTileWidth ? m_uiMaxCUWidth*(widthInCU-accColumnWidth):m_uiMaxCUWidth*maxTileWidth; 2637 3287 } 2638 if(m_ iNumRowsMinus1<1)3288 if(m_numTileRowsMinus1<1) 2639 3289 { 2640 3290 maxTileHeight = m_iSourceHeight; … … 2643 3293 { 2644 3294 Int accRowHeight = 0; 2645 for(Int row=0; row<(m_ iNumRowsMinus1); row++)3295 for(Int row=0; row<(m_numTileRowsMinus1); row++) 2646 3296 { 2647 maxTileHeight = m_ pRowHeight[row]>maxTileHeight ? m_pRowHeight[row]:maxTileHeight;2648 accRowHeight += m_ pRowHeight[row];3297 maxTileHeight = m_tileRowHeight[row]>maxTileHeight ? m_tileRowHeight[row]:maxTileHeight; 3298 accRowHeight += m_tileRowHeight[row]; 2649 3299 } 2650 3300 maxTileHeight = (heightInCU-accRowHeight)>maxTileHeight ? m_uiMaxCUHeight*(heightInCU-accRowHeight):m_uiMaxCUHeight*maxTileHeight; … … 2670 3320 } 2671 3321 #endif 3322 #if !SVC_EXTENSION 2672 3323 xConfirmPara( m_iWaveFrontSynchro < 0, "WaveFrontSynchro cannot be negative" ); 2673 #if !SVC_EXTENSION2674 3324 xConfirmPara( m_iWaveFrontSubstreams <= 0, "WaveFrontSubstreams must be positive" ); 2675 3325 xConfirmPara( m_iWaveFrontSubstreams > 1 && !m_iWaveFrontSynchro, "Must have WaveFrontSynchro > 0 in order to have WaveFrontSubstreams > 1" ); … … 2703 3353 } 2704 3354 #endif 3355 #if Q0074_COLOUR_REMAPPING_SEI 3356 #if !SVC_EXTENSION 3357 if ( ( m_colourRemapSEIFile.size() > 0 ) && !m_colourRemapSEICancelFlag ) 3358 { 3359 xConfirmPara( m_colourRemapSEIInputBitDepth < 8 || m_colourRemapSEIInputBitDepth > 16 , "colour_remap_input_bit_depth shall be in the range of 8 to 16, inclusive"); 3360 xConfirmPara( m_colourRemapSEIBitDepth < 8 || m_colourRemapSEIBitDepth > 16, "colour_remap_bit_depth shall be in the range of 8 to 16, inclusive"); 3361 for( Int c=0 ; c<3 ; c++) 3362 { 3363 xConfirmPara( m_colourRemapSEIPreLutNumValMinus1[c] < 0 || m_colourRemapSEIPreLutNumValMinus1[c] > 32, "pre_lut_num_val_minus1[c] shall be in the range of 0 to 32, inclusive"); 3364 if( m_colourRemapSEIPreLutNumValMinus1[c]>0 ) 3365 for( Int i=0 ; i<=m_colourRemapSEIPreLutNumValMinus1[c] ; i++) 3366 { 3367 xConfirmPara( m_colourRemapSEIPreLutCodedValue[c][i] < 0 || m_colourRemapSEIPreLutCodedValue[c][i] > ((1<<m_colourRemapSEIInputBitDepth)-1), "pre_lut_coded_value[c][i] shall be in the range of 0 to (1<<colour_remap_input_bit_depth)-1, inclusive"); 3368 xConfirmPara( m_colourRemapSEIPreLutTargetValue[c][i] < 0 || m_colourRemapSEIPreLutTargetValue[c][i] > ((1<<m_colourRemapSEIBitDepth)-1), "pre_lut_target_value[c][i] shall be in the range of 0 to (1<<colour_remap_bit_depth)-1, inclusive"); 3369 } 3370 xConfirmPara( m_colourRemapSEIPostLutNumValMinus1[c] < 0 || m_colourRemapSEIPostLutNumValMinus1[c] > 32, "post_lut_num_val_minus1[c] shall be in the range of 0 to 32, inclusive"); 3371 if( m_colourRemapSEIPostLutNumValMinus1[c]>0 ) 3372 for( Int i=0 ; i<=m_colourRemapSEIPostLutNumValMinus1[c] ; i++) 3373 { 3374 xConfirmPara( m_colourRemapSEIPostLutCodedValue[c][i] < 0 || m_colourRemapSEIPostLutCodedValue[c][i] > ((1<<m_colourRemapSEIBitDepth)-1), "post_lut_coded_value[c][i] shall be in the range of 0 to (1<<colour_remap_bit_depth)-1, inclusive"); 3375 xConfirmPara( m_colourRemapSEIPostLutTargetValue[c][i] < 0 || m_colourRemapSEIPostLutTargetValue[c][i] > ((1<<m_colourRemapSEIBitDepth)-1), "post_lut_target_value[c][i] shall be in the range of 0 to (1<<colour_remap_bit_depth)-1, inclusive"); 3376 } 3377 } 3378 if ( m_colourRemapSEIMatrixPresentFlag ) 3379 { 3380 xConfirmPara( m_colourRemapSEILog2MatrixDenom < 0 || m_colourRemapSEILog2MatrixDenom > 15, "log2_matrix_denom shall be in the range of 0 to 15, inclusive"); 3381 for( Int c=0 ; c<3 ; c++) 3382 for( Int i=0 ; i<3 ; i++) 3383 xConfirmPara( m_colourRemapSEICoeffs[c][i] < -32768 || m_colourRemapSEICoeffs[c][i] > 32767, "colour_remap_coeffs[c][i] shall be in the range of -32768 and 32767, inclusive"); 3384 } 3385 } 3386 #endif 3387 #endif 2705 3388 2706 3389 #if RC_SHVC_HARMONIZATION … … 2909 3592 printf("Scalable : %d\n", m_scalabilityMask[SCALABILITY_ID] ); 2910 3593 #if AVC_BASE 3594 #if VPS_AVC_BL_FLAG_REMOVAL 3595 printf("Base layer : %s\n", m_nonHEVCBaseLayerFlag ? "Non-HEVC" : "HEVC"); 3596 #else 2911 3597 printf("Base layer : %s\n", m_avcBaseLayerFlag ? "AVC" : "HEVC"); 3598 #endif 2912 3599 #endif 2913 3600 #if AUXILIARY_PICTURES … … 2933 3620 { 2934 3621 printf("=== Layer %d settings === \n", layer); 2935 #if AVC_SYNTAX2936 m_acLayerCfg[layer].xPrintParameter( layer );2937 #else2938 3622 m_acLayerCfg[layer].xPrintParameter(); 2939 #endif2940 3623 printf("\n"); 2941 3624 } 2942 3625 printf("=== Common configuration settings === \n"); 2943 3626 printf("Bitstream File : %s\n", m_pBitstreamFile ); 2944 #else 3627 #else //SVC_EXTENSION 2945 3628 printf("Input File : %s\n", m_pchInputFile ); 2946 3629 printf("Bitstream File : %s\n", m_pchBitstreamFile ); 2947 3630 printf("Reconstruction File : %s\n", m_pchReconFile ); 2948 printf("Real Format : %dx%d %dHz\n", m_iSourceWidth - m_conf Left - m_confRight, m_iSourceHeight - m_confTop - m_confBottom, m_iFrameRate );3631 printf("Real Format : %dx%d %dHz\n", m_iSourceWidth - m_confWinLeft - m_confWinRight, m_iSourceHeight - m_confWinTop - m_confWinBottom, m_iFrameRate ); 2949 3632 printf("Internal Format : %dx%d %dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate ); 2950 #endif 3633 #endif //SVC_EXTENSION 2951 3634 if (m_isField) 2952 3635 { … … 3084 3767 printf("CGS: %d CGSMaxOctantDepth: %d CGSMaxYPartNumLog2: %d CGSLUTBit:%d " , m_nCGSFlag , m_nCGSMaxOctantDepth , m_nCGSMaxYPartNumLog2 , m_nCGSLUTBit ); 3085 3768 #endif 3769 #if R0151_CGS_3D_ASYMLUT_IMPROVE 3770 printf("CGSAdaptC:%d " , m_nCGSAdaptiveChroma ); 3771 #endif 3772 #if R0179_ENC_OPT_3DLUT_SIZE 3773 printf("CGSSizeRDO:%d " , m_nCGSLutSizeRDO ); 3774 #endif 3775 3086 3776 printf("\n\n"); 3087 3777 … … 3099 3789 3100 3790 #if SVC_EXTENSION 3791 #if OUTPUT_LAYER_SETS_CONFIG 3792 Void TAppEncCfg::cfgStringToArray(Int **arr, string const cfgString, Int const numEntries, const char* logString) 3793 #else 3101 3794 Void TAppEncCfg::cfgStringToArray(Int **arr, string cfgString, Int numEntries, const char* logString) 3795 #endif 3102 3796 { 3103 3797 Char *tempChar = cfgString.empty() ? NULL : strdup(cfgString.c_str()); … … 3108 3802 *arr = new Int[numEntries]; 3109 3803 3804 #if OUTPUT_LAYER_SETS_CONFIG 3805 if( tempChar == NULL ) 3806 { 3807 arrayEntry = NULL; 3808 } 3809 else 3810 { 3811 arrayEntry = strtok( tempChar, " ,"); 3812 } 3813 #else 3110 3814 arrayEntry = strtok( tempChar, " ,"); 3815 #endif 3111 3816 while(arrayEntry != NULL) 3112 3817 { … … 3130 3835 *arr = NULL; 3131 3836 } 3837 3838 if( tempChar ) 3839 { 3840 free( tempChar ); 3841 tempChar = NULL; 3842 } 3132 3843 } 3133 3844 3845 #if OUTPUT_LAYER_SETS_CONFIG 3846 Bool TAppEncCfg::scanStringToArray(string const cfgString, Int const numEntries, const char* logString, Int * const returnArray) 3847 { 3848 Int *tempArray = NULL; 3849 // For all layer sets 3850 cfgStringToArray( &tempArray, cfgString, numEntries, logString ); 3851 if(tempArray) 3852 { 3853 for(Int i = 0; i < numEntries; i++) 3854 { 3855 returnArray[i] = tempArray[i]; 3856 } 3857 delete [] tempArray; tempArray = NULL; 3858 return true; 3859 } 3860 return false; 3861 } 3862 Bool TAppEncCfg::scanStringToArray(string const cfgString, Int const numEntries, const char* logString, std::vector<Int> & returnVector) 3863 { 3864 Int *tempArray = NULL; 3865 // For all layer sets 3866 cfgStringToArray( &tempArray, cfgString, numEntries, logString ); 3867 if(tempArray) 3868 { 3869 returnVector.empty(); 3870 for(Int i = 0; i < numEntries; i++) 3871 { 3872 returnVector.push_back(tempArray[i]); 3873 } 3874 delete [] tempArray; tempArray = NULL; 3875 return true; 3876 } 3877 return false; 3878 } 3879 #endif 3134 3880 #endif //SVC_EXTENSION 3135 3881 //! \} -
trunk/source/App/TAppEncoder/TAppEncCfg.h
r815 r906 46 46 #endif 47 47 #include <sstream> 48 #include <vector> 48 49 //! \ingroup TAppEncoder 49 50 //! \{ … … 68 69 Int m_framesToBeEncoded; ///< number of encoded frames 69 70 #if AVC_BASE 71 #if VPS_AVC_BL_FLAG_REMOVAL 72 Int m_nonHEVCBaseLayerFlag; ///< non HEVC BL 73 #else 70 74 Int m_avcBaseLayerFlag; ///< avc_baselayer_flag 71 75 #endif 72 #if AVC_SYNTAX73 Char* m_BLSyntaxFile; ///< input syntax file74 76 #endif 75 77 Bool m_maxTidRefPresentFlag; … … 81 83 Int m_numHighestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1]; 82 84 Int m_highestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 85 #endif 86 #if OUTPUT_LAYER_SETS_CONFIG 87 std::vector<Int> m_outputLayerSetIdx; 88 Int m_defaultTargetOutputLayerIdc; 89 Int m_numOutputLayerSets; 90 std::vector<Int> m_numLayersInOutputLayerSet; 91 std::vector< std::vector<Int> > m_listOfOutputLayers; 83 92 #endif 84 93 #else … … 96 105 97 106 98 Int m_conformance Mode;99 Int m_conf Left;100 Int m_conf Right;101 Int m_conf Top;102 Int m_conf Bottom;107 Int m_conformanceWindowMode; 108 Int m_confWinLeft; 109 Int m_confWinRight; 110 Int m_confWinTop; 111 Int m_confWinBottom; 103 112 Int m_framesToBeEncoded; ///< number of encoded frames 104 113 Int m_aiPad[2]; ///< number of padded pixels for width and height … … 222 231 Bool m_useRDOQ; ///< flag for using RD optimized quantization 223 232 Bool m_useRDOQTS; ///< flag for using RD optimized quantization for transform skip 224 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)233 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) 225 234 Int m_iFastSearch; ///< ME mode, 0 = full, 1 = diamond, 2 = PMVFAST 226 235 Int m_iSearchRange; ///< ME search range … … 243 252 Bool m_bLFCrossSliceBoundaryFlag; ///< 1: filter across slice boundaries 0: do not filter across slice boundaries 244 253 Bool m_bLFCrossTileBoundaryFlag; ///< 1: filter across tile boundaries 0: do not filter across tile boundaries 245 Int m_iUniformSpacingIdr; 246 Int m_iNumColumnsMinus1; 247 Char* m_pchColumnWidth; 248 Int m_iNumRowsMinus1; 249 Char* m_pchRowHeight; 250 UInt* m_pColumnWidth; 251 UInt* m_pRowHeight; 254 Bool m_tileUniformSpacingFlag; 255 Int m_numTileColumnsMinus1; 256 Int m_numTileRowsMinus1; 257 std::vector<Int> m_tileColumnWidth; 258 std::vector<Int> m_tileRowHeight; 259 #if !SVC_EXTENSION 252 260 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. 253 #if !SVC_EXTENSION254 261 Int m_iWaveFrontSubstreams; //< If iWaveFrontSynchro, this is the number of substreams per frame (dependent tiles) or per tile (independent tiles). 255 262 #endif 256 257 263 Bool m_bUseConstrainedIntraPred; ///< flag for using constrained intra prediction 258 259 264 Int m_decodedPictureHashSEIEnabled; ///< Checksum(3)/CRC(2)/MD5(1)/disable(0) acting on decoded picture hash SEI message 260 265 Int m_recoveryPointSEIEnabled; … … 288 293 Int* m_codedPivotValue; 289 294 Int* m_targetPivotValue; 290 #if Q0074_SEI_COLOR_MAPPING291 Char* m_pchSEIColorMappingFile; ///< SEI Color Mapping File (initialized from external file)292 #endif293 295 Int m_framePackingSEIEnabled; 294 296 Int m_framePackingSEIType; … … 377 379 Int m_elRapSliceBEnabled; 378 380 #endif 381 #if Q0074_COLOUR_REMAPPING_SEI 382 #if !SVC_EXTENSION 383 string m_colourRemapSEIFile; 384 Int m_colourRemapSEIId; 385 Bool m_colourRemapSEICancelFlag; 386 Bool m_colourRemapSEIPersistenceFlag; 387 Bool m_colourRemapSEIVideoSignalInfoPresentFlag; 388 Bool m_colourRemapSEIFullRangeFlag; 389 Int m_colourRemapSEIPrimaries; 390 Int m_colourRemapSEITransferFunction; 391 Int m_colourRemapSEIMatrixCoefficients; 392 Int m_colourRemapSEIInputBitDepth; 393 Int m_colourRemapSEIBitDepth; 394 Int m_colourRemapSEIPreLutNumValMinus1[3]; 395 Int* m_colourRemapSEIPreLutCodedValue[3]; 396 Int* m_colourRemapSEIPreLutTargetValue[3]; 397 Bool m_colourRemapSEIMatrixPresentFlag; 398 Int m_colourRemapSEILog2MatrixDenom; 399 Int m_colourRemapSEICoeffs[3][3]; 400 Int m_colourRemapSEIPostLutNumValMinus1[3]; 401 Int* m_colourRemapSEIPostLutCodedValue[3]; 402 Int* m_colourRemapSEIPostLutTargetValue[3]; 403 #endif 404 #endif 379 405 // internal member functions 380 406 #if LAYER_CTB … … 439 465 Int m_nCGSMaxYPartNumLog2; 440 466 Int m_nCGSLUTBit; 441 #endif 467 #if R0151_CGS_3D_ASYMLUT_IMPROVE 468 Int m_nCGSAdaptiveChroma; 469 #endif 470 #if R0179_ENC_OPT_3DLUT_SIZE 471 Int m_nCGSLutSizeRDO; 472 #endif 473 #endif 442 474 #endif //SVC_EXTENSION 443 475 public: … … 468 500 #endif 469 501 Int getDecodingRefreshType() {return m_iDecodingRefreshType; } 470 Int getWaveFrontSynchro( ) { return m_iWaveFrontSynchro; }502 Int getWaveFrontSynchro(Int layerId) { return m_acLayerCfg[layerId].m_waveFrontSynchro; } 471 503 Void getDirFilename(string& filename, string& dir, const string path); 472 #if AVC_SYNTAX 473 Char* getBLSyntaxFile() { return m_BLSyntaxFile; } 474 #endif 504 #if OUTPUT_LAYER_SETS_CONFIG 505 Bool scanStringToArray(string const cfgString, Int const numEntries, const char* logString, Int * const returnArray); 506 Bool scanStringToArray(string const cfgString, Int const numEntries, const char* logString, std::vector<Int> & returnVector); 507 Void cfgStringToArray(Int **arr, string const cfgString, Int const numEntries, const char* logString); 508 #else 475 509 Void cfgStringToArray(Int **arr, string cfgString, Int numEntries, const char* logString); 510 #endif 476 511 #if REPN_FORMAT_IN_VPS 477 512 RepFormatCfg* getRepFormatCfg(Int i) { return &m_repFormatCfg[i]; } -
trunk/source/App/TAppEncoder/TAppEncLayerCfg.cpp
r713 r906 49 49 , m_repFormatIdx (-1) 50 50 #endif 51 { 52 m_confLeft = m_confRight = m_confTop = m_confBottom = 0; 51 #if Q0074_COLOUR_REMAPPING_SEI 52 , m_colourRemapSEIFile(string("")) 53 #endif 54 { 55 #if Q0074_COLOUR_REMAPPING_SEI 56 for( Int c=0 ; c<3 ; c++) 57 { 58 m_colourRemapSEIPreLutCodedValue[c] = NULL; 59 m_colourRemapSEIPreLutTargetValue[c] = NULL; 60 m_colourRemapSEIPostLutCodedValue[c] = NULL; 61 m_colourRemapSEIPostLutTargetValue[c] = NULL; 62 } 63 #endif 64 m_confWinLeft = m_confWinRight = m_confWinTop = m_confWinBottom = 0; 53 65 m_aiPad[1] = m_aiPad[0] = 0; 54 66 m_numScaledRefLayerOffsets = 0; … … 60 72 ::memset(m_scaledRefLayerRightOffset, 0, sizeof(m_scaledRefLayerRightOffset)); 61 73 ::memset(m_scaledRefLayerBottomOffset, 0, sizeof(m_scaledRefLayerBottomOffset)); 74 #if REF_REGION_OFFSET 75 ::memset(m_scaledRefLayerOffsetPresentFlag, 0, sizeof(m_scaledRefLayerOffsetPresentFlag)); 76 ::memset(m_refRegionOffsetPresentFlag, 0, sizeof(m_refRegionOffsetPresentFlag)); 77 ::memset(m_refRegionLeftOffset, 0, sizeof(m_refRegionLeftOffset)); 78 ::memset(m_refRegionTopOffset, 0, sizeof(m_refRegionTopOffset)); 79 ::memset(m_refRegionRightOffset, 0, sizeof(m_refRegionRightOffset)); 80 ::memset(m_refRegionBottomOffset, 0, sizeof(m_refRegionBottomOffset)); 81 #endif 82 #if R0209_GENERIC_PHASE 83 ::memset(m_resamplePhaseSetPresentFlag, 0, sizeof(m_resamplePhaseSetPresentFlag)); 84 ::memset(m_phaseHorLuma, 0, sizeof(m_phaseHorLuma)); 85 ::memset(m_phaseVerLuma, 0, sizeof(m_phaseVerLuma)); 86 ::memset(m_phaseHorChroma, 0, sizeof(m_phaseHorChroma)); 87 ::memset(m_phaseVerChroma, 0, sizeof(m_phaseVerChroma)); 88 #else 62 89 #if P0312_VERT_PHASE_ADJ 63 90 ::memset(m_vertPhasePositionEnableFlag, 0, sizeof(m_vertPhasePositionEnableFlag)); 64 91 #endif 92 #endif 65 93 } 66 94 … … 71 99 delete[] m_aidQP; 72 100 } 101 #if Q0074_COLOUR_REMAPPING_SEI 102 for( Int c=0 ; c<3 ; c++) 103 { 104 if ( m_colourRemapSEIPreLutCodedValue[c] ) 105 { 106 delete[] m_colourRemapSEIPreLutCodedValue[c]; 107 } 108 if ( m_colourRemapSEIPreLutTargetValue[c] ) 109 { 110 delete[] m_colourRemapSEIPreLutTargetValue[c]; 111 } 112 if ( m_colourRemapSEIPostLutCodedValue[c] ) 113 { 114 delete[] m_colourRemapSEIPostLutCodedValue[c]; 115 } 116 if ( m_colourRemapSEIPostLutTargetValue[c] ) 117 { 118 delete[] m_colourRemapSEIPostLutTargetValue[c]; 119 } 120 } 121 #endif 73 122 } 74 123 … … 98 147 Int tmpInputChromaFormat; 99 148 Int tmpChromaFormat; 149 #endif 150 #if Q0074_COLOUR_REMAPPING_SEI 151 string cfg_colourRemapSEIFile; 100 152 #endif 101 153 … … 114 166 ("ChromaFormatIDC", tmpChromaFormat, 420, "ChromaFormatIDC (400|420|422|444 or set 0 (default) for same as InputChromaFormat)") 115 167 #endif 116 ("CropLeft", m_confLeft, 0, "Left cropping/padding for cropping mode 3") 117 ("CropRight", m_confRight, 0, "Right cropping/padding for cropping mode 3") 118 ("CropTop", m_confTop, 0, "Top cropping/padding for cropping mode 3") 119 ("CropBottom", m_confBottom, 0, "Bottom cropping/padding for cropping mode 3") 168 ("ConfLeft", m_confWinLeft, 0, "Deprecated alias of ConfWinLeft") 169 ("ConfRight", m_confWinRight, 0, "Deprecated alias of ConfWinRight") 170 ("ConfTop", m_confWinTop, 0, "Deprecated alias of ConfWinTop") 171 ("ConfBottom", m_confWinBottom, 0, "Deprecated alias of ConfWinBottom") 172 ("ConfWinLeft", m_confWinLeft, 0, "Left offset for window conformance mode 3") 173 ("ConfWinRight", m_confWinRight, 0, "Right offset for window conformance mode 3") 174 ("ConfWinTop", m_confWinTop, 0, "Top offset for window conformance mode 3") 175 ("ConfWinBottom", m_confWinBottom, 0, "Bottom offset for window conformance mode 3") 120 176 ("HorizontalPadding,-pdx",m_aiPad[0], 0, "horizontal source padding for cropping mode 2") 121 177 ("VerticalPadding,-pdy", m_aiPad[1], 0, "vertical source padding for cropping mode 2") … … 124 180 ("dQPFile,m", cfg_dQPFile, string(""), "dQP file name") 125 181 ("QP,q", m_fQP, 30.0, "Qp value, if value is float, QP is switched once during encoding") 126 ; 182 #if Q0074_COLOUR_REMAPPING_SEI 183 ("SEIColourRemappingInfoFile", cfg_colourRemapSEIFile, string(""), "Colour Remapping Information SEI parameters file name") 184 #endif 185 ; 127 186 128 187 po::setDefaults(opts); … … 136 195 m_chromaFormatIDC = ((tmpChromaFormat == 0) ? (m_InputChromaFormat) : (numberToChromaFormat(tmpChromaFormat))); 137 196 #endif 197 #if Q0074_COLOUR_REMAPPING_SEI 198 m_colourRemapSEIFile = cfg_colourRemapSEIFile.empty() ? NULL : strdup(cfg_colourRemapSEIFile.c_str()); 199 #endif 138 200 139 201 // reading external dQP description from file … … 154 216 } 155 217 } 218 219 #if Q0074_COLOUR_REMAPPING_SEI 220 if( m_colourRemapSEIFile.size() > 0 ) 221 { 222 FILE* fic; 223 Int retval; 224 if((fic = fopen(m_colourRemapSEIFile.c_str(),"r")) == (FILE*)NULL) 225 { 226 fprintf(stderr, "Can't open Colour Remapping Information SEI parameters file %s\n", m_colourRemapSEIFile.c_str()); 227 exit(EXIT_FAILURE); 228 } 229 230 Int tempCode; 231 retval = fscanf( fic, "%d", &m_colourRemapSEIId ); 232 retval = fscanf( fic, "%d", &tempCode );m_colourRemapSEICancelFlag = tempCode ? 1 : 0; 233 if( !m_colourRemapSEICancelFlag ) 234 { 235 retval = fscanf( fic, "%d", &tempCode );m_colourRemapSEIPersistenceFlag = tempCode ? 1 : 0; 236 retval = fscanf( fic, "%d", &tempCode );m_colourRemapSEIVideoSignalInfoPresentFlag = tempCode ? 1 : 0; 237 if( m_colourRemapSEIVideoSignalInfoPresentFlag ) 238 { 239 retval = fscanf( fic, "%d", &tempCode );m_colourRemapSEIFullRangeFlag = tempCode ? 1 : 0; 240 retval = fscanf( fic, "%d", &m_colourRemapSEIPrimaries ); 241 retval = fscanf( fic, "%d", &m_colourRemapSEITransferFunction ); 242 retval = fscanf( fic, "%d", &m_colourRemapSEIMatrixCoefficients ); 243 } 244 245 retval = fscanf( fic, "%d", &m_colourRemapSEIInputBitDepth ); 246 retval = fscanf( fic, "%d", &m_colourRemapSEIBitDepth ); 247 248 for( Int c=0 ; c<3 ; c++ ) 249 { 250 retval = fscanf( fic, "%d", &m_colourRemapSEIPreLutNumValMinus1[c] ); 251 if( m_colourRemapSEIPreLutNumValMinus1[c]>0 ) 252 { 253 m_colourRemapSEIPreLutCodedValue[c] = new Int[m_colourRemapSEIPreLutNumValMinus1[c]+1]; 254 m_colourRemapSEIPreLutTargetValue[c] = new Int[m_colourRemapSEIPreLutNumValMinus1[c]+1]; 255 for( Int i=0 ; i<=m_colourRemapSEIPreLutNumValMinus1[c] ; i++ ) 256 { 257 retval = fscanf( fic, "%d", &m_colourRemapSEIPreLutCodedValue[c][i] ); 258 retval = fscanf( fic, "%d", &m_colourRemapSEIPreLutTargetValue[c][i] ); 259 } 260 } 261 } 262 263 retval = fscanf( fic, "%d", &tempCode );m_colourRemapSEIMatrixPresentFlag = tempCode ? 1 : 0; 264 if( m_colourRemapSEIMatrixPresentFlag ) 265 { 266 retval = fscanf( fic, "%d", &m_colourRemapSEILog2MatrixDenom ); 267 for( Int c=0 ; c<3 ; c++ ) 268 for( Int i=0 ; i<3 ; i++ ) 269 retval = fscanf( fic, "%d", &m_colourRemapSEICoeffs[c][i] ); 270 } 271 272 for( Int c=0 ; c<3 ; c++ ) 273 { 274 retval = fscanf( fic, "%d", &m_colourRemapSEIPostLutNumValMinus1[c] ); 275 if( m_colourRemapSEIPostLutNumValMinus1[c]>0 ) 276 { 277 m_colourRemapSEIPostLutCodedValue[c] = new Int[m_colourRemapSEIPostLutNumValMinus1[c]+1]; 278 m_colourRemapSEIPostLutTargetValue[c] = new Int[m_colourRemapSEIPostLutNumValMinus1[c]+1]; 279 for( Int i=0 ; i<=m_colourRemapSEIPostLutNumValMinus1[c] ; i++ ) 280 { 281 retval = fscanf( fic, "%d", &m_colourRemapSEIPostLutCodedValue[c][i] ); 282 retval = fscanf( fic, "%d", &m_colourRemapSEIPostLutTargetValue[c][i] ); 283 } 284 } 285 } 286 } 287 288 fclose( fic ); 289 if( retval != 1 ) 290 { 291 fprintf(stderr, "Error while reading Colour Remapping Information SEI parameters file\n"); 292 exit(EXIT_FAILURE); 293 } 294 } 295 #endif 296 156 297 return true; 157 298 } 158 299 159 #if AVC_SYNTAX160 Void TAppEncLayerCfg::xPrintParameter( UInt layerId )161 #else162 300 Void TAppEncLayerCfg::xPrintParameter() 163 #endif164 301 { 165 302 printf("Input File : %s\n", m_cInputFile.c_str() ); 166 303 printf("Reconstruction File : %s\n", m_cReconFile.c_str() ); 167 #if AVC_SYNTAX168 if( layerId == 0 )169 {170 printf("Base layer syntax file : %s\n", m_cAppEncCfg->getBLSyntaxFile() );171 }172 #endif173 304 #if REPN_FORMAT_IN_VPS 174 printf("Real Format : %dx%d %dHz\n", m_iSourceWidth - ( m_conf Left + m_confRight ) * TComSPS::getWinUnitX( m_chromaFormatIDC ), m_iSourceHeight - ( m_confTop + m_confBottom ) * TComSPS::getWinUnitY( m_chromaFormatIDC ), m_iFrameRate );305 printf("Real Format : %dx%d %dHz\n", m_iSourceWidth - ( m_confWinLeft + m_confWinRight ) * TComSPS::getWinUnitX( m_chromaFormatIDC ), m_iSourceHeight - ( m_confWinTop + m_confWinBottom ) * TComSPS::getWinUnitY( m_chromaFormatIDC ), m_iFrameRate ); 175 306 #else 176 printf("Real Format : %dx%d %dHz\n", m_iSourceWidth - m_conf Left - m_confRight, m_iSourceHeight - m_confTop - m_confBottom, m_iFrameRate );307 printf("Real Format : %dx%d %dHz\n", m_iSourceWidth - m_confWinLeft - m_confWinRight, m_iSourceHeight - m_confWinTop - m_confWinBottom, m_iFrameRate ); 177 308 #endif 178 309 printf("Internal Format : %dx%d %dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate ); … … 202 333 } 203 334 #endif 204 printf("WaveFrontSynchro:%d WaveFrontSubstreams:%d", m_ cAppEncCfg->getWaveFrontSynchro(), m_iWaveFrontSubstreams);335 printf("WaveFrontSynchro:%d WaveFrontSubstreams:%d", m_waveFrontSynchro, m_iWaveFrontSubstreams); 205 336 #if LAYER_CTB 206 337 printf("PCM:%d ", (m_cAppEncCfg->getUsePCM() && (1<<m_cAppEncCfg->getPCMLog2MinSize()) <= m_uiMaxCUWidth)? 1 : 0); … … 217 348 { 218 349 // no cropping or padding 219 m_conf Left = m_confRight = m_confTop = m_confBottom = 0;350 m_confWinLeft = m_confWinRight = m_confWinTop = m_confWinBottom = 0; 220 351 m_aiPad[1] = m_aiPad[0] = 0; 221 352 break; … … 231 362 if (m_iSourceWidth % minCuSize) 232 363 { 233 m_aiPad[0] = m_conf Right = ((m_iSourceWidth / minCuSize) + 1) * minCuSize - m_iSourceWidth;234 m_iSourceWidth += m_conf Right;364 m_aiPad[0] = m_confWinRight = ((m_iSourceWidth / minCuSize) + 1) * minCuSize - m_iSourceWidth; 365 m_iSourceWidth += m_confWinRight; 235 366 #if REPN_FORMAT_IN_VPS 236 m_conf Right /= TComSPS::getWinUnitX( m_chromaFormatIDC );367 m_confWinRight /= TComSPS::getWinUnitX( m_chromaFormatIDC ); 237 368 #endif 238 369 } 239 370 if (m_iSourceHeight % minCuSize) 240 371 { 241 m_aiPad[1] = m_conf Bottom = ((m_iSourceHeight / minCuSize) + 1) * minCuSize - m_iSourceHeight;242 m_iSourceHeight += m_conf Bottom;372 m_aiPad[1] = m_confWinBottom = ((m_iSourceHeight / minCuSize) + 1) * minCuSize - m_iSourceHeight; 373 m_iSourceHeight += m_confWinBottom; 243 374 if ( isField ) 244 375 { 245 m_iSourceHeightOrg += m_conf Bottom << 1;246 m_aiPad[1] = m_conf Bottom << 1;376 m_iSourceHeightOrg += m_confWinBottom << 1; 377 m_aiPad[1] = m_confWinBottom << 1; 247 378 } 248 379 #if REPN_FORMAT_IN_VPS 249 m_conf Bottom /= TComSPS::getWinUnitY( m_chromaFormatIDC );380 m_confWinBottom /= TComSPS::getWinUnitY( m_chromaFormatIDC ); 250 381 #endif 251 382 } … … 257 388 m_iSourceWidth += m_aiPad[0]; 258 389 m_iSourceHeight += m_aiPad[1]; 259 m_conf Right = m_aiPad[0];260 m_conf Bottom = m_aiPad[1];390 m_confWinRight = m_aiPad[0]; 391 m_confWinBottom = m_aiPad[1]; 261 392 #if REPN_FORMAT_IN_VPS 262 m_conf Right /= TComSPS::getWinUnitX( m_chromaFormatIDC );263 m_conf Bottom /= TComSPS::getWinUnitY( m_chromaFormatIDC );393 m_confWinRight /= TComSPS::getWinUnitX( m_chromaFormatIDC ); 394 m_confWinBottom /= TComSPS::getWinUnitY( m_chromaFormatIDC ); 264 395 #endif 265 396 break; … … 268 399 { 269 400 // conformance 270 if ((m_conf Left == 0) && (m_confRight == 0) && (m_confTop == 0) && (m_confBottom == 0))401 if ((m_confWinLeft == 0) && (m_confWinRight == 0) && (m_confWinTop == 0) && (m_confWinBottom == 0)) 271 402 { 272 403 fprintf(stderr, "Warning: Cropping enabled, but all cropping parameters set to zero\n"); … … 333 464 #endif 334 465 335 336 m_iWaveFrontSubstreams = m_cAppEncCfg->getWaveFrontSynchro() ? (m_iSourceHeight + maxCUHeight - 1) / maxCUHeight : 1;466 m_iWaveFrontSubstreams = m_waveFrontSynchro ? (m_iSourceHeight + maxCUHeight - 1) / maxCUHeight : 1; 467 xConfirmPara( m_waveFrontSynchro < 0, "WaveFrontSynchro cannot be negative" ); 337 468 xConfirmPara( m_iWaveFrontSubstreams <= 0, "WaveFrontSubstreams must be positive" ); 338 xConfirmPara( m_iWaveFrontSubstreams > 1 && !m_ cAppEncCfg->getWaveFrontSynchro(), "Must have WaveFrontSynchro > 0 in order to have WaveFrontSubstreams > 1" );469 xConfirmPara( m_iWaveFrontSubstreams > 1 && !m_waveFrontSynchro, "Must have WaveFrontSynchro > 0 in order to have WaveFrontSubstreams > 1" ); 339 470 340 471 //chekc parameters … … 386 517 } 387 518 #endif 519 #if Q0074_COLOUR_REMAPPING_SEI 520 if ( ( m_colourRemapSEIFile.size() > 0 ) && !m_colourRemapSEICancelFlag ) 521 { 522 xConfirmPara( m_colourRemapSEIInputBitDepth < 8 || m_colourRemapSEIInputBitDepth > 16 , "colour_remap_input_bit_depth shall be in the range of 8 to 16, inclusive"); 523 xConfirmPara( m_colourRemapSEIBitDepth < 8 || m_colourRemapSEIBitDepth > 16, "colour_remap_bit_depth shall be in the range of 8 to 16, inclusive"); 524 for( Int c=0 ; c<3 ; c++) 525 { 526 xConfirmPara( m_colourRemapSEIPreLutNumValMinus1[c] < 0 || m_colourRemapSEIPreLutNumValMinus1[c] > 32, "pre_lut_num_val_minus1[c] shall be in the range of 0 to 32, inclusive"); 527 if( m_colourRemapSEIPreLutNumValMinus1[c]>0 ) 528 for( Int i=0 ; i<=m_colourRemapSEIPreLutNumValMinus1[c] ; i++) 529 { 530 xConfirmPara( m_colourRemapSEIPreLutCodedValue[c][i] < 0 || m_colourRemapSEIPreLutCodedValue[c][i] > ((1<<m_colourRemapSEIInputBitDepth)-1), "pre_lut_coded_value[c][i] shall be in the range of 0 to (1<<colour_remap_input_bit_depth)-1, inclusive"); 531 xConfirmPara( m_colourRemapSEIPreLutTargetValue[c][i] < 0 || m_colourRemapSEIPreLutTargetValue[c][i] > ((1<<m_colourRemapSEIBitDepth)-1), "pre_lut_target_value[c][i] shall be in the range of 0 to (1<<colour_remap_bit_depth)-1, inclusive"); 532 } 533 xConfirmPara( m_colourRemapSEIPostLutNumValMinus1[c] < 0 || m_colourRemapSEIPostLutNumValMinus1[c] > 32, "post_lut_num_val_minus1[c] shall be in the range of 0 to 32, inclusive"); 534 if( m_colourRemapSEIPostLutNumValMinus1[c]>0 ) 535 for( Int i=0 ; i<=m_colourRemapSEIPostLutNumValMinus1[c] ; i++) 536 { 537 xConfirmPara( m_colourRemapSEIPostLutCodedValue[c][i] < 0 || m_colourRemapSEIPostLutCodedValue[c][i] > ((1<<m_colourRemapSEIBitDepth)-1), "post_lut_coded_value[c][i] shall be in the range of 0 to (1<<colour_remap_bit_depth)-1, inclusive"); 538 xConfirmPara( m_colourRemapSEIPostLutTargetValue[c][i] < 0 || m_colourRemapSEIPostLutTargetValue[c][i] > ((1<<m_colourRemapSEIBitDepth)-1), "post_lut_target_value[c][i] shall be in the range of 0 to (1<<colour_remap_bit_depth)-1, inclusive"); 539 } 540 } 541 if( m_colourRemapSEIMatrixPresentFlag ) 542 { 543 xConfirmPara( m_colourRemapSEILog2MatrixDenom < 0 || m_colourRemapSEILog2MatrixDenom > 15, "log2_matrix_denom shall be in the range of 0 to 15, inclusive"); 544 for( Int c=0 ; c<3 ; c++) 545 for( Int i=0 ; i<3 ; i++) 546 xConfirmPara( m_colourRemapSEICoeffs[c][i] < -32768 || m_colourRemapSEICoeffs[c][i] > 32767, "colour_remap_coeffs[c][i] shall be in the range of -32768 and 32767, inclusive"); 547 } 548 } 549 #endif 388 550 389 551 #undef xConfirmPara -
trunk/source/App/TAppEncoder/TAppEncLayerCfg.h
r815 r906 35 35 Int m_iSourceHeightOrg; ///< original source height in pixel (when interlaced = frame height) 36 36 Int m_conformanceMode; 37 Int m_conf Left;38 Int m_conf Right;39 Int m_conf Top;40 Int m_conf Bottom;37 Int m_confWinLeft; 38 Int m_confWinRight; 39 Int m_confWinTop; 40 Int m_confWinBottom; 41 41 Int m_aiPad[2]; ///< number of padded pixels for width and height 42 42 Int m_iIntraPeriod; ///< period of I-slice (random access period) … … 54 54 Int *m_predLayerIds; 55 55 Int m_numActiveRefLayers; 56 #endif57 #if Q0074_SEI_COLOR_MAPPING58 string m_cSeiColorMappingFile;59 56 #endif 60 57 … … 84 81 85 82 Int m_maxTidIlRefPicsPlus1; 86 Int m_iWaveFrontSubstreams; //< If iWaveFrontSynchro, this is the number of substreams per frame (dependent tiles) or per tile (independent tiles). 83 Int m_waveFrontSynchro; ///< 0: no WPP. >= 1: WPP is enabled, the "Top right" from which inheritance occurs is this LCU offset in the line above the current. 84 Int m_iWaveFrontSubstreams; ///< If iWaveFrontSynchro, this is the number of substreams per frame (dependent tiles) or per tile (independent tiles). 87 85 88 86 Int m_iQP; ///< QP value of key-picture (integer) … … 98 96 Int m_scaledRefLayerRightOffset [MAX_LAYERS]; 99 97 Int m_scaledRefLayerBottomOffset[MAX_LAYERS]; 100 #if P0312_VERT_PHASE_ADJ 98 #if REF_REGION_OFFSET 99 Bool m_scaledRefLayerOffsetPresentFlag [MAX_LAYERS]; 100 Bool m_refRegionOffsetPresentFlag [MAX_LAYERS]; 101 Int m_refRegionLeftOffset [MAX_LAYERS]; 102 Int m_refRegionTopOffset [MAX_LAYERS]; 103 Int m_refRegionRightOffset [MAX_LAYERS]; 104 Int m_refRegionBottomOffset[MAX_LAYERS]; 105 #endif 106 #if P0312_VERT_PHASE_ADJ 101 107 Bool m_vertPhasePositionEnableFlag[MAX_LAYERS]; 108 #endif 109 #if R0209_GENERIC_PHASE 110 Int m_phaseHorLuma [MAX_LAYERS]; 111 Int m_phaseVerLuma [MAX_LAYERS]; 112 Int m_phaseHorChroma[MAX_LAYERS]; 113 Int m_phaseVerChroma[MAX_LAYERS]; 114 Bool m_resamplePhaseSetPresentFlag [MAX_LAYERS]; 102 115 #endif 103 116 … … 113 126 Int m_repFormatIdx; 114 127 #endif 128 #if Q0074_COLOUR_REMAPPING_SEI 129 string m_colourRemapSEIFile; ///< Colour Remapping Information SEI message parameters file 130 Int m_colourRemapSEIId; 131 Bool m_colourRemapSEICancelFlag; 132 Bool m_colourRemapSEIPersistenceFlag; 133 Bool m_colourRemapSEIVideoSignalInfoPresentFlag; 134 Bool m_colourRemapSEIFullRangeFlag; 135 Int m_colourRemapSEIPrimaries; 136 Int m_colourRemapSEITransferFunction; 137 Int m_colourRemapSEIMatrixCoefficients; 138 Int m_colourRemapSEIInputBitDepth; 139 Int m_colourRemapSEIBitDepth; 140 Int m_colourRemapSEIPreLutNumValMinus1[3]; 141 Int* m_colourRemapSEIPreLutCodedValue[3]; 142 Int* m_colourRemapSEIPreLutTargetValue[3]; 143 Bool m_colourRemapSEIMatrixPresentFlag; 144 Int m_colourRemapSEILog2MatrixDenom; 145 Int m_colourRemapSEICoeffs[3][3]; 146 Int m_colourRemapSEIPostLutNumValMinus1[3]; 147 Int* m_colourRemapSEIPostLutCodedValue[3]; 148 Int* m_colourRemapSEIPostLutTargetValue[3]; 149 #endif 150 115 151 public: 116 152 TAppEncLayerCfg(); … … 122 158 bool parseCfg ( const string& cfgFileName ); ///< parse layer configuration file to fill member variables 123 159 124 #if AVC_SYNTAX125 Void xPrintParameter( UInt layerId );126 #else127 160 Void xPrintParameter(); 128 #endif129 161 Bool xCheckParameter( Bool isField ); 130 162 … … 140 172 Int* getPad() {return m_aiPad; } 141 173 Double getFloatQP() {return m_fQP; } 142 Int getConf Left() {return m_confLeft; }143 Int getConf Right() {return m_confRight; }144 Int getConf Top() {return m_confTop; }145 Int getConf Bottom() {return m_confBottom; }174 Int getConfWinLeft() {return m_confWinLeft; } 175 Int getConfWinRight() {return m_confWinRight; } 176 Int getConfWinTop() {return m_confWinTop; } 177 Int getConfWinBottom() {return m_confWinBottom; } 146 178 #if AUXILIARY_PICTURES 147 179 ChromaFormat getInputChromaFormat() {return m_InputChromaFormat;} -
trunk/source/App/TAppEncoder/TAppEncTop.cpp
r815 r906 77 77 TComVPS* vps = m_acTEncTop[0].getVPS(); 78 78 79 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 80 vps->setVpsPocLsbAlignedFlag(false); 81 #endif 79 82 vps->setMaxTLayers ( m_maxTempLayer ); 80 83 if (m_maxTempLayer == 1) … … 181 184 repFormat->setBitDepthVpsChroma ( getInternalBitDepthC() ); // Need modification to change for each layer 182 185 #endif 186 187 #if R0156_CONF_WINDOW_IN_REP_FORMAT 188 repFormat->getConformanceWindowVps().setWindow( 189 m_acLayerCfg[mapIdxToLayer[idx]].m_confWinLeft, 190 m_acLayerCfg[mapIdxToLayer[idx]].m_confWinRight, 191 m_acLayerCfg[mapIdxToLayer[idx]].m_confWinTop, 192 m_acLayerCfg[mapIdxToLayer[idx]].m_confWinBottom ); 193 #endif 194 183 195 #if HIGHER_LAYER_IRAP_SKIP_FLAG 184 196 m_acTEncTop[mapIdxToLayer[idx]].setSkipPictureAtArcSwitch( m_skipPictureAtArcSwitch ); … … 213 225 m_acTEncTop[layer].setSourceWidth ( m_acLayerCfg[layer].getSourceWidth() ); 214 226 m_acTEncTop[layer].setSourceHeight ( m_acLayerCfg[layer].getSourceHeight() ); 215 m_acTEncTop[layer].setConformanceMode ( m_acLayerCfg[layer].getConformanceMode() ); 216 m_acTEncTop[layer].setConformanceWindow ( m_acLayerCfg[layer].m_confLeft, m_acLayerCfg[layer].m_confRight, m_acLayerCfg[layer].m_confTop, m_acLayerCfg[layer].m_confBottom ); 227 m_acTEncTop[layer].setConformanceWindow ( m_acLayerCfg[layer].m_confWinLeft, m_acLayerCfg[layer].m_confWinRight, m_acLayerCfg[layer].m_confWinTop, m_acLayerCfg[layer].m_confWinBottom ); 217 228 m_acTEncTop[layer].setFramesToBeEncoded ( m_framesToBeEncoded ); 218 229 … … 226 237 #if REF_IDX_MFM 227 238 #if AVC_BASE 228 m_acTEncTop[layer].setMFMEnabledFlag(layer == 0 ? false : ( m_avcBaseLayerFlag ? AVC_SYNTAX : true ) && m_acLayerCfg[layer].getNumMotionPredRefLayers()); 239 #if VPS_AVC_BL_FLAG_REMOVAL 240 m_acTEncTop[layer].setMFMEnabledFlag(layer == 0 ? false : ( m_nonHEVCBaseLayerFlag ? false : true ) && m_acLayerCfg[layer].getNumMotionPredRefLayers()); 241 #else 242 m_acTEncTop[layer].setMFMEnabledFlag(layer == 0 ? false : ( m_avcBaseLayerFlag ? false : true ) && m_acLayerCfg[layer].getNumMotionPredRefLayers()); 243 #endif 229 244 #else 230 245 m_acTEncTop[layer].setMFMEnabledFlag(layer == 0 ? false : ( m_acLayerCfg[layer].getNumMotionPredRefLayers() > 0 ) ); … … 352 367 } 353 368 } 369 #if REF_REGION_OFFSET 370 for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++) 371 { 372 #if AUXILIARY_PICTURES 373 Int cf = m_acLayerCfg[i].m_chromaFormatIDC; 374 Int rlSubWidthC = ( cf == CHROMA_420 || cf == CHROMA_422 ) ? 2 : 1; 375 Int rlSubHeightC = ( cf == CHROMA_420 ) ? 2 : 1; 376 #else 377 Int rlSubWidthC = 2; 378 Int rlSubHeightC = 2; 379 #endif 380 m_acTEncTop[layer].setRefRegionOffsetPresentFlag( i, m_acLayerCfg[layer].m_refRegionOffsetPresentFlag ); 381 m_acTEncTop[layer].getRefLayerWindow(i).setWindow( rlSubWidthC * m_acLayerCfg[layer].m_refRegionLeftOffset[i], rlSubWidthC * m_acLayerCfg[layer].m_refRegionRightOffset[i], 382 rlSubHeightC * m_acLayerCfg[layer].m_refRegionTopOffset[i], rlSubHeightC * m_acLayerCfg[layer].m_refRegionBottomOffset[i]); 383 } 384 #endif 385 } 386 else 387 { 388 assert( layer == 0 ); 389 m_acTEncTop[layer].setNumDirectRefLayers(0); 354 390 } 355 391 #endif //VPS_EXTN_DIRECT_REF_LAYERS … … 514 550 m_acTEncTop[layer].setKneeSEIOutputKneePoint ( m_kneeSEIOutputKneePoint ); 515 551 #endif 516 #if Q0074_SEI_COLOR_MAPPING 517 m_acTEncTop[layer].setColorMappingInfoSEIFile ( m_acLayerCfg[layer].m_cSeiColorMappingFile.empty() ? NULL : const_cast<Char *>(m_acLayerCfg[layer].m_cSeiColorMappingFile.c_str()) ); 552 #if Q0074_COLOUR_REMAPPING_SEI 553 m_acTEncTop[layer].setCRISEIFile ( const_cast<Char*>(m_acLayerCfg[layer].m_colourRemapSEIFile.c_str()) ); 554 m_acTEncTop[layer].setCRISEIId ( m_acLayerCfg[layer].m_colourRemapSEIId ); 555 m_acTEncTop[layer].setCRISEICancelFlag ( m_acLayerCfg[layer].m_colourRemapSEICancelFlag ); 556 m_acTEncTop[layer].setCRISEIPersistenceFlag ( m_acLayerCfg[layer].m_colourRemapSEIPersistenceFlag ); 557 m_acTEncTop[layer].setCRISEIVideoSignalInfoPresentFlag ( m_acLayerCfg[layer].m_colourRemapSEIVideoSignalInfoPresentFlag ); 558 m_acTEncTop[layer].setCRISEIFullRangeFlag ( m_acLayerCfg[layer].m_colourRemapSEIFullRangeFlag ); 559 m_acTEncTop[layer].setCRISEIPrimaries ( m_acLayerCfg[layer].m_colourRemapSEIPrimaries ); 560 m_acTEncTop[layer].setCRISEITransferFunction ( m_acLayerCfg[layer].m_colourRemapSEITransferFunction ); 561 m_acTEncTop[layer].setCRISEIMatrixCoefficients ( m_acLayerCfg[layer].m_colourRemapSEIMatrixCoefficients ); 562 m_acTEncTop[layer].setCRISEIInputBitDepth ( m_acLayerCfg[layer].m_colourRemapSEIInputBitDepth ); 563 m_acTEncTop[layer].setCRISEIBitDepth ( m_acLayerCfg[layer].m_colourRemapSEIBitDepth ); 564 m_acTEncTop[layer].setCRISEIPreLutNumValMinus1 ( m_acLayerCfg[layer].m_colourRemapSEIPreLutNumValMinus1 ); 565 m_acTEncTop[layer].setCRISEIPreLutCodedValue ( m_acLayerCfg[layer].m_colourRemapSEIPreLutCodedValue ); 566 m_acTEncTop[layer].setCRISEIPreLutTargetValue ( m_acLayerCfg[layer].m_colourRemapSEIPreLutTargetValue ); 567 m_acTEncTop[layer].setCRISEIMatrixPresentFlag ( m_acLayerCfg[layer].m_colourRemapSEIMatrixPresentFlag ); 568 m_acTEncTop[layer].setCRISEILog2MatrixDenom ( m_acLayerCfg[layer].m_colourRemapSEILog2MatrixDenom ); 569 m_acTEncTop[layer].setCRISEICoeffs ( m_acLayerCfg[layer].m_colourRemapSEICoeffs ); 570 m_acTEncTop[layer].setCRISEIPostLutNumValMinus1 ( m_acLayerCfg[layer].m_colourRemapSEIPostLutNumValMinus1 ); 571 m_acTEncTop[layer].setCRISEIPostLutCodedValue ( m_acLayerCfg[layer]. m_colourRemapSEIPostLutCodedValue ); 572 m_acTEncTop[layer].setCRISEIPostLutTargetValue ( m_acLayerCfg[layer].m_colourRemapSEIPostLutTargetValue ); 518 573 #endif 519 574 m_acTEncTop[layer].setFramePackingArrangementSEIEnabled( m_framePackingSEIEnabled ); … … 542 597 m_acTEncTop[layer].setIlcIdc( m_ilcIdc ); 543 598 #endif 544 m_acTEncTop[layer].set UniformSpacingIdr ( m_iUniformSpacingIdr);545 m_acTEncTop[layer].setNumColumnsMinus1 ( m_ iNumColumnsMinus1 );546 m_acTEncTop[layer].setNumRowsMinus1 ( m_ iNumRowsMinus1 );547 if( m_iUniformSpacingIdr==0)548 { 549 m_acTEncTop[layer].setColumnWidth ( m_ pColumnWidth );550 m_acTEncTop[layer].setRowHeight ( m_ pRowHeight );599 m_acTEncTop[layer].setTileUniformSpacingFlag ( m_tileUniformSpacingFlag ); 600 m_acTEncTop[layer].setNumColumnsMinus1 ( m_numTileColumnsMinus1 ); 601 m_acTEncTop[layer].setNumRowsMinus1 ( m_numTileRowsMinus1 ); 602 if(!m_tileUniformSpacingFlag) 603 { 604 m_acTEncTop[layer].setColumnWidth ( m_tileColumnWidth ); 605 m_acTEncTop[layer].setRowHeight ( m_tileRowHeight ); 551 606 } 552 607 m_acTEncTop[layer].xCheckGSParameters(); 553 Int uiTilesCount = (m_iNumRowsMinus1+1) * (m_iNumColumnsMinus1+1);608 Int uiTilesCount = (m_numTileRowsMinus1+1) * (m_numTileColumnsMinus1+1); 554 609 if(uiTilesCount == 1) 555 610 { … … 557 612 } 558 613 m_acTEncTop[layer].setLFCrossTileBoundaryFlag( m_bLFCrossTileBoundaryFlag ); 559 m_acTEncTop[layer].setWaveFrontSynchro ( m_ iWaveFrontSynchro );614 m_acTEncTop[layer].setWaveFrontSynchro ( m_acLayerCfg[layer].m_waveFrontSynchro ); 560 615 m_acTEncTop[layer].setWaveFrontSubstreams ( m_acLayerCfg[layer].m_iWaveFrontSubstreams ); 561 616 m_acTEncTop[layer].setTMVPModeId ( m_TMVPModeId ); … … 586 641 m_acTEncTop[layer].setActiveParameterSetsSEIEnabled ( m_activeParameterSetsSEIEnabled ); 587 642 m_acTEncTop[layer].setVuiParametersPresentFlag( m_vuiParametersPresentFlag ); 643 m_acTEncTop[layer].setAspectRatioInfoPresentFlag( m_aspectRatioInfoPresentFlag); 588 644 m_acTEncTop[layer].setAspectRatioIdc( m_aspectRatioIdc ); 589 645 m_acTEncTop[layer].setSarWidth( m_sarWidth ); … … 617 673 if( layer > 0 ) 618 674 { 675 #if REF_REGION_OFFSET 676 #if AUXILIARY_PICTURES 677 Int cf = m_acLayerCfg[layer].m_chromaFormatIDC; 678 Int subWidthC = ( cf == CHROMA_420 || cf == CHROMA_422 ) ? 2 : 1; 679 Int subHeightC = ( cf == CHROMA_420 ) ? 2 : 1; 680 #else 681 Int subWidthC = 2; 682 Int subHeightC = 2; 683 #endif 684 #endif 619 685 m_acTEncTop[layer].setNumScaledRefLayerOffsets( m_acLayerCfg[layer].m_numScaledRefLayerOffsets ); 620 686 for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++) … … 623 689 m_acTEncTop[layer].setScaledRefLayerId(i, m_acLayerCfg[layer].m_scaledRefLayerId[i]); 624 690 #endif 691 #if REF_REGION_OFFSET 692 m_acTEncTop[layer].setScaledRefLayerOffsetPresentFlag( i, m_acLayerCfg[layer].m_scaledRefLayerOffsetPresentFlag[i] ); 693 m_acTEncTop[layer].getScaledRefLayerWindow(i).setWindow( subWidthC * m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i], subWidthC * m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i], 694 subHeightC * m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i], subHeightC * m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i]); 695 #else 625 696 #if P0312_VERT_PHASE_ADJ 626 697 m_acTEncTop[layer].setVertPhasePositionEnableFlag( i, m_acLayerCfg[layer].m_vertPhasePositionEnableFlag[i] ); … … 630 701 m_acTEncTop[layer].getScaledRefLayerWindow(i).setWindow( 2*m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i], 631 702 2*m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i]); 703 #endif 704 #endif 705 #if R0209_GENERIC_PHASE 706 m_acTEncTop[layer].setResamplePhaseSetPresentFlag( i, m_acLayerCfg[layer].m_resamplePhaseSetPresentFlag[i] ); 707 m_acTEncTop[layer].setPhaseHorLuma( i, m_acLayerCfg[layer].m_phaseHorLuma[i] ); 708 m_acTEncTop[layer].setPhaseVerLuma( i, m_acLayerCfg[layer].m_phaseVerLuma[i] ); 709 m_acTEncTop[layer].setPhaseHorChroma( i, m_acLayerCfg[layer].m_phaseHorChroma[i] ); 710 m_acTEncTop[layer].setPhaseVerChroma( i, m_acLayerCfg[layer].m_phaseVerChroma[i] ); 632 711 #endif 633 712 } … … 650 729 m_acTEncTop[layer].setCGSMaxYPartNumLog2( m_nCGSMaxYPartNumLog2 ); 651 730 m_acTEncTop[layer].setCGSLUTBit( m_nCGSLUTBit ); 731 #if R0151_CGS_3D_ASYMLUT_IMPROVE 732 m_acTEncTop[layer].setCGSAdaptChroma( m_nCGSAdaptiveChroma ); 733 #endif 734 #if R0179_ENC_OPT_3DLUT_SIZE 735 m_acTEncTop[layer].setCGSLutSizeRDO( m_nCGSLutSizeRDO ); 736 #endif 652 737 #endif 653 738 #if Q0078_ADD_LAYER_SETS … … 685 770 m_cTEncTop.setSourceWidth ( m_iSourceWidth ); 686 771 m_cTEncTop.setSourceHeight ( m_iSourceHeight ); 687 m_cTEncTop.setConformanceWindow ( m_conf Left, m_confRight, m_confTop, m_confBottom );772 m_cTEncTop.setConformanceWindow ( m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom ); 688 773 m_cTEncTop.setFramesToBeEncoded ( m_framesToBeEncoded ); 689 774 … … 853 938 m_cTEncTop.setKneeSEIOutputKneePoint ( m_kneeSEIOutputKneePoint ); 854 939 #endif 855 #if Q0074_SEI_COLOR_MAPPING 856 m_cTEncTop.setColorMappingInfoSEIFile ( m_pchSEIColorMappingFile ); 940 #if Q0074_COLOUR_REMAPPING_SEI 941 m_cTEncTop.setCRISEIFile ( const_cast<Char*>(m_colourRemapSEIFile.c_str()) ); 942 m_cTEncTop.setCRISEIId ( m_colourRemapSEIId ); 943 m_cTEncTop.setCRISEICancelFlag ( m_colourRemapSEICancelFlag ); 944 m_cTEncTop.setCRISEIPersistenceFlag ( m_colourRemapSEIPersistenceFlag ); 945 m_cTEncTop.setCRISEIVideoSignalInfoPresentFlag ( m_colourRemapSEIVideoSignalInfoPresentFlag ); 946 m_cTEncTop.setCRISEIFullRangeFlag ( m_colourRemapSEIFullRangeFlag ); 947 m_cTEncTop.setCRISEIPrimaries ( m_colourRemapSEIPrimaries ); 948 m_cTEncTop.setCRISEITransferFunction ( m_colourRemapSEITransferFunction ); 949 m_cTEncTop.setCRISEIMatrixCoefficients ( m_colourRemapSEIMatrixCoefficients ); 950 m_cTEncTop.setCRISEIInputBitDepth ( m_colourRemapSEIInputBitDepth ); 951 m_cTEncTop.setCRISEIBitDepth ( m_colourRemapSEIBitDepth ); 952 m_cTEncTop.setCRISEIPreLutNumValMinus1 ( m_colourRemapSEIPreLutNumValMinus1 ); 953 m_cTEncTop.setCRISEIPreLutCodedValue ( m_colourRemapSEIPreLutCodedValue ); 954 m_cTEncTop.setCRISEIPreLutTargetValue ( m_colourRemapSEIPreLutTargetValue ); 955 m_cTEncTop.setCRISEIMatrixPresentFlag ( m_colourRemapSEIMatrixPresentFlag ); 956 m_cTEncTop.setCRISEILog2MatrixDenom ( m_colourRemapSEILog2MatrixDenom ); 957 m_cTEncTop.setCRISEICoeffs ( m_colourRemapSEICoeffs ); 958 m_cTEncTop.setCRISEIPostLutNumValMinus1 ( m_colourRemapSEIPostLutNumValMinus1 ); 959 m_cTEncTop.setCRISEIPostLutCodedValue ( m_colourRemapSEIPostLutCodedValue ); 960 m_cTEncTop.setCRISEIPostLutTargetValue ( m_colourRemapSEIPostLutTargetValue ); 857 961 #endif 858 962 m_cTEncTop.setFramePackingArrangementSEIEnabled( m_framePackingSEIEnabled ); … … 870 974 m_cTEncTop.setSOPDescriptionSEIEnabled( m_SOPDescriptionSEIEnabled ); 871 975 m_cTEncTop.setScalableNestingSEIEnabled( m_scalableNestingSEIEnabled ); 872 m_cTEncTop.set UniformSpacingIdr ( m_iUniformSpacingIdr);873 m_cTEncTop.setNumColumnsMinus1 ( m_ iNumColumnsMinus1 );874 m_cTEncTop.setNumRowsMinus1 ( m_ iNumRowsMinus1 );875 if( m_iUniformSpacingIdr==0)876 { 877 m_cTEncTop.setColumnWidth ( m_ pColumnWidth );878 m_cTEncTop.setRowHeight ( m_ pRowHeight );976 m_cTEncTop.setTileUniformSpacingFlag ( m_tileUniformSpacingFlag ); 977 m_cTEncTop.setNumColumnsMinus1 ( m_numTileColumnsMinus1 ); 978 m_cTEncTop.setNumRowsMinus1 ( m_numTileRowsMinus1 ); 979 if(!m_tileUniformSpacingFlag) 980 { 981 m_cTEncTop.setColumnWidth ( m_tileColumnWidth ); 982 m_cTEncTop.setRowHeight ( m_tileRowHeight ); 879 983 } 880 984 m_cTEncTop.xCheckGSParameters(); 881 Int uiTilesCount = (m_ iNumRowsMinus1+1) * (m_iNumColumnsMinus1+1);985 Int uiTilesCount = (m_numTileRowsMinus1+1) * (m_numTileColumnsMinus1+1); 882 986 if(uiTilesCount == 1) 883 987 { … … 904 1008 m_cTEncTop.setActiveParameterSetsSEIEnabled ( m_activeParameterSetsSEIEnabled ); 905 1009 m_cTEncTop.setVuiParametersPresentFlag( m_vuiParametersPresentFlag ); 1010 m_cTEncTop.setAspectRatioInfoPresentFlag( m_aspectRatioInfoPresentFlag); 906 1011 m_cTEncTop.setAspectRatioIdc( m_aspectRatioIdc ); 907 1012 m_cTEncTop.setSarWidth( m_sarWidth ); … … 1056 1161 1057 1162 #if Q0078_ADD_LAYER_SETS 1163 #if OUTPUT_LAYER_SETS_CONFIG 1164 if (m_numLayerSets > 1) 1165 { 1166 vps->setNumLayerSets(m_numLayerSets); 1167 #else 1058 1168 if (m_numLayerSets > 0) 1059 1169 { 1060 1170 vps->setNumLayerSets(m_numLayerSets+1); 1171 #endif 1061 1172 for (Int setId = 1; setId < vps->getNumLayerSets(); setId++) 1062 1173 { … … 1068 1179 for (Int setId = 1; setId < vps->getNumLayerSets(); setId++) 1069 1180 { 1181 #if OUTPUT_LAYER_SETS_CONFIG 1182 for (Int i = 0; i < m_numLayerInIdList[setId]; i++) 1183 { 1184 Int layerId = m_layerSetLayerIdList[setId][i]; 1185 #else 1070 1186 for (Int i = 0; i < m_numLayerInIdList[setId-1]; i++) 1071 1187 { 1072 1188 Int layerId = m_layerSetLayerIdList[setId-1][i]; 1073 1189 #endif 1074 1190 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1075 1191 //4 … … 1133 1249 UInt i = 0, dimIdLen = 0; 1134 1250 #if AVC_BASE 1251 #if VPS_AVC_BL_FLAG_REMOVAL 1252 vps->setNonHEVCBaseLayerFlag( m_nonHEVCBaseLayerFlag ); 1253 if ( m_nonHEVCBaseLayerFlag ) 1254 { 1255 vps->setBaseLayerInternalFlag (false); 1256 } 1257 #else 1135 1258 vps->setAvcBaseLayerFlag(m_avcBaseLayerFlag); 1259 #endif 1136 1260 #else 1137 1261 vps->setAvcBaseLayerFlag(false); … … 1200 1324 #endif 1201 1325 #if VPS_TSLAYERS 1202 1203 1204 1205 1206 1207 1326 vps->setMaxTSLayersPresentFlag(true); 1327 1328 for( i = 0; i < vps->getMaxLayers(); i++ ) 1329 { 1330 vps->setMaxTSLayersMinus1(i, vps->getMaxTLayers()-1); 1331 } 1208 1332 #endif 1209 1333 vps->setMaxTidRefPresentFlag(m_maxTidRefPresentFlag); … … 1238 1362 vps->setIlpSshSignalingEnabledFlag(false); 1239 1363 #if VPS_EXTN_PROFILE_INFO 1364 1365 #if LIST_OF_PTL 1366 vps->getPTLForExtnPtr()->resize(1); // Dummy object - unused. 1367 for(i = 0; i < vps->getMaxLayers(); i++) 1368 { 1369 // TODO: The profile tier level have to be given support to be included in the configuration files 1370 if(i == 0) 1371 { 1372 if( vps->getBaseLayerInternalFlag() && vps->getMaxLayers() > 1 ) 1373 { 1374 vps->setProfilePresentFlag(1, false); 1375 vps->getPTLForExtnPtr()->push_back( *(m_acTEncTop[0].getSPS()->getPTL()) ); 1376 } 1377 } 1378 else // i > 0 1379 { 1380 vps->setProfilePresentFlag(i, true); 1381 // Note - may need to be changed for other layer structures. 1382 vps->getPTLForExtnPtr()->push_back( *(m_acTEncTop[0].getSPS()->getPTL()) ); 1383 } 1384 } 1385 #else 1240 1386 vps->getPTLForExtnPtr()->resize(vps->getNumLayerSets()); 1241 1387 for(Int setId = 1; setId < vps->getNumLayerSets(); setId++) … … 1245 1391 *(vps->getPTLForExtn(setId)) = *(m_acTEncTop[setId].getSPS()->getPTL()); 1246 1392 } 1393 #endif 1247 1394 #endif 1248 1395 #if VPS_EXTN_DIRECT_REF_LAYERS … … 1317 1464 #endif 1318 1465 #endif 1466 #if OUTPUT_LAYER_SETS_CONFIG 1467 1468 vps->setDefaultTargetOutputLayerIdc( m_defaultTargetOutputLayerIdc ); // As per configuration file 1469 1470 if( m_numOutputLayerSets == -1 ) // # of output layer sets not specified in the configuration file 1471 { 1472 vps->setNumOutputLayerSets(vps->getNumLayerSets()); 1473 1474 for(i = 1; i < vps->getNumLayerSets(); i++) 1475 { 1476 vps->setOutputLayerSetIdx(i, i); 1477 } 1478 } 1479 else 1480 { 1481 vps->setNumOutputLayerSets( m_numOutputLayerSets ); 1482 for( Int olsCtr = 0; olsCtr < vps->getNumLayerSets(); olsCtr ++ ) // Default output layer sets 1483 { 1484 vps->setOutputLayerSetIdx(olsCtr, olsCtr); 1485 } 1486 for( Int olsCtr = vps->getNumLayerSets(); olsCtr < vps->getNumOutputLayerSets(); olsCtr ++ ) // Non-default output layer sets 1487 { 1488 vps->setOutputLayerSetIdx(olsCtr, m_outputLayerSetIdx[olsCtr - vps->getNumLayerSets()]); 1489 } 1490 } 1491 #endif 1319 1492 // Target output layer 1493 #if LIST_OF_PTL 1494 vps->setNumProfileTierLevel( vps->getPTLForExtnPtr()->size() ); // +1 for the base VPS PTL() 1495 #else 1320 1496 vps->setNumOutputLayerSets(vps->getNumLayerSets()); 1321 1497 vps->setNumProfileTierLevel(vps->getNumLayerSets()); 1498 #endif 1499 #if !OUTPUT_LAYER_SETS_CONFIG // Taken care by configuration file parameter 1322 1500 #if P0295_DEFAULT_OUT_LAYER_IDC 1323 1501 vps->setDefaultTargetOutputLayerIdc(1); … … 1329 1507 #endif 1330 1508 #endif 1509 #endif 1510 #if !PER_LAYER_PTL 1331 1511 for(i = 1; i < vps->getNumLayerSets(); i++) 1332 1512 { 1333 1513 vps->setProfileLevelTierIdx(i, i); 1514 #if !OUTPUT_LAYER_SETS_CONFIG 1334 1515 vps->setOutputLayerSetIdx(i, i); 1516 #endif 1335 1517 } 1518 #endif 1336 1519 #endif 1337 1520 #if VPS_DPB_SIZE_TABLE … … 1347 1530 1348 1531 // derive OutputLayerFlag[i][j] 1532 #if !OUTPUT_LAYER_SETS_CONFIG 1349 1533 if( vps->getDefaultTargetOutputLayerIdc() == 1 ) 1534 #endif 1350 1535 { 1351 1536 // default_output_layer_idc equal to 1 specifies that only the layer with the highest value of nuh_layer_id such that nuh_layer_id equal to nuhLayerIdA and … … 1360 1545 if( vps->getLayerIdIncludedFlag(lsIdx, layer) ) 1361 1546 #endif 1362 { 1547 { 1548 #if OUTPUT_LAYER_SETS_CONFIG 1549 switch(vps->getDefaultTargetOutputLayerIdc()) 1550 { 1551 case 0: vps->setOutputLayerFlag( lsIdx, layer, 1 ); 1552 break; 1553 case 1: vps->setOutputLayerFlag( lsIdx, layer, layer == vps->getNumLayersInIdList(lsIdx) - 1 ); 1554 break; 1555 case 2: 1556 case 3: vps->setOutputLayerFlag( lsIdx, layer, std::find( m_listOfOutputLayers[lsIdx].begin(), m_listOfOutputLayers[lsIdx].end(), layer) != m_listOfOutputLayers[lsIdx].end() ); 1557 break; 1558 } 1559 #else 1363 1560 vps->setOutputLayerFlag( lsIdx, layer, layer == vps->getNumLayersInIdList(lsIdx) - 1 ); 1561 #endif 1364 1562 } 1365 1563 } 1366 1564 } 1367 } 1565 #if OUTPUT_LAYER_SETS_CONFIG 1566 for( Int olsIdx = vps->getNumLayerSets(); olsIdx < vps->getNumOutputLayerSets(); olsIdx++ ) 1567 { 1568 for( UInt layer = 0; layer < vps->getNumLayersInIdList(vps->getOutputLayerSetIdx(olsIdx)); layer++ ) 1569 { 1570 vps->setOutputLayerFlag( olsIdx, layer, std::find( m_listOfOutputLayers[olsIdx].begin(), m_listOfOutputLayers[olsIdx].end(), layer) != m_listOfOutputLayers[olsIdx].end()); 1571 } 1572 } 1573 #endif 1574 } 1575 #if !OUTPUT_LAYER_SETS_CONFIG 1368 1576 else 1369 1577 { … … 1371 1579 assert(!"default_output_layer_idc not equal to 1 is not yet supported"); 1372 1580 } 1373 1581 #endif 1582 #if NECESSARY_LAYER_FLAG 1583 vps->deriveNecessaryLayerFlag(); 1584 vps->checkNecessaryLayerFlagCondition(); 1585 #endif 1586 #if PER_LAYER_PTL 1587 vps->getProfileLevelTierIdx()->resize(vps->getNumOutputLayerSets()); 1588 vps->getProfileLevelTierIdx(0)->push_back( vps->getBaseLayerInternalFlag() && vps->getMaxLayers() > 1 ? 1 : 0 ); // Default 0-th output layer set 1589 for(i = 1; i < vps->getNumOutputLayerSets(); i++) 1590 { 1591 Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx( i ); 1592 Int numLayerInLayerSet = vps->getNumLayersInIdList( layerSetIdxForOutputLayerSet ); 1593 for(Int j = 0; j < numLayerInLayerSet; j++) 1594 { 1595 Int layerIdxInVps = vps->getLayerIdInVps( vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, j) ); 1596 if( vps->getNecessaryLayerFlag(i, j) ) 1597 { 1598 vps->getProfileLevelTierIdx(i)->push_back( vps->getBaseLayerInternalFlag() && vps->getMaxLayers() > 1 ? layerIdxInVps + 1 : layerIdxInVps); 1599 } 1600 else 1601 { 1602 vps->getProfileLevelTierIdx(i)->push_back( -1 ); 1603 } 1604 } 1605 } 1606 #endif 1607 #if SUB_LAYERS_IN_LAYER_SET 1608 vps->calculateMaxSLInLayerSets(); 1609 #endif 1374 1610 // Initialize dpb_size_table() for all ouput layer sets in the VPS extension 1375 1611 for(i = 1; i < vps->getNumOutputLayerSets(); i++) … … 1501 1737 #endif 1502 1738 1739 #if VPS_VUI_BSP_HRD_PARAMS 1740 vps->setVpsVuiBspHrdPresentFlag(false); 1741 TEncTop *pcCfg = &m_acTEncTop[0]; 1742 if( pcCfg->getBufferingPeriodSEIEnabled() ) 1743 { 1744 Int j; 1745 vps->setVpsVuiBspHrdPresentFlag(true); 1746 vps->setVpsNumAddHrdParams( vps->getMaxLayers() ); 1747 vps->createBspHrdParamBuffer(vps->getVpsNumAddHrdParams() + 1); 1748 for( i = vps->getNumHrdParameters(), j = 0; i < vps->getNumHrdParameters() + vps->getVpsNumAddHrdParams(); i++, j++ ) 1749 { 1750 vps->setCprmsAddPresentFlag( j, true ); 1751 vps->setNumSubLayerHrdMinus1( j, vps->getMaxTLayers() - 1 ); 1752 1753 UInt layerId = j; 1754 TEncTop *pcCfgLayer = &m_acTEncTop[layerId]; 1755 1756 Int iPicWidth = pcCfgLayer->getSourceWidth(); 1757 Int iPicHeight = pcCfgLayer->getSourceHeight(); 1758 #if LAYER_CTB 1759 UInt uiWidthInCU = ( iPicWidth % m_acLayerCfg[layerId].m_uiMaxCUWidth ) ? iPicWidth / m_acLayerCfg[layerId].m_uiMaxCUWidth + 1 : iPicWidth / m_acLayerCfg[layerId].m_uiMaxCUWidth; 1760 UInt uiHeightInCU = ( iPicHeight % m_acLayerCfg[layerId].m_uiMaxCUHeight ) ? iPicHeight / m_acLayerCfg[layerId].m_uiMaxCUHeight + 1 : iPicHeight / m_acLayerCfg[layerId].m_uiMaxCUHeight; 1761 UInt maxCU = pcCfgLayer->getSliceArgument() >> ( m_acLayerCfg[layerId].m_uiMaxCUDepth << 1); 1762 #else 1763 UInt uiWidthInCU = ( iPicWidth %m_uiMaxCUWidth ) ? iPicWidth /m_uiMaxCUWidth + 1 : iPicWidth /m_uiMaxCUWidth; 1764 UInt uiHeightInCU = ( iPicHeight%m_uiMaxCUHeight ) ? iPicHeight/m_uiMaxCUHeight + 1 : iPicHeight/m_uiMaxCUHeight; 1765 UInt maxCU = pcCfgLayer->getSliceArgument() >> ( m_uiMaxCUDepth << 1); 1766 #endif 1767 UInt uiNumCUsInFrame = uiWidthInCU * uiHeightInCU; 1768 1769 UInt numDU = ( pcCfgLayer->getSliceMode() == 1 ) ? ( uiNumCUsInFrame / maxCU ) : ( 0 ); 1770 if( uiNumCUsInFrame % maxCU != 0 || numDU == 0 ) 1771 { 1772 numDU ++; 1773 } 1774 vps->getBspHrd(i)->setNumDU( numDU ); 1775 vps->setBspHrdParameters( i, pcCfgLayer->getFrameRate(), numDU, pcCfgLayer->getTargetBitrate(), ( pcCfgLayer->getIntraPeriod() > 0 ) ); 1776 } 1777 1778 // Signalling of additional partitioning schemes 1779 for(Int h = 1; h < vps->getNumOutputLayerSets(); h++) 1780 { 1781 Int lsIdx = vps->getOutputLayerSetIdx( h ); 1782 vps->setNumSignalledPartitioningSchemes(h, 1); // Only the default per-layer partitioning scheme 1783 for( j = 1; j < vps->getNumSignalledPartitioningSchemes(h); j++ ) 1784 { 1785 // ToDo: Add code for additional partitioning schemes here 1786 // ToDo: Initialize num_partitions_in_scheme_minus1 and layer_included_in_partition_flag 1787 } 1788 1789 for( i = 0; i < vps->getNumSignalledPartitioningSchemes(h); i++ ) 1790 { 1791 if( i == 0 ) 1792 { 1793 for(Int t = 0; t <= vps->getMaxSLayersInLayerSetMinus1( lsIdx ); t++) 1794 { 1795 vps->setNumBspSchedulesMinus1( h, i, t, 0 ); 1796 for( j = 0; j <= vps->getNumBspSchedulesMinus1(h, i, t); j++ ) 1797 { 1798 for( Int k = 0; k <= vps->getNumPartitionsInSchemeMinus1(h, i); k++ ) 1799 { 1800 // Only for the default partition 1801 Int nuhlayerId = vps->getLayerSetLayerIdList( lsIdx, k); 1802 Int layerIdxInVps = vps->getLayerIdInVps( nuhlayerId ); 1803 vps->setBspHrdIdx(h, i, t, j, k, layerIdxInVps + vps->getNumHrdParameters()); 1804 1805 vps->setBspSchedIdx(h, i, t, j, k, 0); 1806 } 1807 } 1808 } 1809 } 1810 else 1811 { 1812 assert(0); // Need to add support for additional partitioning schemes. 1813 } 1814 } 1815 } 1816 } 1817 #else 1818 1503 1819 #if O0164_MULTI_LAYER_HRD 1504 1820 vps->setVpsVuiBspHrdPresentFlag(false); … … 1572 1888 } 1573 1889 } 1890 #endif 1574 1891 #endif 1575 1892 … … 1669 1986 } 1670 1987 1671 #if AVC_SYNTAX1672 fstream streamSyntaxFile;1673 if( m_acTEncTop[0].getVPS()->getAvcBaseLayerFlag() )1674 {1675 if( !m_BLSyntaxFile )1676 {1677 printf( "Wrong base layer syntax input file\n" );1678 exit(EXIT_FAILURE);1679 }1680 streamSyntaxFile.open( m_BLSyntaxFile, fstream::in | fstream::binary );1681 if( !streamSyntaxFile.good() )1682 {1683 printf( "Base layer syntax input reading error\n" );1684 exit(EXIT_FAILURE);1685 }1686 m_acTEncTop[0].setBLSyntaxFile( &streamSyntaxFile );1687 }1688 #endif1689 1690 1988 Bool bFirstFrame = true; 1691 1989 while ( !bEos ) … … 1816 2114 } 1817 2115 } 2116 #if R0247_SEI_ACTIVE 2117 if(bFirstFrame) 2118 { 2119 list<AccessUnit>::iterator first_au = outputAccessUnits.begin(); 2120 AccessUnit::iterator it_sps; 2121 for (it_sps = first_au->begin(); it_sps != first_au->end(); it_sps++) 2122 { 2123 if( (*it_sps)->m_nalUnitType == NAL_UNIT_SPS ) 2124 { 2125 break; 2126 } 2127 } 2128 2129 for (list<AccessUnit>::iterator it_au = ++outputAccessUnits.begin(); it_au != outputAccessUnits.end(); it_au++) 2130 { 2131 for (AccessUnit::iterator it_nalu = it_au->begin(); it_nalu != it_au->end(); it_nalu++) 2132 { 2133 if( (*it_nalu)->m_nalUnitType == NAL_UNIT_SPS ) 2134 { 2135 first_au->insert(++it_sps, *it_nalu); 2136 it_nalu = it_au->erase(it_nalu); 2137 } 2138 } 2139 } 2140 } 2141 2142 #endif 1818 2143 1819 2144 #if RC_SHVC_HARMONIZATION … … 1858 2183 1859 2184 AccessUnit& accessUnit = outputAccessUnits.back(); 2185 #if T_ID_EOB_BUG_FIX 2186 nalu.m_temporalId = 0; 2187 #else 1860 2188 nalu.m_temporalId = accessUnit.front()->m_temporalId; 2189 #endif 1861 2190 accessUnit.push_back(new NALUnitEBSP(nalu)); 1862 2191 } … … 1884 2213 m_acTEncTop[layer].deletePicBuffer(); 1885 2214 } 1886 1887 #if AVC_SYNTAX1888 if( streamSyntaxFile.is_open() )1889 {1890 streamSyntaxFile.close();1891 }1892 #endif1893 2215 1894 2216 // delete buffers & classes … … 2154 2476 { 2155 2477 #if REPN_FORMAT_IN_VPS 2156 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRecTop, pcPicYuvRecBottom, m_acLayerCfg[layer].getConf Left() * xScal, m_acLayerCfg[layer].getConfRight() * xScal,2157 m_acLayerCfg[layer].getConf Top() * yScal, m_acLayerCfg[layer].getConfBottom() * yScal, m_isTopFieldFirst );2158 #else 2159 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRecTop, pcPicYuvRecBottom, m_acLayerCfg[layer].getConf Left(), m_acLayerCfg[layer].getConfRight(), m_acLayerCfg[layer].getConfTop(), m_acLayerCfg[layer].getConfBottom(), m_isTopFieldFirst );2478 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRecTop, pcPicYuvRecBottom, m_acLayerCfg[layer].getConfWinLeft() * xScal, m_acLayerCfg[layer].getConfWinRight() * xScal, 2479 m_acLayerCfg[layer].getConfWinTop() * yScal, m_acLayerCfg[layer].getConfWinBottom() * yScal, m_isTopFieldFirst ); 2480 #else 2481 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRecTop, pcPicYuvRecBottom, m_acLayerCfg[layer].getConfWinLeft(), m_acLayerCfg[layer].getConfWinRight(), m_acLayerCfg[layer].getConfWinTop(), m_acLayerCfg[layer].getConfWinBottom(), m_isTopFieldFirst ); 2160 2482 #endif 2161 2483 } … … 2183 2505 { 2184 2506 #if REPN_FORMAT_IN_VPS 2185 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConf Left() * xScal, m_acLayerCfg[layer].getConfRight() * xScal,2186 m_acLayerCfg[layer].getConf Top() * yScal, m_acLayerCfg[layer].getConfBottom() * yScal );2187 #else 2188 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConf Left(), m_acLayerCfg[layer].getConfRight(),2189 m_acLayerCfg[layer].getConf Top(), m_acLayerCfg[layer].getConfBottom() );2507 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConfWinLeft() * xScal, m_acLayerCfg[layer].getConfWinRight() * xScal, 2508 m_acLayerCfg[layer].getConfWinTop() * yScal, m_acLayerCfg[layer].getConfWinBottom() * yScal ); 2509 #else 2510 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConfWinLeft(), m_acLayerCfg[layer].getConfWinRight(), 2511 m_acLayerCfg[layer].getConfWinTop(), m_acLayerCfg[layer].getConfWinBottom() ); 2190 2512 #endif 2191 2513 } … … 2295 2617 if (m_pchReconFile) 2296 2618 { 2297 m_cTVideoIOYuvReconFile.write( pcPicYuvRecTop, pcPicYuvRecBottom, m_conf Left, m_confRight, m_confTop, m_confBottom, m_isTopFieldFirst );2619 m_cTVideoIOYuvReconFile.write( pcPicYuvRecTop, pcPicYuvRecBottom, m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom, m_isTopFieldFirst ); 2298 2620 } 2299 2621 … … 2310 2632 { 2311 2633 Int i; 2312 2313 2634 TComList<TComPicYuv*>::iterator iterPicYuvRec = m_cListPicYuvRec.end(); 2314 2635 list<AccessUnit>::const_iterator iterBitstream = accessUnits.begin(); … … 2324 2645 if (m_pchReconFile) 2325 2646 { 2326 #if SYNTAX_OUTPUT 2327 m_cTVideoIOYuvReconFile.write( pcPicYuvRec, m_confLeft, m_confRight, m_confTop, m_confBottom ); 2328 #endif 2647 m_cTVideoIOYuvReconFile.write( pcPicYuvRec, m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom ); 2329 2648 } 2330 2649
Note: See TracChangeset for help on using the changeset viewer.