Changeset 713 in SHVCSoftware
- Timestamp:
- 21 Apr 2014, 04:44:16 (11 years ago)
- Location:
- trunk
- Files:
-
- 77 edited
- 14 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/SHM-6-dev (added) merged: 651-712
- Property svn:mergeinfo changed
-
trunk/build/linux/lib/TLibCommon/makefile
r125 r713 58 58 $(OBJ_DIR)/TComRdCostWeightPrediction.o \ 59 59 $(OBJ_DIR)/TComUpsampleFilter.o \ 60 $(OBJ_DIR)/TCom3DAsymLUT.o \ 60 61 61 62 LIBS = -lpthread -
trunk/build/linux/lib/TLibEncoder/makefile
r125 r713 52 52 $(OBJ_DIR)/WeightPredAnalysis.o \ 53 53 $(OBJ_DIR)/TEncRateCtrl.o \ 54 $(OBJ_DIR)/TEnc3DAsymLUT.o \ 54 55 55 56 LIBS = -lpthread -
trunk/build/vc10/TAppDownConvert/TAppDownConvert.vcxproj
r540 r713 82 82 <WarningLevel>Level3</WarningLevel> 83 83 <Optimization>Disabled</Optimization> 84 <PreprocessorDefinitions>_MBCS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> 84 85 </ClCompile> 85 86 <Link> … … 102 103 <FunctionLevelLinking>true</FunctionLevelLinking> 103 104 <IntrinsicFunctions>true</IntrinsicFunctions> 105 <PreprocessorDefinitions>_MBCS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> 104 106 </ClCompile> 105 107 <Link> -
trunk/build/vc10/TLibCommon_vc10.vcxproj
r125 r713 148 148 <ClCompile Include="..\..\source\Lib\libmd5\libmd5.c" /> 149 149 <ClCompile Include="..\..\source\Lib\TLibCommon\SEI.cpp" /> 150 <ClCompile Include="..\..\source\Lib\TLibCommon\TCom3DAsymLUT.cpp" /> 150 151 <ClCompile Include="..\..\source\Lib\TLibCommon\TComBitStream.cpp" /> 151 152 <ClCompile Include="..\..\source\Lib\TLibCommon\TComCABACTables.cpp" /> … … 180 181 <ClInclude Include="..\..\source\Lib\TLibCommon\NAL.h" /> 181 182 <ClInclude Include="..\..\source\Lib\TLibCommon\SEI.h" /> 183 <ClInclude Include="..\..\source\Lib\TLibCommon\TCom3DAsymLUT.h" /> 182 184 <ClInclude Include="..\..\source\Lib\TLibCommon\TComBitCounter.h" /> 183 185 <ClInclude Include="..\..\source\Lib\TLibCommon\TComBitStream.h" /> -
trunk/build/vc10/TLibEncoder_vc10.vcxproj
r125 r713 147 147 <ClCompile Include="..\..\source\Lib\TLibEncoder\SEIwrite.cpp" /> 148 148 <ClCompile Include="..\..\source\Lib\TLibEncoder\SyntaxElementWriter.cpp" /> 149 <ClCompile Include="..\..\source\Lib\TLibEncoder\TEnc3DAsymLUT.cpp" /> 149 150 <ClCompile Include="..\..\source\Lib\TLibEncoder\TEncAnalyze.cpp" /> 150 151 <ClCompile Include="..\..\source\Lib\TLibEncoder\TEncBinCoderCABAC.cpp" /> … … 169 170 <ClInclude Include="..\..\source\Lib\TLibEncoder\SEIwrite.h" /> 170 171 <ClInclude Include="..\..\source\Lib\TLibEncoder\SyntaxElementWriter.h" /> 172 <ClInclude Include="..\..\source\Lib\TLibEncoder\TEnc3DAsymLUT.h" /> 171 173 <ClInclude Include="..\..\source\Lib\TLibEncoder\TEncAnalyze.h" /> 172 174 <ClInclude Include="..\..\source\Lib\TLibEncoder\TEncBinCoder.h" /> -
trunk/build/vc9/TLibCommon_vc9.vcproj
r313 r713 300 300 </File> 301 301 <File 302 RelativePath="..\..\source\Lib\TLibCommon\TCom3DAsymLUT.cpp" 303 > 304 </File> 305 <File 302 306 RelativePath="..\..\source\Lib\TLibCommon\TComBitStream.cpp" 303 307 > … … 426 430 </File> 427 431 <File 432 RelativePath="..\..\source\Lib\TLibCommon\TCom3DAsymLUT.h" 433 > 434 </File> 435 <File 428 436 RelativePath="..\..\source\Lib\TLibCommon\TComBitCounter.h" 429 437 > -
trunk/build/vc9/TLibEncoder_vc9.vcproj
r313 r713 295 295 </File> 296 296 <File 297 RelativePath="..\..\source\Lib\TLibEncoder\TEnc3DAsymLUT.cpp" 298 > 299 </File> 300 <File 297 301 RelativePath="..\..\source\Lib\TLibEncoder\TEncAnalyze.cpp" 298 302 > … … 377 381 <File 378 382 RelativePath="..\..\source\Lib\TLibEncoder\SyntaxElementWriter.h" 383 > 384 </File> 385 <File 386 RelativePath="..\..\source\Lib\TLibEncoder\TEnc3DAsymLUT.h" 379 387 > 380 388 </File> -
trunk/cfg
- Property svn:mergeinfo changed
/branches/SHM-6-dev/cfg (added) merged: 679,681-682,688-689,701,706
- Property svn:mergeinfo changed
-
trunk/cfg/layers.cfg
r595 r713 9 9 CrossLayerPictureTypeAlignFlag: 1 # Picture type alignment across layers 10 10 CrossLayerIrapAlignFlag : 1 # Align IRAP across layers 11 InterLayerWeightedPred : 0 # enable IL WP parameters estimation at encoder12 11 SEIpictureDigest : 1 13 12 … … 15 14 QP0 : 22 16 15 MaxTidIlRefPicsPlus10 : 1 # max_tid_il_ref_pics_plus1 for layer0 17 InternalBitDepth0 : 8 # codec operating bit-depth for layer 018 16 #============ Rate Control ============== 19 17 RateControl0 : 0 # Rate control: enable rate control for layer 0 … … 28 26 #============= LAYER 1 ================== 29 27 QP1 : 20 30 InternalBitDepth1 : 8 # codec operating bit-depth for layer 131 28 NumSamplePredRefLayers1 : 1 # number of sample pred reference layers 32 29 SamplePredRefLayerIds1 : 0 # reference layer id -
trunk/cfg/layers_avcbase.cfg
r595 r713 6 6 CrossLayerPictureTypeAlignFlag: 0 # Picture type alignment across layers 7 7 CrossLayerIrapAlignFlag : 0 # Align IRAP across layers 8 InterLayerWeightedPred : 0 # enable IL WP parameters estimation at encoder9 8 SEIpictureDigest : 1 10 9 11 10 #============= LAYER 0 ================== 12 11 QP0 : 22 13 InternalBitDepth0 : 8 # codec operating bit-depth for layer 014 12 15 13 #============ Rate Control ============== … … 25 23 #============= LAYER 1 ================== 26 24 QP1 : 20 27 InternalBitDepth1 : 8 # codec operating bit-depth for layer 128 25 NumSamplePredRefLayers1 : 1 # number of sample pred reference layers 29 26 SamplePredRefLayerIds1 : 0 # reference layer id -
trunk/cfg/per-sequence-svc-avcbase/BQTerrace-2x.cfg
r595 r713 22 22 IntraPeriod1 : 64 # Period of I-Frame ( -1 = only first) 23 23 ConformanceMode1 : 1 # conformance mode 24 NumScaledRefLayerOffsets1 : 1 # Number of scaled entry offsets for this layer25 24 ScaledRefLayerId1 : 0 # Scaled reference layer ID 26 ScaledRefLayerBottomOffset1 : -4 # offset for spatial alignment of the base and enhancement layers27 25 QP1 : 20 -
trunk/cfg/per-sequence-svc-avcbase/BasketballDrive-2x.cfg
r595 r713 22 22 IntraPeriod1 : 48 # Period of I-Frame ( -1 = only first) 23 23 ConformanceMode1 : 1 # conformance mode 24 NumScaledRefLayerOffsets1 : 1 # Number of scaled entry offsets for this layer25 24 ScaledRefLayerId1 : 0 # Scaled reference layer ID 26 ScaledRefLayerBottomOffset1 : -4 # offset for spatial alignment of the base and enhancement layers27 25 QP1 : 20 -
trunk/cfg/per-sequence-svc-avcbase/Cactus-2x.cfg
r595 r713 22 22 IntraPeriod1 : 48 # Period of I-Frame ( -1 = only first) 23 23 ConformanceMode1 : 1 # conformance mode 24 NumScaledRefLayerOffsets1 : 1 # Number of scaled entry offsets for this layer25 24 ScaledRefLayerId1 : 0 # Scaled reference layer ID 26 ScaledRefLayerBottomOffset1 : -4 # offset for spatial alignment of the base and enhancement layers27 25 QP1 : 20 -
trunk/cfg/per-sequence-svc-avcbase/Kimono-2x.cfg
r595 r713 22 22 IntraPeriod1 : 24 # Period of I-Frame ( -1 = only first) 23 23 ConformanceMode1 : 1 # conformance mode 24 NumScaledRefLayerOffsets1 : 1 # Number of scaled entry offsets for this layer25 24 ScaledRefLayerId1 : 0 # Scaled reference layer ID 26 ScaledRefLayerBottomOffset1 : -4 # offset for spatial alignment of the base and enhancement layers27 25 QP1 : 20 -
trunk/cfg/per-sequence-svc-avcbase/ParkScene-2x.cfg
r595 r713 22 22 IntraPeriod1 : 24 # Period of I-Frame ( -1 = only first) 23 23 ConformanceMode1 : 1 # conformance mode 24 NumScaledRefLayerOffsets1 : 1 # Number of scaled entry offsets for this layer25 24 ScaledRefLayerId1 : 0 # Scaled reference layer ID 26 ScaledRefLayerBottomOffset1 : -4 # offset for spatial alignment of the base and enhancement layers27 25 QP1 : 20 -
trunk/cfg/per-sequence-svc/BQTerrace-2x.cfg
r595 r713 23 23 IntraPeriod1 : 64 # Period of I-Frame ( -1 = only first) 24 24 ConformanceMode1 : 1 # conformance mode 25 NumScaledRefLayerOffsets1 : 1 # Number of scaled entry offsets for this layer26 ScaledRefLayerId1 : 0 # Scaled reference layer ID27 ScaledRefLayerBottomOffset1 : -4 # offset for spatial alignment of the base and enhancement layers28 25 QP1 : 20 -
trunk/cfg/per-sequence-svc/BasketballDrive-2x.cfg
r595 r713 23 23 IntraPeriod1 : 48 # Period of I-Frame ( -1 = only first) 24 24 ConformanceMode1 : 1 # conformance mode 25 NumScaledRefLayerOffsets1 : 1 # Number of scaled entry offsets for this layer26 ScaledRefLayerId1 : 0 # Scaled reference layer ID27 ScaledRefLayerBottomOffset1 : -4 # offset for spatial alignment of the base and enhancement layers28 25 QP1 : 20 -
trunk/cfg/per-sequence-svc/Cactus-2x.cfg
r595 r713 23 23 IntraPeriod1 : 48 # Period of I-Frame ( -1 = only first) 24 24 ConformanceMode1 : 1 # conformance mode 25 NumScaledRefLayerOffsets1 : 1 # Number of scaled entry offsets for this layer26 ScaledRefLayerId1 : 0 # Scaled reference layer ID27 ScaledRefLayerBottomOffset1 : -4 # offset for spatial alignment of the base and enhancement layers28 25 QP1 : 20 -
trunk/cfg/per-sequence-svc/Kimono-2x.cfg
r595 r713 23 23 IntraPeriod1 : 24 # Period of I-Frame ( -1 = only first) 24 24 ConformanceMode1 : 1 # conformance mode 25 NumScaledRefLayerOffsets1 : 1 # Number of scaled entry offsets for this layer26 ScaledRefLayerId1 : 0 # Scaled reference layer ID27 ScaledRefLayerBottomOffset1 : -4 # offset for spatial alignment of the base and enhancement layers28 25 QP1 : 20 -
trunk/cfg/per-sequence-svc/ParkScene-2x.cfg
r595 r713 23 23 IntraPeriod1 : 24 # Period of I-Frame ( -1 = only first) 24 24 ConformanceMode1 : 1 # conformance mode 25 NumScaledRefLayerOffsets1 : 1 # Number of scaled entry offsets for this layer26 ScaledRefLayerId1 : 0 # Scaled reference layer ID27 ScaledRefLayerBottomOffset1 : -4 # offset for spatial alignment of the base and enhancement layers28 25 QP1 : 20 -
trunk/doc/readme.txt
r2 r713 1 TAppEncoder -c cfg/encoder_randomaccess_main.cfg -c cfg/per-sequence-svc/BasketballDrive-2x.cfg - q0 22 -q1 22 -b str/BasketballDrive.bin -o0 rec/BasketballDrive_l0_rec.yuv -o1 rec/BasketballDrive_l1_rec.yuv1 TAppEncoder -c cfg/encoder_randomaccess_main.cfg -c cfg/per-sequence-svc/BasketballDrive-2x.cfg -c cfg/layers.cfg -q0 22 -q1 22 -b str/BasketballDrive.bin -o0 rec/BasketballDrive_l0_rec.yuv -o1 rec/BasketballDrive_l1_rec.yuv 2 2 3 3 TAppDecoder -b str/BasketballDrive.bin -ls 2 -o0 rec/BasketballDrive_l0_drec.yuv -o1 rec/BasketballDrive_l1_drec.yuv 4 4 5 For AVC_BASE tests the following additionally should be used. 6 7 In the encoder config file for the layer0 ONLY new line should be added. Strictly after InputFile. InputBLFile indicates the path to the BL yuv. Example: 8 InputFile : O:\BasketballDrive_1280x720_50_zerophase_0.9pi.yuv 9 InputBLFile : O:\BasketballDrive_l0_rec.yuv 10 11 For decoder, new command line parameters additionally should be used as following 12 -ibl BLrecon.yuv wdt BLwidth hgt BLheight 5 For AVC base layer tests the following should be used: 6 cfg/layers_avcbase.cfg configuration file 7 -ibl <BLrecon.yuv> option to specify the reconstructed base layer input -
trunk/source
- Property svn:mergeinfo changed
/branches/SHM-6-dev/source (added) merged: 652-678,680,683-684,686-691,693-700,702-705,707-711
- Property svn:mergeinfo changed
-
trunk/source/App/TAppDecoder/TAppDecCfg.cpp
r595 r713 92 92 #if AVC_BASE 93 93 ("BLReconFile,-ibl", cfg_BLReconFile, string(""), "BL reconstructed YUV input file name") 94 #if !REPN_FORMAT_IN_VPS 94 95 ("BLSourceWidth,-wdt", m_iBLSourceWidth, 0, "BL source picture width") 95 96 ("BLSourceHeight,-hgt", m_iBLSourceHeight, 0, "BL source picture height") 97 #endif 96 98 #if AVC_SYNTAX 97 99 ("BLSyntaxFile,-ibs", cfg_BLSyntaxFile, string(""), "BL syntax input file name") -
trunk/source/App/TAppDecoder/TAppDecCfg.h
r595 r713 74 74 #if AVC_BASE 75 75 Char* m_pchBLReconFile; ///< input BL reconstruction file name 76 #if !REPN_FORMAT_IN_VPS 76 77 Int m_iBLSourceWidth; 77 78 Int m_iBLSourceHeight; 79 #endif 78 80 #if AVC_SYNTAX 79 81 Char* m_pchBLSyntaxFile; ///< input BL syntax file name … … 84 86 #if SYNTAX_OUTPUT 85 87 Char* m_pchBLSyntaxFile; ///< input BL syntax file name 88 #if !REPN_FORMAT_IN_VPS 86 89 Int m_iBLSourceWidth; 87 90 Int m_iBLSourceHeight; 91 #endif 88 92 Int m_iBLFrames; 89 93 #endif … … 108 112 #if SVC_EXTENSION 109 113 , m_tgtLayerId(0) 110 #if AVC_BASE 114 #if AVC_BASE && !REPN_FORMAT_IN_VPS 111 115 , m_iBLSourceWidth(0) 112 116 , m_iBLSourceHeight(0) -
trunk/source/App/TAppDecoder/TAppDecTop.cpp
r644 r713 163 163 } 164 164 TComList<TComPic*> *cListPic = m_acTDecTop[0].getListPic(); 165 #if AVC_SYNTAX || !REPN_FORMAT_IN_VPS 165 166 m_acTDecTop[0].setBLsize( m_iBLSourceWidth, m_iBLSourceHeight ); 167 #endif 166 168 m_acTDecTop[0].setBLReconFile( &streamYUV ); 167 169 pcBLPic.setLayerId( 0 ); … … 257 259 Bool outputPicturesFlag = true; 258 260 #if NO_OUTPUT_OF_PRIOR_PICS 259 if( m_acTDecTop[nalu.m_layerId].getNoOutput OfPriorPicsFlags() )261 if( m_acTDecTop[nalu.m_layerId].getNoOutputPriorPicsFlag() ) 260 262 { 261 263 outputPicturesFlag = false; … … 449 451 loopFiltered = (nalu.m_nalUnitType == NAL_UNIT_EOS); 450 452 } 453 #if !FIX_WRITING_OUTPUT 454 #if SETTING_NO_OUT_PIC_PRIOR 455 if (bNewPicture && m_cTDecTop.getNoOutputPriorPicsFlag()) 456 { 457 m_cTDecTop.checkNoOutputPriorPics( pcListPic ); 458 } 459 #endif 460 #endif 451 461 452 462 if( pcListPic ) … … 460 470 openedReconFile = true; 461 471 } 472 #if FIX_WRITING_OUTPUT 473 // write reconstruction to file 474 if( bNewPicture ) 475 { 476 xWriteOutput( pcListPic, nalu.m_temporalId ); 477 } 478 #if SETTING_NO_OUT_PIC_PRIOR 479 if ( (bNewPicture || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA) && m_cTDecTop.getNoOutputPriorPicsFlag() ) 480 { 481 m_cTDecTop.checkNoOutputPriorPics( pcListPic ); 482 m_cTDecTop.setNoOutputPriorPicsFlag (false); 483 } 484 #endif 485 #endif 462 486 if ( bNewPicture && 463 487 ( nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL … … 471 495 if (nalu.m_nalUnitType == NAL_UNIT_EOS) 472 496 { 497 #if FIX_OUTPUT_EOS 498 xWriteOutput( pcListPic, nalu.m_temporalId ); 499 #else 473 500 xFlushOutput( pcListPic ); 474 } 475 // write reconstruction to file 501 #endif 502 } 503 // write reconstruction to file -- for additional bumping as defined in C.5.2.3 504 #if FIX_WRITING_OUTPUT 505 if(!bNewPicture && nalu.m_nalUnitType >= NAL_UNIT_CODED_SLICE_TRAIL_N && nalu.m_nalUnitType <= NAL_UNIT_RESERVED_VCL31) 506 #else 476 507 if(bNewPicture) 508 #endif 477 509 { 478 510 xWriteOutput( pcListPic, nalu.m_temporalId ); … … 586 618 TComList<TComPic*>::iterator iterPic = pcListPic->begin(); 587 619 Int numPicsNotYetDisplayed = 0; 620 Int dpbFullness = 0; 621 #if SVC_EXTENSION 622 TComSPS* activeSPS = m_acTDecTop[layerId].getActiveSPS(); 623 #else 624 TComSPS* activeSPS = m_cTDecTop.getActiveSPS(); 625 #endif 626 UInt numReorderPicsHighestTid; 627 UInt maxDecPicBufferingHighestTid; 628 UInt maxNrSublayers = activeSPS->getMaxTLayers(); 629 630 if(m_iMaxTemporalLayer == -1 || m_iMaxTemporalLayer >= maxNrSublayers) 631 { 632 numReorderPicsHighestTid = activeSPS->getNumReorderPics(maxNrSublayers-1); 633 maxDecPicBufferingHighestTid = activeSPS->getMaxDecPicBuffering(maxNrSublayers-1); 634 } 635 else 636 { 637 numReorderPicsHighestTid = activeSPS->getNumReorderPics(m_iMaxTemporalLayer); 638 maxDecPicBufferingHighestTid = activeSPS->getMaxDecPicBuffering(m_iMaxTemporalLayer); 639 } 588 640 589 641 while (iterPic != pcListPic->end()) … … 597 649 { 598 650 numPicsNotYetDisplayed++; 651 dpbFullness++; 652 } 653 else if(pcPic->getSlice( 0 )->isReferenced()) 654 { 655 dpbFullness++; 599 656 } 600 657 iterPic++; … … 619 676 620 677 #if SVC_EXTENSION 621 if ( pcPicTop->getOutputMark() && (numPicsNotYetDisplayed > pcPicTop->getNumReorderPics(tId) && !(pcPicTop->getPOC()%2) && pcPicBottom->getPOC() == pcPicTop->getPOC()+1) 622 && pcPicBottom->getOutputMark() && (numPicsNotYetDisplayed > pcPicBottom->getNumReorderPics(tId) && (pcPicTop->getPOC() == m_aiPOCLastDisplay[layerId]+1 || m_aiPOCLastDisplay[layerId]<0))) 623 #else 624 if ( pcPicTop->getOutputMark() && (numPicsNotYetDisplayed > pcPicTop->getNumReorderPics(tId) && !(pcPicTop->getPOC()%2) && pcPicBottom->getPOC() == pcPicTop->getPOC()+1) 625 && pcPicBottom->getOutputMark() && (numPicsNotYetDisplayed > pcPicBottom->getNumReorderPics(tId) && (pcPicTop->getPOC() == m_iPOCLastDisplay+1 || m_iPOCLastDisplay<0))) 678 if( pcPicTop->getOutputMark() && pcPicBottom->getOutputMark() && 679 (numPicsNotYetDisplayed > numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid) && 680 (!(pcPicTop->getPOC()%2) && pcPicBottom->getPOC() == pcPicTop->getPOC()+1) && 681 (pcPicTop->getPOC() == m_aiPOCLastDisplay[layerId]+1 || m_aiPOCLastDisplay[layerId]<0) ) 682 #else 683 if ( pcPicTop->getOutputMark() && pcPicBottom->getOutputMark() && 684 (numPicsNotYetDisplayed > numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid) && 685 (!(pcPicTop->getPOC()%2) && pcPicBottom->getPOC() == pcPicTop->getPOC()+1) && 686 (pcPicTop->getPOC() == m_iPOCLastDisplay+1 || m_iPOCLastDisplay < 0)) 626 687 #endif 627 688 { … … 634 695 const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window(); 635 696 const Bool isTff = pcPicTop->isTopField(); 697 TComPicYuv* pPicCYuvRecTop = pcPicTop->getPicYuvRec(); 698 TComPicYuv* pPicCYuvRecBot = pcPicBottom->getPicYuvRec(); 699 #if Q0074_SEI_COLOR_MAPPING 700 if( m_acTDecTop[layerId].m_ColorMapping->getColorMappingFlag() ) 701 { 702 pPicCYuvRecTop = m_acTDecTop[layerId].m_ColorMapping->getColorMapping( pPicCYuvRecTop, 0, layerId ); 703 pPicCYuvRecBot = m_acTDecTop[layerId].m_ColorMapping->getColorMapping( pPicCYuvRecBot, 1, layerId ); 704 } 705 #endif 636 706 #if REPN_FORMAT_IN_VPS 637 707 UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc(); 638 708 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 639 m_acTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 709 710 m_acTVideoIOYuvReconFile[layerId].write( pPicCYuvRecTop, pPicCYuvRecBot, 640 711 conf.getWindowLeftOffset() * xScal + defDisp.getWindowLeftOffset(), 641 712 conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(), 642 713 conf.getWindowTopOffset() * yScal + defDisp.getWindowTopOffset(), 643 714 conf.getWindowBottomOffset()* yScal + defDisp.getWindowBottomOffset(), isTff ); 644 645 #else 646 #if O0194_DIFFERENT_BITDEPTH_EL_BL 647 // Compile time bug-fix 648 m_acTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 649 #else 650 m_cTVideoIOYuvReconFile.write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 651 #endif 715 #else 716 m_acTVideoIOYuvReconFile[layerId].write( pPicCYuvRecTop, pPicCYuvRecBot, 717 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 718 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 719 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 720 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), isTff ); 721 #endif 722 } 723 724 // update POC of display order 725 m_aiPOCLastDisplay[layerId] = pcPicBottom->getPOC(); 726 #else 727 if ( m_pchReconFile ) 728 { 729 const Window &conf = pcPicTop->getConformanceWindow(); 730 const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window(); 731 const Bool isTff = pcPicTop->isTopField(); 732 TComPicYuv* pPicCYuvRecTop = pcPicTop->getPicYuvRec(); 733 TComPicYuv* pPicCYuvRecBot = pcPicBottom->getPicYuvRec(); 734 #if Q0074_SEI_COLOR_MAPPING 735 if ( m_cTDecTop.m_ColorMapping->getColorMappingFlag() ) 736 { 737 pPicCYuvRecTop = m_cTDecTop.m_ColorMapping->getColorMapping( pPicCYuvRecTop, 0 ); 738 pPicCYuvRecBot = m_cTDecTop.m_ColorMapping->getColorMapping( pPicCYuvRecBot, 1 ); 739 } 740 #endif 741 m_cTVideoIOYuvReconFile.write( pPicCYuvRecTop, pPicCYuvRecBot, 652 742 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 653 743 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 654 744 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 655 745 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), isTff ); 656 #endif657 746 } 658 747 659 748 // update POC of display order 660 m_aiPOCLastDisplay[layerId] = pcPicBottom->getPOC(); 749 m_iPOCLastDisplay = pcPicBottom->getPOC(); 750 #endif 751 752 // erase non-referenced picture in the reference picture list after display 753 if ( !pcPicTop->getSlice(0)->isReferenced() && pcPicTop->getReconMark() == true ) 754 { 755 #if !DYN_REF_FREE 756 pcPicTop->setReconMark(false); 757 758 // mark it should be extended later 759 pcPicTop->getPicYuvRec()->setBorderExtension( false ); 760 761 #else 762 pcPicTop->destroy(); 763 pcListPic->erase( iterPic ); 764 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 765 continue; 766 #endif 767 } 768 if ( !pcPicBottom->getSlice(0)->isReferenced() && pcPicBottom->getReconMark() == true ) 769 { 770 #if !DYN_REF_FREE 771 pcPicBottom->setReconMark(false); 772 773 // mark it should be extended later 774 pcPicBottom->getPicYuvRec()->setBorderExtension( false ); 775 776 #else 777 pcPicBottom->destroy(); 778 pcListPic->erase( iterPic ); 779 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 780 continue; 781 #endif 782 } 783 pcPicTop->setOutputMark(false); 784 pcPicBottom->setOutputMark(false); 785 } 786 } 787 } 788 else if (!pcPic->isField()) //Frame Decoding 789 { 790 iterPic = pcListPic->begin(); 791 while (iterPic != pcListPic->end()) 792 { 793 pcPic = *(iterPic); 794 795 #if SVC_EXTENSION 796 if( pcPic->getOutputMark() && pcPic->getPOC() > m_aiPOCLastDisplay[layerId] && 797 (numPicsNotYetDisplayed > numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid) ) 798 #else 799 if(pcPic->getOutputMark() && pcPic->getPOC() > m_iPOCLastDisplay && 800 (numPicsNotYetDisplayed > numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid)) 801 #endif 802 { 803 // write to file 804 numPicsNotYetDisplayed--; 805 if(pcPic->getSlice(0)->isReferenced() == false) 806 { 807 dpbFullness--; 808 } 809 #if SVC_EXTENSION 810 if( m_pchReconFile[layerId] ) 811 { 812 const Window &conf = pcPic->getConformanceWindow(); 813 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 814 TComPicYuv* pPicCYuvRec = pcPic->getPicYuvRec(); 815 #if Q0074_SEI_COLOR_MAPPING 816 if ( m_acTDecTop[layerId].m_ColorMapping->getColorMappingFlag() ) 817 { 818 pPicCYuvRec = m_acTDecTop[layerId].m_ColorMapping->getColorMapping( pPicCYuvRec, 0, layerId ); 819 } 820 #endif 821 822 #if REPN_FORMAT_IN_VPS 823 UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc(); 824 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 825 826 m_acTVideoIOYuvReconFile[layerId].write( pPicCYuvRec, 827 conf.getWindowLeftOffset() * xScal + defDisp.getWindowLeftOffset(), 828 conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(), 829 conf.getWindowTopOffset() * yScal + defDisp.getWindowTopOffset(), 830 conf.getWindowBottomOffset()* yScal + defDisp.getWindowBottomOffset() ); 831 #else 832 m_acTVideoIOYuvReconFile[layerId].write( pPicCYuvRec, 833 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 834 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 835 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 836 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 837 #endif 838 } 839 840 // update POC of display order 841 m_aiPOCLastDisplay[layerId] = pcPic->getPOC(); 661 842 #else 662 843 if ( m_pchReconFile ) 844 { 845 #if SYNTAX_OUTPUT 846 TComPicYuv* pPicCYuvRec = pcPic->getPicYuvRec(); 847 #if Q0074_SEI_COLOR_MAPPING 848 if( m_acTDecTop[layerIdx].m_ColorMapping->getColorMappingFlag() ) 849 { 850 pPicCYuvRec = m_acTDecTop[layerIdx].m_ColorMapping->getColorMapping( pPicCYuvRec, 0, layerIdx ); 851 } 852 #endif 853 const Window &conf = pcPic->getConformanceWindow(); 854 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 855 m_cTVideoIOYuvReconFile.write( pPicCYuvRec, 856 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 857 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 858 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 859 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 860 #endif 861 } 862 863 // update POC of display order 864 m_iPOCLastDisplay = pcPic->getPOC(); 865 #endif 866 867 // erase non-referenced picture in the reference picture list after display 868 if ( !pcPic->getSlice(0)->isReferenced() && pcPic->getReconMark() == true ) 869 { 870 #if !DYN_REF_FREE 871 pcPic->setReconMark(false); 872 873 // mark it should be extended later 874 pcPic->getPicYuvRec()->setBorderExtension( false ); 875 876 #else 877 pcPic->destroy(); 878 pcListPic->erase( iterPic ); 879 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 880 continue; 881 #endif 882 } 883 pcPic->setOutputMark(false); 884 } 885 886 iterPic++; 887 } 888 } 889 } 890 891 /** \param pcListPic list of pictures to be written to file 892 \todo DYN_REF_FREE should be revised 893 */ 894 #if SVC_EXTENSION 895 Void TAppDecTop::xFlushOutput( TComList<TComPic*>* pcListPic, UInt layerId ) 896 #else 897 Void TAppDecTop::xFlushOutput( TComList<TComPic*>* pcListPic ) 898 #endif 899 { 900 if(!pcListPic || pcListPic->empty()) 901 { 902 return; 903 } 904 TComList<TComPic*>::iterator iterPic = pcListPic->begin(); 905 906 iterPic = pcListPic->begin(); 907 TComPic* pcPic = *(iterPic); 908 909 if (pcPic->isField()) //Field Decoding 910 { 911 TComList<TComPic*>::iterator endPic = pcListPic->end(); 912 endPic--; 913 TComPic *pcPicTop, *pcPicBottom = NULL; 914 while (iterPic != endPic) 915 { 916 pcPicTop = *(iterPic); 917 iterPic++; 918 pcPicBottom = *(iterPic); 919 920 if ( pcPicTop->getOutputMark() && pcPicBottom->getOutputMark() && !(pcPicTop->getPOC()%2) && (pcPicBottom->getPOC() == pcPicTop->getPOC()+1) ) 921 { 922 // write to file 923 #if SVC_EXTENSION 924 if ( m_pchReconFile[layerId] ) 663 925 { 664 926 const Window &conf = pcPicTop->getConformanceWindow(); 665 927 const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window(); 666 928 const Bool isTff = pcPicTop->isTopField(); 667 m_cTVideoIOYuvReconFile.write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 929 TComPicYuv* pPicCYuvRecTop = pcPicTop->getPicYuvRec(); 930 TComPicYuv* pPicCYuvRecBot = pcPicBottom->getPicYuvRec(); 931 #if Q0074_SEI_COLOR_MAPPING 932 if( m_acTDecTop[layerId].m_ColorMapping->getColorMappingFlag() ) 933 { 934 pPicCYuvRecTop = m_acTDecTop[layerId].m_ColorMapping->getColorMapping( pPicCYuvRecTop, 0, layerId ); 935 pPicCYuvRecBot = m_acTDecTop[layerId].m_ColorMapping->getColorMapping( pPicCYuvRecBot, 1, layerId ); 936 } 937 #endif 938 #if REPN_FORMAT_IN_VPS 939 UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc(); 940 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 941 942 m_acTVideoIOYuvReconFile[layerId].write( pPicCYuvRecTop, pPicCYuvRecBot, 943 conf.getWindowLeftOffset() *xScal + defDisp.getWindowLeftOffset(), 944 conf.getWindowRightOffset() *xScal + defDisp.getWindowRightOffset(), 945 conf.getWindowTopOffset() *yScal + defDisp.getWindowTopOffset(), 946 conf.getWindowBottomOffset()*yScal + defDisp.getWindowBottomOffset(), isTff ); 947 #else 948 m_acTVideoIOYuvReconFile[layerId].write( pPicCYuvRecTop, pPicCYuvRecBot, 949 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 950 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 951 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 952 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), isTff ); 953 #endif 954 } 955 956 // update POC of display order 957 m_aiPOCLastDisplay[layerId] = pcPicBottom->getPOC(); 958 #else 959 if ( m_pchReconFile ) 960 { 961 const Window &conf = pcPicTop->getConformanceWindow(); 962 const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window(); 963 const Bool isTff = pcPicTop->isTopField(); 964 TComPicYuv* pPicCYuvRecTop = pcPicTop->getPicYuvRec(); 965 TComPicYuv* pPicCYuvRecBot = pcPicBottom->getPicYuvRec(); 966 #if Q0074_SEI_COLOR_MAPPING 967 if( m_cTDecTop.m_ColorMapping->getColorMappingFlag() ) 968 { 969 pPicCYuvRecTop = m_cTDecTop.m_ColorMapping->getColorMapping( pPicCYuvRecTop, 0 ); 970 pPicCYuvRecBot = m_cTDecTop.m_ColorMapping->getColorMapping( pPicCYuvRecBot, 1 ); 971 } 972 #endif 973 m_cTVideoIOYuvReconFile.write( pPicCYuvRecTop, pPicCYuvRecBot, 668 974 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 669 975 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), … … 709 1015 pcPicTop->setOutputMark(false); 710 1016 pcPicBottom->setOutputMark(false); 711 } 712 } 713 } 714 else if (!pcPic->isField()) //Frame Decoding 715 { 716 iterPic = pcListPic->begin(); 1017 1018 #if !DYN_REF_FREE 1019 if(pcPicTop) 1020 { 1021 pcPicTop->destroy(); 1022 delete pcPicTop; 1023 pcPicTop = NULL; 1024 } 1025 #endif 1026 } 1027 } 1028 if(pcPicBottom) 1029 { 1030 pcPicBottom->destroy(); 1031 delete pcPicBottom; 1032 pcPicBottom = NULL; 1033 } 1034 } 1035 else //Frame decoding 1036 { 717 1037 while (iterPic != pcListPic->end()) 718 1038 { 719 1039 pcPic = *(iterPic); 720 1040 721 #if SVC_EXTENSION 722 if ( pcPic->getOutputMark() && (numPicsNotYetDisplayed > pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_aiPOCLastDisplay[layerId])) 723 #else 724 if ( pcPic->getOutputMark() && (numPicsNotYetDisplayed > pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_iPOCLastDisplay)) 725 #endif 1041 if ( pcPic->getOutputMark() ) 726 1042 { 727 1043 // write to file 728 numPicsNotYetDisplayed--;729 1044 #if SVC_EXTENSION 730 1045 if ( m_pchReconFile[layerId] ) … … 732 1047 const Window &conf = pcPic->getConformanceWindow(); 733 1048 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 1049 TComPicYuv* pPicCYuvRec = pcPic->getPicYuvRec(); 1050 #if Q0074_SEI_COLOR_MAPPING 1051 if( m_acTDecTop[layerId].m_ColorMapping->getColorMappingFlag() ) 1052 { 1053 pPicCYuvRec = m_acTDecTop[layerId].m_ColorMapping->getColorMapping( pPicCYuvRec, 0, layerId ); 1054 } 1055 #endif 734 1056 #if REPN_FORMAT_IN_VPS 735 1057 UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc(); 736 1058 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 737 m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(), 738 conf.getWindowLeftOffset() * xScal + defDisp.getWindowLeftOffset(), 739 conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(), 740 conf.getWindowTopOffset() * yScal + defDisp.getWindowTopOffset(), 741 conf.getWindowBottomOffset()* yScal + defDisp.getWindowBottomOffset() ); 742 743 #else 744 m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(), 745 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 746 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 747 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 748 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 749 #endif 750 } 751 752 // update POC of display order 753 m_aiPOCLastDisplay[layerId] = pcPic->getPOC(); 754 #else 755 if ( m_pchReconFile ) 756 { 757 #if SYNTAX_OUTPUT 758 const Window &conf = pcPic->getConformanceWindow(); 759 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 760 m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(), 761 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 762 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 763 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 764 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 765 #endif 766 } 767 768 // update POC of display order 769 m_iPOCLastDisplay = pcPic->getPOC(); 770 #endif 771 772 // erase non-referenced picture in the reference picture list after display 773 if ( !pcPic->getSlice(0)->isReferenced() && pcPic->getReconMark() == true ) 774 { 775 #if !DYN_REF_FREE 776 pcPic->setReconMark(false); 777 778 // mark it should be extended later 779 pcPic->getPicYuvRec()->setBorderExtension( false ); 780 781 #else 782 pcPic->destroy(); 783 pcListPic->erase( iterPic ); 784 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 785 continue; 786 #endif 787 } 788 pcPic->setOutputMark(false); 789 } 790 791 iterPic++; 792 } 793 } 794 } 795 796 /** \param pcListPic list of pictures to be written to file 797 \todo DYN_REF_FREE should be revised 798 */ 799 #if SVC_EXTENSION 800 Void TAppDecTop::xFlushOutput( TComList<TComPic*>* pcListPic, UInt layerId ) 801 #else 802 Void TAppDecTop::xFlushOutput( TComList<TComPic*>* pcListPic ) 803 #endif 804 { 805 if(!pcListPic || pcListPic->empty()) 806 { 807 return; 808 } 809 TComList<TComPic*>::iterator iterPic = pcListPic->begin(); 810 811 iterPic = pcListPic->begin(); 812 TComPic* pcPic = *(iterPic); 813 814 if (pcPic->isField()) //Field Decoding 815 { 816 TComList<TComPic*>::iterator endPic = pcListPic->end(); 817 endPic--; 818 TComPic *pcPicTop, *pcPicBottom = NULL; 819 while (iterPic != endPic) 820 { 821 pcPicTop = *(iterPic); 822 iterPic++; 823 pcPicBottom = *(iterPic); 824 825 if ( pcPicTop->getOutputMark() && pcPicBottom->getOutputMark() && !(pcPicTop->getPOC()%2) && (pcPicBottom->getPOC() == pcPicTop->getPOC()+1) ) 826 { 827 // write to file 828 #if SVC_EXTENSION 829 if ( m_pchReconFile[layerId] ) 830 { 831 const Window &conf = pcPicTop->getConformanceWindow(); 832 const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window(); 833 const Bool isTff = pcPicTop->isTopField(); 834 #if REPN_FORMAT_IN_VPS 835 UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc(); 836 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 837 m_acTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 838 conf.getWindowLeftOffset() *xScal + defDisp.getWindowLeftOffset(), 839 conf.getWindowRightOffset() *xScal + defDisp.getWindowRightOffset(), 840 conf.getWindowTopOffset() *yScal + defDisp.getWindowTopOffset(), 841 conf.getWindowBottomOffset()*yScal + defDisp.getWindowBottomOffset(), isTff ); 842 843 #else 844 #if O0194_DIFFERENT_BITDEPTH_EL_BL 845 // Compile time bug-fix 846 m_acTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 847 #else 848 m_cTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 849 #endif 850 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 851 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 852 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 853 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), isTff ); 854 #endif 855 } 856 857 // update POC of display order 858 m_aiPOCLastDisplay[layerId] = pcPicBottom->getPOC(); 859 #else 860 if ( m_pchReconFile ) 861 { 862 const Window &conf = pcPicTop->getConformanceWindow(); 863 const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window(); 864 const Bool isTff = pcPicTop->isTopField(); 865 m_cTVideoIOYuvReconFile.write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 866 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 867 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 868 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 869 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), isTff ); 870 } 871 872 // update POC of display order 873 m_iPOCLastDisplay = pcPicBottom->getPOC(); 874 #endif 875 876 // erase non-referenced picture in the reference picture list after display 877 if ( !pcPicTop->getSlice(0)->isReferenced() && pcPicTop->getReconMark() == true ) 878 { 879 #if !DYN_REF_FREE 880 pcPicTop->setReconMark(false); 881 882 // mark it should be extended later 883 pcPicTop->getPicYuvRec()->setBorderExtension( false ); 884 885 #else 886 pcPicTop->destroy(); 887 pcListPic->erase( iterPic ); 888 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 889 continue; 890 #endif 891 } 892 if ( !pcPicBottom->getSlice(0)->isReferenced() && pcPicBottom->getReconMark() == true ) 893 { 894 #if !DYN_REF_FREE 895 pcPicBottom->setReconMark(false); 896 897 // mark it should be extended later 898 pcPicBottom->getPicYuvRec()->setBorderExtension( false ); 899 900 #else 901 pcPicBottom->destroy(); 902 pcListPic->erase( iterPic ); 903 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 904 continue; 905 #endif 906 } 907 pcPicTop->setOutputMark(false); 908 pcPicBottom->setOutputMark(false); 909 910 #if !DYN_REF_FREE 911 if(pcPicTop) 912 { 913 pcPicTop->destroy(); 914 delete pcPicTop; 915 pcPicTop = NULL; 916 } 917 #endif 918 } 919 } 920 if(pcPicBottom) 921 { 922 pcPicBottom->destroy(); 923 delete pcPicBottom; 924 pcPicBottom = NULL; 925 } 926 } 927 else //Frame decoding 928 { 929 while (iterPic != pcListPic->end()) 930 { 931 pcPic = *(iterPic); 932 933 if ( pcPic->getOutputMark() ) 934 { 935 // write to file 936 #if SVC_EXTENSION 937 if ( m_pchReconFile[layerId] ) 938 { 939 const Window &conf = pcPic->getConformanceWindow(); 940 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 941 #if REPN_FORMAT_IN_VPS 942 UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc(); 943 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 944 m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(), 1059 1060 m_acTVideoIOYuvReconFile[layerId].write( pPicCYuvRec, 945 1061 conf.getWindowLeftOffset() *xScal + defDisp.getWindowLeftOffset(), 946 1062 conf.getWindowRightOffset() *xScal + defDisp.getWindowRightOffset(), 947 1063 conf.getWindowTopOffset() *yScal + defDisp.getWindowTopOffset(), 948 1064 conf.getWindowBottomOffset()*yScal + defDisp.getWindowBottomOffset() ); 949 950 #else 951 m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(), 952 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 953 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 954 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 1065 #else 1066 m_acTVideoIOYuvReconFile[layerId].write( pPicCYuvRec, 1067 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 1068 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 1069 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 955 1070 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 956 1071 #endif … … 964 1079 const Window &conf = pcPic->getConformanceWindow(); 965 1080 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 966 m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(), 1081 TComPicYuv* pPicCYuvRec = pcPic->getPicYuvRec(); 1082 #if Q0074_SEI_COLOR_MAPPING 1083 if( m_cTDecTop.m_ColorMapping->getColorMappingFlag() ) 1084 { 1085 pPicCYuvRec = m_cTDecTop.m_ColorMapping->getColorMapping( pPicCYuvRec ); 1086 } 1087 #endif 1088 m_cTVideoIOYuvReconFile.write( pPicCYuvRec, 967 1089 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 968 1090 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), … … 1045 1167 yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 1046 1168 #endif 1047 m_acTVideoIOYuvReconFile[layerIdx].write( pic->getPicYuvRec(), 1169 TComPicYuv* pPicCYuvRec = pic->getPicYuvRec(); 1170 #if Q0074_SEI_COLOR_MAPPING 1171 pPicCYuvRec = m_acTDecTop[layerIdx].m_ColorMapping->getColorMapping( pPicCYuvRec, 0, layerIdx ); 1172 #endif 1173 m_acTVideoIOYuvReconFile[layerIdx].write( pPicCYuvRec, 1048 1174 conf.getWindowLeftOffset() * xScal + defDisp.getWindowLeftOffset(), 1049 1175 conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(), -
trunk/source/App/TAppEncoder/TAppEncCfg.cpp
r649 r713 339 339 string* cfg_ReconFile [MAX_LAYERS]; 340 340 Double* cfg_fQP [MAX_LAYERS]; 341 #if Q0074_SEI_COLOR_MAPPING 342 string* cfg_seiColorMappingFile[MAX_LAYERS]; 343 #endif 341 344 342 345 #if REPN_FORMAT_IN_VPS … … 433 436 cfg_IntraPeriod[layer] = &m_acLayerCfg[layer].m_iIntraPeriod; 434 437 cfg_conformanceMode[layer] = &m_acLayerCfg[layer].m_conformanceMode; 438 #if Q0074_SEI_COLOR_MAPPING 439 cfg_seiColorMappingFile[layer] = &m_acLayerCfg[layer].m_cSeiColorMappingFile; 440 #endif 435 441 #if LAYER_CTB 436 442 // coding unit (CU) definition … … 616 622 #endif 617 623 ("EnableElRapB,-use-rap-b", m_elRapSliceBEnabled, 0, "Set ILP over base-layer I picture to B picture (default is P picture)") 624 #if Q0074_SEI_COLOR_MAPPING 625 ("SEIColorMappingFile%d", cfg_seiColorMappingFile, string(""), MAX_LAYERS, "File Containing SEI Color Mapping data") 626 #endif 618 627 #else //SVC_EXTENSION 619 628 ("InputFile,i", cfg_InputFile, string(""), "Original YUV input file name") … … 710 719 ("IntraPeriod,-ip", m_iIntraPeriod, -1, "Intra period in frames, (-1: only first frame)") 711 720 #endif 721 #if ALLOW_RECOVERY_POINT_AS_RAP 722 ("DecodingRefreshType,-dr", m_iDecodingRefreshType, 0, "Intra refresh type (0:none 1:CRA 2:IDR 3:RecPointSEI)") 723 #else 712 724 ("DecodingRefreshType,-dr", m_iDecodingRefreshType, 0, "Intra refresh type (0:none 1:CRA 2:IDR)") 725 #endif 713 726 ("GOPSize,g", m_iGOPSize, 1, "GOP size of temporal structure") 714 727 // motion options … … 905 918 ("SEIToneMapCameraIsoSpeedIdc", m_cameraIsoSpeedIdc, 0, "Indicates the camera ISO speed for daylight illumination") 906 919 ("SEIToneMapCameraIsoSpeedValue", m_cameraIsoSpeedValue, 400, "Specifies the camera ISO speed for daylight illumination of Extended_ISO") 920 ("SEIToneMapExposureIndexIdc", m_exposureIndexIdc, 0, "Indicates the exposure index setting of the camera") 921 ("SEIToneMapExposureIndexValue", m_exposureIndexValue, 400, "Specifies the exposure index setting of the cameran of Extended_ISO") 907 922 ("SEIToneMapExposureCompensationValueSignFlag", m_exposureCompensationValueSignFlag, 0, "Specifies the sign of ExposureCompensationValue") 908 923 ("SEIToneMapExposureCompensationValueNumerator", m_exposureCompensationValueNumerator, 0, "Specifies the numerator of ExposureCompensationValue") … … 955 970 ("CrossLayerBLAFlag", m_crossLayerBLAFlag, false, "Specifies the value of cross_layer_bla_flag in VPS") 956 971 #endif 972 #if Q0048_CGS_3D_ASYMLUT 973 ("CGS", m_nCGSFlag , 0, "whether CGS is enabled") 974 ("CGSMaxOctantDepth", m_nCGSMaxOctantDepth , 1, "max octant depth") 975 ("CGSMaxYPartNumLog", m_nCGSMaxYPartNumLog2 , 2, "max Y part number ") 976 ("CGSLUTBit", m_nCGSLUTBit , 12, "bit depth of CGS LUT") 977 #endif 957 978 ; 958 979 … … 1202 1223 if( i >= m_acLayerCfg[layer].m_numSamplePredRefLayers ) 1203 1224 { 1204 printf( "NumSamplePredRefLayers : The number of columns whose width are defined is larger than the allowed number of columns.\n");1225 printf( "NumSamplePredRefLayers%d: The number of columns whose width are defined is larger than the allowed number of columns.\n", layer ); 1205 1226 exit( EXIT_FAILURE ); 1206 1227 } … … 1211 1232 if( i < m_acLayerCfg[layer].m_numSamplePredRefLayers ) 1212 1233 { 1213 printf( "NumSamplePredRefLayers : The width of some columns is not defined.\n");1234 printf( "NumSamplePredRefLayers%d: The width of some columns is not defined.\n", layer ); 1214 1235 exit( EXIT_FAILURE ); 1215 1236 } … … 1233 1254 if( i >= m_acLayerCfg[layer].m_numMotionPredRefLayers ) 1234 1255 { 1235 printf( "NumMotionPredRefLayers : The number of columns whose width are defined is larger than the allowed number of columns.\n");1256 printf( "NumMotionPredRefLayers%d: The number of columns whose width are defined is larger than the allowed number of columns.\n", layer ); 1236 1257 exit( EXIT_FAILURE ); 1237 1258 } … … 1242 1263 if( i < m_acLayerCfg[layer].m_numMotionPredRefLayers ) 1243 1264 { 1244 printf( "NumMotionPredRefLayers : The width of some columns is not defined.\n");1265 printf( "NumMotionPredRefLayers%d: The width of some columns is not defined.\n", layer ); 1245 1266 exit( EXIT_FAILURE ); 1246 1267 } … … 1272 1293 if( i >= m_acLayerCfg[layer].m_numActiveRefLayers ) 1273 1294 { 1274 printf( "NumActiveRefLayers : The number of columns whose width are defined is larger than the allowed number of columns.\n");1295 printf( "NumActiveRefLayers%d: The number of columns whose width are defined is larger than the allowed number of columns.\n", layer ); 1275 1296 exit( EXIT_FAILURE ); 1276 1297 } … … 1281 1302 if( i < m_acLayerCfg[layer].m_numActiveRefLayers ) 1282 1303 { 1283 printf( "NumActiveRefLayers : The width of some columns is not defined.\n");1304 printf( "NumActiveRefLayers%d: The width of some columns is not defined.\n", layer ); 1284 1305 exit( EXIT_FAILURE ); 1285 1306 } … … 1474 1495 } 1475 1496 } 1497 1476 1498 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 1477 1499 if (m_interLayerConstrainedTileSetsSEIEnabled) … … 1587 1609 xConfirmPara( (m_iIntraPeriod > 0 && m_iIntraPeriod < m_iGOPSize) || m_iIntraPeriod == 0, "Intra period must be more than GOP size, or -1 , not 0" ); 1588 1610 #endif 1611 #if ALLOW_RECOVERY_POINT_AS_RAP 1612 xConfirmPara( m_iDecodingRefreshType < 0 || m_iDecodingRefreshType > 3, "Decoding Refresh Type must be comprised between 0 and 3 included" ); 1613 if(m_iDecodingRefreshType == 3) 1614 { 1615 xConfirmPara( !m_recoveryPointSEIEnabled, "When using RecoveryPointSEI messages as RA points, recoveryPointSEI must be enabled" ); 1616 } 1617 #else 1589 1618 xConfirmPara( m_iDecodingRefreshType < 0 || m_iDecodingRefreshType > 2, "Decoding Refresh Type must be equal to 0, 1 or 2" ); 1619 #endif 1590 1620 #if !SVC_EXTENSION 1591 1621 xConfirmPara( m_iQP < -6 * (m_internalBitDepthY - 8) || m_iQP > 51, "QP exceeds supported range (-QpBDOffsety to 51)" ); … … 2160 2190 xConfirmPara( m_toneMapModelId < 0 || m_toneMapModelId > 4 , "SEIToneMapModelId must be in rage 0 to 4"); 2161 2191 xConfirmPara( m_cameraIsoSpeedValue == 0, "SEIToneMapCameraIsoSpeedValue shall not be equal to 0"); 2192 xConfirmPara( m_exposureIndexValue == 0, "SEIToneMapExposureIndexValue shall not be equal to 0"); 2162 2193 xConfirmPara( m_extendedRangeWhiteLevel < 100, "SEIToneMapExtendedRangeWhiteLevel should be greater than or equal to 100"); 2163 2194 xConfirmPara( m_nominalBlackLevelLumaCodeValue >= m_nominalWhiteLevelLumaCodeValue, "SEIToneMapNominalWhiteLevelLumaCodeValue shall be greater than SEIToneMapNominalBlackLevelLumaCodeValue"); … … 2286 2317 } 2287 2318 #endif 2319 #if Q0048_CGS_3D_ASYMLUT 2320 xConfirmPara( m_nCGSFlag < 0 || m_nCGSFlag > 1 , "0<=CGS<=1" ); 2321 #endif 2288 2322 #undef xConfirmPara 2289 2323 if (check_failed) … … 2545 2579 printf("RecalQP:%d", m_recalculateQPAccordingToLambda ? 1 : 0 ); 2546 2580 #endif 2581 #if Q0048_CGS_3D_ASYMLUT 2582 printf("CGS: %d CGSMaxOctantDepth: %d CGSMaxYPartNumLog2: %d CGSLUTBit:%d " , m_nCGSFlag , m_nCGSMaxOctantDepth , m_nCGSMaxYPartNumLog2 , m_nCGSLUTBit ); 2583 #endif 2547 2584 printf("\n\n"); 2548 2585 -
trunk/source/App/TAppEncoder/TAppEncCfg.h
r644 r713 255 255 Int m_cameraIsoSpeedIdc; 256 256 Int m_cameraIsoSpeedValue; 257 Int m_exposureIndexIdc; 258 Int m_exposureIndexValue; 257 259 Int m_exposureCompensationValueSignFlag; 258 260 Int m_exposureCompensationValueNumerator; … … 266 268 Int* m_codedPivotValue; 267 269 Int* m_targetPivotValue; 270 #if Q0074_SEI_COLOR_MAPPING 271 Char* m_pchSEIColorMappingFile; ///< SEI Color Mapping File (initialized from external file) 272 #endif 268 273 Int m_framePackingSEIEnabled; 269 274 Int m_framePackingSEIType; … … 393 398 Bool m_useInterLayerWeightedPred; 394 399 #endif 400 #if Q0048_CGS_3D_ASYMLUT 401 Int m_nCGSFlag; 402 Int m_nCGSMaxOctantDepth; 403 Int m_nCGSMaxYPartNumLog2; 404 Int m_nCGSLUTBit; 405 #endif 395 406 public: 396 407 TAppEncCfg(); -
trunk/source/App/TAppEncoder/TAppEncLayerCfg.cpp
r644 r713 171 171 } 172 172 #endif 173 #if REPN_FORMAT_IN_VPS 174 printf("Real Format : %dx%d %dHz\n", m_iSourceWidth - ( m_confLeft + m_confRight ) * TComSPS::getWinUnitX( m_chromaFormatIDC ), m_iSourceHeight - ( m_confTop + m_confBottom ) * TComSPS::getWinUnitY( m_chromaFormatIDC ), m_iFrameRate ); 175 #else 173 176 printf("Real Format : %dx%d %dHz\n", m_iSourceWidth - m_confLeft - m_confRight, m_iSourceHeight - m_confTop - m_confBottom, m_iFrameRate ); 177 #endif 174 178 printf("Internal Format : %dx%d %dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate ); 175 179 #if O0194_DIFFERENT_BITDEPTH_EL_BL … … 229 233 m_aiPad[0] = m_confRight = ((m_iSourceWidth / minCuSize) + 1) * minCuSize - m_iSourceWidth; 230 234 m_iSourceWidth += m_confRight; 235 #if REPN_FORMAT_IN_VPS 236 m_confRight /= TComSPS::getWinUnitX( m_chromaFormatIDC ); 237 #endif 231 238 } 232 239 if (m_iSourceHeight % minCuSize) … … 239 246 m_aiPad[1] = m_confBottom << 1; 240 247 } 248 #if REPN_FORMAT_IN_VPS 249 m_confBottom /= TComSPS::getWinUnitY( m_chromaFormatIDC ); 250 #endif 241 251 } 242 252 break; … … 249 259 m_confRight = m_aiPad[0]; 250 260 m_confBottom = m_aiPad[1]; 261 #if REPN_FORMAT_IN_VPS 262 m_confRight /= TComSPS::getWinUnitX( m_chromaFormatIDC ); 263 m_confBottom /= TComSPS::getWinUnitY( m_chromaFormatIDC ); 264 #endif 251 265 break; 252 266 } … … 331 345 xConfirmPara( m_aiPad[1] % TComSPS::getWinUnitY(CHROMA_420) != 0, "Vertical padding must be an integer multiple of the specified chroma subsampling"); 332 346 347 #if !REPN_FORMAT_IN_VPS 333 348 xConfirmPara( m_confLeft % TComSPS::getWinUnitX(CHROMA_420) != 0, "Left conformance window offset must be an integer multiple of the specified chroma subsampling"); 334 349 xConfirmPara( m_confRight % TComSPS::getWinUnitX(CHROMA_420) != 0, "Right conformance window offset must be an integer multiple of the specified chroma subsampling"); 335 350 xConfirmPara( m_confTop % TComSPS::getWinUnitY(CHROMA_420) != 0, "Top conformance window offset must be an integer multiple of the specified chroma subsampling"); 336 351 xConfirmPara( m_confBottom % TComSPS::getWinUnitY(CHROMA_420) != 0, "Bottom conformance window offset must be an integer multiple of the specified chroma subsampling"); 352 #endif 337 353 338 354 #if LAYER_CTB -
trunk/source/App/TAppEncoder/TAppEncLayerCfg.h
r644 r713 54 54 Int *m_predLayerIds; 55 55 Int m_numActiveRefLayers; 56 #endif 57 #if Q0074_SEI_COLOR_MAPPING 58 string m_cSeiColorMappingFile; 56 59 #endif 57 60 -
trunk/source/App/TAppEncoder/TAppEncTop.cpp
r649 r713 91 91 } 92 92 93 #if REPN_FORMAT_IN_VPS 94 vps->setRepFormatIdxPresentFlag( true ); // Could be disabled to optimize in some cases. 93 #if REPN_FORMAT_IN_VPS 95 94 Int maxRepFormatIdx = -1; 96 95 Int formatIdx = -1; … … 125 124 126 125 assert( m_acLayerCfg[layer].getRepFormatIdx() != -1 && "RepFormatIdx not assigned for a layer" ); 126 127 127 vps->setVpsRepFormatIdx( layer, m_acLayerCfg[layer].getRepFormatIdx() ); 128 128 129 maxRepFormatIdx = std::max( m_acLayerCfg[layer].getRepFormatIdx(), maxRepFormatIdx ); 129 130 } 131 130 132 assert( vps->getVpsRepFormatIdx( 0 ) == 0 ); // Base layer should point to the first one. 133 131 134 Int* mapIdxToLayer = new Int[maxRepFormatIdx + 1]; 135 132 136 // Check that all the indices from 0 to maxRepFormatIdx are used in the VPS 133 137 for(Int i = 0; i <= maxRepFormatIdx; i++) … … 145 149 assert( layer != m_numLayers ); // One of the VPS Rep format indices not set 146 150 } 151 147 152 vps->setVpsNumRepFormats( maxRepFormatIdx + 1 ); 153 154 #if Q0195_REP_FORMAT_CLEANUP 155 // When not present, the value of rep_format_idx_present_flag is inferred to be equal to 0 156 vps->setRepFormatIdxPresentFlag( vps->getVpsNumRepFormats() > 1 ? true : false ); 157 #else 158 vps->setRepFormatIdxPresentFlag( true ); 159 #endif 160 148 161 for(UInt idx=0; idx < vps->getVpsNumRepFormats(); idx++) 149 162 { … … 467 480 m_acTEncTop[layer].setTMISEINominalWhiteLevelLumaCodeValue ( m_nominalWhiteLevelLumaCodeValue ); 468 481 m_acTEncTop[layer].setTMISEIExtendedWhiteLevelLumaCodeValue ( m_extendedWhiteLevelLumaCodeValue ); 482 #if Q0074_SEI_COLOR_MAPPING 483 m_acTEncTop[layer].setColorMappingInfoSEIFile ( m_acLayerCfg[layer].m_cSeiColorMappingFile.empty() ? NULL : const_cast<Char *>(m_acLayerCfg[layer].m_cSeiColorMappingFile.c_str()) ); 484 #endif 469 485 m_acTEncTop[layer].setFramePackingArrangementSEIEnabled( m_framePackingSEIEnabled ); 470 486 m_acTEncTop[layer].setFramePackingArrangementSEIType( m_framePackingSEIType ); … … 592 608 m_acTEncTop[layer].setCrossLayerBLAFlag( m_crossLayerBLAFlag ); 593 609 #endif 610 #if Q0048_CGS_3D_ASYMLUT 611 m_acTEncTop[layer].setCGSFlag( layer == 0 ? 0 : m_nCGSFlag ); 612 m_acTEncTop[layer].setCGSMaxOctantDepth( m_nCGSMaxOctantDepth ); 613 m_acTEncTop[layer].setCGSMaxYPartNumLog2( m_nCGSMaxYPartNumLog2 ); 614 m_acTEncTop[layer].setCGSLUTBit( m_nCGSLUTBit ); 615 #endif 594 616 } 595 617 } … … 767 789 m_cTEncTop.setTMISEICameraIsoSpeedIdc ( m_cameraIsoSpeedIdc ); 768 790 m_cTEncTop.setTMISEICameraIsoSpeedValue ( m_cameraIsoSpeedValue ); 791 m_cTEncTop.setTMISEIExposureIndexIdc ( m_exposureIndexIdc ); 792 m_cTEncTop.setTMISEIExposureIndexValue ( m_exposureIndexValue ); 769 793 m_cTEncTop.setTMISEIExposureCompensationValueSignFlag ( m_exposureCompensationValueSignFlag ); 770 794 m_cTEncTop.setTMISEIExposureCompensationValueNumerator ( m_exposureCompensationValueNumerator ); … … 775 799 m_cTEncTop.setTMISEINominalWhiteLevelLumaCodeValue ( m_nominalWhiteLevelLumaCodeValue ); 776 800 m_cTEncTop.setTMISEIExtendedWhiteLevelLumaCodeValue ( m_extendedWhiteLevelLumaCodeValue ); 801 #if Q0074_SEI_COLOR_MAPPING 802 m_cTEncTop.setColorMappingInfoSEIFile ( m_pchSEIColorMappingFile ); 803 #endif 777 804 m_cTEncTop.setFramePackingArrangementSEIEnabled( m_framePackingSEIEnabled ); 778 805 m_cTEncTop.setFramePackingArrangementSEIType( m_framePackingSEIType ); … … 974 1001 vps->setMaxLayerId(m_numLayers - 1); // Set max-layer ID 975 1002 1003 vps->setVpsExtensionFlag( m_numLayers > 1 ? true : false ); 1004 976 1005 vps->setNumLayerSets(m_numLayers); 977 1006 for(Int setId = 1; setId < vps->getNumLayerSets(); setId++) … … 1068 1097 #if VPS_TSLAYERS 1069 1098 vps->setMaxTSLayersPresentFlag(true); 1070 for( i = 0; i < MAX_VPS_LAYER_ID_PLUS1 - 1; i++ )1071 { 1072 1099 for( i = 0; i < vps->getMaxLayers(); i++ ) 1100 { 1101 vps->setMaxTSLayersMinus1(i, vps->getMaxTLayers()-1); 1073 1102 } 1074 1103 #endif … … 1081 1110 if (vps->getMaxTidRefPresentFlag()) 1082 1111 { 1083 for( i = 0; i < MAX_VPS_LAYER_ID_PLUS1- 1; i++ )1112 for( i = 0; i < vps->getMaxLayers() - 1; i++ ) 1084 1113 { 1085 1114 #if N0120_MAX_TID_REF_CFG 1086 1115 #if O0225_MAX_TID_FOR_REF_LAYERS 1087 for( Int j = i+1; j < = MAX_VPS_LAYER_ID_PLUS1 - 1; j++)1116 for( Int j = i+1; j < vps->getMaxLayers(); j++) 1088 1117 { 1089 1118 vps->setMaxTidIlRefPicsPlus1(i, j, m_acTEncTop[i].getMaxTidIlRefPicsPlus1()); … … 1094 1123 #else 1095 1124 #if O0225_MAX_TID_FOR_REF_LAYERS 1096 for( Int j = i+1; j < = MAX_VPS_LAYER_ID_PLUS1 - 1; j++)1125 for( Int j = i+1; j < vps->getMaxLayers(); j++) 1097 1126 { 1098 1127 vps->setMaxTidIlRefPicsPlus1(i, j, vps->getMaxTLayers()+1); … … 1106 1135 else 1107 1136 { 1108 for( i = 0; i < MAX_VPS_LAYER_ID_PLUS1- 1; i++ )1137 for( i = 0; i < vps->getMaxLayers() - 1; i++ ) 1109 1138 { 1110 1139 #if O0225_MAX_TID_FOR_REF_LAYERS 1111 for( Int j = i+1; j < = MAX_VPS_LAYER_ID_PLUS1 - 1; j++)1140 for( Int j = i+1; j < vps->getMaxLayers(); j++) 1112 1141 { 1113 1142 vps->setMaxTidIlRefPicsPlus1(i, j, 7); … … 1297 1326 if(vps->getMaxLayers() > MAX_REF_LAYERS) 1298 1327 { 1299 for(UInt layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++)1328 for(UInt layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++) 1300 1329 { 1301 1330 assert( vps->getNumRefLayers(vps->getLayerIdInNuh(layerCtr)) <= MAX_REF_LAYERS); … … 1400 1429 Int iPicWidth = pcCfgLayer->getSourceWidth(); 1401 1430 Int iPicHeight = pcCfgLayer->getSourceHeight(); 1431 #if LAYER_CTB 1432 UInt uiWidthInCU = ( iPicWidth % m_acLayerCfg[layerId].m_uiMaxCUWidth ) ? iPicWidth / m_acLayerCfg[layerId].m_uiMaxCUWidth + 1 : iPicWidth / m_acLayerCfg[layerId].m_uiMaxCUWidth; 1433 UInt uiHeightInCU = ( iPicHeight % m_acLayerCfg[layerId].m_uiMaxCUHeight ) ? iPicHeight / m_acLayerCfg[layerId].m_uiMaxCUHeight + 1 : iPicHeight / m_acLayerCfg[layerId].m_uiMaxCUHeight; 1434 #else 1402 1435 UInt uiWidthInCU = ( iPicWidth %m_uiMaxCUWidth ) ? iPicWidth /m_uiMaxCUWidth + 1 : iPicWidth /m_uiMaxCUWidth; 1403 1436 UInt uiHeightInCU = ( iPicHeight%m_uiMaxCUHeight ) ? iPicHeight/m_uiMaxCUHeight + 1 : iPicHeight/m_uiMaxCUHeight; 1437 #endif 1404 1438 UInt uiNumCUsInFrame = uiWidthInCU * uiHeightInCU; 1405 1439 1440 #if LAYER_CTB 1441 UInt maxCU = pcCfgLayer->getSliceArgument() >> ( m_acLayerCfg[layerId].m_uiMaxCUDepth << 1); 1442 #else 1406 1443 UInt maxCU = pcCfgLayer->getSliceArgument() >> ( m_uiMaxCUDepth << 1); 1444 #endif 1407 1445 UInt numDU = ( pcCfgLayer->getSliceMode() == 1 ) ? ( uiNumCUsInFrame / maxCU ) : ( 0 ); 1408 1446 if( uiNumCUsInFrame % maxCU != 0 || numDU == 0 ) -
trunk/source/Lib/TLibCommon/CommonDef.h
r644 r713 58 58 #if SVC_EXTENSION 59 59 #include <vector> 60 #define NV_VERSION " 5.1 (HM-13.0)" ///< Current software version60 #define NV_VERSION "6.0 (HM-14.0)" ///< Current software version 61 61 #else 62 #define NV_VERSION "1 3.0" ///< Current software version62 #define NV_VERSION "14.0" ///< Current software version 63 63 #endif 64 64 -
trunk/source/Lib/TLibCommon/SEI.h
r644 r713 79 79 #endif 80 80 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 81 INTER_LAYER_CONSTRAINED_TILE_SETS = 138 81 INTER_LAYER_CONSTRAINED_TILE_SETS = 138, 82 82 #endif 83 83 #if SUB_BITSTREAM_PROPERTY_SEI 84 ,SUB_BITSTREAM_PROPERTY = 139// Final PayloadType to be defined after finalization84 SUB_BITSTREAM_PROPERTY = 139, // Final PayloadType to be defined after finalization 85 85 #endif 86 86 #if O0164_MULTI_LAYER_HRD 87 ,BSP_NESTING = 140 88 ,BSP_INITIAL_ARRIVAL_TIME = 141 89 ,BSP_HRD = 142 87 BSP_NESTING = 140, 88 BSP_INITIAL_ARRIVAL_TIME = 141, 89 BSP_HRD = 142, 90 #endif 91 #if Q0074_SEI_COLOR_MAPPING 92 COLOR_MAPPING_INFO = 143, 90 93 #endif 91 94 }; … … 142 145 SEIActiveParameterSets() 143 146 : activeVPSId (0) 144 , m_ fullRandomAccessFlag (false)145 , m_noParam SetUpdateFlag (false)147 , m_selfContainedCvsFlag (false) 148 , m_noParameterSetUpdateFlag (false) 146 149 , numSpsIdsMinus1 (0) 147 150 {} … … 149 152 150 153 Int activeVPSId; 151 Bool m_ fullRandomAccessFlag;152 Bool m_noParam SetUpdateFlag;154 Bool m_selfContainedCvsFlag; 155 Bool m_noParameterSetUpdateFlag; 153 156 Int numSpsIdsMinus1; 154 std::vector<Int> activeSeqParam SetId;157 std::vector<Int> activeSeqParameterSetId; 155 158 }; 156 159 … … 393 396 Int m_cameraIsoSpeedIdc; 394 397 Int m_cameraIsoSpeedValue; 398 Int m_exposureIndexIdc; 399 Int m_exposureIndexValue; 395 400 Int m_exposureCompensationValueSignFlag; 396 401 Int m_exposureCompensationValueNumerator; … … 402 407 Int m_extendedWhiteLevelLumaCodeValue; 403 408 }; 409 410 #if Q0074_SEI_COLOR_MAPPING 411 class SEIColorMappingInfo : public SEI 412 { 413 public: 414 PayloadType payloadType() const { return COLOR_MAPPING_INFO; } 415 SEIColorMappingInfo() { 416 } 417 virtual ~SEIColorMappingInfo() {} 418 419 Int m_colorMapId; 420 Bool m_colorMapCancelFlag; 421 Bool m_colorMapPersistenceFlag; 422 Bool m_colorMap_video_signal_type_present_flag; 423 Bool m_colorMap_video_full_range_flag; 424 Int m_colorMap_primaries; 425 Int m_colorMap_transfer_characteristics; 426 Int m_colorMap_matrix_coeffs; 427 Int m_colorMapModelId; 428 429 Int m_colour_map_coded_data_bit_depth; 430 Int m_colour_map_target_bit_depth; 431 432 Int m_num_input_pivots[3]; 433 Int* m_coded_input_pivot_value[3]; 434 Int* m_target_input_pivot_value[3]; 435 436 Bool m_matrix_flag; 437 Int m_log2_matrix_denom; 438 Int m_matrix_coef[3][3]; 439 440 Int m_num_output_pivots[3]; 441 Int* m_coded_output_pivot_value[3]; 442 Int* m_target_output_pivot_value[3]; 443 }; 444 #endif 404 445 405 446 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI -
trunk/source/Lib/TLibCommon/TComDataCU.cpp
r595 r713 172 172 memset( m_pcTrCoeffCb, 0,uiWidth*uiHeight/4 * sizeof( TCoeff ) ); 173 173 memset( m_pcTrCoeffCr, 0,uiWidth*uiHeight/4 * sizeof( TCoeff ) ); 174 #if ADAPTIVE_QP_SELECTION 174 #if ADAPTIVE_QP_SELECTION 175 175 if( bGlobalRMARLBuffer ) 176 176 { 177 177 if( m_pcGlbArlCoeffY == NULL ) 178 178 { 179 #if LAYER_CTB 180 m_pcGlbArlCoeffY = (Int*)xMalloc(Int, MAX_CU_SIZE * MAX_CU_SIZE); 181 m_pcGlbArlCoeffCb = (Int*)xMalloc(Int, MAX_CU_SIZE * MAX_CU_SIZE/4); 182 m_pcGlbArlCoeffCr = (Int*)xMalloc(Int, MAX_CU_SIZE * MAX_CU_SIZE/4); 183 #else 179 184 m_pcGlbArlCoeffY = (Int*)xMalloc(Int, uiWidth*uiHeight); 180 185 m_pcGlbArlCoeffCb = (Int*)xMalloc(Int, uiWidth*uiHeight/4); 181 186 m_pcGlbArlCoeffCr = (Int*)xMalloc(Int, uiWidth*uiHeight/4); 187 #endif 182 188 } 183 189 m_pcArlCoeffY = m_pcGlbArlCoeffY; … … 1690 1696 } 1691 1697 1692 1693 #if FAST_INTRA_SHVC1694 /** generate limited set of remaining modes1695 *\param uiAbsPartIdx1696 *\param uiIntraDirPred pointer to the array for MPM storage1697 *\returns Number of intra coding modes (nb of remaining modes + 3 MPMs)1698 */1699 Int TComDataCU::reduceSetOfIntraModes( UInt uiAbsPartIdx, Int* uiIntraDirPred, Int &fullSetOfModes )1700 {1701 // check BL mode1702 UInt uiCUAddrBase = 0, uiAbsPartAddrBase = 0;1703 // the right reference layerIdc should be specified, currently it is set to m_layerId-11704 TComDataCU* pcTempCU = getBaseColCU(m_layerId - 1, uiAbsPartIdx, uiCUAddrBase, uiAbsPartAddrBase, 0 );1705 1706 if( pcTempCU->getPredictionMode( uiAbsPartAddrBase ) != MODE_INTRA )1707 {1708 return( NUM_INTRA_MODE-1 );1709 }1710 1711 // compute set of enabled modes g_reducedSetIntraModes[...]1712 Int authorizedMode[NUM_INTRA_MODE-1]={1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};1713 Int nbModes;1714 for (nbModes=0; nbModes<3; nbModes++) // add 3 MPMs 1st1715 {1716 g_reducedSetIntraModes[nbModes] = uiIntraDirPred[nbModes];1717 authorizedMode[ uiIntraDirPred[nbModes] ] = 0;1718 }1719 1720 Int iColBaseDir = pcTempCU->getLumaIntraDir( uiAbsPartAddrBase );1721 if ( authorizedMode[iColBaseDir] ) //possibly add BL mode1722 {1723 g_reducedSetIntraModes[nbModes++] = iColBaseDir;1724 authorizedMode[ iColBaseDir ] = 0;1725 }1726 1727 Int iRefMode = ( iColBaseDir > 1 ) ? iColBaseDir : uiIntraDirPred[0];1728 if ( iRefMode > 1 ) //add neighboring modes of refMode1729 {1730 UInt Left = iRefMode;1731 UInt Right = iRefMode;1732 while ( nbModes < NB_REMAIN_MODES+3 )1733 {1734 Left = ((Left + 29) % 32) + 2;1735 Right = ((Right - 1 ) % 32) + 2;1736 if ( authorizedMode[Left] ) g_reducedSetIntraModes[nbModes++] = Left;1737 if ( authorizedMode[Right] ) g_reducedSetIntraModes[nbModes++] = Right;1738 }1739 }1740 else //add pre-defined modes1741 {1742 Int idx = 0;1743 while ( nbModes < NB_REMAIN_MODES+3 )1744 {1745 UInt mode = g_predefSetIntraModes[idx++];1746 if ( authorizedMode[mode] ) g_reducedSetIntraModes[nbModes++] = mode;1747 }1748 }1749 1750 fullSetOfModes = 0;1751 return ( nbModes );1752 }1753 #endif1754 1755 1756 1698 UInt TComDataCU::getCtxSplitFlag( UInt uiAbsPartIdx, UInt uiDepth ) 1757 1699 { … … 1809 1751 return log2MinTUSizeInCU; 1810 1752 } 1811 1812 #if REF_IDX_ME_ZEROMV1813 Bool TComDataCU::xCheckZeroMVILRMerge(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1)1814 {1815 Bool checkZeroMVILR = true;1816 1817 if(uhInterDir&0x1) //list01818 {1819 Int refIdxL0 = cMvFieldL0.getRefIdx();1820 if(getSlice()->getRefPic(REF_PIC_LIST_0, refIdxL0)->isILR(m_layerId))1821 {1822 checkZeroMVILR &= (cMvFieldL0.getHor() == 0 && cMvFieldL0.getVer() == 0);1823 }1824 }1825 if(uhInterDir&0x2) //list11826 {1827 Int refIdxL1 = cMvFieldL1.getRefIdx();1828 if(getSlice()->getRefPic(REF_PIC_LIST_1, refIdxL1)->isILR(m_layerId))1829 {1830 checkZeroMVILR &= (cMvFieldL1.getHor() == 0 && cMvFieldL1.getVer() == 0);1831 }1832 }1833 1834 return checkZeroMVILR;1835 }1836 1837 Bool TComDataCU::xCheckZeroMVILRMvdL1Zero(Int iRefList, Int iRefIdx, Int MvpIdx)1838 {1839 RefPicList eRefPicList = iRefList > 0? REF_PIC_LIST_1: REF_PIC_LIST_0;1840 assert(eRefPicList == REF_PIC_LIST_1);1841 1842 Bool checkZeroMVILR = true;1843 1844 if(getSlice()->getRefPic(eRefPicList, iRefIdx)->isILR(m_layerId))1845 {1846 AMVPInfo* pcAMVPInfo = getCUMvField(eRefPicList)->getAMVPInfo();1847 TComMv cMv = pcAMVPInfo->m_acMvCand[MvpIdx];1848 checkZeroMVILR &= (cMv.getHor() == 0 && cMv.getVer() == 0);1849 }1850 1851 return checkZeroMVILR;1852 }1853 #endif1854 1855 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI1856 Bool TComDataCU::isInterLayerReference(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1)1857 {1858 Bool checkILR = false;1859 1860 if(uhInterDir&0x1) //list01861 {1862 Int refIdxL0 = cMvFieldL0.getRefIdx();1863 checkILR = getSlice()->getRefPic(REF_PIC_LIST_0, refIdxL0)->isILR(m_layerId);1864 }1865 if(uhInterDir&0x2) //list11866 {1867 Int refIdxL1 = cMvFieldL1.getRefIdx();1868 checkILR = checkILR || getSlice()->getRefPic(REF_PIC_LIST_1, refIdxL1)->isILR(m_layerId);1869 }1870 1871 return checkILR;1872 }1873 #endif1874 1753 1875 1754 UInt TComDataCU::getCtxSkipFlag( UInt uiAbsPartIdx ) … … 2168 2047 } 2169 2048 2170 UChar TComDataCU::getNumPart Inter()2049 UChar TComDataCU::getNumPartitions() 2171 2050 { 2172 2051 UChar iNumPart = 0; … … 3612 3491 TComDataCU* TComDataCU::getBaseColCU( UInt refLayerIdc, UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Int iMotionMapping ) 3613 3492 { 3614 TComPic* cBaseColPic = m_pcSlice->getBaseColPic(refLayerIdc);3493 TComPic* baseColPic = m_pcSlice->getBaseColPic(refLayerIdc); 3615 3494 3616 3495 uiPelX = (UInt)Clip3<UInt>(0, m_pcPic->getPicYuvRec()->getWidth() - 1, uiPelX); … … 3622 3501 3623 3502 #if O0098_SCALED_REF_LAYER_ID 3624 Int leftStartL = getSlice()->getSPS()->getScaledRefLayerWindowForLayer(getSlice()->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowLeftOffset();3625 Int topStartL = getSlice()->getSPS()->getScaledRefLayerWindowForLayer(getSlice()->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowTopOffset();3503 Int leftStartL = baseColPic->getSlice(0)->getSPS()->getScaledRefLayerWindowForLayer(baseColPic->getSlice(0)->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowLeftOffset(); 3504 Int topStartL = baseColPic->getSlice(0)->getSPS()->getScaledRefLayerWindowForLayer(baseColPic->getSlice(0)->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowTopOffset(); 3626 3505 #else 3627 Int leftStartL = this->getSlice()->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowLeftOffset(); 3628 Int topStartL = this->getSlice()->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowTopOffset(); 3629 #endif 3506 Int leftStartL = baseColPic->getSlice(0)->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowLeftOffset(); 3507 Int topStartL = baseColPic->getSlice(0)->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowTopOffset(); 3508 #endif 3509 3510 #if Q0200_CONFORMANCE_BL_SIZE 3511 Int chromaFormatIdc = baseColPic->getSlice(0)->getChromaFormatIdc(); 3512 Int iBX = (((uiPelX - leftStartL)*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16) + baseColPic->getConformanceWindow().getWindowLeftOffset() * TComSPS::getWinUnitX( chromaFormatIdc ); 3513 Int iBY = (((uiPelY - topStartL )*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16) + baseColPic->getConformanceWindow().getWindowTopOffset() * TComSPS::getWinUnitY( chromaFormatIdc ); 3514 #else 3630 3515 Int iBX = ((uiPelX - leftStartL)*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16; 3631 3516 Int iBY = ((uiPelY - topStartL )*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16; 3517 #endif 3632 3518 3633 3519 #if N0139_POSITION_ROUNDING_OFFSET 3634 3520 if( iMotionMapping == 1 ) 3635 3521 { 3636 iBX += 4;3637 iB Y +=4;3638 }3639 #endif 3640 3641 if ( iBX >= cBaseColPic->getPicYuvRec()->getWidth() || iBY >= cBaseColPic->getPicYuvRec()->getHeight() || 3642 iBX < 0 || iBY < 0)3522 // actually, motion field compression is performed in the Void TComPic::compressMotion() function, but with (+4) the rounding may have effect on the picture boundary check. 3523 iBX = ( ( iBX + 4 ) >> 4 ) << 4; 3524 iBY = ( ( iBY + 4 ) >> 4 ) << 4; 3525 } 3526 #endif 3527 3528 if ( iBX < 0 || iBX >= baseColPic->getPicYuvRec()->getWidth() || iBY < 0 || iBY >= baseColPic->getPicYuvRec()->getHeight() ) 3643 3529 { 3644 3530 return NULL; … … 3646 3532 3647 3533 #if LAYER_CTB 3648 UInt baseMaxCUHeight = cBaseColPic->getPicSym()->getMaxCUHeight();3649 UInt baseMaxCUWidth = cBaseColPic->getPicSym()->getMaxCUWidth();3650 UInt baseMinUnitSize = cBaseColPic->getMinCUWidth();3651 3652 uiCUAddrBase = ( iBY / cBaseColPic->getPicSym()->getMaxCUHeight() ) * cBaseColPic->getFrameWidthInCU() + ( iBX / cBaseColPic->getPicSym()->getMaxCUWidth());3534 UInt baseMaxCUHeight = baseColPic->getPicSym()->getMaxCUHeight(); 3535 UInt baseMaxCUWidth = baseColPic->getPicSym()->getMaxCUWidth(); 3536 UInt baseMinUnitSize = baseColPic->getMinCUWidth(); 3537 3538 uiCUAddrBase = ( iBY / baseMaxCUHeight ) * baseColPic->getFrameWidthInCU() + ( iBX / baseMaxCUWidth ); 3653 3539 #else 3654 uiCUAddrBase = (iBY/g_uiMaxCUHeight)* cBaseColPic->getFrameWidthInCU() + (iBX/g_uiMaxCUWidth);3655 #endif 3656 3657 assert(uiCUAddrBase < cBaseColPic->getNumCUsInFrame());3540 uiCUAddrBase = (iBY/g_uiMaxCUHeight)*baseColPic->getFrameWidthInCU() + (iBX/g_uiMaxCUWidth); 3541 #endif 3542 3543 assert(uiCUAddrBase < baseColPic->getNumCUsInFrame()); 3658 3544 3659 3545 #if LAYER_CTB 3660 UInt uiRasterAddrBase = ( iBY - (iBY/baseMaxCUHeight)*baseMaxCUHeight ) / baseMinUnitSize * cBaseColPic->getNumPartInWidth() + ( iBX - (iBX/baseMaxCUWidth)*baseMaxCUWidth ) / baseMinUnitSize;3661 3662 uiAbsPartIdxBase = g_auiLayerRasterToZscan[ cBaseColPic->getLayerId()][uiRasterAddrBase];3546 UInt uiRasterAddrBase = ( iBY - (iBY/baseMaxCUHeight)*baseMaxCUHeight ) / baseMinUnitSize * baseColPic->getNumPartInWidth() + ( iBX - (iBX/baseMaxCUWidth)*baseMaxCUWidth ) / baseMinUnitSize; 3547 3548 uiAbsPartIdxBase = g_auiLayerRasterToZscan[baseColPic->getLayerId()][uiRasterAddrBase]; 3663 3549 #else 3664 UInt uiRasterAddrBase = (iBY - (iBY/g_uiMaxCUHeight)*g_uiMaxCUHeight)/uiMinUnitSize* cBaseColPic->getNumPartInWidth()3550 UInt uiRasterAddrBase = (iBY - (iBY/g_uiMaxCUHeight)*g_uiMaxCUHeight)/uiMinUnitSize*baseColPic->getNumPartInWidth() 3665 3551 + (iBX - (iBX/g_uiMaxCUWidth)*g_uiMaxCUWidth)/uiMinUnitSize; 3666 3552 … … 3668 3554 #endif 3669 3555 3670 return cBaseColPic->getCU(uiCUAddrBase);3556 return baseColPic->getCU(uiCUAddrBase); 3671 3557 } 3672 3558 … … 3680 3566 rcMvFieldEnhance.setMvField( cMv, rcMvFieldBase.getRefIdx() ); 3681 3567 } 3568 3569 #if FAST_INTRA_SHVC 3570 /** generate limited set of remaining modes 3571 *\param uiAbsPartIdx 3572 *\param uiIntraDirPred pointer to the array for MPM storage 3573 *\returns Number of intra coding modes (nb of remaining modes + 3 MPMs) 3574 */ 3575 Int TComDataCU::reduceSetOfIntraModes( UInt uiAbsPartIdx, Int* uiIntraDirPred, Int &fullSetOfModes ) 3576 { 3577 // check BL mode 3578 UInt uiCUAddrBase = 0, uiAbsPartAddrBase = 0; 3579 // the right reference layerIdc should be specified, currently it is set to m_layerId-1 3580 TComDataCU* pcTempCU = getBaseColCU(m_layerId - 1, uiAbsPartIdx, uiCUAddrBase, uiAbsPartAddrBase, 0 ); 3581 3582 if( pcTempCU->getPredictionMode( uiAbsPartAddrBase ) != MODE_INTRA ) 3583 { 3584 return( NUM_INTRA_MODE-1 ); 3585 } 3586 3587 // compute set of enabled modes g_reducedSetIntraModes[...] 3588 Int authorizedMode[NUM_INTRA_MODE-1]={1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; 3589 Int nbModes; 3590 for (nbModes=0; nbModes<3; nbModes++) // add 3 MPMs 1st 3591 { 3592 g_reducedSetIntraModes[nbModes] = uiIntraDirPred[nbModes]; 3593 authorizedMode[ uiIntraDirPred[nbModes] ] = 0; 3594 } 3595 3596 Int iColBaseDir = pcTempCU->getLumaIntraDir( uiAbsPartAddrBase ); 3597 if ( authorizedMode[iColBaseDir] ) //possibly add BL mode 3598 { 3599 g_reducedSetIntraModes[nbModes++] = iColBaseDir; 3600 authorizedMode[ iColBaseDir ] = 0; 3601 } 3602 3603 Int iRefMode = ( iColBaseDir > 1 ) ? iColBaseDir : uiIntraDirPred[0]; 3604 if ( iRefMode > 1 ) //add neighboring modes of refMode 3605 { 3606 UInt Left = iRefMode; 3607 UInt Right = iRefMode; 3608 while ( nbModes < NB_REMAIN_MODES+3 ) 3609 { 3610 Left = ((Left + 29) % 32) + 2; 3611 Right = ((Right - 1 ) % 32) + 2; 3612 if ( authorizedMode[Left] ) g_reducedSetIntraModes[nbModes++] = Left; 3613 if ( authorizedMode[Right] ) g_reducedSetIntraModes[nbModes++] = Right; 3614 } 3615 } 3616 else //add pre-defined modes 3617 { 3618 Int idx = 0; 3619 while ( nbModes < NB_REMAIN_MODES+3 ) 3620 { 3621 UInt mode = g_predefSetIntraModes[idx++]; 3622 if ( authorizedMode[mode] ) g_reducedSetIntraModes[nbModes++] = mode; 3623 } 3624 } 3625 3626 fullSetOfModes = 0; 3627 return ( nbModes ); 3628 } 3629 #endif 3630 3631 #if REF_IDX_ME_ZEROMV 3632 Bool TComDataCU::xCheckZeroMVILRMerge(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1) 3633 { 3634 Bool checkZeroMVILR = true; 3635 3636 if(uhInterDir&0x1) //list0 3637 { 3638 Int refIdxL0 = cMvFieldL0.getRefIdx(); 3639 if(getSlice()->getRefPic(REF_PIC_LIST_0, refIdxL0)->isILR(m_layerId)) 3640 { 3641 checkZeroMVILR &= (cMvFieldL0.getHor() == 0 && cMvFieldL0.getVer() == 0); 3642 } 3643 } 3644 if(uhInterDir&0x2) //list1 3645 { 3646 Int refIdxL1 = cMvFieldL1.getRefIdx(); 3647 if(getSlice()->getRefPic(REF_PIC_LIST_1, refIdxL1)->isILR(m_layerId)) 3648 { 3649 checkZeroMVILR &= (cMvFieldL1.getHor() == 0 && cMvFieldL1.getVer() == 0); 3650 } 3651 } 3652 3653 return checkZeroMVILR; 3654 } 3655 3656 Bool TComDataCU::xCheckZeroMVILRMvdL1Zero(Int iRefList, Int iRefIdx, Int MvpIdx) 3657 { 3658 RefPicList eRefPicList = iRefList > 0? REF_PIC_LIST_1: REF_PIC_LIST_0; 3659 assert(eRefPicList == REF_PIC_LIST_1); 3660 3661 Bool checkZeroMVILR = true; 3662 3663 if(getSlice()->getRefPic(eRefPicList, iRefIdx)->isILR(m_layerId)) 3664 { 3665 AMVPInfo* pcAMVPInfo = getCUMvField(eRefPicList)->getAMVPInfo(); 3666 TComMv cMv = pcAMVPInfo->m_acMvCand[MvpIdx]; 3667 checkZeroMVILR &= (cMv.getHor() == 0 && cMv.getVer() == 0); 3668 } 3669 3670 return checkZeroMVILR; 3671 } 3672 #endif 3673 3674 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 3675 Bool TComDataCU::isInterLayerReference(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1) 3676 { 3677 Bool checkILR = false; 3678 3679 if(uhInterDir&0x1) //list0 3680 { 3681 Int refIdxL0 = cMvFieldL0.getRefIdx(); 3682 checkILR = getSlice()->getRefPic(REF_PIC_LIST_0, refIdxL0)->isILR(m_layerId); 3683 } 3684 if(uhInterDir&0x2) //list1 3685 { 3686 Int refIdxL1 = cMvFieldL1.getRefIdx(); 3687 checkILR = checkILR || getSlice()->getRefPic(REF_PIC_LIST_1, refIdxL1)->isILR(m_layerId); 3688 } 3689 3690 return checkILR; 3691 } 3692 #endif 3693 3682 3694 #endif //SVC_EXTENSION 3683 3695 //! \} -
trunk/source/Lib/TLibCommon/TComDataCU.h
r595 r713 352 352 353 353 Void getPartIndexAndSize ( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight ); 354 UChar getNumPart Inter();354 UChar getNumPartitions (); 355 355 Bool isFirstAbsZorderIdxInDepth (UInt uiAbsPartIdx, UInt uiDepth); 356 356 -
trunk/source/Lib/TLibCommon/TComMotionInfo.h
r595 r713 141 141 Void setAllMvField( TComMvField const & mvField, PartSize eMbMode, Int iPartAddr, UInt uiDepth, Int iPartIdx=0 ); 142 142 143 #if AVC_SYNTAX144 Void setMv (TComMv cMv, Int iIdx ) { m_pcMv [iIdx] = cMv; }145 Void setRefIdx(Int iRefIdx, Int iIdx ) { m_piRefIdx[iIdx] = iRefIdx; }146 #endif147 148 143 Void setNumPartition( Int iNumPart ) 149 144 { … … 159 154 160 155 Void compress(Char* pePredMode, Int scale); 156 157 #if AVC_SYNTAX 158 Void setMv (TComMv cMv, Int iIdx ) { m_pcMv [iIdx] = cMv; } 159 Void setRefIdx(Int iRefIdx, Int iIdx ) { m_piRefIdx[iIdx] = iRefIdx; } 160 #endif 161 161 162 162 #if REF_IDX_MFM -
trunk/source/Lib/TLibCommon/TComPic.h
r595 r713 89 89 TComPicYuv* m_pcFullPelBaseRec[MAX_LAYERS]; // upsampled base layer recontruction for difference domain inter prediction 90 90 #endif 91 #if Q0048_CGS_3D_ASYMLUT 92 Int m_nFrameBit; 93 #endif 91 94 92 95 public: … … 115 118 UInt getTLayer() { return m_uiTLayer; } 116 119 Void setTLayer( UInt uiTLayer ) { m_uiTLayer = uiTLayer; } 120 117 121 Bool getUsedByCurr() { return m_bUsedByCurr; } 118 122 Void setUsedByCurr( Bool bUsed ) { m_bUsedByCurr = bUsed; } … … 219 223 #endif 220 224 225 #if Q0048_CGS_3D_ASYMLUT 226 Void setFrameBit( Int n ) { m_nFrameBit = n; } 227 Int getFrameBit() { return m_nFrameBit; } 228 #endif 221 229 };// END CLASS DEFINITION TComPic 222 230 -
trunk/source/Lib/TLibCommon/TComPicYuv.cpp
r595 r713 174 174 Int numCuInHeight = m_iPicHeight / m_iCuHeight + (m_iPicHeight % m_iCuHeight != 0); 175 175 176 #if LAYER_CTB 177 m_iLumaMarginX = uiMaxCUWidth + 16; // for 16-byte alignment 178 m_iLumaMarginY = uiMaxCUHeight + 16; // margin for 8-tap filter and infinite padding 179 #else 176 180 m_iLumaMarginX = g_uiMaxCUWidth + 16; // for 16-byte alignment 177 181 m_iLumaMarginY = g_uiMaxCUHeight + 16; // margin for 8-tap filter and infinite padding 182 #endif 178 183 179 184 m_apiPicBufY = (Pel*)xMalloc( Pel, ( m_iPicWidth + (m_iLumaMarginX <<1)) * ( m_iPicHeight + (m_iLumaMarginY <<1))); -
trunk/source/Lib/TLibCommon/TComPrediction.cpp
r644 r713 447 447 } 448 448 449 for ( iPartIdx = 0; iPartIdx < pcCU->getNumPart Inter(); iPartIdx++ )449 for ( iPartIdx = 0; iPartIdx < pcCU->getNumPartitions(); iPartIdx++ ) 450 450 { 451 451 pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight ); … … 768 768 #if O0215_PHASE_ALIGNMENT 769 769 #if O0194_JOINT_US_BITSHIFT 770 Void TComPrediction::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window,Bool phaseAlignFlag )771 { 772 m_cUsf.upsampleBasePic( currSlice, refLayerIdc, pcUsPic, pcBasePic, pcTempPic, window,phaseAlignFlag );770 Void TComPrediction::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, Bool phaseAlignFlag ) 771 { 772 m_cUsf.upsampleBasePic( currSlice, refLayerIdc, pcUsPic, pcBasePic, pcTempPic, phaseAlignFlag ); 773 773 } 774 774 #else -
trunk/source/Lib/TLibCommon/TComPrediction.h
r644 r713 121 121 #if O0215_PHASE_ALIGNMENT 122 122 #if O0194_JOINT_US_BITSHIFT 123 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window,Bool phaseAlignFlag );123 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, Bool phaseAlignFlag ); 124 124 #else 125 125 Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag ); -
trunk/source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp
r644 r713 112 112 m_offsetClipTable[compIdx] = NULL; 113 113 } 114 #if !SAO_SGN_FUNC 114 115 m_signTable = NULL; 115 116 #endif 116 117 117 118 m_lineBufWidth = 0; … … 169 170 } 170 171 172 #if !SAO_SGN_FUNC 171 173 //look-up table for clipping 174 Int overallMaxSampleValue=0; 175 #endif 172 176 for(Int compIdx =0; compIdx < NUM_SAO_COMPONENTS; compIdx++) 173 177 { … … 179 183 Int maxOffsetValue = (g_saoMaxOffsetQVal[compIdx] << m_offsetStepLog2[compIdx]); 180 184 #endif 185 #if !SAO_SGN_FUNC 186 if (maxSampleValue>overallMaxSampleValue) overallMaxSampleValue=maxSampleValue; 187 #endif 181 188 182 189 m_offsetClipTable[compIdx] = new Int[(maxSampleValue + maxOffsetValue -1)+ (maxOffsetValue)+1 ]; //positive & negative range plus 0 … … 194 201 *(offsetClipPtr -k -1 ) = 0; 195 202 } 196 if(compIdx == SAO_Y) //g_bitDepthY is always larger than or equal to g_bitDepthC 197 { 198 m_signTable = new Short[ 2*(maxSampleValue-1) + 1 ]; 199 m_sign = &(m_signTable[maxSampleValue-1]); 200 201 m_sign[0] = 0; 202 for(Int k=1; k< maxSampleValue; k++) 203 { 204 m_sign[k] = 1; 205 m_sign[-k]= -1; 206 } 207 } 208 } 209 203 } 204 205 #if !SAO_SGN_FUNC 206 m_signTable = new Short[ 2*(overallMaxSampleValue-1) + 1 ]; 207 m_sign = &(m_signTable[overallMaxSampleValue-1]); 208 209 m_sign[0] = 0; 210 for(Int k=1; k< overallMaxSampleValue; k++) 211 { 212 m_sign[k] = 1; 213 m_sign[-k]= -1; 214 } 215 #endif 210 216 } 211 217 … … 226 232 } 227 233 } 234 #if !SAO_SGN_FUNC 228 235 if( m_signTable ) 229 236 { 230 237 delete[] m_signTable; m_signTable = NULL; 231 238 } 239 #endif 232 240 } 233 241 … … 406 414 for (y=0; y< height; y++) 407 415 { 416 #if SAO_SGN_FUNC 417 signLeft = (Char)sgn(srcLine[startX] - srcLine[startX-1]); 418 #else 408 419 signLeft = (Char)m_sign[srcLine[startX] - srcLine[startX-1]]; 420 #endif 409 421 for (x=startX; x< endX; x++) 410 422 { 423 #if SAO_SGN_FUNC 424 signRight = (Char)sgn(srcLine[x] - srcLine[x+1]); 425 #else 411 426 signRight = (Char)m_sign[srcLine[x] - srcLine[x+1]]; 427 #endif 412 428 edgeType = signRight + signLeft; 413 429 signLeft = -signRight; … … 437 453 for (x=0; x< width; x++) 438 454 { 455 #if SAO_SGN_FUNC 456 signUpLine[x] = (Char)sgn(srcLine[x] - srcLineAbove[x]); 457 #else 439 458 signUpLine[x] = (Char)m_sign[srcLine[x] - srcLineAbove[x]]; 459 #endif 440 460 } 441 461 … … 447 467 for (x=0; x< width; x++) 448 468 { 469 #if SAO_SGN_FUNC 470 signDown = (Char)sgn(srcLine[x] - srcLineBelow[x]); 471 #else 449 472 signDown = (Char)m_sign[srcLine[x] - srcLineBelow[x]]; 473 #endif 450 474 edgeType = signDown + signUpLine[x]; 451 475 signUpLine[x]= -signDown; … … 474 498 for (x=startX; x< endX+1; x++) 475 499 { 500 #if SAO_SGN_FUNC 501 signUpLine[x] = (Char)sgn(srcLineBelow[x] - srcLine[x- 1]); 502 #else 476 503 signUpLine[x] = (Char)m_sign[srcLineBelow[x] - srcLine[x- 1]]; 504 #endif 477 505 } 478 506 … … 483 511 for(x= firstLineStartX; x< firstLineEndX; x++) 484 512 { 513 #if SAO_SGN_FUNC 514 edgeType = sgn(srcLine[x] - srcLineAbove[x- 1]) - signUpLine[x+1]; 515 #else 485 516 edgeType = m_sign[srcLine[x] - srcLineAbove[x- 1]] - signUpLine[x+1]; 517 #endif 486 518 resLine[x] = offsetClip[srcLine[x] + offset[edgeType]]; 487 519 } … … 497 529 for (x=startX; x<endX; x++) 498 530 { 531 #if SAO_SGN_FUNC 532 signDown = (Char)sgn(srcLine[x] - srcLineBelow[x+ 1]); 533 #else 499 534 signDown = (Char)m_sign[srcLine[x] - srcLineBelow[x+ 1]] ; 535 #endif 500 536 edgeType = signDown + signUpLine[x]; 501 537 resLine[x] = offsetClip[srcLine[x] + offset[edgeType]]; … … 503 539 signDownLine[x+1] = -signDown; 504 540 } 541 #if SAO_SGN_FUNC 542 signDownLine[startX] = (Char)sgn(srcLineBelow[startX] - srcLine[startX-1]); 543 #else 505 544 signDownLine[startX] = (Char)m_sign[srcLineBelow[startX] - srcLine[startX-1]]; 545 #endif 506 546 507 547 signTmpLine = signUpLine; … … 519 559 for(x= lastLineStartX; x< lastLineEndX; x++) 520 560 { 561 #if SAO_SGN_FUNC 562 edgeType = sgn(srcLine[x] - srcLineBelow[x+ 1]) + signUpLine[x]; 563 #else 521 564 edgeType = m_sign[srcLine[x] - srcLineBelow[x+ 1]] + signUpLine[x]; 565 #endif 522 566 resLine[x] = offsetClip[srcLine[x] + offset[edgeType]]; 523 567 … … 537 581 for (x=startX-1; x< endX; x++) 538 582 { 583 #if SAO_SGN_FUNC 584 signUpLine[x] = (Char)sgn(srcLineBelow[x] - srcLine[x+1]); 585 #else 539 586 signUpLine[x] = (Char)m_sign[srcLineBelow[x] - srcLine[x+1]]; 587 #endif 540 588 } 541 589 … … 547 595 for(x= firstLineStartX; x< firstLineEndX; x++) 548 596 { 597 #if SAO_SGN_FUNC 598 edgeType = sgn(srcLine[x] - srcLineAbove[x+1]) -signUpLine[x-1]; 599 #else 549 600 edgeType = m_sign[srcLine[x] - srcLineAbove[x+1]] -signUpLine[x-1]; 601 #endif 550 602 resLine[x] = offsetClip[srcLine[x] + offset[edgeType]]; 551 603 } … … 560 612 for(x= startX; x< endX; x++) 561 613 { 614 #if SAO_SGN_FUNC 615 signDown = (Char)sgn(srcLine[x] - srcLineBelow[x-1]); 616 #else 562 617 signDown = (Char)m_sign[srcLine[x] - srcLineBelow[x-1]] ; 618 #endif 563 619 edgeType = signDown + signUpLine[x]; 564 620 resLine[x] = offsetClip[srcLine[x] + offset[edgeType]]; 565 621 signUpLine[x-1] = -signDown; 566 622 } 623 #if SAO_SGN_FUNC 624 signUpLine[endX-1] = (Char)sgn(srcLineBelow[endX-1] - srcLine[endX]); 625 #else 567 626 signUpLine[endX-1] = (Char)m_sign[srcLineBelow[endX-1] - srcLine[endX]]; 627 #endif 568 628 srcLine += srcStride; 569 629 resLine += resStride; … … 576 636 for(x= lastLineStartX; x< lastLineEndX; x++) 577 637 { 638 #if SAO_SGN_FUNC 639 edgeType = sgn(srcLine[x] - srcLineBelow[x-1]) + signUpLine[x]; 640 #else 578 641 edgeType = m_sign[srcLine[x] - srcLineBelow[x-1]] + signUpLine[x]; 642 #endif 579 643 resLine[x] = offsetClip[srcLine[x] + offset[edgeType]]; 580 644 -
trunk/source/Lib/TLibCommon/TComSampleAdaptiveOffset.h
r644 r713 56 56 extern UInt g_saoMaxOffsetQVal[NUM_SAO_COMPONENTS]; 57 57 #endif 58 #if SAO_SGN_FUNC 59 template <typename T> int sgn(T val) 60 { 61 return (T(0) < val) - (val < T(0)); 62 } 63 #endif 58 64 59 65 class TComSampleAdaptiveOffset … … 88 94 UInt m_offsetStepLog2[NUM_SAO_COMPONENTS]; //offset step 89 95 Int* m_offsetClip[NUM_SAO_COMPONENTS]; //clip table for fast operation 96 #if !SAO_SGN_FUNC 90 97 Short* m_sign; //sign table for fast operation 98 #endif 91 99 TComPicYuv* m_tempPicYuv; //temporary buffer 92 100 Int m_picWidth; … … 105 113 Bool m_picSAOEnabled[NUM_SAO_COMPONENTS]; 106 114 Int* m_offsetClipTable[NUM_SAO_COMPONENTS]; 115 #if !SAO_SGN_FUNC 107 116 Short* m_signTable; 117 #endif 108 118 #if SVC_EXTENSION 109 119 UInt m_saoMaxOffsetQVal[NUM_SAO_COMPONENTS]; -
trunk/source/Lib/TLibCommon/TComSlice.cpp
r644 r713 75 75 , m_pcPic ( NULL ) 76 76 , m_colFromL0Flag ( 1 ) 77 #if SETTING_NO_OUT_PIC_PRIOR 78 , m_noOutputPriorPicsFlag ( false ) 79 , m_noRaslOutputFlag ( false ) 80 , m_handleCraAsBlaFlag ( false ) 81 #endif 77 82 , m_colRefIdx ( 0 ) 78 83 , m_uiTLayer ( 0 ) … … 111 116 , m_bCrossLayerBLAFlag ( false ) 112 117 #endif 113 #if NO_OUTPUT_OF_PRIOR_PICS114 , m_noOutputOfPriorPicsFlag ( false )115 , m_noRaslOutputFlag ( false )116 , m_handleCraAsBlaFlag ( false )117 #endif118 118 #if POC_RESET_IDC_SIGNALLING 119 119 , m_pocResetIdc ( 0 ) … … 536 536 { 537 537 UInt refLayerIdc = m_interLayerPredLayerIdc[i]; 538 UInt refLayerId = m_pcVPS->getRefLayerId( m_layerId, refLayerIdc ); 538 539 #if RESAMPLING_CONSTRAINT_BUG_FIX 539 540 #if O0098_SCALED_REF_LAYER_ID 540 const Window &scalEL = getSPS()->getScaledRefLayerWindowForLayer( m_pcVPS->getRefLayerId( m_layerId, m_interLayerPredLayerIdc[i] ));541 const Window &scalEL = getSPS()->getScaledRefLayerWindowForLayer(refLayerId); 541 542 #else 542 543 const Window &scalEL = getSPS()->getScaledRefLayerWindow(m_interLayerPredLayerIdc[i]); … … 548 549 ); 549 550 #endif 551 #if O0194_DIFFERENT_BITDEPTH_EL_BL 552 Int sameBitDepth = g_bitDepthYLayer[m_layerId] - g_bitDepthYLayer[refLayerId] + g_bitDepthCLayer[m_layerId] - g_bitDepthCLayer[refLayerId]; 553 554 if( !( g_posScalingFactor[refLayerIdc][0] == 65536 && g_posScalingFactor[refLayerIdc][1] == 65536 ) || !scalingOffset || !sameBitDepth 555 #if Q0048_CGS_3D_ASYMLUT 556 || getPPS()->getCGSFlag() 557 #endif 558 ) // ratio 1x 559 #else 550 560 if(!( g_posScalingFactor[refLayerIdc][0] == 65536 && g_posScalingFactor[refLayerIdc][1] == 65536 ) || (!scalingOffset)) // ratio 1x 561 #endif 551 562 { 552 563 #if MOTION_RESAMPLING_CONSTRAINT 553 UInt predType = m_pcVPS->getDirectDependencyType( m_layerId, m_pcVPS->getRefLayerId( m_layerId, refLayerIdc )) + 1;564 UInt predType = m_pcVPS->getDirectDependencyType( m_layerId, refLayerId ) + 1; 554 565 555 566 if( predType & 0x1 ) … … 596 607 // The variable NumPocTotalCurr is derived as specified in subclause 7.4.7.2. It is a requirement of bitstream conformance that the following applies to the value of NumPocTotalCurr: 597 608 #if SVC_EXTENSION // inter-layer prediction is allowed for BLA, CRA pictures of nuh_layer_id>0 598 // –If the current picture is a BLA or CRA picture with nuh_layer_id equal to 0, the value of NumPocTotalCurr shall be equal to 0.599 // –Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.609 // - If the current picture is a BLA or CRA picture with nuh_layer_id equal to 0, the value of NumPocTotalCurr shall be equal to 0. 610 // - Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0. 600 611 if (getRapPicFlag() && getLayerId()==0) 601 612 #else 602 // –If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0.603 // –Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.613 // - If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0. 614 // - Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0. 604 615 if (getRapPicFlag()) 605 616 #endif … … 1008 1019 */ 1009 1020 #if NO_CLRAS_OUTPUT_FLAG 1021 Void TComSlice::decodingRefreshMarking( TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag ) 1022 { 1023 if( !isIRAP() ) 1024 { 1025 return; 1026 } 1027 1028 Int pocCurr = getPOC(); 1029 TComPic* rpcPic = NULL; 1030 1031 // When the current picture is an IRAP picture with nuh_layer_id equal to 0 and NoClrasOutputFlag is equal to 1, 1032 // all reference pictures with any value of nuh_layer_id currently in the DPB (if any) are marked as "unused for reference". 1033 if( m_layerId == 0 && noClrasOutputFlag ) 1034 { 1035 // mark all pictures for all layers as not used for reference 1036 TComList<TComPic*>::iterator iterPic = rcListPic.begin(); 1037 while( iterPic != rcListPic.end() ) 1038 { 1039 rpcPic = *(iterPic); 1040 if( rpcPic->getPOC() != pocCurr ) 1041 { 1042 rpcPic->getSlice(0)->setReferenced(false); 1043 } 1044 iterPic++; 1045 } 1046 } 1047 1048 // When the current picture is an IRAP picture with NoRaslOutputFlag equal to 1, 1049 // all reference pictures with nuh_layer_id equal to currPicLayerId currently in the DPB (if any) are marked as "unused for reference". 1050 if( m_noRaslOutputFlag ) 1051 { 1052 // mark all pictures of a current layer as not used for reference 1053 TComList<TComPic*>::iterator iterPic = rcListPic.begin(); 1054 while( iterPic != rcListPic.end() ) 1055 { 1056 rpcPic = *(iterPic); 1057 if( rpcPic->getPOC() != pocCurr && rpcPic->getLayerId() == m_layerId ) 1058 { 1059 rpcPic->getSlice(0)->setReferenced(false); 1060 } 1061 iterPic++; 1062 } 1063 } 1064 } 1065 1010 1066 Void TComSlice::decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag) 1011 1067 #else … … 1051 1107 pocCRA = pocCurr; 1052 1108 } 1109 #if EFFICIENT_FIELD_IRAP 1110 bRefreshPending = true; 1111 #endif 1053 1112 } 1054 1113 else // CRA or No DR 1055 1114 { 1115 #if EFFICIENT_FIELD_IRAP 1116 if(getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL) 1117 { 1118 if (bRefreshPending==true && pocCurr > m_iLastIDR) // IDR reference marking pending 1119 { 1120 TComList<TComPic*>::iterator iterPic = rcListPic.begin(); 1121 while (iterPic != rcListPic.end()) 1122 { 1123 rpcPic = *(iterPic); 1124 if (rpcPic->getPOC() != pocCurr && rpcPic->getPOC() != m_iLastIDR) 1125 { 1126 rpcPic->getSlice(0)->setReferenced(false); 1127 } 1128 iterPic++; 1129 } 1130 bRefreshPending = false; 1131 } 1132 } 1133 else 1134 { 1135 #endif 1056 1136 if (bRefreshPending==true && pocCurr > pocCRA) // CRA reference marking pending 1057 1137 { … … 1068 1148 bRefreshPending = false; 1069 1149 } 1150 #if EFFICIENT_FIELD_IRAP 1151 } 1152 #endif 1070 1153 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA ) // CRA picture found 1071 1154 { … … 1323 1406 // in decoding order shall precede the IRAP picture in output order. 1324 1407 // (Note that any picture following in output order would be present in the DPB) 1408 #if !SETTING_NO_OUT_PIC_PRIOR 1325 1409 if(rpcPic->getSlice(0)->getPicOutputFlag() == 1) 1410 #else 1411 if(rpcPic->getSlice(0)->getPicOutputFlag() == 1 && !this->getNoOutputPriorPicsFlag()) 1412 #endif 1326 1413 { 1327 1414 if(nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP || … … 1502 1589 /** Function for applying picture marking based on the Reference Picture Set in pReferencePictureSet. 1503 1590 */ 1591 #if ALLOW_RECOVERY_POINT_AS_RAP 1592 Int TComSlice::checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess, Bool bUseRecoveryPoint) 1593 #else 1504 1594 Int TComSlice::checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess) 1505 { 1595 #endif 1596 { 1597 #if ALLOW_RECOVERY_POINT_AS_RAP 1598 Int atLeastOneUnabledByRecoveryPoint = 0; 1599 Int atLeastOneFlushedByPreviousIDR = 0; 1600 #endif 1506 1601 TComPic* rpcPic; 1507 1602 Int i, isAvailable; … … 1524 1619 if(rpcPic->getIsLongTerm() && (rpcPic->getPicSym()->getSlice(0)->getPOC()) == pReferencePictureSet->getPOC(i) && rpcPic->getSlice(0)->isReferenced()) 1525 1620 { 1621 #if ALLOW_RECOVERY_POINT_AS_RAP 1622 if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess) 1623 { 1624 isAvailable = 0; 1625 } 1626 else 1627 { 1526 1628 isAvailable = 1; 1629 } 1630 #else 1631 isAvailable = 1; 1632 #endif 1527 1633 } 1528 1634 } … … 1534 1640 if(rpcPic->getIsLongTerm() && curPoc == refPoc && rpcPic->getSlice(0)->isReferenced()) 1535 1641 { 1642 #if ALLOW_RECOVERY_POINT_AS_RAP 1643 if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess) 1644 { 1645 isAvailable = 0; 1646 } 1647 else 1648 { 1536 1649 isAvailable = 1; 1650 } 1651 #else 1652 isAvailable = 1; 1653 #endif 1537 1654 } 1538 1655 } … … 1557 1674 if (rpcPic->getSlice(0)->isReferenced() && curPoc == refPoc) 1558 1675 { 1676 #if ALLOW_RECOVERY_POINT_AS_RAP 1677 if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess) 1678 { 1679 isAvailable = 0; 1680 } 1681 else 1682 { 1559 1683 isAvailable = 1; 1560 1684 rpcPic->setIsLongTerm(1); 1561 1685 break; 1686 } 1687 #else 1688 isAvailable = 1; 1689 rpcPic->setIsLongTerm(1); 1690 break; 1691 #endif 1562 1692 } 1563 1693 } … … 1587 1717 } 1588 1718 } 1719 #if ALLOW_RECOVERY_POINT_AS_RAP 1720 else if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess) 1721 { 1722 atLeastOneUnabledByRecoveryPoint = 1; 1723 } 1724 else if(bUseRecoveryPoint && (this->getAssociatedIRAPType()==NAL_UNIT_CODED_SLICE_IDR_N_LP || this->getAssociatedIRAPType()==NAL_UNIT_CODED_SLICE_IDR_W_RADL)) 1725 { 1726 atLeastOneFlushedByPreviousIDR = 1; 1727 } 1728 #endif 1589 1729 } 1590 1730 } … … 1602 1742 if(!rpcPic->getIsLongTerm() && rpcPic->getPicSym()->getSlice(0)->getPOC() == this->getPOC() + pReferencePictureSet->getDeltaPOC(i) && rpcPic->getSlice(0)->isReferenced()) 1603 1743 { 1744 #if ALLOW_RECOVERY_POINT_AS_RAP 1745 if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess) 1746 { 1747 isAvailable = 0; 1748 } 1749 else 1750 { 1604 1751 isAvailable = 1; 1752 } 1753 #else 1754 isAvailable = 1; 1755 #endif 1605 1756 } 1606 1757 } … … 1629 1780 } 1630 1781 } 1631 } 1782 #if ALLOW_RECOVERY_POINT_AS_RAP 1783 else if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess) 1784 { 1785 atLeastOneUnabledByRecoveryPoint = 1; 1786 } 1787 else if(bUseRecoveryPoint && (this->getAssociatedIRAPType()==NAL_UNIT_CODED_SLICE_IDR_N_LP || this->getAssociatedIRAPType()==NAL_UNIT_CODED_SLICE_IDR_W_RADL)) 1788 { 1789 atLeastOneFlushedByPreviousIDR = 1; 1790 } 1791 #endif 1792 } 1793 } 1794 #if ALLOW_RECOVERY_POINT_AS_RAP 1795 if(atLeastOneUnabledByRecoveryPoint || atLeastOneFlushedByPreviousIDR) 1796 { 1797 return -1; 1632 1798 } 1799 #endif 1633 1800 if(atLeastOneLost) 1634 1801 { … … 1647 1814 /** Function for constructing an explicit Reference Picture Set out of the available pictures in a referenced Reference Picture Set 1648 1815 */ 1816 #if ALLOW_RECOVERY_POINT_AS_RAP 1817 Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP, Int pocRandomAccess, Bool bUseRecoveryPoint) 1818 #else 1649 1819 Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP) 1820 #endif 1650 1821 { 1651 1822 TComPic* rpcPic; … … 1673 1844 pcRPS->setDeltaPOC(k, pReferencePictureSet->getDeltaPOC(i)); 1674 1845 pcRPS->setUsed(k, pReferencePictureSet->getUsed(i) && (!isRAP)); 1846 #if ALLOW_RECOVERY_POINT_AS_RAP 1847 pcRPS->setUsed(k, pcRPS->getUsed(k) && !(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess) ); 1848 #endif 1675 1849 if(pcRPS->getDeltaPOC(k) < 0) 1676 1850 { … … 1685 1859 } 1686 1860 } 1861 #if EFFICIENT_FIELD_IRAP 1862 Bool useNewRPS = false; 1863 // if current picture is complimentary field associated to IRAP, add the IRAP to its RPS. 1864 if(m_pcPic->isField()) 1865 { 1866 TComList<TComPic*>::iterator iterPic = rcListPic.begin(); 1867 while ( iterPic != rcListPic.end()) 1868 { 1869 rpcPic = *(iterPic++); 1870 if(rpcPic->getPicSym()->getSlice(0)->getPOC() == this->getAssociatedIRAPPOC() && this->getAssociatedIRAPPOC() == this->getPOC()+1) 1871 { 1872 pcRPS->setDeltaPOC(k, 1); 1873 pcRPS->setUsed(k, true); 1874 nrOfPositivePictures++; 1875 k ++; 1876 useNewRPS = true; 1877 } 1878 } 1879 } 1880 #endif 1687 1881 pcRPS->setNumberOfNegativePictures(nrOfNegativePictures); 1688 1882 pcRPS->setNumberOfPositivePictures(nrOfPositivePictures); … … 1691 1885 // inter RPS prediction with. Here we just use the reference used by pReferencePictureSet. 1692 1886 // If pReferencePictureSet is not inter_RPS_predicted, then inter_RPS_prediction is for the current RPS also disabled. 1693 if (!pReferencePictureSet->getInterRPSPrediction()) 1887 if (!pReferencePictureSet->getInterRPSPrediction() 1888 #if EFFICIENT_FIELD_IRAP 1889 || useNewRPS 1890 #endif 1891 ) 1694 1892 { 1695 1893 pcRPS->setInterRPSPrediction(false); … … 1888 2086 if( layerId == 0 ) 1889 2087 { 1890 retVal = sps->getChromaFormatIdc(); 2088 if( vps->getAvcBaseLayerFlag() ) 2089 { 2090 retVal = vps->getVpsRepFormat(layerId)->getChromaFormatVpsIdc(); 2091 } 2092 else 2093 { 2094 retVal = sps->getChromaFormatIdc(); 2095 } 1891 2096 } 1892 2097 else … … 2034 2239 #endif 2035 2240 #if REPN_FORMAT_IN_VPS 2241 #if Q0195_REP_FORMAT_CLEANUP 2242 , m_repFormatIdxPresentFlag (false) 2243 #else 2036 2244 , m_repFormatIdxPresentFlag (true) 2245 #endif 2037 2246 , m_vpsNumRepFormats (1) 2038 2247 #endif … … 2306 2515 Void TComVPS::setRefLayersFlags(Int currLayerId) 2307 2516 { 2308 for (Int i = 0; i < getNumDirectRefLayers(currLayerId); i++)2517 for (Int i = 0; i < m_numDirectRefLayers[currLayerId]; i++) 2309 2518 { 2310 2519 UInt refLayerId = getRefLayerId(currLayerId, i); 2311 setRecursiveRefLayerFlag(currLayerId, refLayerId, true);2520 m_recursiveRefLayerFlag[currLayerId][refLayerId] = true; 2312 2521 for (Int k = 0; k < MAX_NUM_LAYER_IDS; k++) 2313 2522 { 2314 setRecursiveRefLayerFlag(currLayerId, k, (getRecursiveRefLayerFlag(currLayerId, k) | getRecursiveRefLayerFlag(refLayerId, k)));2523 m_recursiveRefLayerFlag[currLayerId][k] = m_recursiveRefLayerFlag[currLayerId][k] | m_recursiveRefLayerFlag[refLayerId][k]; 2315 2524 } 2316 2525 } … … 2319 2528 Void TComVPS::setNumRefLayers(Int currLayerId) 2320 2529 { 2321 for (Int i = 0; i < = getMaxLayers(); i++)2322 { 2323 UInt iNuhLId = getLayerIdInNuh(i);2530 for (Int i = 0; i < m_uiMaxLayers; i++) 2531 { 2532 UInt iNuhLId = m_layerIdInNuh[i]; 2324 2533 setRefLayersFlags(iNuhLId); 2325 2534 for (UInt j = 0; j < MAX_NUM_LAYER_IDS; j++) 2326 2535 { 2327 m_numberRefLayers[iNuhLId] += ( getRecursiveRefLayerFlag(iNuhLId, j)== true ? 1 : 0);2536 m_numberRefLayers[iNuhLId] += (m_recursiveRefLayerFlag[iNuhLId][j] == true ? 1 : 0); 2328 2537 } 2329 2538 } … … 3526 3735 3527 3736 TComPic* pcRefPicBL = pcRefPicRL[refLayerIdc]; 3737 3528 3738 //set reference picture POC of each ILP reference 3529 3739 Int thePoc = ilpPic[refLayerIdc]->getPOC(); … … 3532 3742 ilpPic[refLayerIdc]->getSlice(0)->setBaseColPic( refLayerIdc, pcRefPicBL ); 3533 3743 3534 //copy reference pictures marking from the reference layer 3535 ilpPic[refLayerIdc]->getSlice(0)->copySliceInfo(pcRefPicBL->getSlice(0)); 3744 //copy layer id from the reference layer 3745 ilpPic[refLayerIdc]->setLayerId( pcRefPicBL->getLayerId() ); 3746 3747 //copy slice type from the reference layer 3748 ilpPic[refLayerIdc]->getSlice(0)->setSliceType( pcRefPicBL->getSlice(0)->getSliceType() ); 3749 3750 //copy "used for reference" 3751 ilpPic[refLayerIdc]->getSlice(0)->setReferenced( pcRefPicBL->getSlice(0)->isReferenced() ); 3536 3752 3537 3753 for( Int refList = 0; refList < 2; refList++ ) … … 3555 3771 ilpPic[refLayerIdc]->getSlice(0)->setRefPOC(0, refPicList, refIdx); 3556 3772 ilpPic[refLayerIdc]->getSlice(0)->setRefPic(NULL, refPicList, refIdx); 3773 } 3774 3775 //copy reference pictures' marking from the reference layer 3776 for(Int j = 0; j < MAX_NUM_REF + 1; j++) 3777 { 3778 ilpPic[refLayerIdc]->getSlice(0)->setIsUsedAsLongTerm(refList, j, pcRefPicBL->getSlice(0)->getIsUsedAsLongTerm(refList, j)); 3557 3779 } 3558 3780 } -
trunk/source/Lib/TLibCommon/TComSlice.h
r644 r713 231 231 { 232 232 ProfileTierLevel m_generalPTL; 233 ProfileTierLevel m_subLayerPTL [MAX_TLAYER-1]; // max. value of max_sub_layers_minus1 is MAX_TLAYER-1 ( = 6)233 ProfileTierLevel m_subLayerPTL [MAX_TLAYER-1]; // max. value of max_sub_layers_minus1 is MAX_TLAYER-1 (= 6) 234 234 Bool m_subLayerProfilePresentFlag [MAX_TLAYER-1]; 235 235 Bool m_subLayerLevelPresentFlag [MAX_TLAYER-1]; … … 581 581 #if VPS_TSLAYERS 582 582 Bool m_maxTSLayersPresentFlag; 583 UInt m_maxTSLayerMinus1[MAX_ VPS_LAYER_ID_PLUS1 - 1];583 UInt m_maxTSLayerMinus1[MAX_LAYERS]; 584 584 #endif 585 585 #if M0040_ADAPTIVE_RESOLUTION_CHANGE … … 684 684 Bool m_vpsVuiPresentFlag; 685 685 #endif 686 Bool m_vpsExtensionFlag; 686 687 687 688 #if O0164_MULTI_LAYER_HRD … … 1131 1132 1132 1133 #if O0109_MOVE_VPS_VUI_FLAG 1133 Bool getVpsVuiPresentFlag() { return m_vpsVuiPresentFlag; } 1134 Void setVpsVuiPresentFlag(Bool x) { m_vpsVuiPresentFlag = x; } 1135 #endif 1134 Bool getVpsVuiPresentFlag() { return m_vpsVuiPresentFlag; } 1135 Void setVpsVuiPresentFlag(Bool x) { m_vpsVuiPresentFlag = x; } 1136 #endif 1137 Bool getVpsExtensionFlag() { return m_vpsExtensionFlag; } 1138 Void setVpsExtensionFlag(Bool x) { m_vpsExtensionFlag = x; } 1136 1139 1137 1140 #if !P0307_REMOVE_VPS_VUI_OFFSET … … 1741 1744 Bool m_pocResetInfoPresentFlag; 1742 1745 #endif 1746 #if Q0048_CGS_3D_ASYMLUT 1747 Int m_nCGSFlag; 1748 Int m_nCGSOutputBitDepthY; // not for syntax 1749 Int m_nCGSOutputBitDepthC; // not for syntax 1750 #endif 1743 1751 #endif 1744 1752 … … 1881 1889 Bool getPocResetInfoPresentFlag () { return m_pocResetInfoPresentFlag; } 1882 1890 Void setPocResetInfoPresentFlag (const Bool val) { m_pocResetInfoPresentFlag = val; } 1891 #endif 1892 #if Q0048_CGS_3D_ASYMLUT 1893 Int getCGSFlag() { return m_nCGSFlag; } 1894 Void setCGSFlag(Int n) { m_nCGSFlag = n; } 1895 Int getCGSOutputBitDepthY() { return m_nCGSOutputBitDepthY; } 1896 Void setCGSOutputBitDepthY(Int n){ m_nCGSOutputBitDepthY = n; } 1897 Int getCGSOutputBitDepthC() { return m_nCGSOutputBitDepthC; } 1898 Void setCGSOutputBitDepthC(Int n){ m_nCGSOutputBitDepthC = n; } 1883 1899 #endif 1884 1900 }; … … 1963 1979 UInt m_colFromL0Flag; // collocated picture from List0 flag 1964 1980 1981 #if SETTING_NO_OUT_PIC_PRIOR 1982 Bool m_noOutputPriorPicsFlag; 1983 Bool m_noRaslOutputFlag; 1984 Bool m_handleCraAsBlaFlag; 1985 #endif 1986 1965 1987 UInt m_colRefIdx; 1966 1988 UInt m_maxNumMergeCand; … … 2030 2052 Bool m_bCrossLayerBLAFlag; 2031 2053 #endif 2032 #if NO_OUTPUT_OF_PRIOR_PICS2033 Bool m_noOutputOfPriorPicsFlag;2034 Bool m_noRaslOutputFlag;2035 Bool m_handleCraAsBlaFlag;2036 #endif2037 2054 #if POC_RESET_IDC_SIGNALLING 2038 2055 Int m_pocResetIdc; … … 2043 2060 Bool m_pocMsbValRequiredFlag; 2044 2061 Bool m_pocMsbValPresentFlag; 2062 #endif 2063 #if Q0048_CGS_3D_ASYMLUT 2064 Int m_nCGSOverWritePPS; // for optimization, not output to bitstream 2045 2065 #endif 2046 2066 #endif //SVC_EXTENSION … … 2130 2150 NalUnitType getNalUnitType () const { return m_eNalUnitType; } 2131 2151 Bool getRapPicFlag (); 2132 #if NO_OUTPUT_OF_PRIOR_PICS2133 Bool getBlaPicFlag ();2134 Bool getCraPicFlag ();2135 #endif2136 2152 Bool getIdrPicFlag () { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } 2137 2153 Bool isIRAP () const { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } 2138 2154 Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic); 2139 2155 #if NO_CLRAS_OUTPUT_FLAG 2156 Void decodingRefreshMarking( TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag ); 2140 2157 Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag); 2141 2158 #else … … 2163 2180 #if SVC_EXTENSION 2164 2181 Void setRefPicList ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false, TComPic** ilpPic = NULL ); 2182 #if Q0048_CGS_3D_ASYMLUT 2183 Int getCGSOverWritePPS() { return m_nCGSOverWritePPS; } 2184 Void setCGSOverWritePPS(Int n) { m_nCGSOverWritePPS = n; } 2185 #endif 2165 2186 #else 2166 2187 Void setRefPicList ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false ); … … 2203 2224 Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic ); 2204 2225 Bool isStepwiseTemporalLayerSwitchingPointCandidate( TComList<TComPic*>& rcListPic ); 2205 Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0); 2206 Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP); 2226 #if ALLOW_RECOVERY_POINT_AS_RAP 2227 Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0, Bool bUseRecoveryPoint = false); 2228 Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP, Int pocRandomAccess = 0, Bool bUseRecoveryPoint = false); 2229 #else 2230 Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0); 2231 Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP); 2232 #endif 2207 2233 2208 2234 Void setMaxNumMergeCand (UInt val ) { m_maxNumMergeCand = val; } 2209 2235 UInt getMaxNumMergeCand () { return m_maxNumMergeCand; } 2236 2237 #if SETTING_NO_OUT_PIC_PRIOR 2238 Void setNoOutputPriorPicsFlag ( Bool val ) { m_noOutputPriorPicsFlag = val; } 2239 Bool getNoOutputPriorPicsFlag () { return m_noOutputPriorPicsFlag; } 2240 2241 Void setNoRaslOutputFlag ( Bool val ) { m_noRaslOutputFlag = val; } 2242 Bool getNoRaslOutputFlag () { return m_noRaslOutputFlag; } 2243 2244 Void setHandleCraAsBlaFlag ( Bool val ) { m_handleCraAsBlaFlag = val; } 2245 Bool getHandleCraAsBlaFlag () { return m_handleCraAsBlaFlag; } 2246 #endif 2210 2247 2211 2248 Void setSliceMode ( UInt uiMode ) { m_sliceMode = uiMode; } … … 2360 2397 2361 2398 Void setILRPic(TComPic **pcIlpPic); 2362 #if NO_OUTPUT_OF_PRIOR_PICS2363 Void setNoOutputOfPriorPicsFlag(const Bool x) { m_noOutputOfPriorPicsFlag = x; }2364 Bool getNoOutputOfPriorPicsFlag() { return m_noOutputOfPriorPicsFlag; }2365 2366 Void setNoRaslOutputFlag ( const Bool val ) { m_noRaslOutputFlag = val; }2367 Bool getNoRaslOutputFlag () { return m_noRaslOutputFlag; }2368 2369 Void setHandleCraAsBlaFlag ( const Bool val ) { m_handleCraAsBlaFlag = val; }2370 Bool getHandleCraAsBlaFlag () { return m_handleCraAsBlaFlag; }2371 2372 #endif2373 2399 #if POC_RESET_IDC_SIGNALLING 2374 2400 Int getPocResetIdc () { return m_pocResetIdc; } … … 2388 2414 #endif 2389 2415 2416 #if NO_OUTPUT_OF_PRIOR_PICS 2417 Bool getBlaPicFlag (); 2418 Bool getCraPicFlag (); 2419 #endif 2420 2390 2421 #endif //SVC_EXTENSION 2391 2422 protected: -
trunk/source/Lib/TLibCommon/TComUpsampleFilter.cpp
r644 r713 99 99 #if O0215_PHASE_ALIGNMENT 100 100 #if O0194_JOINT_US_BITSHIFT 101 Void TComUpsampleFilter::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag )102 #else 103 Void TComUpsampleFilter::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag )101 Void TComUpsampleFilter::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, Bool phaseAlignFlag ) 102 #else 103 Void TComUpsampleFilter::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag ) 104 104 #endif 105 105 #else … … 116 116 Int i, j; 117 117 118 #if O0194_JOINT_US_BITSHIFT 119 UInt currLayerId = currSlice->getLayerId(); 120 UInt refLayerId = currSlice->getVPS()->getRefLayerId( currLayerId, refLayerIdc ); 121 #endif 122 123 #if O0098_SCALED_REF_LAYER_ID 124 const Window &scalEL = currSlice->getSPS()->getScaledRefLayerWindowForLayer(refLayerId); 125 #else 126 const Window &scalEL = currSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc); 127 #endif 128 118 129 //========== Y component upsampling =========== 119 const Window &scalEL = window;120 121 130 Int widthBL = pcBasePic->getWidth (); 122 131 Int heightBL = pcBasePic->getHeight(); … … 127 136 Int strideEL = pcUsPic->getStride(); 128 137 138 #if Q0200_CONFORMANCE_BL_SIZE 139 Int chromaFormatIdc = currSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getChromaFormatIdc(); 140 const Window &confBL = currSlice->getBaseColPic(refLayerIdc)->getConformanceWindow(); 141 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ); 142 Int yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 143 #endif 129 144 #if P0312_VERT_PHASE_ADJ 130 145 Bool vertPhasePositionEnableFlag = scalEL.getVertPhasePositionEnableFlag(); … … 159 174 Int scaleY = g_posScalingFactor[refLayerIdc][1]; 160 175 161 #if O0194_JOINT_US_BITSHIFT162 UInt currLayerId = currSlice->getLayerId();163 UInt refLayerId = currSlice->getVPS()->getRefLayerId( currLayerId, refLayerIdc );164 #endif165 166 176 // non-normative software optimization for certain simple resampling cases 167 177 if( scaleX == 65536 && scaleY == 65536 ) // ratio 1x … … 172 182 #if O0194_JOINT_US_BITSHIFT 173 183 Int shift = g_bitDepthYLayer[currLayerId] - g_bitDepthYLayer[refLayerId]; 184 #if Q0048_CGS_3D_ASYMLUT 185 if( currSlice->getPPS()->getCGSFlag() ) 186 { 187 shift = g_bitDepthYLayer[currLayerId] - currSlice->getPPS()->getCGSOutputBitDepthY(); 188 } 189 assert( shift >= 0 ); 190 #endif 174 191 #endif 175 192 … … 205 222 #if O0194_JOINT_US_BITSHIFT 206 223 shift = g_bitDepthCLayer[currLayerId] - g_bitDepthCLayer[refLayerId]; 224 #if Q0048_CGS_3D_ASYMLUT 225 if( currSlice->getPPS()->getCGSFlag() ) 226 { 227 shift = g_bitDepthCLayer[currLayerId] - currSlice->getPPS()->getCGSOutputBitDepthC(); 228 } 229 #endif 207 230 #endif 208 231 … … 254 277 Int phaseX = 2*phaseAlignFlag; 255 278 #if P0312_VERT_PHASE_ADJ 279 #if Q0120_PHASE_CALCULATION 280 Int phaseY = 2*phaseAlignFlag; 281 #else 256 282 Int phaseY = vertPhasePositionEnableFlag ? ( vertPhasePositionFlag * 4 ) : ( 2 * phaseAlignFlag ); 283 #endif 257 284 #else 258 285 Int phaseY = 2*phaseAlignFlag; … … 261 288 Int phaseX = 0; 262 289 #if P0312_VERT_PHASE_ADJ 290 #if Q0120_PHASE_CALCULATION 291 Int phaseY = 0; 292 #else 263 293 Int phaseY = (vertPhasePositionEnableFlag?(vertPhasePositionFlag *4):(0)); 294 #endif 264 295 #else 265 296 Int phaseY = 0; 266 297 #endif 267 298 #endif 268 299 269 300 #if ROUNDING_OFFSET 270 301 Int addX = ( ( phaseX * scaleX + 2 ) >> 2 ) + ( 1 << ( shiftX - 5 ) ); 271 302 Int addY = ( ( phaseY * scaleY + 2 ) >> 2 ) + ( 1 << ( shiftY - 5 ) ); 272 303 #else 273 Int addX = ( ( ( widthBL * phaseX ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) ); 274 Int addY = ( ( ( heightBL * phaseY ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) ); 275 #endif 276 277 Int deltaX = 4 * phaseX; 278 Int deltaY = 4 * phaseY; 304 Int addX = ( ( ( widthBL * phaseX ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) ); 305 Int addY = ( ( ( heightBL * phaseY ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) ); 306 #endif 307 308 #if Q0120_PHASE_CALCULATION 309 Int deltaX = (Int)phaseAlignFlag <<3; 310 Int deltaY = (((Int)phaseAlignFlag <<3)>>(Int)vertPhasePositionEnableFlag) + ((Int)vertPhasePositionFlag<<3); 311 #else 312 Int deltaX = 4 * phaseX; 313 Int deltaY = 4 * phaseY; 314 #endif 315 316 #if Q0200_CONFORMANCE_BL_SIZE 317 deltaX -= ( confBL.getWindowLeftOffset() * xScal ) << 4; 318 deltaY -= ( confBL.getWindowTopOffset() * yScal ) << 4; 319 #endif 279 320 280 321 Int shiftXM4 = shiftX - 4; 281 322 Int shiftYM4 = shiftY - 4; 282 323 283 widthEL 284 heightEL 285 286 widthBL 287 heightBL 324 widthEL = pcUsPic->getWidth (); 325 heightEL = pcUsPic->getHeight(); 326 327 widthBL = pcBasePic->getWidth (); 328 heightBL = min<Int>( pcBasePic->getHeight(), heightEL ); 288 329 289 330 Int leftStartL = scalEL.getWindowLeftOffset(); … … 292 333 Int bottomEndL = pcUsPic->getHeight() - scalEL.getWindowBottomOffset(); 293 334 Int leftOffset = leftStartL > 0 ? leftStartL : 0; 294 295 335 #if N0214_INTERMEDIATE_BUFFER_16BITS 296 336 #if O0194_JOINT_US_BITSHIFT 297 337 // g_bitDepthY was set to EL bit-depth, but shift1 should be calculated using BL bit-depth 298 338 Int shift1 = g_bitDepthYLayer[refLayerId] - 8; 339 #if Q0048_CGS_3D_ASYMLUT 340 if( currSlice->getPPS()->getCGSFlag() ) 341 { 342 shift1 = currSlice->getPPS()->getCGSOutputBitDepthY() - 8; 343 } 344 #endif 299 345 #else 300 346 Int shift1 = g_bitDepthY - 8; … … 380 426 widthBL = pcBasePic->getWidth (); 381 427 heightBL = pcBasePic->getHeight(); 382 383 428 widthEL = pcUsPic->getWidth () - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset(); 384 429 heightEL = pcUsPic->getHeight() - scalEL.getWindowTopOffset() - scalEL.getWindowBottomOffset(); … … 400 445 Int bottomEndC = (pcUsPic->getHeight() >> 1) - (scalEL.getWindowBottomOffset() >> 1); 401 446 leftOffset = leftStartC > 0 ? leftStartC : 0; 402 403 447 shiftX = 16; 404 448 shiftY = 16; … … 407 451 Int phaseXC = phaseAlignFlag; 408 452 #if P0312_VERT_PHASE_ADJ 453 #if Q0120_PHASE_CALCULATION 454 Int phaseYC = phaseAlignFlag + 1; 455 #else 409 456 Int phaseYC = vertPhasePositionEnableFlag ? ( vertPhasePositionFlag * 4 ) : ( phaseAlignFlag + 1 ); 457 #endif 410 458 #else 411 459 Int phaseYC = phaseAlignFlag + 1; … … 414 462 Int phaseXC = 0; 415 463 #if P0312_VERT_PHASE_ADJ 464 #if Q0120_PHASE_CALCULATION 465 Int phaseYC = 1; 466 #else 416 467 Int phaseYC = vertPhasePositionEnableFlag ? (vertPhasePositionFlag * 4): 1; 468 #endif 417 469 #else 418 470 Int phaseYC = 1; … … 428 480 #endif 429 481 482 #if Q0120_PHASE_CALCULATION 483 deltaX = (Int)phaseAlignFlag << 2; 484 deltaY = ((( (Int)phaseAlignFlag +1)<<2)>>(Int)vertPhasePositionEnableFlag)+((Int)vertPhasePositionFlag<<3); 485 #else 430 486 deltaX = 4 * phaseXC; 431 487 deltaY = 4 * phaseYC; 488 #endif 489 490 #if Q0200_CONFORMANCE_BL_SIZE 491 deltaX -= ( ( confBL.getWindowLeftOffset() * xScal ) >> 1 ) << 4; 492 deltaY -= ( ( confBL.getWindowTopOffset() * yScal ) >> 1 ) << 4; 493 #endif 432 494 433 495 shiftXM4 = shiftX - 4; … … 444 506 // g_bitDepthC was set to EL bit-depth, but shift1 should be calculated using BL bit-depth 445 507 shift1 = g_bitDepthCLayer[refLayerId] - 8; 508 #if Q0048_CGS_3D_ASYMLUT 509 if( currSlice->getPPS()->getCGSFlag() ) 510 { 511 shift1 = currSlice->getPPS()->getCGSOutputBitDepthC() - 8; 512 } 513 #endif 446 514 #else 447 515 shift1 = g_bitDepthC - 8; -
trunk/source/Lib/TLibCommon/TComUpsampleFilter.h
r644 r713 45 45 #if O0215_PHASE_ALIGNMENT 46 46 #if O0194_JOINT_US_BITSHIFT 47 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window,Bool phaseAlignFlag );47 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, Bool phaseAlignFlag ); 48 48 #else 49 49 Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag ); -
trunk/source/Lib/TLibCommon/TypeDef.h
r644 r713 42 42 43 43 #define SYNTAX_BYTES 10 ///< number of bytes taken by syntaxes per 4x4 block [RefIdxL0(1byte), RefIdxL1(1byte), MVxL0(2bytes), MVyL0(2bytes), MVxL1(2bytes), MVyL1(2bytes)] 44 45 44 #if SVC_EXTENSION 46 45 #define MAX_LAYERS 8 ///< max number of layers the codec is supposed to handle … … 50 49 #define O0137_MAX_LAYERID 1 ///< JCTVC-O0137, JCTVC-O0200, JCTVC-O0223: restrict nuh_layer_id and vps_max_layers_minus1 51 50 51 #define Q0200_CONFORMANCE_BL_SIZE 1 ///< JCTVC-Q0200; use conformance picture size in re-sampling processs 52 52 #define P0312_VERT_PHASE_ADJ 1 ///< JCTVC-P0312: vertical phase adjustment in re-sampling process (BoG report) 53 #if P0312_VERT_PHASE_ADJ 54 #define Q0120_PHASE_CALCULATION 1 ///< JCTVC-Q0120 phase offset derivation for combination of spatial scalibility and field coding. 55 #endif 53 56 #define P0130_EOB 1 ///< JCTVC-P0130, set layer Id of EOB NALU to be fixed to 0 54 57 #define P0307_REMOVE_VPS_VUI_OFFSET 1 ///< JCTVC-P0307, remove implementation related to VPS VUI offset signalling … … 81 84 82 85 #define O0164_MULTI_LAYER_HRD 1 ///< JCTVC-O0164: Multi-layer HRD operation 86 #define Q0074_SEI_COLOR_MAPPING 1 ///< JCTVC-Q0074, SEI Color Mapping 83 87 84 88 #define O0194_DIFFERENT_BITDEPTH_EL_BL 1 ///< JCTVC-O0194: Support for different bitdepth values for BL and EL, add required configuration parameters (and Some bugfixes when REPN_FORMAT_IN_VPS (JCTVC-N0092) is enabled) … … 86 90 #define O0194_JOINT_US_BITSHIFT 1 ///< JCTVC-O0194: Joint Upsampling and bit-shift 87 91 #endif 92 #define Q0048_CGS_3D_ASYMLUT 1 ///< JCTVC-Q0048: Colour gamut scalability with look-up table 93 #if Q0048_CGS_3D_ASYMLUT 94 #define O0194_WEIGHTED_PREDICTION_CGS 0 95 #else 88 96 #define O0194_WEIGHTED_PREDICTION_CGS 1 ///< JCTVC-O0194: Weighted prediciton for color gamut scalability 97 #endif 89 98 #define MFM_ENCCONSTRAINT 1 ///< JCTVC-O0216: Encoder constraint for motion field mapping 90 99 #define VPS_NUH_LAYER_ID 1 ///< JCTVC-N0085: Assert that the nuh_layer_id of VPS NAL unit should be 0 … … 185 194 #define TSLAYERS_IL_RPS 1 ///< JCTVC-O0120 IL RPS based on max temporal sub-layers 186 195 #define P0079_DERIVE_NUMACTIVE_REF_PICS 1 ///< JCTVC-P0079 Modification of derivation of variable NumActiveRefLayerPics 196 #define Q0060_MAX_TID_REF_EQUAL_TO_ZERO 1 ///< JCTVC-Q0060 handling the case max_tid_il_ref_pics_plus1 is equal to 0. 187 197 #if REF_IDX_MFM 188 198 #define N0139_POSITION_ROUNDING_OFFSET 1 ///< JCTVC-N0139: offset for collocated block in motion mapping … … 226 236 #define O0096_DEFAULT_DEPENDENCY_TYPE 1 ///< JCTVC-O0096: specify default dependency type for all direct reference layers 227 237 238 #define Q0195_REP_FORMAT_CLEANUP 1 ///< JCTVC-Q0195: restructureing of rep_format() signaling 239 #define REP_FORMAT_FIX 1 ///< update_rep_format_flag should be inferred to be equal to 0 240 228 241 #define RESAMPLING_CONSTRAINT_BUG_FIX 1 229 242 #define O0098_SCALED_REF_LAYER_ID 1 ///< JCTVC-O0098: signal scaled reference id … … 231 244 #define O0153_ALT_OUTPUT_LAYER_FLAG 1 ///< JCTVC-O0153: alt output layer flag 232 245 #define P0300_ALT_OUTPUT_LAYER_FLAG 1 ///< JCTVC-P0300: alt output layer flag 246 247 #define Q0165_OUTPUT_LAYER_SET 1 ///< JCTVC-Q0165: add a constraint to disallow an empty output layer set 248 #define Q0165_NUM_ADD_OUTPUT_LAYER_SETS 1 ///< JCTVC-Q0165: signal num_add_output_layer_set and default_target_output_layer_idc when vps_num_layer_sets_minus1 is greater than 0 233 249 234 250 #define VPS_DPB_SIZE_TABLE 1 ///< JCTVC-O0217: DPB operations: signaling DPB-related parameters … … 264 280 //! \ingroup TLibCommon 265 281 //! \{ 282 #define HARMONIZE_GOP_FIRST_FIELD_COUPLE 1 283 #define FIX_FIELD_DEPTH 1 284 #define EFFICIENT_FIELD_IRAP 1 285 #define ALLOW_RECOVERY_POINT_AS_RAP 1 266 286 #define BUGFIX_INTRAPERIOD 1 267 287 #define SAO_ENCODE_ALLOW_USE_PREDEBLOCK 1 268 288 289 #define SAO_SGN_FUNC 1 290 269 291 #define FIX1172 1 ///< fix ticket #1172 292 293 #define SETTING_PIC_OUTPUT_MARK 1 294 #define SETTING_NO_OUT_PIC_PRIOR 1 295 #define FIX_EMPTY_PAYLOAD_NAL 1 296 #define FIX_WRITING_OUTPUT 1 297 #define FIX_OUTPUT_EOS 1 298 299 #define FIX_POC_CRA_NORASL_OUTPUT 1 270 300 271 301 #define MAX_NUM_PICS_IN_SOP 1024 -
trunk/source/Lib/TLibDecoder/AnnexBread.h
r595 r713 65 65 , m_Input(istream) 66 66 { 67 istream.exceptions(std::istream::eofbit );67 istream.exceptions(std::istream::eofbit | std::istream::badbit); 68 68 } 69 69 -
trunk/source/Lib/TLibDecoder/SEIread.cpp
r644 r713 93 93 fprintf( g_hTrace, "===========Tone Mapping Info SEI message ===========\n"); 94 94 break; 95 #if Q0074_SEI_COLOR_MAPPING 96 case SEI::COLOR_MAPPING_INFO: 97 fprintf( g_hTrace, "===========Color Mapping Info SEI message ===========\n"); 98 break; 99 #endif 95 100 case SEI::SOP_DESCRIPTION: 96 101 fprintf( g_hTrace, "=========== SOP Description SEI message ===========\n"); … … 280 285 xParseSEIToneMappingInfo((SEIToneMappingInfo&) *sei, payloadSize); 281 286 break; 287 #if Q0074_SEI_COLOR_MAPPING 288 case SEI::COLOR_MAPPING_INFO: 289 sei = new SEIColorMappingInfo; 290 xParseSEIColorMappingInfo((SEIColorMappingInfo&) *sei, payloadSize); 291 break; 292 #endif 282 293 case SEI::SOP_DESCRIPTION: 283 294 sei = new SEISOPDescription; … … 518 529 { 519 530 UInt val; 520 READ_CODE(4, val, "active_v ps_id");sei.activeVPSId = val;521 READ_FLAG( val, "full_random_access_flag"); sei.m_fullRandomAccessFlag = val ? true : false;522 READ_FLAG( val, "no_param_set_update_flag"); sei.m_noParamSetUpdateFlag = val ? true : false;531 READ_CODE(4, val, "active_video_parameter_set_id"); sei.activeVPSId = val; 532 READ_FLAG( val, "self_contained_cvs_flag"); sei.m_selfContainedCvsFlag = val ? true : false; 533 READ_FLAG( val, "no_parameter_set_update_flag"); sei.m_noParameterSetUpdateFlag = val ? true : false; 523 534 READ_UVLC( val, "num_sps_ids_minus1"); sei.numSpsIdsMinus1 = val; 524 535 525 sei.activeSeqParam SetId.resize(sei.numSpsIdsMinus1 + 1);536 sei.activeSeqParameterSetId.resize(sei.numSpsIdsMinus1 + 1); 526 537 for (Int i=0; i < (sei.numSpsIdsMinus1 + 1); i++) 527 538 { 528 READ_UVLC(val, "active_seq_param_set_id"); sei.activeSeqParamSetId[i] = val; 529 } 530 531 UInt uibits = m_pcBitstream->getNumBitsUntilByteAligned(); 532 533 while(uibits--) 534 { 535 READ_FLAG(val, "alignment_bit"); 536 } 539 READ_UVLC(val, "active_seq_parameter_set_id"); sei.activeSeqParameterSetId[i] = val; 540 } 541 542 xParseByteAlign(); 537 543 } 538 544 … … 812 818 case 4: 813 819 { 814 READ_CODE( 8, val, "camera_iso_speed_idc" ); sei.m_cameraIsoSpeed Value= val;815 if( sei.m_cameraIsoSpeed Value== 255) //Extended_ISO820 READ_CODE( 8, val, "camera_iso_speed_idc" ); sei.m_cameraIsoSpeedIdc = val; 821 if( sei.m_cameraIsoSpeedIdc == 255) //Extended_ISO 816 822 { 817 823 READ_CODE( 32, val, "camera_iso_speed_value" ); sei.m_cameraIsoSpeedValue = val; 824 } 825 READ_CODE( 8, val, "exposure_index_idc" ); sei.m_exposureIndexIdc = val; 826 if( sei.m_exposureIndexIdc == 255) //Extended_ISO 827 { 828 READ_CODE( 32, val, "exposure_index_value" ); sei.m_exposureIndexValue = val; 818 829 } 819 830 READ_FLAG( val, "exposure_compensation_value_sign_flag" ); sei.m_exposureCompensationValueSignFlag = val; … … 837 848 xParseByteAlign(); 838 849 } 850 851 #if Q0074_SEI_COLOR_MAPPING 852 Void SEIReader::xParseSEIColorMappingInfo(SEIColorMappingInfo& sei, UInt /*payloadSize*/) 853 { 854 UInt uiVal; 855 Int iVal; 856 857 READ_UVLC( uiVal, "colour_map_id" ); sei.m_colorMapId = uiVal; 858 READ_FLAG( uiVal, "colour_map_cancel_flag" ); sei.m_colorMapCancelFlag = uiVal; 859 if( !sei.m_colorMapCancelFlag ) 860 { 861 READ_FLAG( uiVal, "colour_map_persistence_flag" ); sei.m_colorMapPersistenceFlag = uiVal; 862 READ_FLAG( uiVal, "colour_map_video_signal_type_present_flag" ); sei.m_colorMap_video_signal_type_present_flag = uiVal; 863 if ( sei.m_colorMap_video_signal_type_present_flag ) { 864 READ_FLAG( uiVal, "colour_map_video_full_range_flag" ); sei.m_colorMap_video_full_range_flag = uiVal; 865 READ_CODE( 8, uiVal, "colour_map_primaries" ); sei.m_colorMap_primaries = uiVal; 866 READ_CODE( 8, uiVal, "colour_map_transfer_characteristics" ); sei.m_colorMap_transfer_characteristics = uiVal; 867 READ_CODE( 8, uiVal, "colour_map_matrix_coeffs" ); sei.m_colorMap_matrix_coeffs = uiVal; 868 } 869 } 870 871 READ_CODE( 5, uiVal, "colour_map_coded_data_bit_depth" ); sei.m_colour_map_coded_data_bit_depth = uiVal; 872 READ_CODE( 5, uiVal, "colour_map_target_bit_depth" ); sei.m_colour_map_target_bit_depth = uiVal; 873 READ_UVLC( uiVal, "colour_map_model_id" ); sei.m_colorMapModelId = uiVal; 874 875 assert( sei.m_colorMapModelId == 0 ); 876 877 for( Int i=0 ; i<3 ; i++ ) 878 { 879 READ_CODE( 8, uiVal, "num_input_pivots_minus1[i]" ); sei.m_num_input_pivots[i] = (uiVal==0) ? 2 : (uiVal + 1) ; 880 sei.m_coded_input_pivot_value[i] = new Int[ sei.m_num_input_pivots[i] ]; 881 sei.m_target_input_pivot_value[i] = new Int[ sei.m_num_input_pivots[i] ]; 882 if( uiVal > 0 ) 883 { 884 for ( Int j=0 ; j<sei.m_num_input_pivots[i] ; j++ ) 885 { 886 READ_CODE( (( sei.m_colour_map_coded_data_bit_depth + 7 ) >> 3 ) << 3, uiVal, "coded_input_pivot_value[i][j]" ); sei.m_coded_input_pivot_value[i][j] = uiVal; 887 READ_CODE( (( sei.m_colour_map_coded_data_bit_depth + 7 ) >> 3 ) << 3, uiVal, "target_input_pivot_value[i][j]" ); sei.m_target_input_pivot_value[i][j] = uiVal; 888 } 889 } 890 else 891 { 892 sei.m_coded_input_pivot_value[i][0] = 0; 893 sei.m_target_input_pivot_value[i][0] = 0; 894 sei.m_coded_input_pivot_value[i][1] = (1 << sei.m_colour_map_coded_data_bit_depth) - 1 ; 895 sei.m_target_input_pivot_value[i][1] = (1 << sei.m_colour_map_target_bit_depth) - 1 ; 896 } 897 } 898 899 READ_FLAG( uiVal, "matrix_flag" ); sei.m_matrix_flag = uiVal; 900 if( sei.m_matrix_flag ) 901 { 902 READ_CODE( 4, uiVal, "log2_matrix_denom" ); sei.m_log2_matrix_denom = uiVal; 903 for ( Int i=0 ; i<3 ; i++ ) 904 { 905 for ( Int j=0 ; j<3 ; j++ ) 906 { 907 READ_SVLC( iVal, "matrix_coef[i][j]" ); sei.m_matrix_coef[i][j] = iVal; 908 } 909 } 910 } 911 912 for ( Int i=0 ; i<3 ; i++ ) 913 { 914 READ_CODE( 8, uiVal, "num_output_pivots_minus1[i]" ); sei.m_num_output_pivots[i] = (uiVal==0) ? 2 : (uiVal + 1) ; 915 sei.m_coded_output_pivot_value[i] = new Int[ sei.m_num_output_pivots[i] ]; 916 sei.m_target_output_pivot_value[i] = new Int[ sei.m_num_output_pivots[i] ]; 917 if( uiVal > 0 ) 918 { 919 for ( Int j=0 ; j<sei.m_num_output_pivots[i] ; j++ ) 920 { 921 READ_CODE( (( sei.m_colour_map_coded_data_bit_depth + 7 ) >> 3 ) << 3, uiVal, "coded_output_pivot_value[i][j]" ); sei.m_coded_output_pivot_value[i][j] = uiVal; 922 READ_CODE( (( sei.m_colour_map_coded_data_bit_depth + 7 ) >> 3 ) << 3, uiVal, "target_output_pivot_value[i][j]" ); sei.m_target_output_pivot_value[i][j] = uiVal; 923 } 924 } 925 else 926 { 927 sei.m_coded_output_pivot_value[i][0] = 0; 928 sei.m_target_output_pivot_value[i][0] = 0; 929 sei.m_coded_output_pivot_value[i][1] = (1 << sei.m_colour_map_coded_data_bit_depth) - 1 ; 930 sei.m_target_output_pivot_value[i][1] = (1 << sei.m_colour_map_target_bit_depth) - 1 ; 931 } 932 } 933 934 xParseByteAlign(); 935 } 936 #endif 839 937 840 938 Void SEIReader::xParseSEISOPDescription(SEISOPDescription &sei, UInt payloadSize) -
trunk/source/Lib/TLibDecoder/SEIread.h
r644 r713 90 90 Void xParseSEIGradualDecodingRefreshInfo (SEIGradualDecodingRefreshInfo &sei, UInt payloadSize); 91 91 Void xParseSEIToneMappingInfo (SEIToneMappingInfo& sei, UInt payloadSize); 92 #if Q0074_SEI_COLOR_MAPPING 93 Void xParseSEIColorMappingInfo (SEIColorMappingInfo& sei, UInt payloadSize); 94 #endif 92 95 Void xParseSEISOPDescription (SEISOPDescription &sei, UInt payloadSize); 93 96 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI -
trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp
r649 r713 39 39 #include "SEIread.h" 40 40 #include "TDecSlice.h" 41 #if Q0048_CGS_3D_ASYMLUT 42 #include "../TLibCommon/TCom3DAsymLUT.h" 43 #endif 41 44 42 45 //! \ingroup TLibDecoder … … 175 178 } 176 179 177 Void TDecCavlc::parsePPS(TComPPS* pcPPS) 180 Void TDecCavlc::parsePPS(TComPPS* pcPPS 181 #if Q0048_CGS_3D_ASYMLUT 182 , TCom3DAsymLUT * pc3DAsymLUT , Int nLayerID 183 #endif 184 ) 178 185 { 179 186 #if ENC_DEC_TRACE … … 348 355 READ_FLAG( uiCode, "poc_reset_info_present_flag" ); 349 356 pcPPS->setPocResetInfoPresentFlag(uiCode ? true : false); 357 #if Q0048_CGS_3D_ASYMLUT 358 READ_FLAG( uiCode , "colour_mapping_enabled_flag" ); 359 pcPPS->setCGSFlag( uiCode ); 360 if( pcPPS->getCGSFlag() ) 361 { 362 xParse3DAsymLUT( pc3DAsymLUT ); 363 pcPPS->setCGSOutputBitDepthY( pc3DAsymLUT->getOutputBitDepthY() ); 364 pcPPS->setCGSOutputBitDepthC( pc3DAsymLUT->getOutputBitDepthC() ); 365 } 366 #endif 350 367 #endif 351 368 } … … 599 616 else 600 617 { 618 #if REP_FORMAT_FIX 619 pcSPS->setUpdateRepFormatFlag( false ); 620 #else 601 621 pcSPS->setUpdateRepFormatFlag( true ); 622 #endif 602 623 } 603 624 #if O0096_REP_FORMAT_INDEX … … 681 702 for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++) 682 703 { 683 READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1 ");704 READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1[i]"); 684 705 pcSPS->setMaxDecPicBuffering( uiCode + 1, i); 685 READ_UVLC ( uiCode, "sps_num_reorder_pics " );706 READ_UVLC ( uiCode, "sps_num_reorder_pics[i]" ); 686 707 pcSPS->setNumReorderPics(uiCode, i); 687 READ_UVLC ( uiCode, "sps_max_latency_increase_plus1 ");708 READ_UVLC ( uiCode, "sps_max_latency_increase_plus1[i]"); 688 709 pcSPS->setMaxLatencyIncrease( uiCode, i ); 689 710 … … 887 908 READ_CODE( 6, uiCode, "vps_reserved_zero_6bits" ); assert(uiCode == 0); 888 909 #endif 889 READ_CODE( 3, uiCode, "vps_max_sub_layers_minus1" ); pcVPS->setMaxTLayers( uiCode + 1 ); assert(uiCode <= 6);910 READ_CODE( 3, uiCode, "vps_max_sub_layers_minus1" ); pcVPS->setMaxTLayers( uiCode + 1 ); assert(uiCode+1 <= MAX_TLAYER); 890 911 READ_FLAG( uiCode, "vps_temporal_id_nesting_flag" ); pcVPS->setTemporalNestingFlag( uiCode ? true:false ); 891 912 assert (pcVPS->getMaxTLayers()>1||pcVPS->getTemporalNestingFlag()); … … 973 994 } 974 995 } 975 READ_FLAG( uiCode, "vps_extension_flag" ); 976 if (uiCode) 977 { 996 978 997 #if VPS_EXTNS 998 READ_FLAG( uiCode, "vps_extension_flag" ); pcVPS->setVpsExtensionFlag( uiCode ? true : false ); 999 1000 // When MaxLayersMinus1 is greater than 0, vps_extension_flag shall be equal to 1. 1001 if( pcVPS->getMaxLayers() > 1 ) 1002 { 1003 assert( pcVPS->getVpsExtensionFlag() == true ); 1004 } 1005 1006 if( pcVPS->getVpsExtensionFlag() ) 1007 { 979 1008 while ( m_pcBitstream->getNumBitsRead() % 8 != 0 ) 980 1009 { … … 990 1019 } 991 1020 } 992 #else 1021 } 1022 else 1023 { 1024 // set default parameters when syntax elements are not present 1025 defaultVPSExtension(pcVPS); 1026 } 1027 #else 1028 READ_FLAG( uiCode, "vps_extension_flag" ); 1029 if (uiCode) 1030 { 993 1031 while ( xMoreRbspData() ) 994 1032 { 995 1033 READ_FLAG( uiCode, "vps_extension_data_flag"); 996 1034 } 997 #endif 998 } 1035 } 1036 #endif 999 1037 1000 1038 return; … … 1129 1167 #endif 1130 1168 #if VPS_TSLAYERS 1131 READ_FLAG( uiCode, "vps_sub_layers_max_minus1_present_flag"); vps->setMaxTSLayersPresentFlag(uiCode ? true : false); 1132 if (vps->getMaxTSLayersPresentFlag()) 1133 { 1134 for(i = 0; i < vps->getMaxLayers(); i++) 1135 { 1136 READ_CODE( 3, uiCode, "sub_layers_vps_max_minus1[i]" ); vps->setMaxTSLayersMinus1(i, uiCode); 1137 } 1138 } 1139 else 1140 { 1141 for( i = 0; i < vps->getMaxLayers(); i++) 1142 { 1143 vps->setMaxTSLayersMinus1(i, vps->getMaxTLayers()-1); 1144 } 1145 } 1169 READ_FLAG( uiCode, "vps_sub_layers_max_minus1_present_flag"); vps->setMaxTSLayersPresentFlag(uiCode ? true : false); 1170 1171 if (vps->getMaxTSLayersPresentFlag()) 1172 { 1173 for(i = 0; i < vps->getMaxLayers(); i++) 1174 { 1175 READ_CODE( 3, uiCode, "sub_layers_vps_max_minus1[i]" ); vps->setMaxTSLayersMinus1(i, uiCode); 1176 } 1177 } 1178 else 1179 { 1180 for( i = 0; i < vps->getMaxLayers(); i++) 1181 { 1182 vps->setMaxTSLayersMinus1(i, vps->getMaxTLayers()-1); 1183 } 1184 } 1146 1185 #endif 1147 1186 #if N0120_MAX_TID_REF_PRESENT_FLAG … … 1250 1289 } 1251 1290 #else 1291 1292 #if Q0165_NUM_ADD_OUTPUT_LAYER_SETS 1293 if( vps->getNumLayerSets() > 1 ) 1294 { 1295 READ_UVLC( uiCode, "num_add_output_layer_sets" ); vps->setNumAddOutputLayerSets( uiCode ); 1296 READ_CODE( 2, uiCode, "default_target_output_layer_idc" ); vps->setDefaultTargetOutputLayerIdc( uiCode ); 1297 } 1298 else 1299 { 1300 vps->setNumAddOutputLayerSets( 0 ); 1301 } 1302 #else 1252 1303 READ_UVLC( uiCode, "num_add_output_layer_sets" ); vps->setNumAddOutputLayerSets( uiCode ); 1304 #endif 1305 1306 // The value of num_add_output_layer_sets shall be in the range of 0 to 1023, inclusive. 1307 assert( vps->getNumAddOutputLayerSets() >= 0 && vps->getNumAddOutputLayerSets() < 1024 ); 1308 1253 1309 Int numOutputLayerSets = vps->getNumLayerSets() + vps->getNumAddOutputLayerSets(); 1254 1310 #endif 1255 1311 1256 1312 #if P0295_DEFAULT_OUT_LAYER_IDC 1313 #if !Q0165_NUM_ADD_OUTPUT_LAYER_SETS 1257 1314 if( numOutputLayerSets > 1 ) 1258 1315 { 1259 1316 READ_CODE( 2, uiCode, "default_target_output_layer_idc" ); vps->setDefaultTargetOutputLayerIdc( uiCode ); 1260 1317 } 1318 #endif 1261 1319 vps->setNumOutputLayerSets( numOutputLayerSets ); 1262 1320 … … 1330 1388 vps->setAltOuputLayerFlag(i, uiCode ? true : false); 1331 1389 } 1390 #if Q0165_OUTPUT_LAYER_SET 1391 assert( NumOutputLayersInOutputLayerSet[i]>0 ); 1392 #endif 1393 1332 1394 #endif 1333 1395 } … … 1431 1493 1432 1494 #if REPN_FORMAT_IN_VPS 1495 #if Q0195_REP_FORMAT_CLEANUP 1496 READ_UVLC( uiCode, "vps_num_rep_formats_minus1" ); 1497 vps->setVpsNumRepFormats( uiCode + 1 ); 1498 1499 // The value of vps_num_rep_formats_minus1 shall be in the range of 0 to 255, inclusive. 1500 assert( vps->getVpsNumRepFormats() > 0 && vps->getVpsNumRepFormats() <= 256 ); 1501 1502 for(i = 0; i < vps->getVpsNumRepFormats(); i++) 1503 { 1504 // Read rep_format_structures 1505 parseRepFormat( vps->getVpsRepFormat(i), i > 0 ? vps->getVpsRepFormat(i-1) : 0 ); 1506 } 1507 1508 // Default assignment for layer 0 1509 vps->setVpsRepFormatIdx( 0, 0 ); 1510 1511 if( vps->getVpsNumRepFormats() > 1 ) 1512 { 1513 READ_FLAG( uiCode, "rep_format_idx_present_flag"); 1514 vps->setRepFormatIdxPresentFlag( uiCode ? true : false ); 1515 } 1516 else 1517 { 1518 // When not present, the value of rep_format_idx_present_flag is inferred to be equal to 0 1519 vps->setRepFormatIdxPresentFlag( false ); 1520 } 1521 1522 if( vps->getRepFormatIdxPresentFlag() ) 1523 { 1524 for(i = 1; i < vps->getMaxLayers(); i++) 1525 { 1526 Int numBits = 1; 1527 while ((1 << numBits) < (vps->getVpsNumRepFormats())) 1528 { 1529 numBits++; 1530 } 1531 READ_CODE( numBits, uiCode, "vps_rep_format_idx[i]" ); 1532 vps->setVpsRepFormatIdx( i, uiCode ); 1533 } 1534 } 1535 else 1536 { 1537 // When not present, the value of vps_rep_format_idx[ i ] is inferred to be equal to Min (i, vps_num_rep_formats_minus1) 1538 for(i = 1; i < vps->getMaxLayers(); i++) 1539 { 1540 vps->setVpsRepFormatIdx( i, min( (Int)i, vps->getVpsNumRepFormats()-1 ) ); 1541 } 1542 } 1543 #else 1433 1544 READ_FLAG( uiCode, "rep_format_idx_present_flag"); 1434 1545 vps->setRepFormatIdxPresentFlag( uiCode ? true : false ); … … 1453 1564 vps->setVpsNumRepFormats( vps->getMaxLayers() ); 1454 1565 } 1566 1567 // The value of vps_num_rep_formats_minus1 shall be in the range of 0 to 255, inclusive. 1568 assert( vps->getVpsNumRepFormats() > 0 && vps->getVpsNumRepFormats() <= 256 ); 1569 1455 1570 for(i = 0; i < vps->getVpsNumRepFormats(); i++) 1456 1571 { 1457 1572 // Read rep_format_structures 1458 parseRepFormat( vps->getVpsRepFormat(i) );1573 parseRepFormat( vps->getVpsRepFormat(i), i > 0 ? vps->getVpsRepFormat(i-1) : 0 ); 1459 1574 } 1460 1575 … … 1498 1613 } 1499 1614 } 1615 #endif 1500 1616 #endif 1501 1617 #if RESOLUTION_BASED_DPB … … 1578 1694 #if P0307_VPS_NON_VUI_EXTENSION 1579 1695 READ_UVLC( uiCode, "vps_non_vui_extension_length"); vps->setVpsNonVuiExtLength((Int)uiCode); 1696 1697 // The value of vps_non_vui_extension_length shall be in the range of 0 to 4096, inclusive. 1698 assert( vps->getVpsNonVuiExtLength() >= 0 && vps->getVpsNonVuiExtLength() <= 4096 ); 1699 1580 1700 #if P0307_VPS_NON_VUI_EXT_UPDATE 1581 1701 Int nonVuiExtByte = uiCode; … … 1620 1740 #endif 1621 1741 } 1622 } 1623 #endif 1742 else 1743 { 1744 // set default values for VPS VUI 1745 defaultVPSVUI( vps ); 1746 } 1747 } 1748 1749 Void TDecCavlc::defaultVPSExtension( TComVPS* vps ) 1750 { 1751 // set default parameters when they are not present 1752 Int i, j; 1753 1754 // When layer_id_in_nuh[ i ] is not present, the value is inferred to be equal to i. 1755 for(i = 0; i < vps->getMaxLayers(); i++) 1756 { 1757 vps->setLayerIdInNuh(i, i); 1758 vps->setLayerIdInVps(vps->getLayerIdInNuh(i), i); 1759 } 1760 1761 // When not present, sub_layers_vps_max_minus1[ i ] is inferred to be equal to vps_max_sub_layers_minus1. 1762 for( i = 0; i < vps->getMaxLayers(); i++) 1763 { 1764 vps->setMaxTSLayersMinus1(i, vps->getMaxTLayers()-1); 1765 } 1766 1767 // When not present, max_tid_il_ref_pics_plus1[ i ][ j ] is inferred to be equal to 7. 1768 for( i = 0; i < vps->getMaxLayers() - 1; i++ ) 1769 { 1770 #if O0225_MAX_TID_FOR_REF_LAYERS 1771 for( j = i + 1; j < vps->getMaxLayers(); j++ ) 1772 { 1773 vps->setMaxTidIlRefPicsPlus1(i, j, 7); 1774 } 1775 #else 1776 vps->setMaxTidIlRefPicsPlus1(i, 7); 1777 #endif 1778 } 1779 1780 // When not present, the value of num_add_output_layer_sets is inferred to be equal to 0. 1781 // NumOutputLayerSets = num_add_output_layer_sets + vps_num_layer_sets_minus1 + 1 1782 vps->setNumOutputLayerSets( vps->getNumLayerSets() ); 1783 1784 // For i in the range of 0 to NumOutputLayerSets-1, inclusive, the variable LayerSetIdxForOutputLayerSet[ i ] is derived as specified in the following: 1785 // LayerSetIdxForOutputLayerSet[ i ] = ( i <= vps_number_layer_sets_minus1 ) ? i : output_layer_set_idx_minus1[ i ] + 1 1786 for( i = 1; i < vps->getNumOutputLayerSets(); i++ ) 1787 { 1788 vps->setOutputLayerSetIdx( i, i ); 1789 Int lsIdx = vps->getOutputLayerSetIdx(i); 1790 1791 for( j = 0; j < vps->getNumLayersInIdList(lsIdx); j++ ) 1792 { 1793 vps->setOutputLayerFlag(i, j, 1); 1794 } 1795 } 1796 1797 // The value of sub_layer_dpb_info_present_flag[ i ][ 0 ] for any possible value of i is inferred to be equal to 1 1798 // When not present, the value of sub_layer_dpb_info_present_flag[ i ][ j ] for j greater than 0 and any possible value of i, is inferred to be equal to be equal to 0. 1799 for( i = 1; i < vps->getNumOutputLayerSets(); i++ ) 1800 { 1801 vps->setSubLayerDpbInfoPresentFlag( i, 0, true ); 1802 } 1803 1804 // When not present, the value of vps_num_rep_formats_minus1 is inferred to be equal to MaxLayersMinus1. 1805 vps->setVpsNumRepFormats( vps->getMaxLayers() ); 1806 1807 // When not present, the value of rep_format_idx_present_flag is inferred to be equal to 0 1808 vps->setRepFormatIdxPresentFlag( false ); 1809 1810 if( !vps->getRepFormatIdxPresentFlag() ) 1811 { 1812 // When not present, the value of vps_rep_format_idx[ i ] is inferred to be equal to Min(i, vps_num_rep_formats_minus1). 1813 for(i = 1; i < vps->getMaxLayers(); i++) 1814 { 1815 vps->setVpsRepFormatIdx( i, min( (Int)i, vps->getVpsNumRepFormats() - 1 ) ); 1816 } 1817 } 1818 1819 // vps_poc_lsb_aligned_flag 1820 // When not present, vps_poc_lsb_aligned_flag is inferred to be equal to 0. 1821 1822 #if O0062_POC_LSB_NOT_PRESENT_FLAG 1823 // When not present, poc_lsb_not_present_flag[ i ] is inferred to be equal to 0. 1824 for(i = 1; i< vps->getMaxLayers(); i++) 1825 { 1826 vps->setPocLsbNotPresentFlag(i, 0); 1827 } 1828 #endif 1829 1830 // set default values for VPS VUI 1831 defaultVPSVUI( vps ); 1832 } 1833 1834 Void TDecCavlc::defaultVPSVUI( TComVPS* vps ) 1835 { 1836 #if N0147_IRAP_ALIGN_FLAG 1837 // When not present, the value of all_layers_idr_aligned_flag is inferred to be equal to 0. 1838 vps->setCrossLayerIrapAlignFlag( false ); 1839 #endif 1840 1841 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 1842 // When single_layer_for_non_irap_flag is not present, it is inferred to be equal to 0. 1843 vps->setSingleLayerForNonIrapFlag( false ); 1844 #endif 1845 1846 #if HIGHER_LAYER_IRAP_SKIP_FLAG 1847 // When higher_layer_irap_skip_flag is not present it is inferred to be equal to 0 1848 vps->setHigherLayerIrapSkipFlag( false ); 1849 #endif 1850 } 1851 #endif 1852 1624 1853 #if REPN_FORMAT_IN_VPS 1625 Void TDecCavlc::parseRepFormat ( RepFormat *repFormat)1854 Void TDecCavlc::parseRepFormat( RepFormat *repFormat, RepFormat *repFormatPrev ) 1626 1855 { 1627 1856 UInt uiCode; 1628 #if REPN_FORMAT_CONTROL_FLAG 1629 READ_FLAG ( uiCode, "chroma_and_bit_depth_vps_present_flag"); repFormat->setChromaAndBitDepthVpsPresentFlag(uiCode ? true : false); 1630 READ_CODE ( 16, uiCode, "pic_width_in_luma_samples" ); repFormat->setPicWidthVpsInLumaSamples ( uiCode ); 1631 READ_CODE ( 16, uiCode, "pic_height_in_luma_samples" ); repFormat->setPicHeightVpsInLumaSamples( uiCode ); 1857 #if REPN_FORMAT_CONTROL_FLAG 1858 READ_CODE( 16, uiCode, "pic_width_vps_in_luma_samples" ); repFormat->setPicWidthVpsInLumaSamples ( uiCode ); 1859 READ_CODE( 16, uiCode, "pic_height_vps_in_luma_samples" ); repFormat->setPicHeightVpsInLumaSamples( uiCode ); 1860 READ_FLAG( uiCode, "chroma_and_bit_depth_vps_present_flag" ); repFormat->setChromaAndBitDepthVpsPresentFlag( uiCode ? true : false ); 1861 1862 if( !repFormatPrev ) 1863 { 1864 // The value of chroma_and_bit_depth_vps_present_flag of the first rep_format( ) syntax structure in the VPS shall be equal to 1 1865 assert( repFormat->getChromaAndBitDepthVpsPresentFlag() ); 1866 } 1632 1867 1633 1868 if( repFormat->getChromaAndBitDepthVpsPresentFlag() ) 1634 1869 { 1870 READ_CODE( 2, uiCode, "chroma_format_vps_idc" ); 1635 1871 #if AUXILIARY_PICTURES 1636 READ_CODE( 2, uiCode, "chroma_format_idc" );repFormat->setChromaFormatVpsIdc( ChromaFormat(uiCode) );1637 #else 1638 READ_CODE( 2, uiCode, "chroma_format_idc" );repFormat->setChromaFormatVpsIdc( uiCode );1872 repFormat->setChromaFormatVpsIdc( ChromaFormat(uiCode) ); 1873 #else 1874 repFormat->setChromaFormatVpsIdc( uiCode ); 1639 1875 #endif 1640 1876 1641 1877 if( repFormat->getChromaFormatVpsIdc() == 3 ) 1642 1878 { 1643 READ_FLAG( uiCode, "separate_colour_plane_flag"); repFormat->setSeparateColourPlaneVpsFlag(uiCode ? true : false); 1644 } 1645 1646 1647 READ_CODE( 4, uiCode, "bit_depth_luma_minus8" ); repFormat->setBitDepthVpsLuma ( uiCode + 8 ); 1648 READ_CODE( 4, uiCode, "bit_depth_chroma_minus8" ); repFormat->setBitDepthVpsChroma( uiCode + 8 ); 1879 READ_FLAG( uiCode, "separate_colour_plane_vps_flag" ); repFormat->setSeparateColourPlaneVpsFlag( uiCode ? true : false ); 1880 } 1881 1882 READ_CODE( 4, uiCode, "bit_depth_vps_luma_minus8" ); repFormat->setBitDepthVpsLuma ( uiCode + 8 ); 1883 READ_CODE( 4, uiCode, "bit_depth_vps_chroma_minus8" ); repFormat->setBitDepthVpsChroma( uiCode + 8 ); 1884 } 1885 else if( repFormatPrev ) 1886 { 1887 // chroma_and_bit_depth_vps_present_flag equal to 0 specifies that the syntax elements, chroma_format_vps_idc, separate_colour_plane_vps_flag, bit_depth_vps_luma_minus8, and 1888 // bit_depth_vps_chroma_minus8 are not present and inferred from the previous rep_format( ) syntax structure in the VPS. 1889 1890 repFormat->setChromaFormatVpsIdc ( repFormatPrev->getChromaFormatVpsIdc() ); 1891 repFormat->setSeparateColourPlaneVpsFlag( repFormatPrev->getSeparateColourPlaneVpsFlag() ); 1892 repFormat->setBitDepthVpsLuma ( repFormatPrev->getBitDepthVpsLuma() ); 1893 repFormat->setBitDepthVpsChroma ( repFormatPrev->getBitDepthVpsChroma() ); 1649 1894 } 1650 1895 #else … … 1700 1945 READ_FLAG( uiCode, "sub_layer_flag_info_present_flag[i]"); vps->setSubLayerFlagInfoPresentFlag( i, uiCode ? true : false ); 1701 1946 #if DPB_PARAMS_MAXTLAYERS 1702 1947 for(Int j = 0; j <= MaxSubLayersInLayerSetMinus1[ i ]; j++) 1703 1948 #else 1704 1949 for(Int j = 0; j <= vps->getMaxTLayers(); j++) … … 1820 2065 if( parseFlag && vps->getBitRatePresentVpsFlag() ) 1821 2066 { 1822 READ_FLAG( uiCode, "bit_rate_present_ vps_flag[i][j]" ); vps->setBitRatePresentFlag( i, j, uiCode ? true : false );2067 READ_FLAG( uiCode, "bit_rate_present_flag[i][j]" ); vps->setBitRatePresentFlag( i, j, uiCode ? true : false ); 1823 2068 } 1824 2069 else … … 1828 2073 if( parseFlag && vps->getPicRatePresentVpsFlag() ) 1829 2074 { 1830 READ_FLAG( uiCode, "pic_rate_present_ vps_flag[i][j]" ); vps->setPicRatePresentFlag( i, j, uiCode ? true : false );2075 READ_FLAG( uiCode, "pic_rate_present_flag[i][j]" ); vps->setPicRatePresentFlag( i, j, uiCode ? true : false ); 1831 2076 } 1832 2077 else … … 1868 2113 vps->setNumVideoSignalInfo(vps->getMaxLayers()); 1869 2114 } 1870 1871 2115 1872 2116 for(i = 0; i < vps->getNumVideoSignalInfo(); i++) … … 1954 2198 #if HIGHER_LAYER_IRAP_SKIP_FLAG 1955 2199 READ_FLAG(uiCode, "higher_layer_irap_skip_flag" ); vps->setHigherLayerIrapSkipFlag(uiCode == 1 ? true : false); 2200 2201 // When single_layer_for_non_irap_flag is equal to 0, higher_layer_irap_skip_flag shall be equal to 0 2202 if( !vps->getSingleLayerForNonIrapFlag() ) 2203 { 2204 assert( !vps->getHigherLayerIrapSkipFlag() ); 2205 } 1956 2206 #endif 1957 2207 #endif … … 2102 2352 if( rpcSlice->getRapPicFlag()) 2103 2353 { 2104 #if !NO_OUTPUT_OF_PRIOR_PICS 2105 READ_FLAG( uiCode, "no_output_of_prior_pics_flag" ); //ignored 2106 #else 2107 READ_FLAG( uiCode, "no_output_of_prior_pics_flag" ); rpcSlice->setNoOutputOfPriorPicsFlag( uiCode ? true : false ); 2354 READ_FLAG( uiCode, "no_output_of_prior_pics_flag" ); //ignored -- updated already 2355 #if SETTING_NO_OUT_PIC_PRIOR 2356 rpcSlice->setNoOutputPriorPicsFlag(uiCode ? true : false); 2357 #else 2358 rpcSlice->setNoOutputPicPrior( false ); 2108 2359 #endif 2109 2360 } … … 2305 2556 else 2306 2557 { 2307 uiCode = 0; 2558 uiCode = 0; 2308 2559 } 2309 2560 *rps = *(sps->getRPSList()->getReferencePictureSet(uiCode)); … … 2453 2704 for( Int i = 0; i < rpcSlice->getNumILRRefIdx(); i++ ) 2454 2705 { 2706 #if Q0060_MAX_TID_REF_EQUAL_TO_ZERO 2707 if((rpcSlice->getVPS()->getMaxTidIlRefPicsPlus1(rpcSlice->getVPS()->getLayerIdInVps(i),rpcSlice->getLayerId()) > rpcSlice->getTLayer() || rpcSlice->getTLayer()==0) && 2708 (rpcSlice->getVPS()->getMaxTSLayersMinus1(rpcSlice->getVPS()->getLayerIdInVps(i)) >= rpcSlice->getTLayer()) ) 2709 #else 2455 2710 if(rpcSlice->getVPS()->getMaxTidIlRefPicsPlus1(rpcSlice->getVPS()->getLayerIdInVps(i),rpcSlice->getLayerId()) > rpcSlice->getTLayer() && 2456 2711 (rpcSlice->getVPS()->getMaxTSLayersMinus1(rpcSlice->getVPS()->getLayerIdInVps(i)) >= rpcSlice->getTLayer()) ) 2712 #endif 2457 2713 { 2458 2714 rpcSlice->setActiveNumILRRefIdx(1); … … 2487 2743 { 2488 2744 #if O0225_TID_BASED_IL_RPS_DERIV && TSLAYERS_IL_RPS 2745 #if Q0060_MAX_TID_REF_EQUAL_TO_ZERO 2746 if((rpcSlice->getVPS()->getMaxTidIlRefPicsPlus1(0,rpcSlice->getLayerId()) > rpcSlice->getTLayer() || rpcSlice->getTLayer()==0) && 2747 (rpcSlice->getVPS()->getMaxTSLayersMinus1(0) >= rpcSlice->getTLayer()) ) 2748 #else 2489 2749 if( (rpcSlice->getVPS()->getMaxTidIlRefPicsPlus1(0,rpcSlice->getLayerId()) > rpcSlice->getTLayer()) && 2490 2750 (rpcSlice->getVPS()->getMaxTSLayersMinus1(0) >= rpcSlice->getTLayer()) ) 2751 #endif 2491 2752 { 2492 2753 #endif … … 2514 2775 for(i = 0, numRefLayerPics = 0; i < rpcSlice->getNumILRRefIdx(); i++ ) 2515 2776 { 2777 #if Q0060_MAX_TID_REF_EQUAL_TO_ZERO 2778 if((rpcSlice->getVPS()->getMaxTidIlRefPicsPlus1(rpcSlice->getVPS()->getLayerIdInVps(i),rpcSlice->getLayerId()) > rpcSlice->getTLayer() || rpcSlice->getTLayer()==0) && 2779 (rpcSlice->getVPS()->getMaxTSLayersMinus1(rpcSlice->getVPS()->getLayerIdInVps(i)) >= rpcSlice->getTLayer()) ) 2780 #else 2516 2781 if(rpcSlice->getVPS()->getMaxTidIlRefPicsPlus1(rpcSlice->getVPS()->getLayerIdInVps(i),rpcSlice->getLayerId()) > rpcSlice->getTLayer() && 2517 2782 (rpcSlice->getVPS()->getMaxTSLayersMinus1(rpcSlice->getVPS()->getLayerIdInVps(i)) >= rpcSlice->getTLayer()) ) 2783 #endif 2518 2784 { 2519 2785 refLayerPicIdc[ numRefLayerPics++ ] = i; … … 2560 2826 { 2561 2827 format = rpcSlice->getVPS()->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : rpcSlice->getVPS()->getVpsRepFormatIdx(sps->getLayerId()) )->getChromaFormatVpsIdc(); 2828 #if Q0195_REP_FORMAT_CLEANUP 2829 assert( (sps->getUpdateRepFormatFlag()==false && rpcSlice->getVPS()->getVpsNumRepFormats()==1) || rpcSlice->getVPS()->getVpsNumRepFormats() > 1 ); //conformance check 2830 #endif 2562 2831 } 2563 2832 #else … … 3468 3737 } 3469 3738 3739 #if Q0048_CGS_3D_ASYMLUT 3740 Void TDecCavlc::xParse3DAsymLUT( TCom3DAsymLUT * pc3DAsymLUT ) 3741 { 3742 UInt uiCurOctantDepth , uiCurPartNumLog2 , uiInputBitDepthM8 , uiOutputBitDepthM8 , uiResQaunBit; 3743 READ_CODE( 2 , uiCurOctantDepth , "cm_octant_depth" ); 3744 READ_CODE( 2 , uiCurPartNumLog2 , "cm_y_part_num_log2" ); 3745 READ_CODE( 3 , uiInputBitDepthM8 , "cm_input_bit_depth_minus8" ); 3746 Int iInputBitDepthCDelta; 3747 READ_SVLC(iInputBitDepthCDelta, "cm_input_bit_depth_chroma delta"); 3748 READ_CODE( 3 , uiOutputBitDepthM8 , "cm_output_bit_depth_minus8" ); 3749 Int iOutputBitDepthCDelta; 3750 READ_SVLC(iOutputBitDepthCDelta, "cm_output_bit_depth_chroma_delta"); 3751 READ_CODE( 2 , uiResQaunBit , "cm_res_quant_bit" ); 3752 pc3DAsymLUT->destroy(); 3753 pc3DAsymLUT->create( uiCurOctantDepth , uiInputBitDepthM8 + 8 , uiInputBitDepthM8 + 8 + iInputBitDepthCDelta, uiOutputBitDepthM8 + 8 , uiOutputBitDepthM8 + 8 + iOutputBitDepthCDelta ,uiCurPartNumLog2 ); 3754 pc3DAsymLUT->setResQuantBit( uiResQaunBit ); 3755 3756 xParse3DAsymLUTOctant( pc3DAsymLUT , 0 , 0 , 0 , 0 , 1 << pc3DAsymLUT->getCurOctantDepth() ); 3757 } 3758 3759 Void TDecCavlc::xParse3DAsymLUTOctant( TCom3DAsymLUT * pc3DAsymLUT , Int nDepth , Int yIdx , Int uIdx , Int vIdx , Int nLength ) 3760 { 3761 UInt uiOctantSplit = nDepth < pc3DAsymLUT->getCurOctantDepth(); 3762 if( nDepth < pc3DAsymLUT->getCurOctantDepth() ) 3763 READ_FLAG( uiOctantSplit , "split_octant_flag" ); 3764 Int nYPartNum = 1 << pc3DAsymLUT->getCurYPartNumLog2(); 3765 if( uiOctantSplit ) 3766 { 3767 Int nHalfLength = nLength >> 1; 3768 for( Int l = 0 ; l < 2 ; l++ ) 3769 { 3770 for( Int m = 0 ; m < 2 ; m++ ) 3771 { 3772 for( Int n = 0 ; n < 2 ; n++ ) 3773 { 3774 xParse3DAsymLUTOctant( pc3DAsymLUT , nDepth + 1 , yIdx + l * nHalfLength * nYPartNum , uIdx + m * nHalfLength , vIdx + n * nHalfLength , nHalfLength ); 3775 } 3776 } 3777 } 3778 } 3779 else 3780 { 3781 for( Int l = 0 ; l < nYPartNum ; l++ ) 3782 { 3783 for( Int nVertexIdx = 0 ; nVertexIdx < 4 ; nVertexIdx++ ) 3784 { 3785 UInt uiCodeVertex = 0; 3786 Int deltaY = 0 , deltaU = 0 , deltaV = 0; 3787 READ_FLAG( uiCodeVertex , "coded_vertex_flag" ); 3788 if( uiCodeVertex ) 3789 { 3790 READ_SVLC( deltaY , "resY" ); 3791 READ_SVLC( deltaU , "resU" ); 3792 READ_SVLC( deltaV , "resV" ); 3793 } 3794 pc3DAsymLUT->setCuboidVertexResTree( yIdx + l , uIdx , vIdx , nVertexIdx , deltaY , deltaU , deltaV ); 3795 } 3796 } 3797 } 3798 } 3799 #endif 3470 3800 //! \} 3471 3801 -
trunk/source/Lib/TLibDecoder/TDecCAVLC.h
r644 r713 46 46 #include "SyntaxElementParser.h" 47 47 48 #if Q0048_CGS_3D_ASYMLUT 49 class TCom3DAsymLUT; 50 #endif 48 51 //! \ingroup TLibDecoder 49 52 //! \{ … … 75 78 #if VPS_EXTNS 76 79 Void parseVPSExtension ( TComVPS* pcVPS ); 80 Void defaultVPSExtension ( TComVPS* pcVPS ); 77 81 #endif 78 82 79 83 #if VPS_VUI 80 84 Void parseVPSVUI ( TComVPS* pcVPS ); 85 Void defaultVPSVUI ( TComVPS* pcVPS ); 81 86 #endif 82 87 #if REPN_FORMAT_IN_VPS 83 Void parseRepFormat ( RepFormat *repFormat );88 Void parseRepFormat ( RepFormat *repFormat, RepFormat *repFormatPrev ); 84 89 #endif 85 90 #if VPS_DPB_SIZE_TABLE … … 95 100 Void parseSPS ( TComSPS* pcSPS ); 96 101 #endif //SVC_EXTENSION 97 Void parsePPS ( TComPPS* pcPPS); 102 Void parsePPS ( TComPPS* pcPPS 103 #if Q0048_CGS_3D_ASYMLUT 104 , TCom3DAsymLUT * pc3DAsymLUT , Int nLayerID 105 #endif 106 ); 98 107 Void parseVUI ( TComVUI* pcVUI, TComSPS* pcSPS ); 99 108 Void parseSEI ( SEIMessages& ); … … 135 144 protected: 136 145 Bool xMoreRbspData(); 146 147 #if Q0048_CGS_3D_ASYMLUT 148 Void xParse3DAsymLUT( TCom3DAsymLUT * pc3DAsymLUT ); 149 Void xParse3DAsymLUTOctant( TCom3DAsymLUT * pc3DAsymLUT , Int nDepth , Int yIdx , Int uIdx , Int vIdx , Int nLength ); 150 #endif 137 151 }; 138 152 -
trunk/source/Lib/TLibDecoder/TDecCu.cpp
r595 r713 73 73 m_ppcCU [ui]->setLayerId(layerId); 74 74 } 75 76 #if LAYER_CTB 77 memcpy(g_auiLayerZscanToRaster[m_layerId], g_auiZscanToRaster, sizeof( g_auiZscanToRaster ) ); 78 memcpy(g_auiLayerRasterToZscan[m_layerId], g_auiRasterToZscan, sizeof( g_auiRasterToZscan ) ); 79 memcpy(g_auiLayerRasterToPelX[m_layerId], g_auiRasterToPelX, sizeof( g_auiRasterToPelX ) ); 80 memcpy(g_auiLayerRasterToPelY[m_layerId], g_auiRasterToPelY, sizeof( g_auiRasterToPelY ) ); 81 #endif 75 82 } 76 83 #else … … 715 722 { 716 723 UInt uiInitTrDepth = ( pcCU->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1 ); 717 UInt uiNumPart = pcCU->getNumPart Inter();724 UInt uiNumPart = pcCU->getNumPartitions(); 718 725 UInt uiNumQParts = pcCU->getTotalNumPart() >> 2; 719 726 -
trunk/source/Lib/TLibDecoder/TDecEntropy.h
r644 r713 49 49 class TDecCavlc; 50 50 class ParameterSetManagerDecoder; 51 #if Q0048_CGS_3D_ASYMLUT 52 class TCom3DAsymLUT; 53 #endif 51 54 52 55 //! \ingroup TLibDecoder … … 71 74 virtual Void parseSPS ( TComSPS* pcSPS ) = 0; 72 75 #endif 73 virtual Void parsePPS ( TComPPS* pcPPS ) = 0; 76 virtual Void parsePPS ( TComPPS* pcPPS 77 #if Q0048_CGS_3D_ASYMLUT 78 , TCom3DAsymLUT * pc3DAsymLUT , Int nLayerID 79 #endif 80 ) = 0; 74 81 75 82 virtual Void parseSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager) = 0; … … 138 145 Void decodeSPS ( TComSPS* pcSPS ) { m_pcEntropyDecoderIf->parseSPS(pcSPS); } 139 146 #endif 140 Void decodePPS ( TComPPS* pcPPS ) { m_pcEntropyDecoderIf->parsePPS(pcPPS); } 147 148 #if Q0048_CGS_3D_ASYMLUT 149 Void decodePPS ( TComPPS* pcPPS, TCom3DAsymLUT * pc3DAsymLUT, Int nLayerID ) { m_pcEntropyDecoderIf->parsePPS(pcPPS, pc3DAsymLUT , nLayerID ); } 150 #else 151 Void decodePPS ( TComPPS* pcPPS ) { m_pcEntropyDecoderIf->parsePPS(pcPPS ); } 152 #endif 141 153 Void decodeSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager) { m_pcEntropyDecoderIf->parseSliceHeader(rpcSlice, parameterSetManager); } 142 154 -
trunk/source/Lib/TLibDecoder/TDecGop.cpp
r595 r713 248 248 } 249 249 250 #if SETTING_PIC_OUTPUT_MARK 251 rpcPic->setOutputMark(rpcPic->getSlice(0)->getPicOutputFlag() ? true : false); 252 #else 250 253 rpcPic->setOutputMark(true); 254 #endif 251 255 rpcPic->setReconMark(true); 252 256 } -
trunk/source/Lib/TLibDecoder/TDecSbac.h
r644 r713 81 81 Void parseSPS ( TComSPS* /*pcSPS*/ ) {} 82 82 #endif 83 Void parsePPS ( TComPPS* /*pcPPS*/ ) {} 83 Void parsePPS ( TComPPS* /*pcPPS*/ 84 #if Q0048_CGS_3D_ASYMLUT 85 , TCom3DAsymLUT * /*pc3DAsymLUT*/ , Int /*nLayerID*/ 86 #endif 87 ) {} 84 88 85 89 Void parseSliceHeader ( TComSlice*& /*rpcSlice*/, ParameterSetManagerDecoder* /*parameterSetManager*/) {} -
trunk/source/Lib/TLibDecoder/TDecTop.cpp
r644 r713 79 79 m_prevSliceSkipped = false; 80 80 m_skippedPOC = 0; 81 #if SETTING_NO_OUT_PIC_PRIOR 82 m_bFirstSliceInBitstream = true; 83 m_lastPOCNoOutputPriorPics = -1; 84 m_craNoRaslOutputFlag = false; 85 m_isNoOutputPriorPics = false; 86 #endif 81 87 #if NO_CLRAS_OUTPUT_FLAG 82 88 m_noClrasOutputFlag = false; 83 89 m_layerInitializedFlag = false; 84 m_firstPicInLayerDecodedFlag = false; 85 m_noOutputOfPriorPicsFlags = false; 86 m_bRefreshPending = false; 90 m_firstPicInLayerDecodedFlag = false; 87 91 #endif 88 92 #if RESOLUTION_BASED_DPB 89 93 m_subDpbIdx = -1; 90 94 #endif 95 #if Q0048_CGS_3D_ASYMLUT 96 m_pColorMappedPic = NULL; 97 #endif 98 99 #if Q0074_SEI_COLOR_MAPPING 100 m_ColorMapping = new TDecColorMapping(); 101 #endif 91 102 } 92 103 … … 95 106 #if ENC_DEC_TRACE 96 107 fclose( g_hTrace ); 108 #endif 109 #if Q0048_CGS_3D_ASYMLUT 110 if(m_pColorMappedPic) 111 { 112 m_pColorMappedPic->destroy(); 113 delete m_pColorMappedPic; 114 m_pColorMappedPic = NULL; 115 } 116 #endif 117 #if Q0074_SEI_COLOR_MAPPING 118 if ( m_ColorMapping ) delete m_ColorMapping; 97 119 #endif 98 120 } … … 353 375 Bool sameBitDepths = ( g_bitDepthYLayer[m_layerId] == g_bitDepthYLayer[refLayerId] ) && ( g_bitDepthCLayer[m_layerId] == g_bitDepthCLayer[refLayerId] ); 354 376 355 if( pcPicYuvRecBase->getWidth() != pcSlice->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getPicHeightInLumaSamples() || !zeroOffsets || !sameBitDepths ) 377 if( pcPicYuvRecBase->getWidth() != pcSlice->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getPicHeightInLumaSamples() || !zeroOffsets || !sameBitDepths 378 #if Q0048_CGS_3D_ASYMLUT 379 || pcSlice->getPPS()->getCGSFlag() > 0 380 #endif 381 #if LAYER_CTB 382 || pcTDecTopBase->getActiveSPS()->getMaxCUWidth() != m_ppcTDecTop[m_layerId]->getActiveSPS()->getMaxCUWidth() || pcTDecTopBase->getActiveSPS()->getMaxCUHeight() != m_ppcTDecTop[m_layerId]->getActiveSPS()->getMaxCUHeight() || pcTDecTopBase->getActiveSPS()->getMaxCUDepth() != m_ppcTDecTop[m_layerId]->getActiveSPS()->getMaxCUDepth() 383 #endif 384 ) 356 385 #else 357 386 if(pcPicYuvRecBase->getWidth() != pcSlice->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getPicHeightInLumaSamples() || !zeroOffsets ) … … 503 532 504 533 // Execute Deblock + Cleanup 505 506 534 m_cGopDecoder.filterPicture(pcPic); 507 535 … … 517 545 return; 518 546 } 547 548 #if SETTING_NO_OUT_PIC_PRIOR 549 Void TDecTop::checkNoOutputPriorPics (TComList<TComPic*>*& rpcListPic) 550 { 551 if (!rpcListPic || !m_isNoOutputPriorPics) return; 552 553 TComList<TComPic*>::iterator iterPic = rpcListPic->begin(); 554 555 while (iterPic != rpcListPic->end()) 556 { 557 TComPic*& pcPicTmp = *(iterPic++); 558 if (m_lastPOCNoOutputPriorPics != pcPicTmp->getPOC()) 559 { 560 pcPicTmp->setOutputMark(false); 561 } 562 } 563 } 564 #endif 519 565 520 566 #if EARLY_REF_PIC_MARKING … … 733 779 #endif 734 780 781 #if AVC_BASE 782 if( activeVPS->getAvcBaseLayerFlag() ) 783 { 784 TComPic* pBLPic = (*m_ppcTDecTop[0]->getListPic()->begin()); 785 if( m_layerId == 1 && pBLPic->getPicYuvRec() == NULL ) 786 { 787 UInt refLayerId = 0; 788 RepFormat* repFormat = activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(refLayerId) ); 789 790 Int numReorderPics[MAX_TLAYER]; 791 Window conformanceWindow; 792 Window defaultDisplayWindow; 793 794 #if AUXILIARY_PICTURES 795 #if SVC_UPSAMPLING 796 #if AVC_SYNTAX 797 pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), repFormat->getChromaFormatVpsIdc(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, activeSPS, true); 798 #else 799 pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), repFormat->getChromaFormatVpsIdc(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, NULL, true); 800 #endif 801 #else 802 pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), repFormat->getChromaFormatVpsIdc(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, true); 803 #endif 804 #else 805 #if SVC_UPSAMPLING 806 #if AVC_SYNTAX 807 pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, activeSPS, true); 808 #else 809 pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, NULL, true); 810 #endif 811 #else 812 pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), onformanceWindow, defaultDisplayWindow, numReorderPics, true); 813 #endif 814 #endif 815 // it is needed where the VPS is accessed through the slice 816 pBLPic->getSlice(0)->setVPS( activeVPS ); 817 818 #if O0194_DIFFERENT_BITDEPTH_EL_BL 819 g_bitDepthYLayer[0] = repFormat->getBitDepthVpsLuma(); 820 g_bitDepthCLayer[0] = repFormat->getBitDepthVpsChroma(); 821 #endif 822 } 823 } 824 #endif 825 735 826 #if P0312_VERT_PHASE_ADJ 736 827 if( activeVPS->getVpsVuiVertPhaseInUseFlag() == 0 ) … … 808 899 g_uiAddCUDepth = max (0, sps->getLog2MinCodingBlockSize() - (Int)sps->getQuadtreeTULog2MinSize() ); 809 900 901 #if Q0074_SEI_COLOR_MAPPING 902 for(Int compID=0; compID<3; compID++) 903 { 904 m_ColorMapping->setColorMapping( compID ? g_bitDepthC : g_bitDepthY, compID ); 905 } 906 #endif 907 810 908 for (Int i = 0; i < sps->getLog2DiffMaxMinCodingBlockSize(); i++) 811 909 { … … 843 941 TComPic*& pcPic = m_pcPic; 844 942 #if SVC_EXTENSION 845 #if !NO_OUTPUT_OF_PRIOR_PICS846 #if NO_CLRAS_OUTPUT_FLAG847 Bool bFirstSliceInSeq;848 #endif849 #endif850 943 m_apcSlicePilot->setVPS( m_parameterSetManagerDecoder.getPrefetchedVPS(0) ); 851 944 #if OUTPUT_LAYER_SET_INDEX … … 900 993 m_apcSlicePilot->setAssociatedIRAPType(m_associatedIRAPType); 901 994 902 #if NO_OUTPUT_OF_PRIOR_PICS 903 // Infer the value of NoOutputOfPriorPicsFlag 904 if( m_apcSlicePilot->getRapPicFlag() ) 905 { 906 if ( m_apcSlicePilot->getBlaPicFlag() || m_apcSlicePilot->getIdrPicFlag() || 907 (m_apcSlicePilot->getCraPicFlag() && m_bFirstSliceInSequence) || 908 (m_apcSlicePilot->getCraPicFlag() && m_apcSlicePilot->getHandleCraAsBlaFlag())) 909 { 910 m_apcSlicePilot->setNoRaslOutputFlag( true ); 995 #if SETTING_NO_OUT_PIC_PRIOR 996 //For inference of NoOutputOfPriorPicsFlag 997 if (m_apcSlicePilot->getRapPicFlag()) 998 { 999 if ((m_apcSlicePilot->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_apcSlicePilot->getNalUnitType() <= NAL_UNIT_CODED_SLICE_IDR_N_LP) || 1000 (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_bFirstSliceInSequence) || 1001 (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_apcSlicePilot->getHandleCraAsBlaFlag())) 1002 { 1003 m_apcSlicePilot->setNoRaslOutputFlag(true); 1004 } 1005 //the inference for NoOutputPriorPicsFlag 1006 if (!m_bFirstSliceInBitstream && m_apcSlicePilot->getRapPicFlag() && m_apcSlicePilot->getNoRaslOutputFlag()) 1007 { 1008 if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA) 1009 { 1010 m_apcSlicePilot->setNoOutputPriorPicsFlag(true); 1011 } 911 1012 } 912 1013 else 913 1014 { 914 m_apcSlicePilot->setNoRaslOutputFlag( false ); 915 } 1015 m_apcSlicePilot->setNoOutputPriorPicsFlag(false); 1016 } 1017 1018 if(m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA) 1019 { 1020 m_craNoRaslOutputFlag = m_apcSlicePilot->getNoRaslOutputFlag(); 1021 } 1022 } 1023 if (m_apcSlicePilot->getRapPicFlag() && m_apcSlicePilot->getNoOutputPriorPicsFlag()) 1024 { 1025 m_lastPOCNoOutputPriorPics = m_apcSlicePilot->getPOC(); 1026 m_isNoOutputPriorPics = true; 1027 } 1028 else 1029 { 1030 m_isNoOutputPriorPics = false; 1031 } 1032 1033 //For inference of PicOutputFlag 1034 if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R) 1035 { 1036 if ( m_craNoRaslOutputFlag ) 1037 { 1038 m_apcSlicePilot->setPicOutputFlag(false); 1039 } 1040 } 1041 #endif 1042 1043 #if FIX_POC_CRA_NORASL_OUTPUT 1044 if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_craNoRaslOutputFlag) //Reset POC MSB when CRA has NoRaslOutputFlag equal to 1 1045 { 1046 Int iMaxPOClsb = 1 << m_apcSlicePilot->getSPS()->getBitsForPOC(); 1047 m_apcSlicePilot->setPOC( m_apcSlicePilot->getPOC() & (iMaxPOClsb - 1) ); 916 1048 } 917 1049 #endif … … 967 1099 } 968 1100 969 m_apcSlicePilot->decodingRefreshMarking( m_pocCRA, m_bRefreshPending, m_cListPic, getNoClrasOutputFlag());1101 m_apcSlicePilot->decodingRefreshMarking( m_cListPic, m_noClrasOutputFlag ); 970 1102 #endif 971 1103 … … 975 1107 if( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_apcSlicePilot->getNoRaslOutputFlag() ) 976 1108 { 977 this->setNoOutput OfPriorPicsFlags( true );1109 this->setNoOutputPriorPicsFlag( true ); 978 1110 } 979 1111 else if( m_apcSlicePilot->getRapPicFlag() && m_apcSlicePilot->getNoRaslOutputFlag() ) 980 1112 { 981 this->setNoOutput OfPriorPicsFlags( m_apcSlicePilot->getNoOutputOfPriorPicsFlag() );1113 this->setNoOutputPriorPicsFlag( m_apcSlicePilot->getNoOutputPriorPicsFlag() ); 982 1114 } 983 1115 else … … 985 1117 if( this->m_ppcTDecTop[0]->getNoClrasOutputFlag() ) 986 1118 { 987 this->setNoOutput OfPriorPicsFlags( true );1119 this->setNoOutputPriorPicsFlag( true ); 988 1120 } 989 1121 } … … 1006 1138 #else 1007 1139 //we should only get a different poc for a new picture (with CTU address==0) 1008 if (m_apcSlicePilot->isNextSlice() && m_apcSlicePilot->getPOC()!=m_prevPOC && !m_bFirstSliceInSequence && ( !m_apcSlicePilot->getSliceCurStartCUAddr()==0))1140 if (m_apcSlicePilot->isNextSlice() && m_apcSlicePilot->getPOC()!=m_prevPOC && !m_bFirstSliceInSequence && (m_apcSlicePilot->getSliceCurStartCUAddr()!=0)) 1009 1141 { 1010 1142 printf ("Warning, the first slice of a picture might have been lost!\n"); … … 1050 1182 #endif 1051 1183 } 1052 #if !NO_OUTPUT_OF_PRIOR_PICS1053 #if NO_CLRAS_OUTPUT_FLAG1054 bFirstSliceInSeq = m_bFirstSliceInSequence;1055 #endif1056 #endif1057 1184 m_bFirstSliceInSequence = false; 1185 #if SETTING_NO_OUT_PIC_PRIOR 1186 m_bFirstSliceInBitstream = false; 1187 #endif 1058 1188 #if POC_RESET_FLAG 1059 1189 // This operation would do the following: … … 1216 1346 #endif 1217 1347 1218 #if !NO_OUTPUT_OF_PRIOR_PICS 1219 #if NO_CLRAS_OUTPUT_FLAG 1220 if (m_layerId == 0 && 1221 (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 1222 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 1223 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP 1224 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL 1225 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP 1226 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA)) 1227 { 1228 if (bFirstSliceInSeq) 1229 { 1230 setNoClrasOutputFlag(true); 1231 } 1232 else if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 1233 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 1234 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP) 1235 { 1236 setNoClrasOutputFlag(true); 1237 } 1238 #if O0149_CROSS_LAYER_BLA_FLAG 1239 else if ((m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP) && 1240 m_apcSlicePilot->getCrossLayerBLAFlag()) 1241 { 1242 setNoClrasOutputFlag(true); 1243 } 1244 #endif 1245 else 1246 { 1247 setNoClrasOutputFlag(false); 1248 } 1249 if (getNoClrasOutputFlag()) 1250 { 1251 for (UInt i = 0; i < m_apcSlicePilot->getVPS()->getMaxLayers(); i++) 1252 { 1253 m_ppcTDecTop[i]->setLayerInitializedFlag(false); 1254 m_ppcTDecTop[i]->setFirstPicInLayerDecodedFlag(false); 1255 } 1256 } 1257 } 1258 #endif 1259 1260 #if NO_CLRAS_OUTPUT_FLAG 1261 m_apcSlicePilot->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, m_cListPic, getNoClrasOutputFlag()); 1262 #endif 1263 #else 1348 #if NO_OUTPUT_OF_PRIOR_PICS 1264 1349 if ( m_layerId == 0 && m_apcSlicePilot->getRapPicFlag() && getNoClrasOutputFlag() ) 1265 1350 { … … 1273 1358 // Buffer initialize for prediction. 1274 1359 m_cPrediction.initTempBuff(); 1275 #if !ALIGNED_BUMPING 1360 #if ALIGNED_BUMPING 1361 m_apcSlicePilot->checkLeadingPictureRestrictions(m_cListPic); 1362 #else 1276 1363 m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS()); 1277 #else1278 m_apcSlicePilot->checkLeadingPictureRestrictions(m_cListPic);1279 1364 #endif 1280 1365 // Get a new picture buffer … … 1515 1600 Int widthBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth(); 1516 1601 Int heightBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight(); 1517 1602 #if Q0200_CONFORMANCE_BL_SIZE 1603 Int chromaFormatIdc = pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getChromaFormatIdc(); 1604 const Window &confBL = pcSlice->getBaseColPic(refLayerIdc)->getConformanceWindow(); 1605 widthBL -= ( confBL.getWindowLeftOffset() + confBL.getWindowRightOffset() ) * TComSPS::getWinUnitX( chromaFormatIdc ); 1606 heightBL -= ( confBL.getWindowTopOffset() + confBL.getWindowBottomOffset() ) * TComSPS::getWinUnitY( chromaFormatIdc ); 1607 #endif 1518 1608 Int widthEL = pcPic->getPicYuvRec()->getWidth() - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset(); 1519 1609 Int heightEL = pcPic->getPicYuvRec()->getHeight() - scalEL.getWindowTopOffset() - scalEL.getWindowBottomOffset(); … … 1525 1615 g_posScalingFactor[refLayerIdc][1] = ((heightBL << 16) + (heightEL >> 1)) / heightEL; 1526 1616 1617 #if Q0048_CGS_3D_ASYMLUT 1618 TComPicYuv* pBaseColRec = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(); 1619 if( pcSlice->getPPS()->getCGSFlag() ) 1620 { 1621 if(!m_pColorMappedPic) 1622 { 1623 initAsymLut(pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)); 1624 } 1625 m_c3DAsymLUTPPS.colorMapping( pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), m_pColorMappedPic ); 1626 pBaseColRec = m_pColorMappedPic; 1627 } 1628 #endif 1527 1629 #if SVC_UPSAMPLING 1528 1630 if( pcPic->isSpatialEnhLayer(refLayerIdc) ) 1529 1631 { 1530 /*#if O0098_SCALED_REF_LAYER_ID1531 Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc));1532 #else1533 Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc);1534 #endif*/1535 1632 #if O0215_PHASE_ALIGNMENT 1536 1633 #if O0194_JOINT_US_BITSHIFT 1537 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() ); 1634 #if Q0048_CGS_3D_ASYMLUT 1635 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() ); 1636 #else 1637 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() ); 1638 #endif 1639 #else 1640 #if Q0048_CGS_3D_ASYMLUT 1641 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() ); 1538 1642 #else 1539 1643 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() ); 1540 1644 #endif 1645 #endif 1541 1646 #else 1542 1647 #if O0194_JOINT_US_BITSHIFT 1648 #if Q0048_CGS_3D_ASYMLUT 1649 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL ); 1650 #else 1543 1651 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL ); 1652 #endif 1653 #else 1654 #if Q0048_CGS_3D_ASYMLUT 1655 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL ); 1544 1656 #else 1545 1657 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL ); 1658 #endif 1546 1659 #endif 1547 1660 #endif … … 1755 1868 } 1756 1869 1757 Void TDecTop::xDecodePPS() 1870 Void TDecTop::xDecodePPS( 1871 #if Q0048_CGS_3D_ASYMLUT 1872 TCom3DAsymLUT * pc3DAsymLUT 1873 #endif 1874 ) 1758 1875 { 1759 1876 TComPPS* pps = new TComPPS(); … … 1763 1880 #endif 1764 1881 1765 m_cEntropyDecoder.decodePPS( pps ); 1882 m_cEntropyDecoder.decodePPS( pps 1883 #if Q0048_CGS_3D_ASYMLUT 1884 , pc3DAsymLUT , m_layerId 1885 #endif 1886 ); 1766 1887 m_parameterSetManagerDecoder.storePrefetchedPPS( pps ); 1767 1888 … … 1809 1930 SEIActiveParameterSets *seiAps = (SEIActiveParameterSets*)(*activeParamSets.begin()); 1810 1931 m_parameterSetManagerDecoder.applyPrefetchedPS(); 1811 assert(seiAps->activeSeqParam SetId.size()>0);1812 if( !m_parameterSetManagerDecoder.activateSPSWithSEI( seiAps->activeSeqParam SetId[0] ) )1932 assert(seiAps->activeSeqParameterSetId.size()>0); 1933 if( !m_parameterSetManagerDecoder.activateSPSWithSEI( seiAps->activeSeqParameterSetId[0] ) ) 1813 1934 { 1814 1935 printf ("Warning SPS activation with Active parameter set SEI failed"); 1815 1936 } 1816 1937 } 1938 #if Q0074_SEI_COLOR_MAPPING 1939 m_ColorMapping->setColorMapping( m_SEIs ); 1940 #endif 1817 1941 } 1818 1942 #else … … 1837 1961 SEIActiveParameterSets *seiAps = (SEIActiveParameterSets*)(*activeParamSets.begin()); 1838 1962 m_parameterSetManagerDecoder.applyPrefetchedPS(); 1839 assert(seiAps->activeSeqParam SetId.size()>0);1840 if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParam SetId[0] ))1963 assert(seiAps->activeSeqParameterSetId.size()>0); 1964 if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParameterSetId[0] )) 1841 1965 { 1842 1966 printf ("Warning SPS activation with Active parameter set SEI failed"); … … 1897 2021 case NAL_UNIT_SPS: 1898 2022 xDecodeSPS(); 1899 #if AVC_BASE1900 if( m_parameterSetManagerDecoder.getPrefetchedVPS(0)->getAvcBaseLayerFlag() )1901 {1902 TComPic* pBLPic = (*m_ppcTDecTop[0]->getListPic()->begin());1903 if( nalu.m_layerId == 1 && pBLPic->getPicYuvRec() == NULL )1904 {1905 // using EL SPS with spsId = 11906 TComSPS* sps = m_parameterSetManagerDecoder.getPrefetchedSPS(1);1907 Int numReorderPics[MAX_TLAYER];1908 Window &conformanceWindow = sps->getConformanceWindow();1909 Window defaultDisplayWindow = sps->getVuiParametersPresentFlag() ? sps->getVuiParameters()->getDefaultDisplayWindow() : Window();1910 #if AUXILIARY_PICTURES1911 #if SVC_UPSAMPLING1912 #if AVC_SYNTAX1913 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, sps, true);1914 #else1915 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, NULL, true);1916 #endif1917 #else1918 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), onformanceWindow, defaultDisplayWindow, numReorderPics, true);1919 #endif1920 #else1921 #if SVC_UPSAMPLING1922 #if AVC_SYNTAX1923 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, sps, true);1924 #else1925 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, NULL, true);1926 #endif1927 #else1928 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), onformanceWindow, defaultDisplayWindow, numReorderPics, true);1929 #endif1930 #endif1931 1932 #if O0194_DIFFERENT_BITDEPTH_EL_BL1933 // set AVC BL bit depth, can be an input parameter from the command line1934 g_bitDepthYLayer[0] = 8;1935 g_bitDepthCLayer[0] = 8;1936 #endif1937 }1938 }1939 #endif1940 2023 return false; 1941 2024 1942 2025 case NAL_UNIT_PPS: 1943 xDecodePPS(); 2026 xDecodePPS( 2027 #if Q0048_CGS_3D_ASYMLUT 2028 &m_c3DAsymLUTPPS 2029 #endif 2030 ); 1944 2031 return false; 1945 2032 … … 1997 2084 return false; 1998 2085 2086 case NAL_UNIT_FILLER_DATA: 2087 return false; 1999 2088 2000 2089 case NAL_UNIT_RESERVED_VCL_N10: … … 2017 2106 case NAL_UNIT_RESERVED_VCL31: 2018 2107 2019 case NAL_UNIT_FILLER_DATA:2020 2108 case NAL_UNIT_RESERVED_NVCL41: 2021 2109 case NAL_UNIT_RESERVED_NVCL42: … … 2304 2392 } 2305 2393 #endif 2394 2395 #if Q0048_CGS_3D_ASYMLUT 2396 Void TDecTop::initAsymLut(TComSlice *pcSlice) 2397 { 2398 if(m_layerId>0) 2399 { 2400 if(!m_pColorMappedPic) 2401 { 2402 Int picWidth = pcSlice->getPicWidthInLumaSamples(); 2403 Int picHeight = pcSlice->getPicHeightInLumaSamples(); 2404 m_pColorMappedPic = new TComPicYuv; 2405 m_pColorMappedPic->create( picWidth, picHeight, pcSlice->getChromaFormatIdc()/*CHROMA_420*/, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, NULL ); 2406 } 2407 } 2408 } 2409 #endif 2410 2306 2411 #endif //SVC_EXTENSION 2412 2413 #if Q0074_SEI_COLOR_MAPPING 2414 TDecColorMapping::TDecColorMapping() 2415 { 2416 m_pcColorMappingPic[0] = NULL; 2417 m_pcColorMappingPic[1] = NULL; 2418 2419 m_colorMapCancelFlag = true; 2420 2421 for( Int i=0 ; i<3 ; i++ ) 2422 { 2423 m_lut1d_computed[i] = false; 2424 m_lut1d_input[i] = NULL; 2425 m_coded_input_pivot_value[i] = NULL; 2426 m_target_input_pivot_value[i] = NULL; 2427 } 2428 for( Int i=0 ; i<3 ; i++ ) 2429 { 2430 m_lut1d_output[i] = NULL; 2431 m_coded_output_pivot_value[i] = NULL; 2432 m_target_output_pivot_value[i] = NULL; 2433 } 2434 } 2435 2436 TDecColorMapping::~TDecColorMapping() 2437 { 2438 if ( m_pcColorMappingPic[0] ) delete m_pcColorMappingPic[0]; 2439 if ( m_pcColorMappingPic[1] ) delete m_pcColorMappingPic[1]; 2440 2441 for( Int i=0 ; i<3 ; i++ ) 2442 { 2443 if ( m_lut1d_input[i] ) delete m_lut1d_input[i]; 2444 if ( m_coded_input_pivot_value[i] ) delete m_coded_input_pivot_value[i]; 2445 if ( m_target_input_pivot_value[i] ) delete m_target_input_pivot_value[i]; 2446 } 2447 for( Int i=0 ; i<3 ; i++ ) 2448 { 2449 if ( m_lut1d_output[i] ) delete m_lut1d_output[i]; 2450 if ( m_coded_output_pivot_value[i] ) delete m_coded_output_pivot_value[i]; 2451 if ( m_target_output_pivot_value[i] ) delete m_target_output_pivot_value[i]; 2452 } 2453 } 2454 2455 Void TDecColorMapping::setColorMapping( SEIMessages m_SEIs ) 2456 { 2457 SEIMessages colorMappingInfo = getSeisByType(m_SEIs, SEI::COLOR_MAPPING_INFO) ; 2458 SEIColorMappingInfo *seiColorMappingInfo = NULL; 2459 if (colorMappingInfo.size() !=0) 2460 { 2461 seiColorMappingInfo = (SEIColorMappingInfo*)(*colorMappingInfo.begin()); 2462 2463 m_colorMapId = seiColorMappingInfo->m_colorMapId; 2464 m_colorMapCancelFlag = seiColorMappingInfo->m_colorMapCancelFlag; 2465 if( !m_colorMapCancelFlag ) 2466 { 2467 m_colorMapPersistenceFlag = seiColorMappingInfo->m_colorMapPersistenceFlag; 2468 m_colorMap_video_signal_type_present_flag = seiColorMappingInfo->m_colorMap_video_signal_type_present_flag; 2469 m_colorMap_video_full_range_flag = seiColorMappingInfo->m_colorMap_video_full_range_flag; 2470 m_colorMap_primaries = seiColorMappingInfo->m_colorMap_primaries; 2471 m_colorMap_transfer_characteristics = seiColorMappingInfo->m_colorMap_transfer_characteristics; 2472 m_colorMap_matrix_coeffs = seiColorMappingInfo->m_colorMap_matrix_coeffs; 2473 m_colorMapModelId = seiColorMappingInfo->m_colorMapModelId; 2474 2475 m_colour_map_coded_data_bit_depth = seiColorMappingInfo->m_colour_map_coded_data_bit_depth; 2476 m_colour_map_target_bit_depth = seiColorMappingInfo->m_colour_map_target_bit_depth; 2477 2478 for( Int i=0 ; i<3 ; i++ ) 2479 { 2480 m_num_input_pivots[i] = seiColorMappingInfo->m_num_input_pivots[i]; 2481 if ( m_coded_input_pivot_value[i] ) delete m_coded_input_pivot_value[i]; 2482 if ( m_target_input_pivot_value[i] ) delete m_target_input_pivot_value[i]; 2483 m_coded_input_pivot_value[i] = new Int[ m_num_input_pivots[i] ]; 2484 m_target_input_pivot_value[i] = new Int[ m_num_input_pivots[i] ]; 2485 for( Int j=0 ; j<m_num_input_pivots[i] ; j++ ) 2486 { 2487 m_coded_input_pivot_value[i][j] = seiColorMappingInfo->m_coded_input_pivot_value[i][j]; 2488 m_target_input_pivot_value[i][j] = seiColorMappingInfo->m_target_input_pivot_value[i][j]; 2489 } 2490 } 2491 2492 m_matrix_flag = seiColorMappingInfo->m_matrix_flag; 2493 m_log2_matrix_denom = m_matrix_flag ? (seiColorMappingInfo->m_log2_matrix_denom) : (0) ; 2494 for( Int i=0 ; i<3 ; i++ ) 2495 { 2496 for( Int j=0 ; j<3 ; j++ ) 2497 { 2498 m_matrix_coef[i][j] = seiColorMappingInfo->m_matrix_coef[i][j]; 2499 } 2500 } 2501 2502 for( Int i=0 ; i<3 ; i++ ) 2503 { 2504 m_num_output_pivots[i] = seiColorMappingInfo->m_num_output_pivots[i]; 2505 if ( m_coded_output_pivot_value[i] ) delete m_coded_output_pivot_value[i]; 2506 if ( m_target_output_pivot_value[i] ) delete m_target_output_pivot_value[i]; 2507 m_coded_output_pivot_value[i] = new Int[ m_num_output_pivots[i] ]; 2508 m_target_output_pivot_value[i] = new Int[ m_num_output_pivots[i] ]; 2509 for( Int j=0 ; j<m_num_output_pivots[i] ; j++ ) 2510 { 2511 m_coded_output_pivot_value[i][j] = seiColorMappingInfo->m_coded_output_pivot_value[i][j]; 2512 m_target_output_pivot_value[i][j] = seiColorMappingInfo->m_target_output_pivot_value[i][j]; 2513 } 2514 } 2515 2516 memset( m_lut1d_computed, 0, sizeof( m_lut1d_computed ) ); 2517 } 2518 } 2519 2520 } 2521 2522 Void TDecColorMapping::setColorMapping( Int bitDepth, Int iComp ) 2523 { 2524 if( !m_colorMapCancelFlag && !m_lut1d_computed[iComp] ) 2525 { 2526 2527 if ( m_lut1d_input[iComp] ) delete m_lut1d_input[iComp]; 2528 if ( m_lut1d_output[iComp] ) delete m_lut1d_output[iComp]; 2529 2530 m_lut1d_input[iComp] = new Int[ 1 << bitDepth ]; 2531 m_lut1d_output[iComp] = new Int[ 1 << bitDepth ]; 2532 2533 Int iShift = (m_colour_map_coded_data_bit_depth >= bitDepth) ? (m_colour_map_coded_data_bit_depth - bitDepth) : (0); 2534 Int iShiftPivot = (m_colour_map_coded_data_bit_depth >= bitDepth) ? (0) : (bitDepth - m_colour_map_coded_data_bit_depth); 2535 2536 for( Int k=0 ; k<(1<<bitDepth) ; k++ ) 2537 { 2538 Int iSample = k << iShift ; 2539 if( m_num_input_pivots[iComp] > 1 ) 2540 { 2541 for( Int iPivot=0 ; iPivot<m_num_input_pivots[iComp] ; iPivot++ ) 2542 { 2543 Int iCodedPrev = m_coded_input_pivot_value[iComp][iPivot] << iShiftPivot; 2544 Int iCodedNext = m_coded_input_pivot_value[iComp][iPivot+1] << iShiftPivot; 2545 Int iTargetPrev = m_target_input_pivot_value[iComp][iPivot] << iShiftPivot; 2546 Int iTargetNext = m_target_input_pivot_value[iComp][iPivot+1] << iShiftPivot; 2547 if ( iCodedPrev <= iSample && iSample < iCodedNext ) 2548 { 2549 Float fInterpol = (Float)( (iCodedNext - iSample)*iTargetPrev + (iSample - iCodedPrev)*iTargetNext ) / (Float)(iCodedNext - iCodedPrev) ; 2550 m_lut1d_input[iComp][k] = (Int)( 0.5 + fInterpol ); 2551 iPivot = m_num_input_pivots[iComp]; // stop 2552 } 2553 } 2554 } 2555 else 2556 { 2557 m_lut1d_input[iComp][k] = k; 2558 } 2559 } 2560 2561 iShift = ( (m_colour_map_coded_data_bit_depth >= bitDepth) ? (m_colour_map_coded_data_bit_depth - bitDepth) : (0) ); 2562 Int iOffset = iShift ? (1 << (iShift - 1)) : (0) ; 2563 iShiftPivot = (m_colour_map_target_bit_depth >= bitDepth) ? (0) : (bitDepth - m_colour_map_target_bit_depth) ; 2564 for( Int k=0 ; k<(1<<bitDepth) ; k++ ) 2565 { 2566 Int iSample = k << iShift; 2567 if ( m_num_output_pivots[iComp]>1 ) 2568 { 2569 for( Int iPivot=0 ; iPivot<m_num_output_pivots[iComp] ; iPivot++ ) 2570 { 2571 Int iCodedPrev = m_coded_output_pivot_value[iComp][iPivot] << iShiftPivot; 2572 Int iCodedNext = m_coded_output_pivot_value[iComp][iPivot+1] << iShiftPivot; 2573 Int iTargetPrev = m_target_output_pivot_value[iComp][iPivot] << iShiftPivot; 2574 Int iTargetNext = m_target_output_pivot_value[iComp][iPivot+1] << iShiftPivot; 2575 if ( iCodedPrev <= iSample && iSample < iCodedNext ) 2576 { 2577 Float fInterpol = (Float)( (iCodedNext - iSample)*iTargetPrev + (iSample - iCodedPrev)*iTargetNext ) / (Float)(iCodedNext - iCodedPrev) ; 2578 m_lut1d_output[iComp][k] = ( (Int)(0.5 + fInterpol) + iOffset ) >> iShift ; 2579 iPivot = m_num_output_pivots[iComp]; // stop 2580 } 2581 } 2582 } 2583 else 2584 { 2585 m_lut1d_output[iComp][k] = k; 2586 } 2587 } 2588 2589 m_lut1d_computed[iComp] = true; 2590 } 2591 2592 } 2593 2594 TComPicYuv* TDecColorMapping::getColorMapping( TComPicYuv* pPicYuvRec, Int iTop, Int curlayerId ) 2595 { 2596 if( !m_colorMapCancelFlag ) 2597 { 2598 if( !m_pcColorMappingPic[iTop] ) 2599 { 2600 m_pcColorMappingPic[iTop] = new TComPicYuv; 2601 #if SVC_EXTENSION 2602 m_pcColorMappingPic[iTop]->create( pPicYuvRec->getWidth(), pPicYuvRec->getHeight(), pPicYuvRec->getChromaFormat(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 2603 #else 2604 m_pcColorMappingPic[iTop]->create( pPicYuvRec->getWidth(), pPicYuvRec->getHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 2605 #endif 2606 } 2607 2608 Int iHeight = pPicYuvRec->getHeight(); 2609 Int iWidth = pPicYuvRec->getWidth(); 2610 Int iStride = pPicYuvRec->getStride(); 2611 Int iCStride = pPicYuvRec->getCStride(); 2612 2613 Pel* Lum0 = pPicYuvRec->getLumaAddr(); 2614 Pel* Cb0 = pPicYuvRec->getCbAddr(); 2615 Pel* Cr0 = pPicYuvRec->getCrAddr(); 2616 Pel* Lum1 = m_pcColorMappingPic[iTop]->getLumaAddr(); 2617 Pel* Cb1 = m_pcColorMappingPic[iTop]->getCbAddr(); 2618 Pel* Cr1 = m_pcColorMappingPic[iTop]->getCrAddr(); 2619 2620 #if SVC_EXTENSION 2621 Int bitDepthY = g_bitDepthYLayer[curlayerId]; 2622 Int bitDepthC = g_bitDepthCLayer[curlayerId]; 2623 2624 assert( g_bitDepthY == bitDepthY ); 2625 assert( g_bitDepthC == bitDepthC ); 2626 #else 2627 Int bitDepthY = g_bitDepthY; 2628 Int bitDepthC = g_bitDepthC; 2629 #endif 2630 2631 Int iYShift = (m_colour_map_target_bit_depth >= bitDepthY) ? (m_colour_map_target_bit_depth - bitDepthY) : (0) ; 2632 Int iCShift = (m_colour_map_target_bit_depth >= bitDepthC) ? (m_colour_map_target_bit_depth - bitDepthC) : (0) ; 2633 Int offsetY = (1 << (m_log2_matrix_denom+iYShift - 1)); 2634 Int offsetC = (1 << (m_log2_matrix_denom+iCShift - 1)); 2635 2636 Int cShift = 1 ; 2637 2638 //Pel* LumPrev0 = Lum0; 2639 for( Int y = 0; y < iHeight ; y++ ) 2640 { 2641 Bool bDoChroma = (y % 2); 2642 for( Int x = 0; x < iWidth ; x++ ) 2643 { 2644 Int s1Y = m_lut1d_input[0][ Lum0[x] ]; 2645 Int s1U = m_lut1d_input[1][ Cb0[x>>1] ]; 2646 Int s1V = m_lut1d_input[2][ Cr0[x>>1] ]; 2647 2648 Int s2Y, s2U, s2V; 2649 if( m_matrix_flag ) 2650 { 2651 s2Y = ( m_matrix_coef[0][0]*s1Y + m_matrix_coef[0][1]*s1U + m_matrix_coef[0][2]*s1V + offsetY ) >> ( m_log2_matrix_denom + iYShift ); 2652 //s2Y = ClipBD( s2Y , bitDepthY ); 2653 s2Y = ClipY( s2Y ); 2654 Lum1[x] = m_lut1d_output[0][ s2Y ]; 2655 } 2656 else 2657 { 2658 s1Y = ( s1Y + offsetY ) >> iYShift ; 2659 //s1Y = ClipBD( s1Y , bitDepthY ); 2660 s1Y = ClipY( s1Y ); 2661 Lum1[x] = m_lut1d_output[0][ s1Y ]; 2662 } 2663 2664 if( bDoChroma && (x%2) ) 2665 { 2666 if( m_matrix_flag ) 2667 { 2668 //s1Y = ( m_lut1d_input[0][ Lum0[x] ] + m_lut1d_input[0][ Lum0[x+1] ] + m_lut1d_input[0][ LumPrev0[x] ] + m_lut1d_input[0][ LumPrev0[x+1] ] + 2 ) >> 2 ; 2669 //s1Y = m_lut1d_input[0][ (Lum0[x] + Lum0[x+1] + LumPrev0[x] + LumPrev0[x+1] + 2)>>2 ] ; 2670 s1Y = m_lut1d_input[0][ Lum0[x] ]; 2671 2672 s2U = ( m_matrix_coef[1][0]*s1Y + m_matrix_coef[1][1]*s1U + m_matrix_coef[1][2]*s1V + offsetC ) >> ( m_log2_matrix_denom + iCShift ) ; 2673 s2V = ( m_matrix_coef[2][0]*s1Y + m_matrix_coef[2][1]*s1U + m_matrix_coef[2][2]*s1V + offsetC ) >> ( m_log2_matrix_denom + iCShift ) ; 2674 //s2U = ClipBD( s2U , bitDepthC ); 2675 //s2V = ClipBD( s2V , bitDepthC ); 2676 s2U = ClipC( s2U ); 2677 s2V = ClipC( s2V ); 2678 Cb1[x>>cShift] = m_lut1d_output[1][ s2U ]; 2679 Cr1[x>>cShift] = m_lut1d_output[2][ s2V ]; 2680 } 2681 else 2682 { 2683 s1U = ( s1U + offsetC ) >> iCShift ; 2684 s1V = ( s1V + offsetC ) >> iCShift ; 2685 //s1U = ClipBD( s1U , bitDepthC ); 2686 //s1V = ClipBD( s1V , bitDepthC ); 2687 s1U = ClipC( s1U ); 2688 s1V = ClipC( s1V ); 2689 Cb1[x>>cShift] = m_lut1d_output[1][ s1U ]; 2690 Cr1[x>>cShift] = m_lut1d_output[2][ s1V ]; 2691 } 2692 } 2693 2694 } 2695 2696 //LumPrev0 = Lum0; 2697 Lum0 += iStride; 2698 Lum1 += iStride; 2699 if( bDoChroma ) 2700 { 2701 Cb0 += iCStride; 2702 Cr0 += iCStride; 2703 Cb1 += iCStride; 2704 Cr1 += iCStride; 2705 } 2706 } 2707 2708 return m_pcColorMappingPic[iTop]; 2709 } 2710 2711 return pPicYuvRec; 2712 } 2713 #endif 2714 2307 2715 //! \} -
trunk/source/Lib/TLibDecoder/TDecTop.h
r644 r713 45 45 #include "TLibCommon/TComTrQuant.h" 46 46 #include "TLibCommon/SEI.h" 47 #if Q0048_CGS_3D_ASYMLUT 48 #include "TLibCommon/TCom3DAsymLUT.h" 49 #endif 47 50 48 51 #include "TDecGop.h" … … 61 64 // ==================================================================================================================== 62 65 66 #if Q0074_SEI_COLOR_MAPPING 67 class TDecColorMapping 68 { 69 Int m_colorMapId; 70 Bool m_colorMapCancelFlag; 71 Bool m_colorMapPersistenceFlag; 72 Bool m_colorMap_video_signal_type_present_flag; 73 Bool m_colorMap_video_full_range_flag; 74 Int m_colorMap_primaries; 75 Int m_colorMap_transfer_characteristics; 76 Int m_colorMap_matrix_coeffs; 77 Int m_colorMapModelId; 78 79 Int m_colour_map_coded_data_bit_depth; 80 Int m_colour_map_target_bit_depth; 81 82 Int m_num_input_pivots[3]; 83 Int* m_coded_input_pivot_value[3]; 84 Int* m_target_input_pivot_value[3]; 85 86 Bool m_matrix_flag; 87 Int m_log2_matrix_denom; 88 Int m_matrix_coef[3][3]; 89 90 Int m_num_output_pivots[3]; 91 Int* m_coded_output_pivot_value[3]; 92 Int* m_target_output_pivot_value[3]; 93 94 Bool m_lut1d_computed[3]; 95 Int* m_lut1d_input[3]; 96 Int* m_lut1d_output[3]; 97 TComPicYuv* m_pcColorMappingPic[2]; 98 99 public: 100 TDecColorMapping(); 101 ~TDecColorMapping(); 102 103 Bool getColorMappingFlag() { return(!m_colorMapCancelFlag);}; 104 105 Void setColorMapping( SEIMessages m_SEIs ); 106 Void setColorMapping( Int bitDepthY, Int bitDepthC ); 107 TComPicYuv* getColorMapping( TComPicYuv* pPicYuvRec, Int iTop=0, Int curlayerId=0 ); 108 };// END CLASS DEFINITION TDecColorMapping 109 #endif 110 63 111 /// decoder class 64 112 class TDecTop … … 79 127 // functional classes 80 128 TComPrediction m_cPrediction; 129 #if Q0048_CGS_3D_ASYMLUT 130 TCom3DAsymLUT m_c3DAsymLUTPPS; 131 TComPicYuv* m_pColorMappedPic; 132 #endif 81 133 TComTrQuant m_cTrQuant; 82 134 TDecGop m_cGopDecoder; … … 104 156 Bool m_prevSliceSkipped; 105 157 Int m_skippedPOC; 158 #if SETTING_NO_OUT_PIC_PRIOR 159 Bool m_bFirstSliceInBitstream; 160 Int m_lastPOCNoOutputPriorPics; 161 Bool m_isNoOutputPriorPics; 162 Bool m_craNoRaslOutputFlag; //value of variable NoRaslOutputFlag of the last CRA pic 163 #endif 106 164 107 165 #if SVC_EXTENSION … … 114 172 #if AVC_BASE 115 173 fstream* m_pBLReconFile; 174 #if !REPN_FORMAT_IN_VPS 116 175 Int m_iBLSourceWidth; 117 Int m_iBLSourceHeight; 176 Int m_iBLSourceHeight; 177 #endif 118 178 #endif 119 179 #if VPS_EXTN_DIRECT_REF_LAYERS … … 136 196 #endif 137 197 138 #if NO_CLRAS_OUTPUT_FLAG 198 #if NO_CLRAS_OUTPUT_FLAG 139 199 Bool m_noClrasOutputFlag; 140 200 Bool m_layerInitializedFlag; 141 201 Bool m_firstPicInLayerDecodedFlag; 142 Bool m_noOutputOfPriorPicsFlags;143 144 Bool m_bRefreshPending;145 202 #endif 146 203 #if RESOLUTION_BASED_DPB 147 Int m_subDpbIdx; // Index to the sub-DPB that the layer belongs to.148 // When new VPS is activated, this should be re-initialized to -1204 Int m_subDpbIdx; // Index to the sub-DPB that the layer belongs to. 205 // When new VPS is activated, this should be re-initialized to -1 149 206 #endif 150 207 public: 208 #if Q0074_SEI_COLOR_MAPPING 209 TDecColorMapping* m_ColorMapping; 210 #endif 211 151 212 TDecTop(); 152 213 virtual ~TDecTop(); … … 166 227 Void deletePicBuffer(); 167 228 229 230 TComSPS* getActiveSPS() { return m_parameterSetManagerDecoder.getActiveSPS(); } 231 232 168 233 Void executeLoopFilters(Int& poc, TComList<TComPic*>*& rpcListPic); 234 #if SETTING_NO_OUT_PIC_PRIOR 235 Void checkNoOutputPriorPics (TComList<TComPic*>*& rpcListPic); 236 Bool getNoOutputPriorPicsFlag () { return m_isNoOutputPriorPics; } 237 Void setNoOutputPriorPicsFlag (Bool val) { m_isNoOutputPriorPics = val; } 238 #endif 239 169 240 #if SVC_EXTENSION 170 241 #if EARLY_REF_PIC_MARKING … … 212 283 Void setBLReconFile( fstream* pFile ) { m_pBLReconFile = pFile; } 213 284 fstream* getBLReconFile() { return m_pBLReconFile; } 285 #if !REPN_FORMAT_IN_VPS 214 286 Void setBLsize( Int iWidth, Int iHeight ) { m_iBLSourceWidth = iWidth; m_iBLSourceHeight = iHeight; } 215 287 Int getBLWidth() { return m_iBLSourceWidth; } 216 288 Int getBLHeight() { return m_iBLSourceHeight; } 289 #endif 217 290 #endif 218 291 #if REPN_FORMAT_IN_VPS … … 238 311 Void setBLSyntaxFile( fstream* pFile ) { m_pBLSyntaxFile = pFile; } 239 312 fstream* getBLSyntaxFile() { return m_pBLSyntaxFile; } 240 #endif241 #if NO_OUTPUT_OF_PRIOR_PICS242 #if NO_CLRAS_OUTPUT_FLAG243 Bool getNoOutputOfPriorPicsFlags() { return m_noOutputOfPriorPicsFlags;}244 Void setNoOutputOfPriorPicsFlags(Bool x) { m_noOutputOfPriorPicsFlags = x; }245 #endif246 313 #endif 247 314 protected: … … 261 328 Void xDecodeVPS(); 262 329 Void xDecodeSPS(); 263 Void xDecodePPS(); 330 Void xDecodePPS( 331 #if Q0048_CGS_3D_ASYMLUT 332 TCom3DAsymLUT * pc3DAsymLUT 333 #endif 334 ); 264 335 Void xDecodeSEI( TComInputBitstream* bs, const NalUnitType nalUnitType ); 265 336 … … 271 342 Int getFirstPicInLayerDecodedFlag() { return m_firstPicInLayerDecodedFlag;} 272 343 Void setFirstPicInLayerDecodedFlag(Bool x) { m_firstPicInLayerDecodedFlag = x; } 273 #if !NO_OUTPUT_OF_PRIOR_PICS 274 Int getNoOutputOfPriorPicsFlags() { return m_noOutputOfPriorPicsFlags;} 275 Void setNoOutputOfPriorPicsFlags(Bool x) { m_noOutputOfPriorPicsFlags = x; } 276 #endif 344 #endif 345 #if Q0048_CGS_3D_ASYMLUT 346 Void initAsymLut(TComSlice *pcSlice); 277 347 #endif 278 348 };// END CLASS DEFINITION TDecTop -
trunk/source/Lib/TLibEncoder/AnnexBwrite.h
r595 r713 58 58 59 59 static const Char start_code_prefix[] = {0,0,0,1}; 60 if (it == au.begin() || nalu.m_nalUnitType == NAL_UNIT_ SPS || nalu.m_nalUnitType == NAL_UNIT_PPS)60 if (it == au.begin() || nalu.m_nalUnitType == NAL_UNIT_VPS || nalu.m_nalUnitType == NAL_UNIT_SPS || nalu.m_nalUnitType == NAL_UNIT_PPS) 61 61 { 62 62 /* From AVC, When any of the following conditions are fulfilled, the -
trunk/source/Lib/TLibEncoder/NALwrite.cpp
r595 r713 91 91 vector<uint8_t>& rbsp = nalu.m_Bitstream.getFIFO(); 92 92 93 #if P0130_EOB 94 if (rbsp.size() == 0) return; 95 #endif 93 if (rbsp.size() == 0) 94 { 95 return; 96 } 96 97 97 98 for (vector<uint8_t>::iterator it = rbsp.begin(); it != rbsp.end();) -
trunk/source/Lib/TLibEncoder/SEIwrite.cpp
r644 r713 87 87 fprintf( g_hTrace, "=========== Tone Mapping Info SEI message ===========\n"); 88 88 break; 89 #if Q0074_SEI_COLOR_MAPPING 90 case SEI::COLOR_MAPPING_INFO: 91 fprintf( g_hTrace, "=========== Color Mapping Info SEI message ===========\n"); 92 break; 93 #endif 89 94 case SEI::SOP_DESCRIPTION: 90 95 fprintf( g_hTrace, "=========== SOP Description SEI message ===========\n"); … … 172 177 xWriteSEIToneMappingInfo(*static_cast<const SEIToneMappingInfo*>(&sei)); 173 178 break; 179 #if Q0074_SEI_COLOR_MAPPING 180 case SEI::COLOR_MAPPING_INFO: 181 xWriteSEIColorMappingInfo(*static_cast<const SEIColorMappingInfo*>(&sei)); 182 break; 183 #endif 174 184 case SEI::SOP_DESCRIPTION: 175 185 xWriteSEISOPDescription(*static_cast<const SEISOPDescription*>(&sei)); … … 333 343 Void SEIWriter::xWriteSEIActiveParameterSets(const SEIActiveParameterSets& sei) 334 344 { 335 WRITE_CODE(sei.activeVPSId, 4, "active_vps_id");336 WRITE_FLAG(sei.m_ fullRandomAccessFlag, "full_random_access_flag");337 WRITE_FLAG(sei.m_noParam SetUpdateFlag, "no_param_set_update_flag");345 WRITE_CODE(sei.activeVPSId, 4, "active_video_parameter_set_id"); 346 WRITE_FLAG(sei.m_selfContainedCvsFlag, "self_contained_cvs_flag"); 347 WRITE_FLAG(sei.m_noParameterSetUpdateFlag, "no_parameter_set_update_flag"); 338 348 WRITE_UVLC(sei.numSpsIdsMinus1, "num_sps_ids_minus1"); 339 349 340 assert (sei.activeSeqParamSetId.size() == (sei.numSpsIdsMinus1 + 1)); 341 342 for (Int i = 0; i < sei.activeSeqParamSetId.size(); i++) 343 { 344 WRITE_UVLC(sei.activeSeqParamSetId[i], "active_seq_param_set_id"); 345 } 346 347 UInt uiBits = m_pcBitIf->getNumberOfWrittenBits(); 348 UInt uiAlignedBits = ( 8 - (uiBits&7) ) % 8; 349 if(uiAlignedBits) 350 { 351 WRITE_FLAG(1, "alignment_bit" ); 352 uiAlignedBits--; 353 while(uiAlignedBits--) 354 { 355 WRITE_FLAG(0, "alignment_bit" ); 356 } 357 } 350 assert (sei.activeSeqParameterSetId.size() == (sei.numSpsIdsMinus1 + 1)); 351 352 for (Int i = 0; i < sei.activeSeqParameterSetId.size(); i++) 353 { 354 WRITE_UVLC(sei.activeSeqParameterSetId[i], "active_seq_parameter_set_id"); 355 } 356 xWriteByteAlign(); 358 357 } 359 358 … … 550 549 { 551 550 WRITE_CODE( sei.m_cameraIsoSpeedValue, 32, "camera_iso_speed_value" ); 551 } 552 WRITE_CODE( sei.m_exposureIndexIdc, 8, "exposure_index_idc" ); 553 if( sei.m_exposureIndexIdc == 255) //Extended_ISO 554 { 555 WRITE_CODE( sei.m_exposureIndexValue, 32, "exposure_index_value" ); 552 556 } 553 557 WRITE_FLAG( sei.m_exposureCompensationValueSignFlag, "exposure_compensation_value_sign_flag" ); … … 572 576 } 573 577 578 #if Q0074_SEI_COLOR_MAPPING 579 Void SEIWriter::xWriteSEIColorMappingInfo(const SEIColorMappingInfo& sei) 580 { 581 WRITE_UVLC( sei.m_colorMapId, "colour_map_id" ); 582 WRITE_FLAG( sei.m_colorMapCancelFlag, "colour_map_cancel_flag" ); 583 if( !sei.m_colorMapCancelFlag ) 584 { 585 WRITE_FLAG( sei.m_colorMapPersistenceFlag, "colour_map_persistence_flag" ); 586 WRITE_FLAG( sei.m_colorMap_video_signal_type_present_flag, "colour_map_video_signal_type_present_flag" ); 587 if ( sei.m_colorMap_video_signal_type_present_flag ) 588 { 589 WRITE_FLAG( sei.m_colorMap_video_full_range_flag, "colour_map_video_full_range_flag" ); 590 WRITE_CODE( sei.m_colorMap_primaries, 8, "colour_map_primaries" ); 591 WRITE_CODE( sei.m_colorMap_transfer_characteristics, 8, "colour_map_transfer_characteristics" ); 592 WRITE_CODE( sei.m_colorMap_matrix_coeffs, 8, "colour_map_matrix_coeffs" ); 593 } 594 } 595 596 WRITE_CODE( sei.m_colour_map_coded_data_bit_depth, 5, "colour_map_coded_data_bit_depth" ); 597 WRITE_CODE( sei.m_colour_map_target_bit_depth, 5, "colour_map_target_bit_depth" ); 598 WRITE_UVLC( sei.m_colorMapModelId, "colour_map_model_id" ); 599 600 assert( sei.m_colorMapModelId == 0 ); 601 602 for( Int i=0 ; i<3 ; i++ ) 603 { 604 WRITE_CODE( sei.m_num_input_pivots[i] - 1, 8, "num_input_pivots_minus1[i]" ); 605 for( Int j=0 ; j<sei.m_num_input_pivots[i] ; j++ ) 606 { 607 WRITE_CODE( sei.m_coded_input_pivot_value[i][j], (( sei.m_colour_map_coded_data_bit_depth + 7 ) >> 3 ) << 3, "coded_input_pivot_value[i][j]" ); 608 WRITE_CODE( sei.m_target_input_pivot_value[i][j], (( sei.m_colour_map_coded_data_bit_depth + 7 ) >> 3 ) << 3, "target_input_pivot_value[i][j]" ); 609 } 610 } 611 612 WRITE_FLAG( sei.m_matrix_flag, "matrix_flag" ); 613 if( sei.m_matrix_flag ) 614 { 615 WRITE_CODE( sei.m_log2_matrix_denom, 4, "log2_matrix_denom" ); 616 for( Int i=0 ; i<3 ; i++ ) 617 { 618 for( Int j=0 ; j<3 ; j++ ) 619 { 620 WRITE_SVLC( sei.m_matrix_coef[i][j], "matrix_coef[i][j]" ); 621 } 622 } 623 } 624 625 for( Int i=0 ; i<3 ; i++ ) 626 { 627 WRITE_CODE( sei.m_num_output_pivots[i] - 1, 8, "num_output_pivots_minus1[i]" ); 628 for( Int j=0 ; j<sei.m_num_output_pivots[i] ; j++ ) 629 { 630 WRITE_CODE( sei.m_coded_output_pivot_value[i][j], (( sei.m_colour_map_coded_data_bit_depth + 7 ) >> 3 ) << 3, "coded_output_pivot_value[i][j]" ); 631 WRITE_CODE( sei.m_target_output_pivot_value[i][j], (( sei.m_colour_map_coded_data_bit_depth + 7 ) >> 3 ) << 3, "target_output_pivot_value[i][j]" ); 632 } 633 } 634 635 xWriteByteAlign(); 636 } 637 #endif 638 574 639 Void SEIWriter::xWriteSEIDisplayOrientation(const SEIDisplayOrientation &sei) 575 640 { … … 633 698 for (UInt i = (sei.m_defaultOpFlag ? 1 : 0); i <= sei.m_nestingNumOpsMinus1; i++) 634 699 { 700 WRITE_CODE( sei.m_nestingNoOpMaxTemporalIdPlus1, 3, "nesting_no_op_max_temporal_id" ); 635 701 WRITE_CODE( sei.m_nestingMaxTemporalIdPlus1[i], 3, "nesting_max_temporal_id" ); 636 702 WRITE_UVLC( sei.m_nestingOpIdx[i], "nesting_op_idx" ); -
trunk/source/Lib/TLibEncoder/SEIwrite.h
r644 r713 72 72 Void xWriteSEIGradualDecodingRefreshInfo(const SEIGradualDecodingRefreshInfo &sei); 73 73 Void xWriteSEIToneMappingInfo(const SEIToneMappingInfo& sei); 74 #if Q0074_SEI_COLOR_MAPPING 75 Void xWriteSEIColorMappingInfo(const SEIColorMappingInfo& sei); 76 #endif 74 77 Void xWriteSEISOPDescription(const SEISOPDescription& sei); 75 78 #if O0164_MULTI_LAYER_HRD -
trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
r649 r713 154 154 155 155 156 Void TEncCavlc::codePPS( TComPPS* pcPPS ) 156 Void TEncCavlc::codePPS( TComPPS* pcPPS 157 #if Q0048_CGS_3D_ASYMLUT 158 , TEnc3DAsymLUT * pc3DAsymLUT 159 #endif 160 ) 157 161 { 158 162 #if ENC_DEC_TRACE … … 268 272 { 269 273 WRITE_FLAG( pcPPS->getPocResetInfoPresentFlag() ? 1 : 0, "poc_reset_info_present_flag" ); 274 #if Q0048_CGS_3D_ASYMLUT 275 UInt uiPos = getNumberOfWrittenBits(); 276 WRITE_FLAG( pcPPS->getCGSFlag() , "colour_mapping_enabled_flag" ); 277 if( pcPPS->getCGSFlag() ) 278 { 279 assert( pc3DAsymLUT != NULL ); 280 xCode3DAsymLUT( pc3DAsymLUT ); 281 } 282 pc3DAsymLUT->setPPSBit( getNumberOfWrittenBits() - uiPos ); 283 #endif 270 284 #endif 271 285 } … … 495 509 if (conf.getWindowEnabledFlag()) 496 510 { 511 #if REPN_FORMAT_IN_VPS 512 WRITE_UVLC( conf.getWindowLeftOffset(), "conf_win_left_offset" ); 513 WRITE_UVLC( conf.getWindowRightOffset(), "conf_win_right_offset" ); 514 WRITE_UVLC( conf.getWindowTopOffset(), "conf_win_top_offset" ); 515 WRITE_UVLC( conf.getWindowBottomOffset(), "conf_win_bottom_offset" ); 516 #else 497 517 WRITE_UVLC( conf.getWindowLeftOffset() / TComSPS::getWinUnitX(pcSPS->getChromaFormatIdc() ), "conf_win_left_offset" ); 498 518 WRITE_UVLC( conf.getWindowRightOffset() / TComSPS::getWinUnitX(pcSPS->getChromaFormatIdc() ), "conf_win_right_offset" ); 499 519 WRITE_UVLC( conf.getWindowTopOffset() / TComSPS::getWinUnitY(pcSPS->getChromaFormatIdc() ), "conf_win_top_offset" ); 500 520 WRITE_UVLC( conf.getWindowBottomOffset() / TComSPS::getWinUnitY(pcSPS->getChromaFormatIdc() ), "conf_win_bottom_offset" ); 521 #endif 501 522 } 502 523 … … 777 798 } 778 799 } 779 #if !VPS_EXTNS 780 WRITE_FLAG( 0, "vps_extension_flag" ); 781 #else 782 WRITE_FLAG( 1, "vps_extension_flag" ); 783 if(1) // Should be conditioned on the value of vps_extension_flag 800 #if VPS_EXTNS 801 // When MaxLayersMinus1 is greater than 0, vps_extension_flag shall be equal to 1. 802 if( pcVPS->getMaxLayers() > 1 ) 803 { 804 assert( pcVPS->getVpsExtensionFlag() == true ); 805 } 806 807 WRITE_FLAG( pcVPS->getVpsExtensionFlag() ? 1 : 0, "vps_extension_flag" ); 808 809 if( pcVPS->getVpsExtensionFlag() ) 784 810 { 785 811 while ( m_pcBitIf->getNumberOfWrittenBits() % 8 != 0 ) … … 797 823 WRITE_FLAG( 0, "vps_extension2_flag" ); // Flag value of 1 reserved 798 824 } 825 #else 826 WRITE_FLAG( 0, "vps_extension_flag" ); 799 827 #endif 800 828 //future extensions here.. … … 996 1024 } 997 1025 #else 998 Int numOutputLayerSets = vps->getNumOutputLayerSets() ; 999 assert( numOutputLayerSets - (Int)vps->getNumLayerSets() >= 0 ); 1026 Int numOutputLayerSets = vps->getNumOutputLayerSets(); 1027 Int numAddOutputLayerSets = numOutputLayerSets - (Int)vps->getNumLayerSets(); 1028 1029 // The value of num_add_output_layer_sets shall be in the range of 0 to 1023, inclusive. 1030 assert( numAddOutputLayerSets >= 0 && numAddOutputLayerSets < 1024 ); 1031 1032 #if Q0165_NUM_ADD_OUTPUT_LAYER_SETS 1033 if( vps->getNumLayerSets() > 1 ) 1034 { 1035 WRITE_UVLC( numAddOutputLayerSets, "num_add_output_layer_sets" ); 1036 WRITE_CODE( vps->getDefaultTargetOutputLayerIdc(), 2, "default_target_output_layer_idc" ); 1037 } 1038 #else 1000 1039 WRITE_UVLC( numOutputLayerSets - vps->getNumLayerSets(), "num_add_output_layer_sets" ); 1001 1040 #endif 1041 #endif 1042 1043 #if !Q0165_NUM_ADD_OUTPUT_LAYER_SETS 1002 1044 if( numOutputLayerSets > 1 ) 1003 1045 { … … 1012 1054 #endif 1013 1055 } 1056 #endif 1014 1057 1015 1058 for(i = 1; i < numOutputLayerSets; i++) … … 1059 1102 WRITE_FLAG(vps->getAltOuputLayerFlag(i), "alt_output_layer_flag[i]"); 1060 1103 } 1104 1105 #if Q0165_OUTPUT_LAYER_SET 1106 assert( NumOutputLayersInOutputLayerSet[i]>0 ); 1107 #endif 1108 1061 1109 #endif 1062 1110 } … … 1072 1120 1073 1121 #if REPN_FORMAT_IN_VPS 1122 #if Q0195_REP_FORMAT_CLEANUP 1123 // The value of vps_num_rep_formats_minus1 shall be in the range of 0 to 255, inclusive. 1124 assert( vps->getVpsNumRepFormats() > 0 && vps->getVpsNumRepFormats() <= 256 ); 1125 1126 WRITE_UVLC( vps->getVpsNumRepFormats() - 1, "vps_num_rep_formats_minus1" ); 1127 1128 for(i = 0; i < vps->getVpsNumRepFormats(); i++) 1129 { 1130 // Write rep_format_structures 1131 codeRepFormat( vps->getVpsRepFormat(i) ); 1132 } 1133 1134 if( vps->getVpsNumRepFormats() > 1 ) 1135 { 1136 WRITE_FLAG( vps->getRepFormatIdxPresentFlag(), "rep_format_idx_present_flag"); 1137 } 1138 else 1139 { 1140 // When not present, the value of rep_format_idx_present_flag is inferred to be equal to 0 1141 assert( !vps->getRepFormatIdxPresentFlag() ); 1142 } 1143 1144 if( vps->getRepFormatIdxPresentFlag() ) 1145 { 1146 for(i = 1; i < vps->getMaxLayers(); i++) 1147 { 1148 Int numBits = 1; 1149 while ((1 << numBits) < (vps->getVpsNumRepFormats())) 1150 { 1151 numBits++; 1152 } 1153 WRITE_CODE( vps->getVpsRepFormatIdx(i), numBits, "vps_rep_format_idx[i]" ); 1154 } 1155 } 1156 #else 1074 1157 WRITE_FLAG( vps->getRepFormatIdxPresentFlag(), "rep_format_idx_present_flag"); 1075 1158 1076 1159 if( vps->getRepFormatIdxPresentFlag() ) 1077 1160 { 1161 // The value of vps_num_rep_formats_minus1 shall be in the range of 0 to 255, inclusive. 1162 assert( vps->getVpsNumRepFormats() > 0 && vps->getVpsNumRepFormats() <= 256 ); 1163 1078 1164 #if O0096_REP_FORMAT_INDEX 1079 1165 #if !VPS_EXTN_UEV_CODING … … 1115 1201 } 1116 1202 } 1203 #endif 1117 1204 #endif 1118 1205 … … 1181 1268 1182 1269 #if P0307_VPS_NON_VUI_EXTENSION 1270 // The value of vps_non_vui_extension_length shall be in the range of 0 to 4096, inclusive. 1271 assert( vps->getVpsNonVuiExtLength() >= 0 && vps->getVpsNonVuiExtLength() <= 4096 ); 1272 1183 1273 WRITE_UVLC( vps->getVpsNonVuiExtLength(), "vps_non_vui_extension_length" ); 1184 1274 #if P0307_VPS_NON_VUI_EXT_UPDATE … … 1216 1306 #else 1217 1307 #if P0307_REMOVE_VPS_VUI_OFFSET 1218 WRITE_FLAG( 1, "vps_vui_present_flag" );1219 1308 vps->setVpsVuiPresentFlag(true); 1309 WRITE_FLAG( vps->getVpsVuiPresentFlag() ? 1 : 0, "vps_vui_present_flag" ); 1220 1310 #endif 1221 1311 if(vps->getVpsVuiPresentFlag()) // Should be conditioned on the value of vps_vui_present_flag … … 1238 1328 #endif 1239 1329 #if REPN_FORMAT_IN_VPS 1240 Void TEncCavlc::codeRepFormat 1330 Void TEncCavlc::codeRepFormat( RepFormat *repFormat ) 1241 1331 { 1242 1332 #if REPN_FORMAT_CONTROL_FLAG 1243 WRITE_FLAG ( repFormat->getChromaAndBitDepthVpsPresentFlag(), "chroma_and_bit_depth_vps_presenet_flag"); 1244 1245 WRITE_CODE ( repFormat->getPicWidthVpsInLumaSamples (), 16, "pic_width_in_luma_samples" ); 1246 WRITE_CODE ( repFormat->getPicHeightVpsInLumaSamples(), 16, "pic_height_in_luma_samples" ); 1247 1248 if ( repFormat->getChromaAndBitDepthVpsPresentFlag() ) 1249 { 1250 WRITE_CODE( repFormat->getChromaFormatVpsIdc(), 2, "chroma_format_idc" ); 1251 1252 if( repFormat->getChromaFormatVpsIdc() == 3 ) 1253 { 1254 WRITE_FLAG( repFormat->getSeparateColourPlaneVpsFlag(), "separate_colour_plane_flag"); 1255 } 1256 1257 assert( repFormat->getBitDepthVpsLuma() >= 8 ); 1258 assert( repFormat->getBitDepthVpsChroma() >= 8 ); 1259 WRITE_CODE( repFormat->getBitDepthVpsLuma() - 8, 4, "bit_depth_luma_minus8" ); 1260 WRITE_CODE( repFormat->getBitDepthVpsChroma() - 8, 4, "bit_depth_chroma_minus8" ); 1261 } 1333 WRITE_CODE( repFormat->getPicWidthVpsInLumaSamples (), 16, "pic_width_vps_in_luma_samples" ); 1334 WRITE_CODE( repFormat->getPicHeightVpsInLumaSamples(), 16, "pic_height_vps_in_luma_samples" ); 1335 WRITE_FLAG( repFormat->getChromaAndBitDepthVpsPresentFlag(), "chroma_and_bit_depth_vps_present_flag" ); 1336 1337 if( repFormat->getChromaAndBitDepthVpsPresentFlag() ) 1338 { 1339 WRITE_CODE( repFormat->getChromaFormatVpsIdc(), 2, "chroma_format_vps_idc" ); 1340 1341 if( repFormat->getChromaFormatVpsIdc() == 3 ) 1342 { 1343 WRITE_FLAG( repFormat->getSeparateColourPlaneVpsFlag(), "separate_colour_plane_vps_flag" ); 1344 } 1345 1346 assert( repFormat->getBitDepthVpsLuma() >= 8 ); 1347 assert( repFormat->getBitDepthVpsChroma() >= 8 ); 1348 WRITE_CODE( repFormat->getBitDepthVpsLuma() - 8, 4, "bit_depth_vps_luma_minus8" ); 1349 WRITE_CODE( repFormat->getBitDepthVpsChroma() - 8, 4, "bit_depth_vps_chroma_minus8" ); 1350 } 1262 1351 #else 1263 1352 WRITE_CODE( repFormat->getChromaFormatVpsIdc(), 2, "chroma_format_idc" ); … … 1275 1364 WRITE_CODE( repFormat->getBitDepthVpsLuma() - 8, 4, "bit_depth_luma_minus8" ); 1276 1365 WRITE_CODE( repFormat->getBitDepthVpsChroma() - 8, 4, "bit_depth_chroma_minus8" ); 1277 #endif 1278 1366 #endif 1279 1367 } 1280 1368 #endif … … 1375 1463 if( vps->getBitRatePresentVpsFlag() ) 1376 1464 { 1377 WRITE_FLAG( vps->getBitRatePresentFlag( i, j), "bit_rate_present_ vps_flag[i][j]" );1465 WRITE_FLAG( vps->getBitRatePresentFlag( i, j), "bit_rate_present_flag[i][j]" ); 1378 1466 } 1379 1467 if( vps->getPicRatePresentVpsFlag() ) 1380 1468 { 1381 WRITE_FLAG( vps->getPicRatePresentFlag( i, j), "pic_rate_present_ vps_flag[i][j]" );1469 WRITE_FLAG( vps->getPicRatePresentFlag( i, j), "pic_rate_present_flag[i][j]" ); 1382 1470 } 1383 1471 if( vps->getBitRatePresentFlag(i, j) ) … … 1466 1554 #endif 1467 1555 #if HIGHER_LAYER_IRAP_SKIP_FLAG 1556 // When single_layer_for_non_irap_flag is equal to 0, higher_layer_irap_skip_flag shall be equal to 0 1557 if( !vps->getSingleLayerForNonIrapFlag() ) 1558 { 1559 assert( !vps->getHigherLayerIrapSkipFlag() ); 1560 } 1561 1468 1562 WRITE_FLAG(vps->getHigherLayerIrapSkipFlag(), "higher_layer_irap_skip_flag" ); 1469 1563 #endif … … 1564 1658 for(i = 1; i < vps->getMaxLayers(); i++) 1565 1659 { 1566 if( vps->getNumRefLayers(vps->getLayerIdInNuh(i)) == 0)1567 { 1568 if ((vps->getSPSId(i) == 0) && (vps->getPPSId(i) == 0))1660 if( vps->getNumRefLayers(vps->getLayerIdInNuh(i)) == 0 ) 1661 { 1662 if( (vps->getSPSId(i) == 0) && (vps->getPPSId(i) == 0) ) 1569 1663 { 1570 1664 vps->setBaseLayerPSCompatibilityFlag(i, 1); 1571 WRITE_FLAG(vps->getBaseLayerPSCompatibilityFlag(i), "base_layer_parameter_set_compatibility_flag" );1572 1665 } 1573 1666 else … … 1575 1668 vps->setBaseLayerPSCompatibilityFlag(i, 0); 1576 1669 } 1670 WRITE_FLAG(vps->getBaseLayerPSCompatibilityFlag(i), "base_layer_parameter_set_compatibility_flag" ); 1577 1671 } 1578 1672 } … … 1612 1706 if ( pcSlice->getRapPicFlag() ) 1613 1707 { 1614 #if NO_OUTPUT_OF_PRIOR_PICS1615 WRITE_FLAG( pcSlice->getNoOutput OfPriorPicsFlag(), "no_output_of_prior_pics_flag" );1708 #if SETTING_NO_OUT_PIC_PRIOR 1709 WRITE_FLAG( pcSlice->getNoOutputPriorPicsFlag() ? 1 : 0, "no_output_of_prior_pics_flag" ); 1616 1710 #else 1617 1711 WRITE_FLAG( 0, "no_output_of_prior_pics_flag" ); … … 2616 2710 return true; 2617 2711 } 2712 2713 #if Q0048_CGS_3D_ASYMLUT 2714 Void TEncCavlc::xCode3DAsymLUT( TCom3DAsymLUT * pc3DAsymLUT ) 2715 { 2716 assert( pc3DAsymLUT->getCurOctantDepth() < 4 ); 2717 WRITE_CODE( pc3DAsymLUT->getCurOctantDepth() , 2 , "cm_octant_depth" ); 2718 assert( pc3DAsymLUT->getCurYPartNumLog2() < 4 ); 2719 WRITE_CODE( pc3DAsymLUT->getCurYPartNumLog2() , 2 , "cm_y_part_num_log2" ); 2720 assert( pc3DAsymLUT->getInputBitDepthY() < 16 ); 2721 WRITE_CODE( pc3DAsymLUT->getInputBitDepthY() - 8 , 3 , "cm_input_bit_depth_minus8" ); 2722 WRITE_SVLC(pc3DAsymLUT->getInputBitDepthC()-pc3DAsymLUT->getInputBitDepthY(), "cm_input_bit_depth_chroma delta"); 2723 assert( pc3DAsymLUT->getOutputBitDepthY() < 16 ); 2724 WRITE_CODE( pc3DAsymLUT->getOutputBitDepthY() - 8 , 3 , "cm_output_bit_depth_minus8" ); 2725 WRITE_SVLC(pc3DAsymLUT->getOutputBitDepthC()-pc3DAsymLUT->getOutputBitDepthY(), "cm_output_bit_depth_chroma_delta"); 2726 assert( pc3DAsymLUT->getResQuantBit() < 4 ); 2727 WRITE_CODE( pc3DAsymLUT->getResQuantBit() , 2 , "cm_res_quant_bit" ); 2728 2729 xCode3DAsymLUTOctant( pc3DAsymLUT , 0 , 0 , 0 , 0 , 1 << pc3DAsymLUT->getCurOctantDepth() ); 2730 } 2731 2732 Void TEncCavlc::xCode3DAsymLUTOctant( TCom3DAsymLUT * pc3DAsymLUT , Int nDepth , Int yIdx , Int uIdx , Int vIdx , Int nLength ) 2733 { 2734 UInt uiOctantSplit = nDepth < pc3DAsymLUT->getCurOctantDepth(); 2735 if( nDepth < pc3DAsymLUT->getCurOctantDepth() ) 2736 WRITE_FLAG( uiOctantSplit , "split_octant_flag" ); 2737 Int nYPartNum = 1 << pc3DAsymLUT->getCurYPartNumLog2(); 2738 if( uiOctantSplit ) 2739 { 2740 Int nHalfLength = nLength >> 1; 2741 for( Int l = 0 ; l < 2 ; l++ ) 2742 { 2743 for( Int m = 0 ; m < 2 ; m++ ) 2744 { 2745 for( Int n = 0 ; n < 2 ; n++ ) 2746 { 2747 xCode3DAsymLUTOctant( pc3DAsymLUT , nDepth + 1 , yIdx + l * nHalfLength * nYPartNum , uIdx + m * nHalfLength , vIdx + n * nHalfLength , nHalfLength ); 2748 } 2749 } 2750 } 2751 } 2752 else 2753 { 2754 for( Int l = 0 ; l < nYPartNum ; l++ ) 2755 { 2756 for( Int nVertexIdx = 0 ; nVertexIdx < 4 ; nVertexIdx++ ) 2757 { 2758 SYUVP sRes = pc3DAsymLUT->getCuboidVertexResTree( yIdx + l , uIdx , vIdx , nVertexIdx ); 2759 UInt uiCodeVertex = sRes.Y != 0 || sRes.U != 0 || sRes.V != 0; 2760 WRITE_FLAG( uiCodeVertex , "coded_vertex_flag" ); 2761 if( uiCodeVertex ) 2762 { 2763 WRITE_SVLC( sRes.Y , "resY" ); 2764 WRITE_SVLC( sRes.U , "resU" ); 2765 WRITE_SVLC( sRes.V , "resV" ); 2766 } 2767 } 2768 } 2769 } 2770 } 2771 #endif 2618 2772 //! \} -
trunk/source/Lib/TLibEncoder/TEncCavlc.h
r644 r713 48 48 #include "TEncEntropy.h" 49 49 #include "SyntaxElementWriter.h" 50 #if Q0048_CGS_3D_ASYMLUT 51 #include "../TLibCommon/TCom3DAsymLUT.h" 52 #include "TEnc3DAsymLUT.h" 53 #endif 50 54 51 55 //! \ingroup TLibEncoder … … 53 57 54 58 class TEncTop; 59 #if Q0048_CGS_3D_ASYMLUT 60 class TCom3DAsymLUT; 61 #endif 55 62 56 63 // ==================================================================================================================== … … 90 97 Void codeVUI ( TComVUI *pcVUI, TComSPS* pcSPS ); 91 98 Void codeSPS ( TComSPS* pcSPS ); 92 Void codePPS ( TComPPS* pcPPS ); 99 Void codePPS ( TComPPS* pcPPS 100 #if Q0048_CGS_3D_ASYMLUT 101 , TEnc3DAsymLUT * pc3DAsymLUT 102 #endif 103 ); 93 104 Void codeSliceHeader ( TComSlice* pcSlice ); 94 105 Void codePTL ( TComPTL* pcPTL, Bool profilePresentFlag, Int maxNumSubLayersMinus1); … … 162 173 Void codeVpsDpbSizeTable (TComVPS *vps); 163 174 #endif 175 #if Q0048_CGS_3D_ASYMLUT 176 protected: 177 Void xCode3DAsymLUT( TCom3DAsymLUT * pc3DAsymLUT ); 178 Void xCode3DAsymLUTOctant( TCom3DAsymLUT * pc3DAsymLUT , Int nDepth , Int yIdx , Int uIdx , Int vIdx , Int nLength ); 179 #endif 164 180 #endif //SVC_EXTENSION 165 181 -
trunk/source/Lib/TLibEncoder/TEncCfg.h
r644 r713 235 235 Int m_cameraIsoSpeedIdc; 236 236 Int m_cameraIsoSpeedValue; 237 Int m_exposureIndexIdc; 238 Int m_exposureIndexValue; 237 239 Int m_exposureCompensationValueSignFlag; 238 240 Int m_exposureCompensationValueNumerator; … … 246 248 Int* m_codedPivotValue; 247 249 Int* m_targetPivotValue; 250 #if Q0074_SEI_COLOR_MAPPING 251 Char* m_seiColorMappingFile; 252 #endif 248 253 Int m_framePackingSEIEnabled; 249 254 Int m_framePackingSEIType; … … 362 367 UInt m_bottomRightTileIndex[1024]; 363 368 UInt m_ilcIdc[1024]; 369 #endif 370 #if Q0048_CGS_3D_ASYMLUT 371 Int m_nCGSFlag; 372 Int m_nCGSMaxOctantDepth; 373 Int m_nCGSMaxYPartNumLog2; 374 Int m_nCGSLUTBit; 364 375 #endif 365 376 #endif //SVC_EXTENSION … … 639 650 Void setTMISEICameraIsoSpeedValue(Int b) { m_cameraIsoSpeedValue = b; } 640 651 Int getTMISEICameraIsoSpeedValue() { return m_cameraIsoSpeedValue; } 652 Void setTMISEIExposureIndexIdc(Int b) { m_exposureIndexIdc = b; } 653 Int getTMISEIExposurIndexIdc() { return m_exposureIndexIdc; } 654 Void setTMISEIExposureIndexValue(Int b) { m_exposureIndexValue = b; } 655 Int getTMISEIExposurIndexValue() { return m_exposureIndexValue; } 641 656 Void setTMISEIExposureCompensationValueSignFlag(Int b) { m_exposureCompensationValueSignFlag = b; } 642 657 Int getTMISEIExposureCompensationValueSignFlag() { return m_exposureCompensationValueSignFlag; } … … 655 670 Void setTMISEIExtendedWhiteLevelLumaCodeValue(Int b) { m_extendedWhiteLevelLumaCodeValue =b; } 656 671 Int getTMISEIExtendedWhiteLevelLumaCodeValue() { return m_extendedWhiteLevelLumaCodeValue; } 672 #if Q0074_SEI_COLOR_MAPPING 673 Void setColorMappingInfoSEIFile( Char* nameFile ) { m_seiColorMappingFile = nameFile; } 674 Char* getColorMappingInfoSEIFile() { return m_seiColorMappingFile; } 675 #endif 657 676 Void setFramePackingArrangementSEIEnabled(Int b) { m_framePackingSEIEnabled = b; } 658 677 Int getFramePackingArrangementSEIEnabled() { return m_framePackingSEIEnabled; } … … 898 917 UInt getIlcIdc(UInt b) { return m_ilcIdc[b]; } 899 918 #endif 919 #if Q0048_CGS_3D_ASYMLUT 920 Void setCGSFlag(Int n) { m_nCGSFlag = n; } 921 Int getCGSFlag() { return m_nCGSFlag; } 922 Void setCGSMaxOctantDepth(Int n) { m_nCGSMaxOctantDepth = n; } 923 Int getCGSMaxOctantDepth() { return m_nCGSMaxOctantDepth; } 924 Void setCGSMaxYPartNumLog2(Int n) { m_nCGSMaxYPartNumLog2 = n; } 925 Int getCGSMaxYPartNumLog2() { return m_nCGSMaxYPartNumLog2; } 926 Void setCGSLUTBit(Int n) { m_nCGSLUTBit = n; } 927 Int getCGSLUTBit() { return m_nCGSLUTBit; } 928 #endif 900 929 #endif 901 930 }; -
trunk/source/Lib/TLibEncoder/TEncEntropy.cpp
r644 r713 79 79 } 80 80 81 #if Q0048_CGS_3D_ASYMLUT 82 Void TEncEntropy::encodePPS( TComPPS* pcPPS, TEnc3DAsymLUT * pc3DAsymLUT ) 83 { 84 m_pcEntropyCoderIf->codePPS( pcPPS, pc3DAsymLUT ); 85 return; 86 } 87 #else 81 88 Void TEncEntropy::encodePPS( TComPPS* pcPPS ) 82 89 { … … 84 91 return; 85 92 } 93 #endif 86 94 87 95 Void TEncEntropy::encodeSPS( TComSPS* pcSPS ) -
trunk/source/Lib/TLibEncoder/TEncEntropy.h
r644 r713 50 50 class TEncCavlc; 51 51 class SEI; 52 #if Q0048_CGS_3D_ASYMLUT 53 class TEnc3DAsymLUT; 54 #endif 52 55 53 56 // ==================================================================================================================== … … 70 73 virtual Void codeVPS ( TComVPS* pcVPS ) = 0; 71 74 virtual Void codeSPS ( TComSPS* pcSPS ) = 0; 72 virtual Void codePPS ( TComPPS* pcPPS ) = 0; 75 virtual Void codePPS ( TComPPS* pcPPS 76 #if Q0048_CGS_3D_ASYMLUT 77 , TEnc3DAsymLUT * pc3DAsymLUT 78 #endif 79 ) = 0; 73 80 virtual Void codeSliceHeader ( TComSlice* pcSlice ) = 0; 74 81 … … 156 163 // SPS 157 164 Void encodeSPS ( TComSPS* pcSPS ); 158 Void encodePPS ( TComPPS* pcPPS ); 165 Void encodePPS ( TComPPS* pcPPS 166 #if Q0048_CGS_3D_ASYMLUT 167 , TEnc3DAsymLUT * pc3DAsymLUT 168 #endif 169 ); 159 170 Void encodeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool bRD = false ); 160 171 Void encodeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); -
trunk/source/Lib/TLibEncoder/TEncGOP.cpp
r644 r713 75 75 m_iNumPicCoded = 0; //Niko 76 76 m_bFirst = true; 77 #if ALLOW_RECOVERY_POINT_AS_RAP 78 m_iLastRecoveryPicPOC = 0; 79 #endif 77 80 78 81 m_pcCfg = NULL; … … 103 106 m_pcPredSearch = NULL; 104 107 #endif 108 #if Q0048_CGS_3D_ASYMLUT 109 m_temp = NULL; 110 m_pColorMappedPic = NULL; 111 #endif 105 112 return; 106 113 } … … 108 115 TEncGOP::~TEncGOP() 109 116 { 117 #if Q0048_CGS_3D_ASYMLUT 118 if(m_pColorMappedPic) 119 { 120 m_pColorMappedPic->destroy(); 121 delete m_pColorMappedPic; 122 m_pColorMappedPic = NULL; 123 } 124 if(m_temp) 125 { 126 free_mem2DintWithPad(m_temp, m_iTap>>1, 0); 127 m_temp = NULL; 128 } 129 #endif 110 130 } 111 131 … … 157 177 m_pcPredSearch = pcTEncTop->getPredSearch(); ///< encoder search class 158 178 #endif 179 #if Q0048_CGS_3D_ASYMLUT 180 if( pcTEncTop->getLayerId() ) 181 { 182 m_Enc3DAsymLUTPicUpdate.create( m_pcCfg->getCGSMaxOctantDepth() , g_bitDepthYLayer[pcTEncTop->getLayerId()-1] , g_bitDepthCLayer[pcTEncTop->getLayerId()-1] , g_bitDepthYLayer[pcTEncTop->getLayerId()] , g_bitDepthCLayer[pcTEncTop->getLayerId()] , m_pcCfg->getCGSMaxYPartNumLog2() /*, m_pcCfg->getCGSPhaseAlignment()*/ ); 183 m_Enc3DAsymLUTPPS.create( m_pcCfg->getCGSMaxOctantDepth() , g_bitDepthYLayer[pcTEncTop->getLayerId()-1] , g_bitDepthCLayer[pcTEncTop->getLayerId()-1] , g_bitDepthYLayer[pcTEncTop->getLayerId()] , g_bitDepthCLayer[pcTEncTop->getLayerId()] , m_pcCfg->getCGSMaxYPartNumLog2() /*, m_pcCfg->getCGSPhaseAlignment()*/ ); 184 if(!m_pColorMappedPic) 185 { 186 m_pColorMappedPic = new TComPicYuv; 187 m_pColorMappedPic->create( m_ppcTEncTop[0]->getSourceWidth(), m_ppcTEncTop[0]->getSourceHeight(), CHROMA_420, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, NULL ); 188 } 189 } 190 #endif 159 191 } 160 192 … … 163 195 SEIActiveParameterSets *seiActiveParameterSets = new SEIActiveParameterSets(); 164 196 seiActiveParameterSets->activeVPSId = m_pcCfg->getVPS()->getVPSId(); 165 seiActiveParameterSets->m_ fullRandomAccessFlag = false;166 seiActiveParameterSets->m_noParam SetUpdateFlag = false;197 seiActiveParameterSets->m_selfContainedCvsFlag = false; 198 seiActiveParameterSets->m_noParameterSetUpdateFlag = false; 167 199 seiActiveParameterSets->numSpsIdsMinus1 = 0; 168 seiActiveParameterSets->activeSeqParam SetId.resize(seiActiveParameterSets->numSpsIdsMinus1 + 1);169 seiActiveParameterSets->activeSeqParam SetId[0] = sps->getSPSId();200 seiActiveParameterSets->activeSeqParameterSetId.resize(seiActiveParameterSets->numSpsIdsMinus1 + 1); 201 seiActiveParameterSets->activeSeqParameterSetId[0] = sps->getSPSId(); 170 202 return seiActiveParameterSets; 171 203 } 172 173 204 174 205 SEIFramePacking* TEncGOP::xCreateSEIFramePacking() … … 271 302 seiToneMappingInfo->m_cameraIsoSpeedValue = m_pcCfg->getTMISEICameraIsoSpeedValue(); 272 303 assert( seiToneMappingInfo->m_cameraIsoSpeedValue !=0 ); 304 seiToneMappingInfo->m_exposureIndexIdc = m_pcCfg->getTMISEIExposurIndexIdc(); 305 seiToneMappingInfo->m_exposureIndexValue = m_pcCfg->getTMISEIExposurIndexValue(); 306 assert( seiToneMappingInfo->m_exposureIndexValue !=0 ); 273 307 seiToneMappingInfo->m_exposureCompensationValueSignFlag = m_pcCfg->getTMISEIExposureCompensationValueSignFlag(); 274 308 seiToneMappingInfo->m_exposureCompensationValueNumerator = m_pcCfg->getTMISEIExposureCompensationValueNumerator(); … … 293 327 } 294 328 329 #if Q0074_SEI_COLOR_MAPPING 330 SEIColorMappingInfo* TEncGOP::xCreateSEIColorMappingInfo( Char* file ) 331 { 332 SEIColorMappingInfo *seiColorMappingInfo = new SEIColorMappingInfo(); 333 334 FILE* fic = fopen( file, "r" ); 335 336 Int iVal, retval; 337 338 retval = fscanf( fic, "%d", &seiColorMappingInfo->m_colorMapId ); 339 retval = fscanf( fic, "%d", &iVal ); 340 seiColorMappingInfo->m_colorMapCancelFlag = iVal; 341 if( !seiColorMappingInfo->m_colorMapCancelFlag ) 342 { 343 retval = fscanf( fic, "%d", &iVal ); 344 seiColorMappingInfo->m_colorMapPersistenceFlag = iVal; 345 retval = fscanf( fic, "%d", &iVal ); 346 seiColorMappingInfo->m_colorMap_video_signal_type_present_flag = iVal; 347 if( seiColorMappingInfo->m_colorMap_video_signal_type_present_flag ) 348 { 349 retval = fscanf( fic, "%d", &iVal ); 350 seiColorMappingInfo->m_colorMap_video_full_range_flag = iVal; 351 retval = fscanf( fic, "%d", &seiColorMappingInfo->m_colorMap_primaries ); 352 retval = fscanf( fic, "%d", &seiColorMappingInfo->m_colorMap_transfer_characteristics ); 353 retval = fscanf( fic, "%d", &seiColorMappingInfo->m_colorMap_matrix_coeffs ); 354 } 355 } 356 357 retval = fscanf( fic, "%d", &seiColorMappingInfo->m_colour_map_coded_data_bit_depth ); 358 retval = fscanf( fic, "%d", &seiColorMappingInfo->m_colour_map_target_bit_depth ); 359 retval = fscanf( fic, "%d", &iVal ); 360 seiColorMappingInfo->m_colorMapModelId = iVal; 361 362 assert( seiColorMappingInfo->m_colorMapModelId == 0 ); 363 364 for( Int i=0 ; i<3 ; i++ ) 365 { 366 retval = fscanf( fic, "%d", &seiColorMappingInfo->m_num_input_pivots[i] ); 367 seiColorMappingInfo->m_coded_input_pivot_value[i] = new Int[ seiColorMappingInfo->m_num_input_pivots[i] ]; 368 seiColorMappingInfo->m_target_input_pivot_value[i] = new Int[ seiColorMappingInfo->m_num_input_pivots[i] ]; 369 for( Int j=0 ; j<seiColorMappingInfo->m_num_input_pivots[i] ; j++ ) 370 { 371 retval = fscanf( fic, "%d", &seiColorMappingInfo->m_coded_input_pivot_value[i][j] ); 372 retval = fscanf( fic, "%d", &seiColorMappingInfo->m_target_input_pivot_value[i][j] ); 373 } 374 } 375 376 retval = fscanf( fic, "%d", &iVal ); 377 seiColorMappingInfo->m_matrix_flag = iVal; 378 if( seiColorMappingInfo->m_matrix_flag ) 379 { 380 retval = fscanf( fic, "%d", &seiColorMappingInfo->m_log2_matrix_denom ); 381 for( Int i=0 ; i<3 ; i++ ) 382 { 383 for( Int j=0 ; j<3 ; j++ ) 384 { 385 retval = fscanf( fic, "%d", &seiColorMappingInfo->m_matrix_coef[i][j] ); 386 } 387 } 388 } 389 390 for( Int i=0 ; i<3 ; i++ ) 391 { 392 retval = fscanf( fic, "%d", &seiColorMappingInfo->m_num_output_pivots[i] ); 393 seiColorMappingInfo->m_coded_output_pivot_value[i] = new Int[ seiColorMappingInfo->m_num_output_pivots[i] ]; 394 seiColorMappingInfo->m_target_output_pivot_value[i] = new Int[ seiColorMappingInfo->m_num_output_pivots[i] ]; 395 for( Int j=0 ; j<seiColorMappingInfo->m_num_output_pivots[i] ; j++ ) 396 { 397 retval = fscanf( fic, "%d", &seiColorMappingInfo->m_coded_output_pivot_value[i][j] ); 398 retval = fscanf( fic, "%d", &seiColorMappingInfo->m_target_output_pivot_value[i][j] ); 399 } 400 } 401 402 fclose( fic ); 403 404 if( retval != 1 ) 405 { 406 printf("Error: can't read color mapping information\n"); 407 } 408 409 return seiColorMappingInfo; 410 } 411 #endif 412 295 413 Void TEncGOP::xCreateLeadingSEIMessages (/*SEIMessages seiMessages,*/ AccessUnit &accessUnit, TComSPS *sps) 296 414 { … … 359 477 delete sei; 360 478 } 479 #if Q0074_SEI_COLOR_MAPPING 480 if(m_pcCfg->getColorMappingInfoSEIFile()) 481 { 482 SEIColorMappingInfo *sei = xCreateSEIColorMappingInfo( m_pcCfg->getColorMappingInfoSEIFile() ); 483 484 #if SVC_EXTENSION 485 nalu = NALUnit(NAL_UNIT_PREFIX_SEI, 0, m_layerId); // temporalId = 0 ? 486 #else 487 nalu = NALUnit(NAL_UNIT_PREFIX_SEI); 488 #endif 489 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 490 #if O0164_MULTI_LAYER_HRD 491 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, m_pcEncTop->getVPS(), sps); 492 #else 493 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps); 494 #endif 495 writeRBSPTrailingBits(nalu.m_Bitstream); 496 accessUnit.push_back(new NALUnitEBSP(nalu)); 497 delete sei; 498 } 499 #endif 361 500 362 501 #if SVC_EXTENSION … … 435 574 UInt *accumNalsDU = NULL; 436 575 SEIDecodingUnitInfo decodingUnitInfoSEI; 576 #if EFFICIENT_FIELD_IRAP 577 Int IRAPGOPid = -1; 578 Bool IRAPtoReorder = false; 579 Bool swapIRAPForward = false; 580 if(isField) 581 { 582 Int pocCurr; 583 #if SVC_EXTENSION 584 for ( Int iGOPid=iPicIdInGOP; iGOPid < iPicIdInGOP+1; iGOPid++ ) 585 #else 586 for ( Int iGOPid=0; iGOPid < m_iGopSize; iGOPid++ ) 587 #endif 588 { 589 // determine actual POC 590 if(iPOCLast == 0) //case first frame or first top field 591 { 592 pocCurr=0; 593 } 594 else if(iPOCLast == 1 && isField) //case first bottom field, just like the first frame, the poc computation is not right anymore, we set the right value 595 { 596 pocCurr = 1; 597 } 598 else 599 { 600 pocCurr = iPOCLast - iNumPicRcvd + m_pcCfg->getGOPEntry(iGOPid).m_POC - isField; 601 } 602 603 // check if POC corresponds to IRAP 604 NalUnitType tmpUnitType = getNalUnitType(pocCurr, m_iLastIDR, isField); 605 if(tmpUnitType >= NAL_UNIT_CODED_SLICE_BLA_W_LP && tmpUnitType <= NAL_UNIT_CODED_SLICE_CRA) // if picture is an IRAP 606 { 607 if(pocCurr%2 == 0 && iGOPid < m_iGopSize-1 && m_pcCfg->getGOPEntry(iGOPid).m_POC == m_pcCfg->getGOPEntry(iGOPid+1).m_POC-1) 608 { // if top field and following picture in enc order is associated bottom field 609 IRAPGOPid = iGOPid; 610 IRAPtoReorder = true; 611 swapIRAPForward = true; 612 break; 613 } 614 if(pocCurr%2 != 0 && iGOPid > 0 && m_pcCfg->getGOPEntry(iGOPid).m_POC == m_pcCfg->getGOPEntry(iGOPid-1).m_POC+1) 615 { 616 // if picture is an IRAP remember to process it first 617 IRAPGOPid = iGOPid; 618 IRAPtoReorder = true; 619 swapIRAPForward = false; 620 break; 621 } 622 } 623 } 624 } 625 #endif 437 626 #if SVC_EXTENSION 438 627 for ( Int iGOPid=iPicIdInGOP; iGOPid < iPicIdInGOP+1; iGOPid++ ) … … 441 630 #endif 442 631 { 632 #if EFFICIENT_FIELD_IRAP 633 if(IRAPtoReorder) 634 { 635 if(swapIRAPForward) 636 { 637 if(iGOPid == IRAPGOPid) 638 { 639 iGOPid = IRAPGOPid +1; 640 } 641 else if(iGOPid == IRAPGOPid +1) 642 { 643 iGOPid = IRAPGOPid; 644 } 645 } 646 else 647 { 648 if(iGOPid == IRAPGOPid -1) 649 { 650 iGOPid = IRAPGOPid; 651 } 652 else if(iGOPid == IRAPGOPid) 653 { 654 iGOPid = IRAPGOPid -1; 655 } 656 } 657 } 658 #endif 443 659 UInt uiColDir = 1; 444 660 //-- For time output for each slice … … 510 726 if(pocCurr>=m_pcCfg->getFramesToBeEncoded()) 511 727 { 728 #if EFFICIENT_FIELD_IRAP 729 if(IRAPtoReorder) 730 { 731 if(swapIRAPForward) 732 { 733 if(iGOPid == IRAPGOPid) 734 { 735 iGOPid = IRAPGOPid +1; 736 IRAPtoReorder = false; 737 } 738 else if(iGOPid == IRAPGOPid +1) 739 { 740 iGOPid --; 741 } 742 } 743 else 744 { 745 if(iGOPid == IRAPGOPid) 746 { 747 iGOPid = IRAPGOPid -1; 748 } 749 else if(iGOPid == IRAPGOPid -1) 750 { 751 iGOPid = IRAPGOPid; 752 IRAPtoReorder = false; 753 } 754 } 755 } 756 #endif 512 757 continue; 513 758 } … … 803 1048 Int widthBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth(); 804 1049 Int heightBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight(); 805 1050 #if Q0200_CONFORMANCE_BL_SIZE 1051 Int chromaFormatIdc = pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getChromaFormatIdc(); 1052 const Window &confBL = pcSlice->getBaseColPic(refLayerIdc)->getConformanceWindow(); 1053 widthBL -= ( confBL.getWindowLeftOffset() + confBL.getWindowRightOffset() ) * TComSPS::getWinUnitX( chromaFormatIdc ); 1054 heightBL -= ( confBL.getWindowTopOffset() + confBL.getWindowBottomOffset() ) * TComSPS::getWinUnitY( chromaFormatIdc ); 1055 #endif 806 1056 Int widthEL = pcPic->getPicYuvRec()->getWidth() - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset(); 807 1057 Int heightEL = pcPic->getPicYuvRec()->getHeight() - scalEL.getWindowTopOffset() - scalEL.getWindowBottomOffset(); … … 813 1063 g_posScalingFactor[refLayerIdc][1] = ((heightBL << 16) + (heightEL >> 1)) / heightEL; 814 1064 1065 #if Q0048_CGS_3D_ASYMLUT 1066 TComPicYuv* pBaseColRec = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(); 1067 if( pcSlice->getPPS()->getCGSFlag() ) 1068 { 1069 if(g_posScalingFactor[refLayerIdc][0] < (1<<16) || g_posScalingFactor[refLayerIdc][1] < (1<<16)) //if(pcPic->isSpatialEnhLayer(refLayerIdc)) 1070 { 1071 //downsampling; 1072 downScalePic(pcPic->getPicYuvOrg(), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvOrg()); 1073 //pcSlice->getBaseColPic(refLayerIdc)->getPicYuvOrg()->dump("ds.yuv", true, true); 1074 m_Enc3DAsymLUTPPS.setDsOrigPic(pcSlice->getBaseColPic(refLayerIdc)->getPicYuvOrg()); 1075 m_Enc3DAsymLUTPicUpdate.setDsOrigPic(pcSlice->getBaseColPic(refLayerIdc)->getPicYuvOrg()); 1076 } 1077 else 1078 { 1079 m_Enc3DAsymLUTPPS.setDsOrigPic(pcPic->getPicYuvOrg()); 1080 m_Enc3DAsymLUTPicUpdate.setDsOrigPic(pcPic->getPicYuvOrg()); 1081 } 1082 1083 Bool bSignalPPS = m_bSeqFirst; 1084 bSignalPPS |= m_pcCfg->getGOPSize() > 1 ? pocCurr % m_pcCfg->getIntraPeriod() == 0 : pocCurr % m_pcCfg->getFrameRate() == 0; 1085 xDetermin3DAsymLUT( pcSlice , pcPic , refLayerIdc , m_pcCfg , bSignalPPS ); 1086 m_Enc3DAsymLUTPPS.colorMapping( pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), m_pColorMappedPic ); 1087 pBaseColRec = m_pColorMappedPic; 1088 } 1089 #endif 815 1090 #if SVC_UPSAMPLING 816 1091 if( pcPic->isSpatialEnhLayer(refLayerIdc)) 817 1092 { 818 /*#if O0098_SCALED_REF_LAYER_ID819 Window scalEL = pcSlice->getSPS()->getScaledRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc));820 #else821 Window scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc);822 #endif*/823 1093 #if P0312_VERT_PHASE_ADJ 824 1094 //when PhasePositionEnableFlag is equal to 1, set vertPhasePositionFlag to 0 if BL is top field and 1 if bottom … … 830 1100 #if O0215_PHASE_ALIGNMENT 831 1101 #if O0194_JOINT_US_BITSHIFT 832 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() ); 1102 #if Q0048_CGS_3D_ASYMLUT 1103 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() ); 1104 #else 1105 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() ); 1106 #endif 1107 #else 1108 #if Q0048_CGS_3D_ASYMLUT 1109 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() ); 833 1110 #else 834 1111 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() ); 835 1112 #endif 1113 #endif 836 1114 #else 837 1115 #if O0194_JOINT_US_BITSHIFT 1116 #if Q0048_CGS_3D_ASYMLUT 1117 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL ); 1118 #else 838 1119 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL ); 1120 #endif 1121 #else 1122 #if Q0048_CGS_3D_ASYMLUT 1123 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL ); 839 1124 #else 840 1125 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL ); 841 1126 #endif 842 1127 #endif 1128 #endif 843 1129 } 844 1130 else 845 1131 { 1132 #if Q0048_CGS_3D_ASYMLUT 1133 pcPic->setFullPelBaseRec( refLayerIdc, pBaseColRec ); 1134 #else 846 1135 pcPic->setFullPelBaseRec( refLayerIdc, pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec() ); 1136 #endif 847 1137 } 848 1138 pcSlice->setFullPelBaseRec ( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc) ); … … 856 1146 } 857 1147 858 #if !O0225_TID_BASED_IL_RPS_DERIV 1148 #if !O0225_TID_BASED_IL_RPS_DERIV || Q0060_MAX_TID_REF_EQUAL_TO_ZERO 859 1149 pcSlice->setActiveNumILRRefIdx( activeNumILRRefIdxTmp ); 860 1150 #endif … … 932 1222 } 933 1223 934 // Do decoding refresh marking if any 935 #if NO_CLRAS_OUTPUT_FLAG 936 pcSlice->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, rcListPic, m_pcEncTop->getNoClrasOutputFlag()); 937 #else 938 pcSlice->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, rcListPic); 939 #endif 940 m_pcEncTop->selectReferencePictureSet(pcSlice, pocCurr, iGOPid); 941 pcSlice->getRPS()->setNumberOfLongtermPictures(0); 1224 #if EFFICIENT_FIELD_IRAP 942 1225 #if FIX1172 943 1226 if ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP … … 954 1237 pcSlice->setAssociatedIRAPPOC(m_associatedIRAPPOC); 955 1238 #endif 956 1239 #endif 1240 // Do decoding refresh marking if any 1241 #if NO_CLRAS_OUTPUT_FLAG 1242 pcSlice->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, rcListPic, m_pcEncTop->getNoClrasOutputFlag()); 1243 #else 1244 pcSlice->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, rcListPic); 1245 #endif 1246 m_pcEncTop->selectReferencePictureSet(pcSlice, pocCurr, iGOPid); 1247 pcSlice->getRPS()->setNumberOfLongtermPictures(0); 1248 #if EFFICIENT_FIELD_IRAP 1249 #else 1250 #if FIX1172 1251 if ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 1252 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 1253 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP 1254 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL 1255 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP 1256 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA ) // IRAP picture 1257 { 1258 m_associatedIRAPType = pcSlice->getNalUnitType(); 1259 m_associatedIRAPPOC = pocCurr; 1260 } 1261 pcSlice->setAssociatedIRAPType(m_associatedIRAPType); 1262 pcSlice->setAssociatedIRAPPOC(m_associatedIRAPPOC); 1263 #endif 1264 #endif 1265 1266 #if ALLOW_RECOVERY_POINT_AS_RAP 1267 if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false, m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3) != 0) || (pcSlice->isIRAP()) 1268 #if EFFICIENT_FIELD_IRAP 1269 || (isField && pcSlice->getAssociatedIRAPType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getAssociatedIRAPType() <= NAL_UNIT_CODED_SLICE_CRA && pcSlice->getAssociatedIRAPPOC() == pcSlice->getPOC()+1) 1270 #endif 1271 ) 1272 { 1273 pcSlice->createExplicitReferencePictureSetFromReference(rcListPic, pcSlice->getRPS(), pcSlice->isIRAP(), m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3); 1274 } 1275 #else 957 1276 if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false) != 0) || (pcSlice->isIRAP())) 958 1277 { 959 1278 pcSlice->createExplicitReferencePictureSetFromReference(rcListPic, pcSlice->getRPS(), pcSlice->isIRAP()); 960 1279 } 1280 #endif 961 1281 #if ALIGNED_BUMPING 962 1282 pcSlice->checkLeadingPictureRestrictions(rcListPic); … … 1743 2063 assert( pcSlice->getPPS()->getPPSId() == 0 || pcSlice->getPPS()->getPPSId() == m_layerId || m_pcEncTop->getVPS()->getRecursiveRefLayerFlag(m_layerId, pcSlice->getPPS()->getPPSId()) ); 1744 2064 #endif 1745 m_pcEntropyCoder->encodePPS(pcSlice->getPPS()); 2065 m_pcEntropyCoder->encodePPS(pcSlice->getPPS() 2066 #if Q0048_CGS_3D_ASYMLUT 2067 , & m_Enc3DAsymLUTPPS 2068 #endif 2069 ); 1746 2070 writeRBSPTrailingBits(nalu.m_Bitstream); 1747 2071 accessUnit.push_back(new NALUnitEBSP(nalu)); … … 1776 2100 m_bSeqFirst = false; 1777 2101 } 2102 #if Q0048_CGS_3D_ASYMLUT 2103 else if( m_pcCfg->getCGSFlag() && pcSlice->getLayerId() && pcSlice->getCGSOverWritePPS() ) 2104 { 2105 #if SVC_EXTENSION 2106 OutputNALUnit nalu(NAL_UNIT_PPS, 0, m_layerId); 2107 #endif 2108 2109 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 2110 m_pcEntropyCoder->encodePPS(pcSlice->getPPS() , &m_Enc3DAsymLUTPPS ); 2111 writeRBSPTrailingBits(nalu.m_Bitstream); 2112 accessUnit.push_back(new NALUnitEBSP(nalu)); 2113 } 2114 #endif 1778 2115 1779 2116 if (writeSOP) // write SOP description SEI (if enabled) at the beginning of GOP … … 1849 2186 pictureTimingSEI.m_auCpbRemovalDelay = std::min<Int>(std::max<Int>(1, m_totalCoded - m_lastBPSEI), static_cast<Int>(pow(2, static_cast<double>(pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getCpbRemovalDelayLengthMinus1()+1)))); // Syntax element signalled as minus, hence the . 1850 2187 #if POC_RESET_FLAG 1851 pictureTimingSEI.m_picDpbOutputDelay = pcSlice->getSPS()->getNumReorderPics(0) + pocCurr - m_totalCoded; 1852 #else 1853 pictureTimingSEI.m_picDpbOutputDelay = pcSlice->getSPS()->getNumReorderPics(0) + pcSlice->getPOC() - m_totalCoded; 2188 pictureTimingSEI.m_picDpbOutputDelay = pcSlice->getSPS()->getNumReorderPics(pcSlice->getSPS()->getMaxTLayers()-1) + pocCurr - m_totalCoded; 2189 #else 2190 pictureTimingSEI.m_picDpbOutputDelay = pcSlice->getSPS()->getNumReorderPics(pcSlice->getSPS()->getMaxTLayers()-1) + pcSlice->getPOC() - m_totalCoded; 2191 #endif 2192 #if EFFICIENT_FIELD_IRAP 2193 if(IRAPGOPid > 0 && IRAPGOPid < m_iGopSize) 2194 { 2195 // if pictures have been swapped there is likely one more picture delay on their tid. Very rough approximation 2196 pictureTimingSEI.m_picDpbOutputDelay ++; 2197 } 1854 2198 #endif 1855 2199 Int factor = pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getTickDivisorMinus2() + 2; … … 1975 2319 #endif 1976 2320 sei_recovery_point.m_brokenLinkFlag = false; 2321 #if ALLOW_RECOVERY_POINT_AS_RAP 2322 if(m_pcCfg->getDecodingRefreshType() == 3) 2323 { 2324 m_iLastRecoveryPicPOC = pocCurr; 2325 } 2326 #endif 1977 2327 1978 2328 #if O0164_MULTI_LAYER_HRD … … 2110 2460 } 2111 2461 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 2462 2463 #if SETTING_NO_OUT_PIC_PRIOR 2464 if (pcSlice->isIRAP()) 2465 { 2466 if (pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_IDR_N_LP) 2467 { 2468 pcSlice->setNoRaslOutputFlag(true); 2469 } 2470 //the inference for NoOutputPriorPicsFlag 2471 if (!m_bFirst && pcSlice->isIRAP() && pcSlice->getNoRaslOutputFlag()) 2472 { 2473 if (pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA) 2474 { 2475 pcSlice->setNoOutputPriorPicsFlag(true); 2476 } 2477 } 2478 } 2479 #endif 2480 2112 2481 tmpBitsBeforeWriting = m_pcEntropyCoder->getNumberOfWrittenBits(); 2113 2482 m_pcEntropyCoder->encodeSliceHeader(pcSlice); … … 2657 3026 2658 3027 delete[] pcSubstreamsOut; 3028 3029 #if EFFICIENT_FIELD_IRAP 3030 if(IRAPtoReorder) 3031 { 3032 if(swapIRAPForward) 3033 { 3034 if(iGOPid == IRAPGOPid) 3035 { 3036 iGOPid = IRAPGOPid +1; 3037 IRAPtoReorder = false; 3038 } 3039 else if(iGOPid == IRAPGOPid +1) 3040 { 3041 iGOPid --; 3042 } 3043 } 3044 else 3045 { 3046 if(iGOPid == IRAPGOPid) 3047 { 3048 iGOPid = IRAPGOPid -1; 3049 } 3050 else if(iGOPid == IRAPGOPid -1) 3051 { 3052 iGOPid = IRAPGOPid; 3053 IRAPtoReorder = false; 3054 } 3055 } 3056 } 3057 #endif 2659 3058 } 2660 3059 delete pcBitstreamRedirect; … … 2918 3317 case NAL_UNIT_CODED_SLICE_CRA: return "CRA"; 2919 3318 case NAL_UNIT_CODED_SLICE_RADL_R: return "RADL_R"; 3319 case NAL_UNIT_CODED_SLICE_RADL_N: return "RADL_N"; 2920 3320 case NAL_UNIT_CODED_SLICE_RASL_R: return "RASL_R"; 3321 case NAL_UNIT_CODED_SLICE_RASL_N: return "RASL_N"; 2921 3322 case NAL_UNIT_VPS: return "VPS"; 2922 3323 case NAL_UNIT_SPS: return "SPS"; … … 3080 3481 pcSlice->getTLayer(), 3081 3482 c, 3082 NaluToStr( pcSlice->getNalUnitType() ).data() .3483 NaluToStr( pcSlice->getNalUnitType() ).data(), 3083 3484 pcSlice->getSliceQp(), 3084 3485 uibits ); … … 3134 3535 printf("]"); 3135 3536 } 3537 #if Q0048_CGS_3D_ASYMLUT 3538 pcPic->setFrameBit( (Int)uibits ); 3539 if( m_layerId && pcSlice->getPPS()->getCGSFlag() ) 3540 { 3541 m_Enc3DAsymLUTPicUpdate.updatePicCGSBits( pcSlice , m_Enc3DAsymLUTPPS.getPPSBit() ); 3542 } 3543 #endif 3136 3544 } 3137 3545 … … 3316 3724 return NAL_UNIT_CODED_SLICE_IDR_W_RADL; 3317 3725 } 3726 #if EFFICIENT_FIELD_IRAP 3727 if(isField && pocCurr == 1) 3728 { 3729 // to avoid the picture becoming an IRAP 3730 return NAL_UNIT_CODED_SLICE_TRAIL_R; 3731 } 3732 #endif 3733 3734 #if ALLOW_RECOVERY_POINT_AS_RAP 3735 if(m_pcCfg->getDecodingRefreshType() != 3 && (pocCurr - isField) % m_pcCfg->getIntraPeriod() == 0) 3736 #else 3318 3737 if ((pocCurr - isField) % m_pcCfg->getIntraPeriod() == 0) 3738 #endif 3319 3739 { 3320 3740 if (m_pcCfg->getDecodingRefreshType() == 1) … … 3828 4248 #endif 3829 4249 4250 #if Q0048_CGS_3D_ASYMLUT 4251 Void TEncGOP::xDetermin3DAsymLUT( TComSlice * pSlice , TComPic * pCurPic , UInt refLayerIdc , TEncCfg * pCfg , Bool bSignalPPS ) 4252 { 4253 Int nCGSFlag = pSlice->getPPS()->getCGSFlag(); 4254 m_Enc3DAsymLUTPPS.setPPSBit( 0 ); 4255 Double dErrorUpdatedPPS = 0 , dErrorPPS = 0; 4256 dErrorUpdatedPPS = m_Enc3DAsymLUTPicUpdate.derive3DAsymLUT( pSlice , pCurPic , refLayerIdc , pCfg , bSignalPPS , m_pcEncTop->getElRapSliceTypeB() ); 4257 if( bSignalPPS ) 4258 { 4259 m_Enc3DAsymLUTPPS.copy3DAsymLUT( &m_Enc3DAsymLUTPicUpdate ); 4260 pSlice->setCGSOverWritePPS( 1 ); // regular PPS update 4261 } 4262 else if( nCGSFlag ) 4263 { 4264 dErrorPPS = m_Enc3DAsymLUTPPS.estimateDistWithCur3DAsymLUT( pCurPic , refLayerIdc ); 4265 Double dFactor = pCfg->getIntraPeriod() == 1 ? 0.99 : 0.9; 4266 pSlice->setCGSOverWritePPS( dErrorUpdatedPPS < dFactor * dErrorPPS ); 4267 if( pSlice->getCGSOverWritePPS() ) 4268 { 4269 m_Enc3DAsymLUTPPS.copy3DAsymLUT( &m_Enc3DAsymLUTPicUpdate ); 4270 } 4271 } 4272 pSlice->getPPS()->setCGSOutputBitDepthY( m_Enc3DAsymLUTPPS.getOutputBitDepthY() ); 4273 pSlice->getPPS()->setCGSOutputBitDepthC( m_Enc3DAsymLUTPPS.getOutputBitDepthC() ); 4274 } 4275 4276 Void TEncGOP::downScalePic( TComPicYuv* pcYuvSrc, TComPicYuv* pcYuvDest) 4277 { 4278 Int inputBitDepth = g_bitDepthYLayer[m_layerId]; 4279 Int outputBitDepth = g_bitDepthYLayer[m_layerId]; 4280 { 4281 pcYuvSrc->setBorderExtension(false); 4282 pcYuvSrc->extendPicBorder (); // extend the border. 4283 pcYuvSrc->setBorderExtension(false); 4284 4285 Int iWidth = pcYuvSrc->getWidth(); 4286 Int iHeight =pcYuvSrc->getHeight(); 4287 4288 if(!m_temp) 4289 initDs(iWidth, iHeight, m_pcCfg->getIntraPeriod()>1); 4290 4291 filterImg(pcYuvSrc->getLumaAddr(), pcYuvSrc->getStride(), pcYuvDest->getLumaAddr(), pcYuvDest->getStride(), iHeight, iWidth, inputBitDepth-outputBitDepth, 0); 4292 filterImg(pcYuvSrc->getCbAddr(), pcYuvSrc->getCStride(), pcYuvDest->getCbAddr(), pcYuvDest->getCStride(), iHeight>>1, iWidth>>1, inputBitDepth-outputBitDepth, 1); 4293 filterImg(pcYuvSrc->getCrAddr(), pcYuvSrc->getCStride(), pcYuvDest->getCrAddr(), pcYuvDest->getCStride(), iHeight>>1, iWidth>>1, inputBitDepth-outputBitDepth, 2); 4294 } 4295 } 4296 const int TEncGOP::m_phase_filter_0_t0[4][13]={ 4297 {0, 2, -3, -9, 6, 39, 58, 39, 6, -9, -3, 2, 0}, 4298 {0, 0, 0, -2, 8,-20, 116, 34, -10, 2, 0, 0, 0}, //{0, 1, -1, -8, -1, 31, 57, 47, 13, -7, -5, 1, 0}, // 4299 {0, 1, 0, -7, -5, 22, 53, 53, 22, -5, -7, 0, 1}, 4300 {0, 0, 1, -5, -7, 13, 47, 57, 31, -1, -8,-1, 1} 4301 }; 4302 4303 const int TEncGOP::m_phase_filter_0_t1[4][13]={ 4304 {0, 4, 0, -12, 0, 40, 64, 40, 0, -12, 0, 4, 0}, 4305 {0, 0, 0, -2, 8,-20, 116,34,-10, 2, 0, 0, 0}, //{0, 1, -1, -8, -1, 31, 57, 47, 13, -7, -5, 1, 0}, // 4306 {0, 1, 0, -7, -5, 22, 53, 53, 22, -5, -7, 0, 1}, 4307 {0, 0, 1, -5, -7, 13, 47, 57, 31, -1, -8,-1, 1} 4308 }; 4309 const int TEncGOP::m_phase_filter_0_t1_chroma[4][13]={ 4310 {0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0}, 4311 {0, 0, 0, -2, 8,-20, 116,34,-10, 2, 0, 0, 0}, //{0, 1, -1, -8, -1, 31, 57, 47, 13, -7, -5, 1, 0}, // 4312 {0, 1, 0, -7, -5, 22, 53, 53, 22, -5, -7, 0, 1}, 4313 {0, 0, 1, -5, -7, 13, 47, 57, 31, -1, -8,-1, 1} 4314 }; 4315 4316 const int TEncGOP::m_phase_filter_1[8][13]={ 4317 {0, 0, 5, -6, -10,37, 76, 37,-10, -6, 5, 0, 0}, 4318 {0, -1, 5, -3, -12,29, 75, 45, -7, -8, 5, 0, 0}, 4319 {0, -1, 4, -1, -13,22, 73, 52, -3, -10, 4, 1, 0}, 4320 {0, -1, 4, 1, -13,14, 70, 59, 2, -12, 3, 2, -1}, 4321 {0, -1, 3, 2, -13, 8, 65, 65, 8, -13, 2, 3, -1}, 4322 {0, -1, 2, 3, -12, 2, 59, 70, 14, -13, 1, 4, -1}, 4323 {0, 0, 1, 4, -10,-3, 52, 73, 22, -13,-1, 4, -1}, 4324 {0, 0, 0, 5, -8,-7, 45, 75, 29, -12,-3, 5, -1} 4325 }; 4326 4327 Void TEncGOP::filterImg( 4328 Pel *src, 4329 Int iSrcStride, 4330 Pel *dst, 4331 Int iDstStride, 4332 Int height1, 4333 Int width1, 4334 Int shift, 4335 Int plane) 4336 { 4337 Int length = m_iTap; 4338 Int height2,width2; 4339 Int k,iSum; 4340 Int i0, div_i0, i1; 4341 Int j0, div_j0, j1; 4342 const Int *p_filter; 4343 Pel *p_src, *p_dst; 4344 Pel *p_src_line, *p_dst_line; 4345 Int **p_temp, *p_tmp; 4346 Int shift2 = 2*7+shift; 4347 Int shift_round = (1 << (shift2 - 1)); 4348 Int iMax = (1<<(g_bitDepthY-shift))-1; 4349 height2 = (height1 * m_iM) / m_iN; 4350 width2 = (width1 * m_iM) / m_iN; 4351 4352 m_phase_filter = plane? m_phase_filter_chroma : m_phase_filter_luma; 4353 4354 // horizontal filtering 4355 p_src_line = src; 4356 for(j1 = 0; j1 < height1; j1++) 4357 { 4358 i0=-m_iN; 4359 p_tmp = m_temp[j1]; 4360 4361 for(i1 = 0; i1 < width2; i1++) 4362 { 4363 i0 += m_iN; 4364 div_i0 = (i0 / m_iM); 4365 p_src = p_src_line + ( div_i0 - (length >> 1)); 4366 p_filter = m_phase_filter[i0 - div_i0 * m_iM]; // phase_filter[i0 % M] 4367 iSum = 0; 4368 for(k = 0; k < length; k++) 4369 { 4370 iSum += (*p_src++) * (*p_filter++); 4371 } 4372 *p_tmp++ = iSum; 4373 } 4374 p_src_line += iSrcStride; 4375 } 4376 4377 // pad temp (vertical) 4378 for (k=-(length>>1); k<0; k++) 4379 memcpy(m_temp[k], m_temp[0], width2*sizeof(int)); 4380 for (k=height1; k<(height1+(length>>1)); k++) 4381 memcpy(m_temp[k], m_temp[k-1], (width2)* sizeof(int)); 4382 4383 // vertical filtering 4384 j0 = (plane == 0) ? -m_iN : -(m_iN-1); 4385 4386 p_dst_line = dst; 4387 for(j1 = 0; j1 < height2; j1++) 4388 { 4389 j0 += m_iN; 4390 div_j0 = (j0 / m_iM); 4391 p_dst = p_dst_line; 4392 p_temp = &m_temp[div_j0 - (length>>1)]; 4393 p_filter = m_phase_filter[j0 - div_j0 * m_iM]; // phase_filter[j0 % M] 4394 for(i1 = 0; i1 < width2;i1++) 4395 { 4396 iSum=0; 4397 for(k = 0; k < length; k++) 4398 { 4399 iSum += p_temp[k][i1] * p_filter[k]; 4400 } 4401 iSum=((iSum + shift_round) >> shift2); 4402 *p_dst++ = (short)(iSum > iMax ? iMax : (iSum < 0 ? 0 : iSum)); 4403 } 4404 p_dst_line += iDstStride; 4405 } 4406 } 4407 4408 Void TEncGOP::initDs(Int iWidth, Int iHeight, Int iType) 4409 { 4410 m_iTap = 13; 4411 if(g_posScalingFactor[0][0] == (1<<15)) 4412 { 4413 m_iM = 4; 4414 m_iN = 8; 4415 m_phase_filter_luma = iType? m_phase_filter_0_t1 : m_phase_filter_0_t0; 4416 m_phase_filter_chroma = m_phase_filter_0_t1_chroma; 4417 } 4418 else 4419 { 4420 m_iM = 8; 4421 m_iN = 12; 4422 m_phase_filter_luma = m_phase_filter_chroma = m_phase_filter_1; 4423 m_phase_filter = m_phase_filter_1; 4424 } 4425 4426 get_mem2DintWithPad (&m_temp, iHeight, iWidth*m_iM/m_iN, m_iTap>>1, 0); 4427 } 4428 4429 Int TEncGOP::get_mem2DintWithPad(Int ***array2D, Int dim0, Int dim1, Int iPadY, Int iPadX) 4430 { 4431 Int i; 4432 Int *curr = NULL; 4433 Int iHeight, iWidth; 4434 4435 iHeight = dim0+2*iPadY; 4436 iWidth = dim1+2*iPadX; 4437 (*array2D) = (Int**)malloc(iHeight*sizeof(Int*)); 4438 *(*array2D) = (Int* )xMalloc(Int, iHeight*iWidth); 4439 4440 (*array2D)[0] += iPadX; 4441 curr = (*array2D)[0]; 4442 for(i = 1 ; i < iHeight; i++) 4443 { 4444 curr += iWidth; 4445 (*array2D)[i] = curr; 4446 } 4447 (*array2D) = &((*array2D)[iPadY]); 4448 4449 return 0; 4450 } 4451 4452 Void TEncGOP::free_mem2DintWithPad(Int **array2D, Int iPadY, Int iPadX) 4453 { 4454 if (array2D) 4455 { 4456 if (*array2D) 4457 xFree(array2D[-iPadY]-iPadX); 4458 else 4459 printf("free_mem2DintWithPad: trying to free unused memory\r\nPress Any Key\r\n"); 4460 4461 free (&array2D[-iPadY]); 4462 } 4463 else 4464 { 4465 printf("free_mem2DintWithPad: trying to free unused memory\r\nPress Any Key\r\n"); 4466 } 4467 } 4468 #endif 3830 4469 #endif //SVC_EXTENSION 3831 4470 -
trunk/source/Lib/TLibEncoder/TEncGOP.h
r644 r713 54 54 #include "TEncSbac.h" 55 55 #include "SEIwrite.h" 56 #if Q0048_CGS_3D_ASYMLUT 57 #include "TEnc3DAsymLUT.h" 58 #endif 56 59 57 60 #include "TEncAnalyze.h" … … 82 85 Int m_iNumPicCoded; 83 86 Bool m_bFirst; 87 #if ALLOW_RECOVERY_POINT_AS_RAP 88 Int m_iLastRecoveryPicPOC; 89 #endif 84 90 85 91 // Access channel … … 132 138 TEncSearch* m_pcPredSearch; ///< encoder search class 133 139 #endif 140 #if Q0048_CGS_3D_ASYMLUT 141 TEnc3DAsymLUT m_Enc3DAsymLUTPicUpdate; 142 TEnc3DAsymLUT m_Enc3DAsymLUTPPS; 143 TComPicYuv* m_pColorMappedPic; 144 145 Int m_iTap; 146 const Int (*m_phase_filter)[13]; 147 const Int (*m_phase_filter_luma)[13]; 148 const Int (*m_phase_filter_chroma)[13]; 149 Int m_iM, m_iN; 150 static const Int m_phase_filter_0_t0[4][13]; 151 static const Int m_phase_filter_0_t1[4][13]; 152 static const Int m_phase_filter_0_t1_chroma[4][13]; 153 static const Int m_phase_filter_1[8][13]; 154 Int **m_temp; 155 #endif 134 156 #endif 135 157 … … 187 209 188 210 SEIToneMappingInfo* xCreateSEIToneMappingInfo(); 211 #if Q0074_SEI_COLOR_MAPPING 212 SEIColorMappingInfo* xCreateSEIColorMappingInfo( Char* file ); 213 #endif 189 214 190 215 Void xCreateLeadingSEIMessages (/*SEIMessages seiMessages,*/ AccessUnit &accessUnit, TComSPS *sps); … … 214 239 SEIScalableNesting* xCreateBspNestingSEI(TComSlice *pcSlice); 215 240 #endif 241 #if Q0048_CGS_3D_ASYMLUT 242 Void xDetermin3DAsymLUT( TComSlice * pSlice , TComPic * pCurPic , UInt refLayerIdc , TEncCfg * pCfg , Bool bSignalPPS ); 243 Void downScalePic( TComPicYuv* pcYuvSrc, TComPicYuv* pcYuvDest); 244 Void downScaleComponent2x2( const Pel* pSrc, Pel* pDest, const Int iSrcStride, const Int iDestStride, const Int iSrcWidth, const Int iSrcHeight, const Int inputBitDepth, const Int outputBitDepth ); 245 inline Short xClip( Short x , Int bitdepth ); 246 Void initDs(Int iWidth, Int iHeight, Int iType); 247 Void filterImg( 248 Pel *src, 249 Int iSrcStride, 250 Pel *dst, 251 Int iDstStride, 252 Int height1, 253 Int width1, 254 Int shift, 255 Int plane); 256 257 Int get_mem2DintWithPad(Int ***array2D, Int dim0, Int dim1, Int iPadY, Int iPadX); 258 Void free_mem2DintWithPad(Int **array2D, Int iPadY, Int iPadX); 259 #endif 216 260 #endif //SVC_EXTENSION 217 261 };// END CLASS DEFINITION TEncGOP -
trunk/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp
r644 r713 952 952 for (y=0; y<endY; y++) 953 953 { 954 #if SAO_SGN_FUNC 955 signLeft = (Char)sgn(srcLine[startX] - srcLine[startX-1]); 956 #else 954 957 signLeft = (Char)m_sign[srcLine[startX] - srcLine[startX-1]]; 958 #endif 955 959 for (x=startX; x<endX; x++) 956 960 { 961 #if SAO_SGN_FUNC 962 signRight = (Char)sgn(srcLine[x] - srcLine[x+1]); 963 #else 957 964 signRight = (Char)m_sign[srcLine[x] - srcLine[x+1]]; 965 #endif 958 966 edgeType = signRight + signLeft; 959 967 signLeft = -signRight; … … 975 983 for(y=0; y<skipLinesB[typeIdx]; y++) 976 984 { 985 #if SAO_SGN_FUNC 986 signLeft = (Char)sgn(srcLine[startX] - srcLine[startX-1]); 987 #else 977 988 signLeft = (Char)m_sign[srcLine[startX] - srcLine[startX-1]]; 989 #endif 978 990 for (x=startX; x<endX; x++) 979 991 { 992 #if SAO_SGN_FUNC 993 signRight = (Char)sgn(srcLine[x] - srcLine[x+1]); 994 #else 980 995 signRight = (Char)m_sign[srcLine[x] - srcLine[x+1]]; 996 #endif 981 997 edgeType = signRight + signLeft; 982 998 signLeft = -signRight; … … 1026 1042 #endif 1027 1043 { 1044 #if SAO_SGN_FUNC 1045 signUpLine[x] = (Char)sgn(srcLine[x] - srcLineAbove[x]); 1046 #else 1028 1047 signUpLine[x] = (Char)m_sign[srcLine[x] - srcLineAbove[x]]; 1048 #endif 1029 1049 } 1030 1050 … … 1040 1060 #endif 1041 1061 { 1062 #if SAO_SGN_FUNC 1063 signDown = (Char)sgn(srcLine[x] - srcLineBelow[x]); 1064 #else 1042 1065 signDown = (Char)m_sign[srcLine[x] - srcLineBelow[x]]; 1066 #endif 1043 1067 edgeType = signDown + signUpLine[x]; 1044 1068 signUpLine[x]= -signDown; … … 1065 1089 for (x=startX; x<endX; x++) 1066 1090 { 1091 #if SAO_SGN_FUNC 1092 edgeType = sgn(srcLine[x] - srcLineBelow[x]) + sgn(srcLine[x] - srcLineAbove[x]); 1093 #else 1067 1094 edgeType = m_sign[srcLine[x] - srcLineBelow[x]] + m_sign[srcLine[x] - srcLineAbove[x]]; 1095 #endif 1068 1096 diff [edgeType] += (orgLine[x] - srcLine[x]); 1069 1097 count[edgeType] ++; … … 1108 1136 for (x=startX; x<endX+1; x++) 1109 1137 { 1138 #if SAO_SGN_FUNC 1139 signUpLine[x] = (Char)sgn(srcLineBelow[x] - srcLine[x-1]); 1140 #else 1110 1141 signUpLine[x] = (Char)m_sign[srcLineBelow[x] - srcLine[x-1]]; 1142 #endif 1111 1143 } 1112 1144 … … 1122 1154 for(x=firstLineStartX; x<firstLineEndX; x++) 1123 1155 { 1156 #if SAO_SGN_FUNC 1157 edgeType = sgn(srcLine[x] - srcLineAbove[x-1]) - signUpLine[x+1]; 1158 #else 1124 1159 edgeType = m_sign[srcLine[x] - srcLineAbove[x-1]] - signUpLine[x+1]; 1160 #endif 1125 1161 diff [edgeType] += (orgLine[x] - srcLine[x]); 1126 1162 count[edgeType] ++; … … 1137 1173 for (x=startX; x<endX; x++) 1138 1174 { 1175 #if SAO_SGN_FUNC 1176 signDown = (Char)sgn(srcLine[x] - srcLineBelow[x+1]); 1177 #else 1139 1178 signDown = (Char)m_sign[srcLine[x] - srcLineBelow[x+1]] ; 1179 #endif 1140 1180 edgeType = signDown + signUpLine[x]; 1141 1181 diff [edgeType] += (orgLine[x] - srcLine[x]); … … 1144 1184 signDownLine[x+1] = -signDown; 1145 1185 } 1186 #if SAO_SGN_FUNC 1187 signDownLine[startX] = (Char)sgn(srcLineBelow[startX] - srcLine[startX-1]); 1188 #else 1146 1189 signDownLine[startX] = (Char)m_sign[srcLineBelow[startX] - srcLine[startX-1]]; 1190 #endif 1147 1191 1148 1192 signTmpLine = signUpLine; … … 1168 1212 for (x=startX; x< endX; x++) 1169 1213 { 1214 #if SAO_SGN_FUNC 1215 edgeType = sgn(srcLine[x] - srcLineBelow[x+1]) + sgn(srcLine[x] - srcLineAbove[x-1]); 1216 #else 1170 1217 edgeType = m_sign[srcLine[x] - srcLineBelow[x+1]] + m_sign[srcLine[x] - srcLineAbove[x-1]]; 1218 #endif 1171 1219 diff [edgeType] += (orgLine[x] - srcLine[x]); 1172 1220 count[edgeType] ++; … … 1206 1254 for (x=startX-1; x<endX; x++) 1207 1255 { 1256 #if SAO_SGN_FUNC 1257 signUpLine[x] = (Char)sgn(srcLineBelow[x] - srcLine[x+1]); 1258 #else 1208 1259 signUpLine[x] = (Char)m_sign[srcLineBelow[x] - srcLine[x+1]]; 1260 #endif 1209 1261 } 1210 1262 … … 1225 1277 for(x=firstLineStartX; x<firstLineEndX; x++) 1226 1278 { 1279 #if SAO_SGN_FUNC 1280 edgeType = sgn(srcLine[x] - srcLineAbove[x+1]) - signUpLine[x-1]; 1281 #else 1227 1282 edgeType = m_sign[srcLine[x] - srcLineAbove[x+1]] - signUpLine[x-1]; 1283 #endif 1228 1284 diff [edgeType] += (orgLine[x] - srcLine[x]); 1229 1285 count[edgeType] ++; … … 1240 1296 for(x=startX; x<endX; x++) 1241 1297 { 1298 #if SAO_SGN_FUNC 1299 signDown = (Char)sgn(srcLine[x] - srcLineBelow[x-1]); 1300 #else 1242 1301 signDown = (Char)m_sign[srcLine[x] - srcLineBelow[x-1]] ; 1302 #endif 1243 1303 edgeType = signDown + signUpLine[x]; 1244 1304 … … 1248 1308 signUpLine[x-1] = -signDown; 1249 1309 } 1310 #if SAO_SGN_FUNC 1311 signUpLine[endX-1] = (Char)sgn(srcLineBelow[endX-1] - srcLine[endX]); 1312 #else 1250 1313 signUpLine[endX-1] = (Char)m_sign[srcLineBelow[endX-1] - srcLine[endX]]; 1314 #endif 1251 1315 srcLine += srcStride; 1252 1316 orgLine += orgStride; … … 1267 1331 for (x=startX; x<endX; x++) 1268 1332 { 1333 #if SAO_SGN_FUNC 1334 edgeType = sgn(srcLine[x] - srcLineBelow[x-1]) + sgn(srcLine[x] - srcLineAbove[x+1]); 1335 #else 1269 1336 edgeType = m_sign[srcLine[x] - srcLineBelow[x-1]] + m_sign[srcLine[x] - srcLineAbove[x+1]]; 1337 #endif 1270 1338 diff [edgeType] += (orgLine[x] - srcLine[x]); 1271 1339 count[edgeType] ++; -
trunk/source/Lib/TLibEncoder/TEncSbac.cpp
r644 r713 248 248 } 249 249 250 Void TEncSbac::codePPS( TComPPS* pcPPS ) 250 Void TEncSbac::codePPS( TComPPS* pcPPS 251 #if Q0048_CGS_3D_ASYMLUT 252 , TEnc3DAsymLUT * pc3DAsymLUT 253 #endif 254 ) 251 255 { 252 256 assert (0); -
trunk/source/Lib/TLibEncoder/TEncSbac.h
r644 r713 92 92 Void codeVPS ( TComVPS* pcVPS ); 93 93 Void codeSPS ( TComSPS* pcSPS ); 94 Void codePPS ( TComPPS* pcPPS ); 94 Void codePPS ( TComPPS* pcPPS 95 #if Q0048_CGS_3D_ASYMLUT 96 , TEnc3DAsymLUT * pc3DAsymLUT 97 #endif 98 ); 95 99 Void codeSliceHeader ( TComSlice* pcSlice ); 96 100 Void codeTilesWPPEntryPoint( TComSlice* pSlice ); 97 #if POC_RESET_IDC_SIGNALLING98 Void codeSliceHeaderExtn ( TComSlice* pSlice, Int shBitsWrittenTillNow );99 #endif100 101 Void codeTerminatingBit ( UInt uilsLast ); 101 102 Void codeSliceFinish (); … … 108 109 109 110 #if SVC_EXTENSION 111 #if POC_RESET_IDC_SIGNALLING 112 Void codeSliceHeaderExtn ( TComSlice* pSlice, Int shBitsWrittenTillNow ); 113 #endif 110 114 Void codeSAOOffsetParam(Int compIdx, SAOOffset& ctbParam, Bool sliceEnabled, UInt* saoMaxOffsetQVal); 111 115 Void codeSAOBlkParam(SAOBlkParam& saoBlkParam -
trunk/source/Lib/TLibEncoder/TEncSearch.cpp
r595 r713 2398 2398 { 2399 2399 UInt uiDepth = pcCU->getDepth(0); 2400 UInt uiNumPU = pcCU->getNumPart Inter();2400 UInt uiNumPU = pcCU->getNumPartitions(); 2401 2401 UInt uiInitTrDepth = pcCU->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1; 2402 2402 UInt uiWidth = pcCU->getWidth (0) >> uiInitTrDepth; … … 3130 3130 TComMv cMvTemp[2][33]; 3131 3131 3132 Int iNumPart = pcCU->getNumPart Inter();3132 Int iNumPart = pcCU->getNumPartitions(); 3133 3133 Int iNumPredDir = pcCU->getSlice()->isInterP() ? 1 : 2; 3134 3134 … … 4612 4612 4613 4613 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[pcCU->getDepth(0)][CI_CURR_BEST] ); 4614 #if 0 // check 4615 { 4616 m_pcEntropyCoder->resetBits(); 4617 m_pcEntropyCoder->encodeCoeff( pcCU, 0, pcCU->getDepth(0), pcCU->getWidth(0), pcCU->getHeight(0) ); 4618 const UInt uiBitsForCoeff = m_pcEntropyCoder->getNumberOfWrittenBits(); 4619 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[pcCU->getDepth(0)][CI_CURR_BEST] ); 4620 if( uiBitsForCoeff != uiBits ) 4621 assert( 0 ); 4622 } 4623 #endif 4614 4624 4615 uiBits = 0; 4625 4616 { -
trunk/source/Lib/TLibEncoder/TEncSlice.cpp
r644 r713 225 225 Int depth; 226 226 { 227 #if FIX_FIELD_DEPTH 228 Int poc = rpcSlice->getPOC(); 229 if(isField) 230 { 231 poc = (poc/2)%(m_pcCfg->getGOPSize()/2); 232 } 233 else 234 { 235 poc = poc%m_pcCfg->getGOPSize(); 236 } 237 #else 227 238 Int poc = rpcSlice->getPOC()%m_pcCfg->getGOPSize(); 239 #endif 228 240 if ( poc == 0 ) 229 241 { … … 248 260 } 249 261 } 262 #if FIX_FIELD_DEPTH 263 #if HARMONIZE_GOP_FIRST_FIELD_COUPLE 264 if(poc != 0) 265 { 266 #endif 267 if(isField && rpcSlice->getPOC()%2 == 1) 268 { 269 depth ++; 270 } 271 #if HARMONIZE_GOP_FIRST_FIELD_COUPLE 272 } 273 #endif 274 #endif 250 275 } 251 276 … … 254 279 255 280 eSliceType=B_SLICE; 281 #if EFFICIENT_FIELD_IRAP 282 if(!(isField && pocLast == 1)) 283 { 284 #endif // EFFICIENT_FIELD_IRAP 285 #if ALLOW_RECOVERY_POINT_AS_RAP 286 if(m_pcCfg->getDecodingRefreshType() == 3) 287 { 288 eSliceType = (pocLast == 0 || pocCurr % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; 289 } 290 else 291 { 256 292 eSliceType = (pocLast == 0 || (pocCurr - isField) % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; 293 } 294 #else 295 eSliceType = (pocLast == 0 || (pocCurr - isField) % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; 296 #endif 297 #if EFFICIENT_FIELD_IRAP 298 } 299 #endif 257 300 258 301 rpcSlice->setSliceType ( eSliceType ); … … 423 466 #if HB_LAMBDA_FOR_LDC 424 467 // restore original slice type 468 469 #if EFFICIENT_FIELD_IRAP 470 if(!(isField && pocLast == 1)) 471 { 472 #endif // EFFICIENT_FIELD_IRAP 473 #if ALLOW_RECOVERY_POINT_AS_RAP 474 if(m_pcCfg->getDecodingRefreshType() == 3) 475 { 476 eSliceType = (pocLast == 0 || (pocCurr) % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; 477 478 } 479 else 480 { 425 481 eSliceType = (pocLast == 0 || (pocCurr - isField) % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; 482 } 483 #else 484 eSliceType = (pocLast == 0 || (pocCurr - isField) % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; 485 #endif 486 #if EFFICIENT_FIELD_IRAP 487 } 488 #endif // EFFICIENT_FIELD_IRAP 426 489 427 490 #if SVC_EXTENSION … … 544 607 // store lambda 545 608 slice->setSliceQp( sliceQP ); 609 #if ADAPTIVE_QP_SELECTION 546 610 slice->setSliceQpBase ( sliceQP ); 611 #endif 547 612 m_pcRdCost ->setLambda( lambda ); 548 613 // for RDO … … 1041 1106 1042 1107 m_pcRateCtrl->setRCQP( estQP ); 1108 #if ADAPTIVE_QP_SELECTION 1043 1109 pcCU->getSlice()->setSliceQpBase( estQP ); 1110 #endif 1044 1111 } 1045 1112 -
trunk/source/Lib/TLibEncoder/TEncTop.cpp
r644 r713 795 795 Bool sameBitDepths = ( g_bitDepthYLayer[m_layerId] == g_bitDepthYLayer[refLayerId] ) && ( g_bitDepthCLayer[m_layerId] == g_bitDepthCLayer[refLayerId] ); 796 796 797 if( m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !zeroOffsets || !sameBitDepths ) 797 if( m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !zeroOffsets || !sameBitDepths 798 #if Q0048_CGS_3D_ASYMLUT 799 || m_cPPS.getCGSFlag() > 0 800 #endif 801 #if LAYER_CTB 802 || pcEncTopBase->getSPS()->getMaxCUWidth() != m_cSPS.getMaxCUWidth() || pcEncTopBase->getSPS()->getMaxCUHeight() != m_cSPS.getMaxCUHeight() || pcEncTopBase->getSPS()->getMaxCUDepth() != m_cSPS.getMaxCUDepth() 803 #endif 804 ) 798 805 #else 799 806 if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !zeroOffsets ) … … 857 864 Bool sameBitDepths = ( g_bitDepthYLayer[m_layerId] == g_bitDepthYLayer[refLayerId] ) && ( g_bitDepthCLayer[m_layerId] == g_bitDepthCLayer[refLayerId] ); 858 865 859 if( m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !zeroOffsets || !sameBitDepths ) 866 if( m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !zeroOffsets || !sameBitDepths 867 #if Q0048_CGS_3D_ASYMLUT 868 || m_cPPS.getCGSFlag() > 0 869 #endif 870 #if LAYER_CTB 871 || pcEncTopBase->getSPS()->getMaxCUWidth() != m_cSPS.getMaxCUWidth() || pcEncTopBase->getSPS()->getMaxCUHeight() != m_cSPS.getMaxCUHeight() || pcEncTopBase->getSPS()->getMaxCUDepth() != m_cSPS.getMaxCUDepth() 872 #endif 873 ) 860 874 #else 861 875 if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !zeroOffsets ) … … 1188 1202 } 1189 1203 #endif 1204 #if Q0048_CGS_3D_ASYMLUT 1205 m_cPPS.setCGSFlag( m_nCGSFlag ); 1206 #endif 1190 1207 } 1191 1208 -
trunk/source/Lib/TLibEncoder/TEncTop.h
r644 r713 273 273 274 274 /// encode several number of pictures until end-of-sequence 275 Void encode( bool bEos, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut,275 Void encode( Bool bEos, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, 276 276 std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded, Bool isTff); 277 277
Note: See TracChangeset for help on using the changeset viewer.