Changeset 916 in SHVCSoftware for branches/SHM-upgrade/source/App/TAppDecoder
- Timestamp:
- 12 Nov 2014, 08:09:17 (10 years ago)
- Location:
- branches/SHM-upgrade/source/App/TAppDecoder
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-upgrade/source/App/TAppDecoder/TAppDecCfg.cpp
r856 r916 41 41 #include "TAppDecCfg.h" 42 42 #include "TAppCommon/program_options_lite.h" 43 #include "TLibCommon/TComChromaFormat.h" 43 44 #if SVC_EXTENSION 44 45 #include <cassert> … … 80 81 81 82 string cfg_TargetDecLayerIdSetFile; 83 string outputColourSpaceConvert; 82 84 83 85 po::Options opts; 84 86 opts.addOptions() 85 ("help", do_help, false, "this help text") 86 ("BitstreamFile,b", cfg_BitstreamFile, string(""), "bitstream input file name") 87 88 89 ("help", do_help, false, "this help text") 90 ("BitstreamFile,b", cfg_BitstreamFile, string(""), "bitstream input file name") 87 91 #if SVC_EXTENSION 88 92 ("ReconFileL%d,-o%d", cfg_ReconFile, string(""), MAX_LAYERS, "Layer %d reconstructed YUV output file name\n" … … 95 99 #endif 96 100 #endif 97 #else98 ("ReconFile,o", cfg_ReconFile, string(""), "reconstructed YUV output file name\n"99 "YUV writing is skipped if omitted")100 #endif101 ("SkipFrames,s", m_iSkipFrame, 0, "number of frames to skip before random access")102 ("OutputBitDepth,d", m_outputBitDepthY, 0, "bit depth of YUV output luma component (default: use 0 for native depth)")103 ("OutputBitDepthC,d", m_outputBitDepthC, 0, "bit depth of YUV output chroma component (default: use 0 for native depth)")104 #if SVC_EXTENSION105 101 ("LayerNum,-ls", nLayerNum, 1, "Number of layers to be decoded.") 106 102 #if OUTPUT_LAYER_SET_INDEX 107 103 ("OutpuLayerSetIdx,-olsidx", olsIdx, -1, "Index of output layer set to be decoded.") 108 104 #endif 109 #endif 110 ("MaxTemporalLayer,t", m_iMaxTemporalLayer, -1, "Maximum Temporal Layer to be decoded. -1 to decode all layers") 111 ("SEIDecodedPictureHash", m_decodedPictureHashSEIEnabled, 1, "Control handling of decoded picture hash SEI messages\n" 112 "\t1: check hash in SEI messages if available in the bitstream\n" 113 "\t0: ignore SEI message") 114 ("SEIpictureDigest", m_decodedPictureHashSEIEnabled, 1, "deprecated alias for SEIDecodedPictureHash") 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.") 116 ("RespectDefDispWindow,w", m_respectDefDispWindow, 0, "Only output content inside the default display window\n") 105 #else 106 ("ReconFile,o", cfg_ReconFile, string(""), "reconstructed YUV output file name\n" 107 "YUV writing is skipped if omitted") 108 #endif 109 110 ("SkipFrames,s", m_iSkipFrame, 0, "number of frames to skip before random access") 111 ("OutputBitDepth,d", m_outputBitDepth[CHANNEL_TYPE_LUMA], 0, "bit depth of YUV output luma component (default: use 0 for native depth)") 112 ("OutputBitDepthC,d", m_outputBitDepth[CHANNEL_TYPE_CHROMA], 0, "bit depth of YUV output chroma component (default: use 0 for native depth)") 113 ("OutputColourSpaceConvert", outputColourSpaceConvert, string(""), "Colour space conversion to apply to input 444 video. Permitted values are (empty string=UNCHANGED) " + getListOfColourSpaceConverts(false)) 114 ("MaxTemporalLayer,t", m_iMaxTemporalLayer, -1, "Maximum Temporal Layer to be decoded. -1 to decode all layers") 115 ("SEIDecodedPictureHash", m_decodedPictureHashSEIEnabled, 1, "Control handling of decoded picture hash SEI messages\n" 116 "\t1: check hash in SEI messages if available in the bitstream\n" 117 "\t0: ignore SEI message") 118 ("SEIpictureDigest", m_decodedPictureHashSEIEnabled, 1, "deprecated alias for SEIDecodedPictureHash") 119 ("SEINoDisplay", m_decodedNoDisplaySEIEnabled, true, "Control handling of decoded no display SEI messages") 120 ("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.") 121 ("RespectDefDispWindow,w", m_respectDefDispWindow, 0, "Only output content inside the default display window\n") 122 #if O0043_BEST_EFFORT_DECODING 123 ("ForceDecodeBitDepth", m_forceDecodeBitDepth, 0U, "Force the decoder to operate at a particular bit-depth (best effort decoding)") 124 #endif 117 125 #if Q0074_COLOUR_REMAPPING_SEI 118 126 ("SEIColourRemappingInfo", m_colourRemapSEIEnabled, false, "Control handling of Colour Remapping Information SEI messages\n" … … 121 129 #endif 122 130 ; 131 123 132 po::setDefaults(opts); 124 133 const list<const Char*>& argv_unhandled = po::scanArgv(opts, argc, (const Char**) argv); … … 132 141 { 133 142 po::doHelp(cout, opts); 143 return false; 144 } 145 146 m_outputColourSpaceConvert = stringToInputColourSpaceConvert(outputColourSpaceConvert, false); 147 if (m_outputColourSpaceConvert>=NUMBER_INPUT_COLOUR_SPACE_CONVERSIONS) 148 { 149 fprintf(stderr, "Bad output colour space conversion string\n"); 134 150 return false; 135 151 } … … 161 177 if (!m_pchBitstreamFile) 162 178 { 163 fprintf(stderr, "No input file specif ed, aborting\n");179 fprintf(stderr, "No input file specified, aborting\n"); 164 180 return false; 165 181 } … … 189 205 if ( layerIdParsed < 0 || layerIdParsed >= MAX_NUM_LAYER_IDS ) 190 206 { 191 fprintf(stderr, "Warning! Parsed LayerId %d is not within gallowed range [0,%d]. Ignoring this value.\n", layerIdParsed, MAX_NUM_LAYER_IDS-1 );207 fprintf(stderr, "Warning! Parsed LayerId %d is not within allowed range [0,%d]. Ignoring this value.\n", layerIdParsed, MAX_NUM_LAYER_IDS-1 ); 192 208 } 193 209 else -
branches/SHM-upgrade/source/App/TAppDecoder/TAppDecCfg.h
r856 r916 57 57 { 58 58 protected: 59 Char* m_pchBitstreamFile; ///< input bitstream file name59 Char* m_pchBitstreamFile; ///< input bitstream file name 60 60 #if SVC_EXTENSION 61 61 Char* m_pchReconFile [MAX_LAYERS]; ///< output reconstruction file name 62 62 #else 63 Char* m_pchReconFile; ///< output reconstruction file name63 Char* m_pchReconFile; ///< output reconstruction file name 64 64 #endif 65 Int m_iSkipFrame; ///< counter for frames prior to the random access point to skip66 Int m_outputBitDepth Y; ///< bit depth used for writing output (luma)67 In t m_outputBitDepthC; ///< bit depth used for writing output (chroma)t65 Int m_iSkipFrame; ///< counter for frames prior to the random access point to skip 66 Int m_outputBitDepth[MAX_NUM_CHANNEL_TYPE]; ///< bit depth used for writing output 67 InputColourSpaceConversion m_outputColourSpaceConvert; 68 68 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 Bool m_decodedNoDisplaySEIEnabled; ///< Enable(true)/disable(false) writing only pictures that get displayed based on the no display SEI message 71 72 #if Q0074_COLOUR_REMAPPING_SEI 72 73 Bool m_colourRemapSEIEnabled; ///< Enable the Colour Remapping Information SEI message if available (remapping decoded pictures) … … 85 86 86 87 std::vector<Int> m_targetDecLayerIdSet; ///< set of LayerIds to be included in the sub-bitstream extraction process. 87 Int m_respectDefDispWindow; ///< Only output content inside the default display window 88 Int m_respectDefDispWindow; ///< Only output content inside the default display window 89 #if O0043_BEST_EFFORT_DECODING 90 UInt m_forceDecodeBitDepth; ///< if non-zero, force the bit depth at the decoder (best effort decoding) 91 #endif 92 std::string m_outputDecodedSEIMessagesFilename; ///< filename to output decoded SEI messages to. If '-', then use stdout. If empty, do not output details. 88 93 #if OUTPUT_LAYER_SET_INDEX 89 94 CommonDecoderParams m_commonDecoderParams; … … 94 99 : m_pchBitstreamFile(NULL) 95 100 #if !SVC_EXTENSION 96 , m_pchReconFile(NULL) 101 , m_pchReconFile(NULL) 97 102 #endif 98 103 , m_iSkipFrame(0) 99 , m_outputBitDepthY(0) 100 , m_outputBitDepthC(0) 104 , m_outputColourSpaceConvert(IPCOLOURSPACE_UNCHANGED) 101 105 , m_iMaxTemporalLayer(-1) 102 106 , m_decodedPictureHashSEIEnabled(0) 107 , m_decodedNoDisplaySEIEnabled(false) 103 108 #if Q0074_COLOUR_REMAPPING_SEI 104 109 , m_colourRemapSEIEnabled(0) … … 112 117 #endif 113 118 , m_respectDefDispWindow(0) 114 {} 119 #if O0043_BEST_EFFORT_DECODING 120 , m_forceDecodeBitDepth(0) 121 #endif 122 { 123 for (UInt channelTypeIndex = 0; channelTypeIndex < MAX_NUM_CHANNEL_TYPE; channelTypeIndex++) 124 m_outputBitDepth[channelTypeIndex] = 0; 125 } 126 115 127 virtual ~TAppDecCfg() {} 116 128 117 129 Bool parseCfg ( Int argc, Char* argv[] ); ///< initialize option class from configuration 118 130 #if OUTPUT_LAYER_SET_INDEX -
branches/SHM-upgrade/source/App/TAppDecoder/TAppDecTop.cpp
r874 r916 41 41 #include <fcntl.h> 42 42 #include <assert.h> 43 #include <iostream> 43 44 44 #include "TAppDecTop.h" 45 45 #include "TLibDecoder/AnnexBread.h" 46 46 #include "TLibDecoder/NALread.h" 47 #if RExt__DECODER_DEBUG_BIT_STATISTICS 48 #include "TLibCommon/TComCodingStatistics.h" 49 #endif 50 47 51 //! \ingroup TAppDecoder 48 52 //! \{ … … 131 135 InputByteStream bytestream(bitstreamFile); 132 136 137 if (!m_outputDecodedSEIMessagesFilename.empty() && m_outputDecodedSEIMessagesFilename!="-") 138 { 139 m_seiMessageFileStream.open(m_outputDecodedSEIMessagesFilename.c_str(), std::ios::out); 140 if (!m_seiMessageFileStream.is_open() || !m_seiMessageFileStream.good()) 141 { 142 fprintf(stderr, "\nUnable to open file `%s' for writing decoded SEI messages\n", m_outputDecodedSEIMessagesFilename.c_str()); 143 exit(EXIT_FAILURE); 144 } 145 } 146 133 147 // create & initialize internal classes 134 148 xCreateDecLib(); 135 xInitDecLib (); 149 xInitDecLib (); 136 150 137 151 // main decoder loop … … 167 181 * requires the TDecTop::decode() method to be called again with the same 168 182 * nal unit. */ 183 #if RExt__DECODER_DEBUG_BIT_STATISTICS 184 TComCodingStatistics::TComCodingStatisticsData backupStats(TComCodingStatistics::GetStatistics()); 185 streampos location = bitstreamFile.tellg() - streampos(bytestream.GetNumBufferedBytes()); 186 #else 169 187 streampos location = bitstreamFile.tellg(); 188 #endif 170 189 AnnexBStats stats = AnnexBStats(); 171 190 … … 173 192 InputNALUnit nalu; 174 193 byteStreamNALUnit(bytestream, nalUnit, stats); 194 175 195 // call actual decoding function 176 196 Bool bNewPicture = false; 177 197 Bool bNewPOC = false; 198 178 199 if (nalUnit.empty()) 179 200 { … … 207 228 * [1] except for the first NAL unit in the file 208 229 * (but bNewPicture doesn't happen then) */ 230 #if RExt__DECODER_DEBUG_BIT_STATISTICS 231 bitstreamFile.seekg(location); 232 bytestream.reset(); 233 TComCodingStatistics::SetStatistics(backupStats); 234 #else 209 235 bitstreamFile.seekg(location-streamoff(3)); 210 236 bytestream.reset(); 237 #endif 211 238 } 212 239 #if POC_RESET_IDC_DECODER … … 218 245 bitstreamFile.seekg(location); 219 246 bytestream.reset(); 247 #if RExt__DECODER_DEBUG_BIT_STATISTICS 248 TComCodingStatistics::SetStatistics(backupStats); 249 #endif 220 250 } 221 251 #endif … … 224 254 225 255 #if POC_RESET_IDC_DECODER 226 if ((bNewPicture && m_acTDecTop[nalu.m_layerId].getParseIdc() == 3) || (m_acTDecTop[nalu.m_layerId].getParseIdc() == 0) || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS) 227 #else 228 if (bNewPicture || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS) 256 if ( (bNewPicture && m_acTDecTop[nalu.m_layerId].getParseIdc() == 3) || (m_acTDecTop[nalu.m_layerId].getParseIdc() == 0) || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS && 257 !m_acTDecTop[nalu.m_layerId].getFirstSliceInSequence() ) 258 #else 259 if (bNewPicture || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS && 260 !m_acTDecTop[nalu.m_layerId].getFirstSliceInSequence() ) 229 261 #endif 230 262 { 231 263 #if O0194_DIFFERENT_BITDEPTH_EL_BL 232 264 //Bug fix: The bit depth was not set correctly for each layer when doing DBF 233 g_bitDepth Y = g_bitDepthYLayer[curLayerId];234 g_bitDepth C = g_bitDepthCLayer[curLayerId];265 g_bitDepth[CHANNEL_TYPE_LUMA] = g_bitDepthLayer[CHANNEL_TYPE_LUMA][curLayerId]; 266 g_bitDepth[CHANNEL_TYPE_CHROMA] = g_bitDepthLayer[CHANNEL_TYPE_CHROMA][curLayerId]; 235 267 #endif 236 268 if (!loopFiltered[curLayerId] || bitstreamFile) … … 242 274 m_acTDecTop[curLayerId].earlyPicMarking(m_iMaxTemporalLayer, m_targetDecLayerIdSet); 243 275 #endif 276 if (nalu.m_nalUnitType == NAL_UNIT_EOS) 277 { 278 m_acTDecTop[nalu.m_layerId].setFirstSliceInSequence(true); 279 } 280 } 281 else if ( (bNewPicture || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS ) && 282 m_acTDecTop[nalu.m_layerId].getFirstSliceInSequence () ) 283 { 284 m_acTDecTop[nalu.m_layerId].setFirstSliceInPicture (true); 244 285 } 245 286 … … 255 296 if ( m_pchReconFile[curLayerId] && !openedReconFile[curLayerId] ) 256 297 { 257 if (!m_outputBitDepthY) { m_outputBitDepthY = g_bitDepthY; } 258 if (!m_outputBitDepthC) { m_outputBitDepthC = g_bitDepthC; } 259 260 m_acTVideoIOYuvReconFile[curLayerId].open( m_pchReconFile[curLayerId], true, m_outputBitDepthY, m_outputBitDepthC, g_bitDepthY, g_bitDepthC ); // write mode 298 for (UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++) 299 { 300 if (m_outputBitDepth[channelType] == 0) m_outputBitDepth[channelType] = g_bitDepth[channelType]; 301 } 302 m_acTVideoIOYuvReconFile[curLayerId].open( m_pchReconFile[curLayerId], true, m_outputBitDepth, m_outputBitDepth, g_bitDepth ); // write mode 261 303 262 304 openedReconFile[curLayerId] = true; … … 373 415 InputByteStream bytestream(bitstreamFile); 374 416 417 if (!m_outputDecodedSEIMessagesFilename.empty() && m_outputDecodedSEIMessagesFilename!="-") 418 { 419 m_seiMessageFileStream.open(m_outputDecodedSEIMessagesFilename.c_str(), std::ios::out); 420 if (!m_seiMessageFileStream.is_open() || !m_seiMessageFileStream.good()) 421 { 422 fprintf(stderr, "\nUnable to open file `%s' for writing decoded SEI messages\n", m_outputDecodedSEIMessagesFilename.c_str()); 423 exit(EXIT_FAILURE); 424 } 425 } 426 375 427 // create & initialize internal classes 376 428 xCreateDecLib(); … … 388 440 * requires the TDecTop::decode() method to be called again with the same 389 441 * nal unit. */ 442 #if RExt__DECODER_DEBUG_BIT_STATISTICS 443 TComCodingStatistics::TComCodingStatisticsData backupStats(TComCodingStatistics::GetStatistics()); 444 streampos location = bitstreamFile.tellg() - streampos(bytestream.GetNumBufferedBytes()); 445 #else 390 446 streampos location = bitstreamFile.tellg(); 447 #endif 391 448 AnnexBStats stats = AnnexBStats(); 392 449 … … 411 468 if( (m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) || !isNaluWithinTargetDecLayerIdSet(&nalu) ) 412 469 { 413 414 470 bNewPicture = false; 471 } 415 472 else 416 473 { … … 423 480 * [1] except for the first NAL unit in the file 424 481 * (but bNewPicture doesn't happen then) */ 482 #if RExt__DECODER_DEBUG_BIT_STATISTICS 483 bitstreamFile.seekg(location); 484 bytestream.reset(); 485 TComCodingStatistics::SetStatistics(backupStats); 486 #else 425 487 bitstreamFile.seekg(location-streamoff(3)); 426 488 bytestream.reset(); 427 } 428 } 429 } 430 if (bNewPicture || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS) 489 #endif 490 } 491 } 492 } 493 494 if ( (bNewPicture || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS) && 495 !m_cTDecTop.getFirstSliceInSequence () ) 431 496 { 432 497 if (!loopFiltered || bitstreamFile) … … 435 500 } 436 501 loopFiltered = (nalu.m_nalUnitType == NAL_UNIT_EOS); 437 } 438 #if !FIX_WRITING_OUTPUT 439 #if SETTING_NO_OUT_PIC_PRIOR 440 if (bNewPicture && m_cTDecTop.getNoOutputPriorPicsFlag()) 441 { 442 m_cTDecTop.checkNoOutputPriorPics( pcListPic ); 443 } 444 #endif 445 #endif 502 if (nalu.m_nalUnitType == NAL_UNIT_EOS) 503 { 504 m_cTDecTop.setFirstSliceInSequence(true); 505 } 506 } 507 else if ( (bNewPicture || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS ) && 508 m_cTDecTop.getFirstSliceInSequence () ) 509 { 510 m_cTDecTop.setFirstSliceInPicture (true); 511 } 446 512 447 513 if( pcListPic ) … … 449 515 if ( m_pchReconFile && !openedReconFile ) 450 516 { 451 if (!m_outputBitDepthY) { m_outputBitDepthY = g_bitDepthY; } 452 if (!m_outputBitDepthC) { m_outputBitDepthC = g_bitDepthC; } 453 454 m_cTVideoIOYuvReconFile.open( m_pchReconFile, true, m_outputBitDepthY, m_outputBitDepthC, g_bitDepthY, g_bitDepthC ); // write mode 517 for (UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++) 518 { 519 if (m_outputBitDepth[channelType] == 0) m_outputBitDepth[channelType] = g_bitDepth[channelType]; 520 } 521 522 m_cTVideoIOYuvReconFile.open( m_pchReconFile, true, m_outputBitDepth, m_outputBitDepth, g_bitDepth ); // write mode 455 523 openedReconFile = true; 456 524 } 457 #if FIX_WRITING_OUTPUT458 525 // write reconstruction to file 459 526 if( bNewPicture ) … … 461 528 xWriteOutput( pcListPic, nalu.m_temporalId ); 462 529 } 463 #if SETTING_NO_OUT_PIC_PRIOR464 530 if ( (bNewPicture || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA) && m_cTDecTop.getNoOutputPriorPicsFlag() ) 465 531 { … … 467 533 m_cTDecTop.setNoOutputPriorPicsFlag (false); 468 534 } 469 #endif470 #endif471 535 if ( bNewPicture && 472 536 ( nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL … … 480 544 if (nalu.m_nalUnitType == NAL_UNIT_EOS) 481 545 { 482 #if FIX_OUTPUT_EOS483 546 xWriteOutput( pcListPic, nalu.m_temporalId ); 484 #else 485 xFlushOutput( pcListPic ); 486 #endif 547 m_cTDecTop.setFirstSliceInPicture (false); 487 548 } 488 549 // write reconstruction to file -- for additional bumping as defined in C.5.2.3 489 #if FIX_WRITING_OUTPUT490 550 if(!bNewPicture && nalu.m_nalUnitType >= NAL_UNIT_CODED_SLICE_TRAIL_N && nalu.m_nalUnitType <= NAL_UNIT_RESERVED_VCL31) 491 #else492 if(bNewPicture)493 #endif494 551 { 495 552 xWriteOutput( pcListPic, nalu.m_temporalId ); … … 579 636 m_cTDecTop.init(); 580 637 m_cTDecTop.setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled); 638 #if O0043_BEST_EFFORT_DECODING 639 m_cTDecTop.setForceDecodeBitDepth(m_forceDecodeBitDepth); 640 #endif 641 if (!m_outputDecodedSEIMessagesFilename.empty()) 642 { 643 std::ostream &os=m_seiMessageFileStream.is_open() ? m_seiMessageFileStream : std::cout; 644 m_cTDecTop.setDecodedSEIMessageOutputStream(&os); 645 } 581 646 #if Q0074_COLOUR_REMAPPING_SEI 582 647 m_cTDecTop.setColourRemappingInfoSEIEnabled(m_colourRemapSEIEnabled); … … 631 696 #endif 632 697 { 633 numPicsNotYetDisplayed++;698 numPicsNotYetDisplayed++; 634 699 dpbFullness++; 635 700 } … … 640 705 iterPic++; 641 706 } 642 iterPic = pcListPic->begin(); 707 708 iterPic = pcListPic->begin(); 709 643 710 if (numPicsNotYetDisplayed>2) 644 711 { … … 678 745 const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window(); 679 746 const Bool isTff = pcPicTop->isTopField(); 680 TComPicYuv* pPicCYuvRecTop = pcPicTop->getPicYuvRec(); 681 TComPicYuv* pPicCYuvRecBot = pcPicBottom->getPicYuvRec(); 747 748 Bool display = true; 749 if( m_decodedNoDisplaySEIEnabled ) 750 { 751 SEIMessages noDisplay = getSeisByType(pcPic->getSEIs(), SEI::NO_DISPLAY ); 752 const SEINoDisplay *nd = ( noDisplay.size() > 0 ) ? (SEINoDisplay*) *(noDisplay.begin()) : NULL; 753 if( (nd != NULL) && nd->m_noDisplay ) 754 { 755 display = false; 756 } 757 } 758 759 if (display) 760 { 682 761 #if REPN_FORMAT_IN_VPS 683 UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc(); 684 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 685 686 m_acTVideoIOYuvReconFile[layerId].write( pPicCYuvRecTop, pPicCYuvRecBot, 687 conf.getWindowLeftOffset() * xScal + defDisp.getWindowLeftOffset(), 688 conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(), 689 conf.getWindowTopOffset() * yScal + defDisp.getWindowTopOffset(), 690 conf.getWindowBottomOffset()* yScal + defDisp.getWindowBottomOffset(), isTff ); 691 #else 692 m_acTVideoIOYuvReconFile[layerId].write( pPicCYuvRecTop, pPicCYuvRecBot, 693 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 694 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 695 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 696 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), isTff ); 697 #endif 762 UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc(); 763 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 764 765 m_acTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 766 m_outputColourSpaceConvert, 767 conf.getWindowLeftOffset() * xScal + defDisp.getWindowLeftOffset(), 768 conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(), 769 conf.getWindowTopOffset() * yScal + defDisp.getWindowTopOffset(), 770 conf.getWindowBottomOffset()* yScal + defDisp.getWindowBottomOffset(), NUM_CHROMA_FORMAT, isTff ); 771 #else 772 m_acTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 773 m_outputColourSpaceConvert, 774 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 775 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 776 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 777 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), NUM_CHROMA_FORMAT, isTff ); 778 #endif 779 } 698 780 } 699 781 … … 706 788 const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window(); 707 789 const Bool isTff = pcPicTop->isTopField(); 708 TComPicYuv* pPicCYuvRecTop = pcPicTop->getPicYuvRec(); 709 TComPicYuv* pPicCYuvRecBot = pcPicBottom->getPicYuvRec(); 710 m_cTVideoIOYuvReconFile.write( pPicCYuvRecTop, pPicCYuvRecBot, 711 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 712 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 713 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 714 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), isTff ); 790 791 Bool display = true; 792 if( m_decodedNoDisplaySEIEnabled ) 793 { 794 SEIMessages noDisplay = getSeisByType(pcPic->getSEIs(), SEI::NO_DISPLAY ); 795 const SEINoDisplay *nd = ( noDisplay.size() > 0 ) ? (SEINoDisplay*) *(noDisplay.begin()) : NULL; 796 if( (nd != NULL) && nd->m_noDisplay ) 797 { 798 display = false; 799 } 800 } 801 802 if (display) 803 { 804 m_cTVideoIOYuvReconFile.write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 805 m_outputColourSpaceConvert, 806 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 807 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 808 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 809 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), NUM_CHROMA_FORMAT, isTff ); 810 } 715 811 } 716 812 … … 758 854 { 759 855 iterPic = pcListPic->begin(); 856 760 857 while (iterPic != pcListPic->end()) 761 858 { … … 771 868 { 772 869 // write to file 773 numPicsNotYetDisplayed--;870 numPicsNotYetDisplayed--; 774 871 if(pcPic->getSlice(0)->isReferenced() == false) 775 872 { … … 780 877 { 781 878 const Window &conf = pcPic->getConformanceWindow(); 782 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 783 TComPicYuv* pPicCYuvRec = pcPic->getPicYuvRec(); 879 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 784 880 #if REPN_FORMAT_IN_VPS 785 881 UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc(); 786 882 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 787 883 788 m_acTVideoIOYuvReconFile[layerId].write( p PicCYuvRec,884 m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(), m_outputColourSpaceConvert, 789 885 conf.getWindowLeftOffset() * xScal + defDisp.getWindowLeftOffset(), 790 886 conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(), … … 792 888 conf.getWindowBottomOffset()* yScal + defDisp.getWindowBottomOffset() ); 793 889 #else 794 m_acTVideoIOYuvReconFile[layerId].write( p PicCYuvRec,890 m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(), m_outputColourSpaceConvert, 795 891 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 796 892 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), … … 805 901 if ( m_pchReconFile ) 806 902 { 807 const Window &conf = pcPic->getConformanceWindow();903 const Window &conf = pcPic->getConformanceWindow(); 808 904 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 905 809 906 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() ); 907 m_outputColourSpaceConvert, 908 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 909 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 910 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 911 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 814 912 } 815 913 … … 879 977 const Window &conf = pcPicTop->getConformanceWindow(); 880 978 const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window(); 881 const Bool isTff = pcPicTop->isTopField(); 882 TComPicYuv* pPicCYuvRecTop = pcPicTop->getPicYuvRec(); 883 TComPicYuv* pPicCYuvRecBot = pcPicBottom->getPicYuvRec(); 979 const Bool isTff = pcPicTop->isTopField(); 884 980 #if REPN_FORMAT_IN_VPS 885 981 UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc(); 886 982 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 887 983 888 m_acTVideoIOYuvReconFile[layerId].write( p PicCYuvRecTop, pPicCYuvRecBot,984 m_acTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), m_outputColourSpaceConvert, 889 985 conf.getWindowLeftOffset() *xScal + defDisp.getWindowLeftOffset(), 890 986 conf.getWindowRightOffset() *xScal + defDisp.getWindowRightOffset(), 891 987 conf.getWindowTopOffset() *yScal + defDisp.getWindowTopOffset(), 892 conf.getWindowBottomOffset()*yScal + defDisp.getWindowBottomOffset(), isTff );893 #else 894 m_acTVideoIOYuvReconFile[layerId].write( p PicCYuvRecTop, pPicCYuvRecBot,988 conf.getWindowBottomOffset()*yScal + defDisp.getWindowBottomOffset(), NUM_CHROMA_FORMAT, isTff ); 989 #else 990 m_acTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), m_outputColourSpaceConvert, 895 991 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 896 992 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 897 993 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 898 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), isTff );994 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), NUM_CHROMA_FORMAT, isTff ); 899 995 #endif 900 996 } … … 908 1004 const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window(); 909 1005 const Bool isTff = pcPicTop->isTopField(); 910 TComPicYuv* pPicCYuvRecTop = pcPicTop->getPicYuvRec(); 911 TComPicYuv* pPicCYuvRecBot = pcPicBottom->getPicYuvRec(); 912 m_cTVideoIOYuvReconFile.write( pPicCYuvRecTop, pPicCYuvRecBot, 913 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 914 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 915 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 916 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), isTff ); 1006 m_cTVideoIOYuvReconFile.write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 1007 m_outputColourSpaceConvert, 1008 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 1009 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 1010 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 1011 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), NUM_CHROMA_FORMAT, isTff ); 917 1012 } 918 1013 … … 985 1080 { 986 1081 const Window &conf = pcPic->getConformanceWindow(); 987 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 988 TComPicYuv* pPicCYuvRec = pcPic->getPicYuvRec(); 1082 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 989 1083 #if REPN_FORMAT_IN_VPS 990 1084 UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc(); 991 1085 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 992 1086 993 m_acTVideoIOYuvReconFile[layerId].write( p PicCYuvRec,1087 m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(), m_outputColourSpaceConvert, 994 1088 conf.getWindowLeftOffset() *xScal + defDisp.getWindowLeftOffset(), 995 1089 conf.getWindowRightOffset() *xScal + defDisp.getWindowRightOffset(), … … 997 1091 conf.getWindowBottomOffset()*yScal + defDisp.getWindowBottomOffset() ); 998 1092 #else 999 m_acTVideoIOYuvReconFile[layerId].write( p PicCYuvRec,1093 m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(), m_outputColourSpaceConvert, 1000 1094 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 1001 1095 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), … … 1010 1104 if ( m_pchReconFile ) 1011 1105 { 1012 const Window &conf = pcPic->getConformanceWindow();1106 const Window &conf = pcPic->getConformanceWindow(); 1013 1107 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 1014 TComPicYuv* pPicCYuvRec = pcPic->getPicYuvRec(); 1015 m_cTVideoIOYuvReconFile.write( pPicCYuvRec, 1016 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 1017 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 1018 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 1019 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 1108 1109 m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(), 1110 m_outputColourSpaceConvert, 1111 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 1112 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 1113 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 1114 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 1020 1115 } 1021 1116 … … 1095 1190 #endif 1096 1191 TComPicYuv* pPicCYuvRec = pic->getPicYuvRec(); 1097 m_acTVideoIOYuvReconFile[layerIdx].write( pPicCYuvRec, 1192 m_acTVideoIOYuvReconFile[layerIdx].write( pPicCYuvRec, m_outputColourSpaceConvert, 1098 1193 conf.getWindowLeftOffset() * xScal + defDisp.getWindowLeftOffset(), 1099 1194 conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(), -
branches/SHM-upgrade/source/App/TAppDecoder/TAppDecTop.h
r845 r916 2 2 * License, included below. This software may be subject to other third party 3 3 * and contributor rights, including patent rights, and no such rights are 4 * granted under this license. 4 * granted under this license. 5 5 * 6 6 * Copyright (c) 2010-2014, ITU/ISO/IEC … … 78 78 Int m_iPOCLastDisplay; ///< last POC in display order 79 79 #endif 80 80 std::ofstream m_seiMessageFileStream; ///< Used for outputing SEI messages. 81 81 82 public: 82 83 TAppDecTop(); 83 84 virtual ~TAppDecTop() {} 84 85 85 86 Void create (); ///< create internal members 86 87 Void destroy (); ///< destroy internal members 87 88 Void decode (); ///< main decoding function 88 89 89 90 protected: 90 91 Void xCreateDecLib (); ///< create internal classes -
branches/SHM-upgrade/source/App/TAppDecoder/decmain.cpp
r595 r916 44 44 //! \{ 45 45 46 bool g_md5_mismatch = false; ///< top level flag that indicates if there has been a decoding mismatch46 Bool g_md5_mismatch = false; ///< top level flag that indicates if there has been a decoding mismatch 47 47 48 48 // ==================================================================================================================== … … 59 59 fprintf( stdout, "SHM software: Decoder Version [%s]", NV_VERSION ); 60 60 #else 61 fprintf( stdout, "HM software: Decoder Version [%s] ", NV_VERSION );61 fprintf( stdout, "HM software: Decoder Version [%s] (including RExt)", NV_VERSION ); 62 62 #endif 63 63 fprintf( stdout, NVM_ONOS ); … … 77 77 78 78 // starting time 79 double dResult;80 longlBefore = clock();79 Double dResult; 80 clock_t lBefore = clock(); 81 81 82 82 // call decoding function … … 89 89 90 90 // ending time 91 dResult = ( double)(clock()-lBefore) / CLOCKS_PER_SEC;91 dResult = (Double)(clock()-lBefore) / CLOCKS_PER_SEC; 92 92 printf("\n Total Time: %12.3f sec.\n", dResult); 93 93
Note: See TracChangeset for help on using the changeset viewer.