Changeset 906 in SHVCSoftware for trunk/source/App/TAppDecoder
- Timestamp:
- 15 Oct 2014, 07:25:10 (10 years ago)
- Location:
- trunk
- Files:
-
- 6 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) );
Note: See TracChangeset for help on using the changeset viewer.