Changeset 367 in 3DVCSoftware for branches/HTM-DEV-0.1-dev/source/Lib/TLibDecoder
- Timestamp:
- 3 May 2013, 17:09:57 (12 years ago)
- Location:
- branches/HTM-DEV-0.1-dev/source/Lib/TLibDecoder
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.1-dev/source/Lib/TLibDecoder/NALread.cpp
r362 r367 103 103 assert(forbidden_zero_bit == 0); 104 104 nalu.m_nalUnitType = (NalUnitType) bs.read(6); // nal_unit_type 105 #if H_MV106 nalu.m_layerId = bs.read(6); // layerId107 #else108 105 nalu.m_reservedZero6Bits = bs.read(6); // nuh_reserved_zero_6bits 109 106 assert(nalu.m_reservedZero6Bits == 0); 110 #endif111 107 nalu.m_temporalId = bs.read(3) - 1; // nuh_temporal_id_plus1 112 108 -
branches/HTM-DEV-0.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r362 r367 680 680 if (uiCode) 681 681 { 682 #if H_MV683 READ_FLAG( uiCode, "inter_view_mv_vert_constraint_flag" ); pcSPS->setInterViewMvVertConstraintFlag(uiCode == 1 ? true : false);684 #else685 682 while ( xMoreRbspData() ) 686 683 { 687 684 READ_FLAG( uiCode, "sps_extension_data_flag"); 688 685 } 689 #endif690 686 } 691 687 } … … 697 693 READ_CODE( 4, uiCode, "vps_video_parameter_set_id" ); pcVPS->setVPSId( uiCode ); 698 694 READ_CODE( 2, uiCode, "vps_reserved_three_2bits" ); assert(uiCode == 3); 699 #if H_MV700 READ_CODE( 6, uiCode, "vps_max_layers_minus1" ); pcVPS->setMaxLayers( uiCode + 1 );701 #else702 695 READ_CODE( 6, uiCode, "vps_reserved_zero_6bits" ); assert(uiCode == 0); 703 #endif704 696 READ_CODE( 3, uiCode, "vps_max_sub_layers_minus1" ); pcVPS->setMaxTLayers( uiCode + 1 ); 705 697 READ_FLAG( uiCode, "vps_temporal_id_nesting_flag" ); pcVPS->setTemporalNestingFlag( uiCode ? true:false ); 706 698 assert (pcVPS->getMaxTLayers()>1||pcVPS->getTemporalNestingFlag()); 707 #if H_MV708 READ_CODE( 16, uiCode, "vps_extension_offset" );709 #else710 699 READ_CODE( 16, uiCode, "vps_reserved_ffff_16bits" ); assert(uiCode == 0xffff); 711 #endif712 700 parsePTL ( pcVPS->getPTL(), true, pcVPS->getMaxTLayers()-1); 713 701 #if SIGNAL_BITRATE_PICRATE_IN_VPS … … 739 727 740 728 assert( pcVPS->getNumHrdParameters() < MAX_VPS_OP_SETS_PLUS1 ); 741 #if H_MV742 assert( pcVPS->getMaxNuhLayerId() < MAX_VPS_NUH_LAYER_ID_PLUS1 );743 READ_CODE( 6, uiCode, "vps_max_nuh_layer_id" ); pcVPS->setMaxNuhLayerId( uiCode );744 #else745 729 assert( pcVPS->getMaxNuhReservedZeroLayerId() < MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1 ); 746 730 READ_CODE( 6, uiCode, "vps_max_nuh_reserved_zero_layer_id" ); pcVPS->setMaxNuhReservedZeroLayerId( uiCode ); 747 #endif748 731 READ_UVLC( uiCode, "vps_max_op_sets_minus1" ); pcVPS->setMaxOpSets( uiCode + 1 ); 749 732 for( UInt opsIdx = 1; opsIdx <= ( pcVPS->getMaxOpSets() - 1 ); opsIdx ++ ) 750 733 { 751 734 // Operation point set 752 #if H_MV753 for( UInt i = 0; i <= pcVPS->getMaxNuhLayerId(); i ++ )754 #else755 735 for( UInt i = 0; i <= pcVPS->getMaxNuhReservedZeroLayerId(); i ++ ) 756 #endif757 736 { 758 737 READ_FLAG( uiCode, "layer_id_included_flag[opsIdx][i]" ); pcVPS->setLayerIdIncludedFlag( uiCode == 1 ? true : false, opsIdx, i ); … … 793 772 if (uiCode) 794 773 { 795 #if H_MV796 m_pcBitstream->readOutTrailingBits();797 798 READ_FLAG( uiCode, "avc_base_layer_flag" ); pcVPS->setAvcBaseLayerFlag( uiCode == 1 ? true : false );799 READ_FLAG( uiCode, "splitting_flag" ); pcVPS->setSplittingFlag( uiCode == 1 ? true : false );800 801 // Parse scalability_mask[i]802 for( Int sIdx = 0; sIdx < MAX_NUM_SCALABILITY_TYPES; sIdx++ )803 {804 READ_FLAG( uiCode, "scalability_mask[i]" ); pcVPS->setScalabilityMask( sIdx, uiCode == 1 ? true : false );805 }806 807 Int numScalabilityTypes = pcVPS->getNumScalabilityTypes();808 809 // Parse dimension_id_len_minus1[j]810 for( Int sIdx = 0; sIdx < numScalabilityTypes; sIdx++ )811 {812 READ_CODE( 3, uiCode, "dimension_id_len_minus1[j]" ); pcVPS->setDimensionIdLen( sIdx, uiCode + 1 );813 }814 815 // vps_nuh_layer_id_present_flag816 READ_FLAG( uiCode, "vps_nuh_layer_id_present_flag" ); pcVPS->setVpsNuhLayerIdPresentFlag( uiCode == 1 ? true : false );817 818 // parse layer_id_in_nuh[i] and derive LayerIdInVps819 pcVPS->setLayerIdInNuh( 0, 0 ); pcVPS->setLayerIdInVps( 0, 0 );820 821 for( Int layer = 1; layer <= pcVPS->getMaxLayers() - 1; layer++ )822 {823 UInt layerIdInNuh;824 if ( pcVPS->getVpsNuhLayerIdPresentFlag() )825 {826 READ_CODE( 6, uiCode, "layer_id_in_nuh[i]" ); layerIdInNuh = uiCode;827 }828 else829 {830 layerIdInNuh = layer;831 }832 833 pcVPS->setLayerIdInNuh( layer, layerIdInNuh );834 pcVPS->setLayerIdInVps( layerIdInNuh, layer );835 836 // parse dimension_id[i][j]837 for( Int sIdx = 0; sIdx < numScalabilityTypes; sIdx++ )838 {839 READ_CODE( pcVPS->getDimensionIdLen( sIdx ), uiCode, "dimension_id[i][j]" ); pcVPS->setDimensionId( layer, sIdx, uiCode );840 }841 }842 843 for( Int layerSet = 1; layerSet <= pcVPS->getMaxOpSets() - 1; layerSet++ )844 {845 READ_FLAG( uiCode, "vps_profile_present_flag[lsIdx]" ); pcVPS->setVpsProfilePresentFlag( layerSet, uiCode == 1 ? true : false );846 if( pcVPS->getVpsProfilePresentFlag( layerSet ) == false )847 {848 READ_UVLC( uiCode, "profile_layer_set_ref_minus1[lsIdx]" ); pcVPS->setProfileLayerSetRefMinus1( layerSet, uiCode );849 }850 851 parsePTL ( pcVPS->getPTL( layerSet ), pcVPS->getVpsProfilePresentFlag( layerSet ), pcVPS->getMaxTLayers()-1);852 if( pcVPS->getVpsProfilePresentFlag( layerSet ) == false )853 {854 TComPTL temp = *pcVPS->getPTL( layerSet );855 *pcVPS->getPTL( layerSet ) = *pcVPS->getPTL( pcVPS->getProfileLayerSetRefMinus1( layerSet ) + 1 );856 pcVPS->getPTL( layerSet )->copyLevelFrom( &temp );857 }858 }859 860 READ_UVLC( uiCode, "num_output_layer_sets" ); pcVPS->setNumOutputLayerSets( uiCode );861 862 for( Int layerSet = 0; layerSet < pcVPS->getNumOutputLayerSets(); layerSet++ )863 {864 READ_UVLC( uiCode, "output_layer_set_idx[i]" ); pcVPS->setOutputLayerSetIdx( layerSet, uiCode );865 for( Int layer = 0; layer <= pcVPS->getMaxNuhLayerId(); layer++ )866 {867 if( pcVPS->getLayerIdIncludedFlag( pcVPS->getOutputLayerSetIdx( layerSet ), layer ) == true )868 {869 READ_FLAG( uiCode, "output_layer_flag" ); pcVPS->setOutputLayerFlag( layerSet, layer, uiCode == 1 ? true : false );870 }871 }872 }873 874 for( Int i = 1; i <= pcVPS->getMaxLayers() - 1; i++ )875 {876 for( Int j = 0; j < i; j++ )877 {878 READ_FLAG( uiCode, "direct_dependency_flag[i][j]" ); pcVPS->setDirectDependencyFlag( i, j, uiCode );879 }880 }881 882 READ_FLAG( uiCode, "vps_extension2_flag" );883 if (uiCode)884 {885 while ( xMoreRbspData() )886 {887 READ_FLAG( uiCode, "vps_extension2_data_flag");888 }889 }890 891 pcVPS->checkVPSExtensionSyntax();892 893 pcVPS->calcIvRefLayers();894 895 #else896 774 while ( xMoreRbspData() ) 897 775 { 898 776 READ_FLAG( uiCode, "vps_extension_data_flag"); 899 777 } 900 #endif901 778 } 902 779 … … 914 791 TComPPS* pps = NULL; 915 792 TComSPS* sps = NULL; 916 #if H_MV917 TComVPS* vps = NULL;918 #endif919 793 920 794 UInt firstSliceSegmentInPic; … … 931 805 //!KS: need to add error handling code here, if SPS is not available 932 806 assert(sps!=0); 933 #if H_MV934 vps = parameterSetManager->getPrefetchedVPS(sps->getVPSId());935 assert(vps!=0);936 rpcSlice->setVPS(vps);937 #endif938 807 rpcSlice->setSPS(sps); 939 808 rpcSlice->setPPS(pps); … … 1523 1392 for (Int i = 0; i < maxNumSubLayersMinus1; i++) 1524 1393 { 1525 #if !H_MV1526 1394 if(profilePresentFlag) 1527 1395 { 1528 #endif1529 1396 READ_FLAG( uiCode, "sub_layer_profile_present_flag[i]" ); rpcPTL->setSubLayerProfilePresentFlag(i, uiCode); 1530 #if H_MV 1531 rpcPTL->setSubLayerProfilePresentFlag( i, profilePresentFlag && rpcPTL->getSubLayerProfilePresentFlag(i) ); 1532 #else 1533 } 1534 #endif 1397 } 1535 1398 READ_FLAG( uiCode, "sub_layer_level_present_flag[i]" ); rpcPTL->setSubLayerLevelPresentFlag (i, uiCode); 1536 1399 } -
branches/HTM-DEV-0.1-dev/source/Lib/TLibDecoder/TDecGop.cpp
r364 r367 205 205 } 206 206 207 #if !H_3D208 207 rpcPic->compressMotion(); 209 #endif210 208 Char c = (pcSlice->isIntra() ? 'I' : pcSlice->isInterP() ? 'P' : 'B'); 211 209 if (!pcSlice->isReferenced()) c += 32; 212 210 213 211 //-- For time output for each slice 214 #if H_MV215 printf("\nLayer %2d POC %4d TId: %1d ( %c-SLICE, QP%3d ) ", pcSlice->getLayerId(),216 pcSlice->getPOC(),217 pcSlice->getTLayer(),218 c,219 pcSlice->getSliceQp() );220 #else221 212 printf("\nPOC %4d TId: %1d ( %c-SLICE, QP%3d ) ", pcSlice->getPOC(), 222 213 pcSlice->getTLayer(), 223 214 c, 224 215 pcSlice->getSliceQp() ); 225 #endif226 216 227 217 m_dDecTime += (Double)(clock()-iBeforeTime) / CLOCKS_PER_SEC; … … 234 224 for (Int iRefIndex = 0; iRefIndex < pcSlice->getNumRefIdx(RefPicList(iRefList)); iRefIndex++) 235 225 { 236 #if H_MV237 if( pcSlice->getLayerId() != pcSlice->getRefLayerId( RefPicList(iRefList), iRefIndex ) )238 {239 printf( "V%d ", pcSlice->getRefLayerId( RefPicList(iRefList), iRefIndex ) );240 }241 else242 {243 #endif244 226 printf ("%d ", pcSlice->getRefPOC(RefPicList(iRefList), iRefIndex)); 245 #if H_MV246 }247 #endif248 227 } 249 228 printf ("] "); -
branches/HTM-DEV-0.1-dev/source/Lib/TLibDecoder/TDecTop.cpp
r364 r367 39 39 #include "TDecTop.h" 40 40 41 #if H_MV42 ParameterSetManagerDecoder TDecTop::m_parameterSetManagerDecoder;43 #endif44 41 //! \ingroup TLibDecoder 45 42 //! \{ … … 60 57 m_bFirstSliceInPicture = true; 61 58 m_bFirstSliceInSequence = true; 62 #if H_MV63 m_layerId = 0;64 m_viewId = 0;65 #if H_3D66 m_isDepth = false;67 #endif68 #endif69 59 } 70 60 … … 96 86 { 97 87 // initialize ROM 98 #if !H_MV99 88 initROM(); 100 #endif101 89 m_cGopDecoder.init( &m_cEntropyDecoder, &m_cSbacDecoder, &m_cBinCABAC, &m_cCavlcDecoder, &m_cSliceDecoder, &m_cLoopFilter, &m_cSAO); 102 90 m_cSliceDecoder.init( &m_cEntropyDecoder, &m_cCuDecoder ); … … 112 100 { 113 101 TComPic* pcPic = *(iterPic++); 114 #if H_MV115 if( pcPic )116 {117 #endif118 102 pcPic->destroy(); 119 103 120 104 delete pcPic; 121 105 pcPic = NULL; 122 #if H_MV123 }124 #endif125 106 } 126 107 … … 129 110 m_cLoopFilter. destroy(); 130 111 131 #if !H_MV132 112 // destroy ROM 133 113 destroyROM(); 134 #endif135 114 } 136 115 … … 198 177 } 199 178 200 #if H_MV201 Void TDecTop::endPicDecoding(Int& poc, TComList<TComPic*>*& rpcListPic, std::vector<Int>& targetDecLayerIdSet )202 #else203 179 Void TDecTop::executeLoopFilters(Int& poc, TComList<TComPic*>*& rpcListPic) 204 #endif205 180 { 206 181 if (!m_pcPic) … … 220 195 rpcListPic = &m_cListPic; 221 196 m_cCuDecoder.destroy(); 222 #if H_MV223 TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer );224 TComSlice::markIvRefPicsAsUnused ( m_ivPicLists, targetDecLayerIdSet, m_parameterSetManagerDecoder.getActiveVPS(), m_layerId, poc );225 #endif226 197 m_bFirstSliceInPicture = true; 227 198 … … 340 311 } 341 312 342 #if H_MV343 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag )344 {345 assert( nalu.m_layerId == m_layerId );346 347 #else348 313 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay ) 349 314 { 350 #endif351 315 TComPic*& pcPic = m_pcPic; 352 316 m_apcSlicePilot->initSlice(); … … 373 337 m_apcSlicePilot->setTLayerInfo(nalu.m_temporalId); 374 338 375 #if H_MV376 m_apcSlicePilot->setLayerId( nalu.m_layerId );377 #endif378 339 m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder); 379 340 380 #if H_MV381 TComVPS* vps = m_apcSlicePilot->getVPS();382 Int layerIdInVps = vps->getLayerIdInVps( nalu.m_layerId );383 384 setViewId( vps->getViewId( layerIdInVps ) );385 m_apcSlicePilot->setViewId( getViewId() );386 #if H_3D387 setIsDepth( vps->getDepthId( layerIdInVps ) == 1 );388 m_apcSlicePilot->setIsDepth( getIsDepth() );389 #endif390 #endif391 341 // Skip pictures due to random access 392 342 if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay)) … … 415 365 m_prevPOC = m_apcSlicePilot->getPOC(); 416 366 } 417 #if H_MV418 if ( newLayerFlag )419 {420 return false;421 }422 #endif423 367 // actual decoding starts here 424 368 xActivateParameterSets(); … … 440 384 m_cPrediction.initTempBuff(); 441 385 m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS()); 442 #if H_MV443 m_apcSlicePilot->createAndApplyIvReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer );444 #endif445 386 // Get a new picture buffer 446 387 xGetNewPicBuffer (m_apcSlicePilot, pcPic); … … 574 515 pcPic->setTLayer(nalu.m_temporalId); 575 516 576 #if H_MV577 pcPic->setLayerId( nalu.m_layerId );578 pcPic->setViewId ( getViewId() );579 #if H_3D580 pcPic->setIsDepth( getIsDepth() );581 #endif582 #endif583 517 if (bNextSlice) 584 518 { 585 519 pcSlice->checkCRA(pcSlice->getRPS(), m_pocCRA, m_prevRAPisBLA, m_cListPic ); 586 520 // Set reference list 587 #if H_MV588 pcSlice->setRefPicList( m_cListPic, m_refPicSetInterLayer, true );589 #else590 521 #if FIX1071 591 522 pcSlice->setRefPicList( m_cListPic, true ); … … 594 525 #endif 595 526 596 #endif597 527 // For generalized B 598 528 // note: maybe not existed case (always L0 is copied to L1 if L1 is empty) … … 732 662 } 733 663 734 #if H_MV735 Bool TDecTop::decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayerFlag)736 #else737 664 Bool TDecTop::decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay) 738 #endif739 665 { 740 666 // Initialize entropy decoder … … 777 703 case NAL_UNIT_CODED_SLICE_RASL_N: 778 704 case NAL_UNIT_CODED_SLICE_RASL_R: 779 #if H_MV780 return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay, newLayerFlag);781 #else782 705 return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay); 783 #endif784 706 break; 785 707 default: … … 861 783 } 862 784 863 #if H_MV864 TComPic* TDecTop::getPic( Int poc )865 {866 xGetPic( m_layerId, poc );867 TComList<TComPic*>* listPic = getListPic();868 TComPic* pcPic = NULL;869 for(TComList<TComPic*>::iterator it=listPic->begin(); it!=listPic->end(); it++)870 {871 if( (*it)->getPOC() == poc )872 {873 pcPic = *it ;874 break ;875 }876 }877 return pcPic;878 }879 880 TComPic* TDecTop::xGetPic( Int layerId, Int poc )881 {882 return m_ivPicLists->getPic( layerId, poc ) ;883 }884 885 #endif886 785 //! \} -
branches/HTM-DEV-0.1-dev/source/Lib/TLibDecoder/TDecTop.h
r366 r367 61 61 // ==================================================================================================================== 62 62 63 #if H_MV64 class TAppDecTop;65 #endif66 63 /// decoder class 67 64 class TDecTop … … 75 72 76 73 TComList<TComPic*> m_cListPic; // Dynamic buffer 77 #if H_MV78 static ParameterSetManagerDecoder m_parameterSetManagerDecoder; // storage for parameter sets79 #else80 74 ParameterSetManagerDecoder m_parameterSetManagerDecoder; // storage for parameter sets 81 #endif82 75 TComSlice* m_apcSlicePilot; 83 76 … … 105 98 Bool m_bFirstSliceInPicture; 106 99 Bool m_bFirstSliceInSequence; 107 #if H_MV108 // For H_MV m_bFirstSliceInSequence indicates first slice in sequence of the particular layer109 Int m_layerId;110 Int m_viewId;111 TComPicLists* m_ivPicLists;112 std::vector<TComPic*> m_refPicSetInterLayer;113 #if H_3D114 Bool m_isDepth;115 #endif116 #endif117 100 118 101 public: … … 126 109 127 110 Void init(); 128 #if H_MV129 Bool decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayer );130 #else131 111 Bool decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay); 132 #endif133 112 134 113 Void deletePicBuffer(); 135 114 136 #if H_MV137 Void endPicDecoding(Int& poc, TComList<TComPic*>*& rpcListPic, std::vector<Int>& targetDecLayerIdSet);138 #else139 115 Void executeLoopFilters(Int& poc, TComList<TComPic*>*& rpcListPic); 140 #endif141 116 142 #if H_MV143 TComPic* getPic ( Int poc );144 TComList<TComPic*>* getListPic () { return &m_cListPic; }145 Void setIvPicLists ( TComPicLists* picLists) { m_ivPicLists = picLists; }146 147 Int getCurrPoc () { return m_apcSlicePilot->getPOC(); }148 Void setLayerId ( Int layer) { m_layerId = layer; }149 Int getLayerId () { return m_layerId; }150 Void setViewId ( Int viewId ) { m_viewId = viewId; }151 Int getViewId () { return m_viewId; }152 #if H_3D153 Void setIsDepth ( Bool isDepth ) { m_isDepth = isDepth; }154 Bool getIsDepth () { return m_isDepth; }155 #endif156 #endif157 117 protected: 158 118 Void xGetNewPicBuffer (TComSlice* pcSlice, TComPic*& rpcPic); … … 160 120 161 121 Void xActivateParameterSets(); 162 #if H_MV163 TComPic* xGetPic( Int layerId, Int poc );164 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag );165 #else166 122 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay); 167 #endif168 123 Void xDecodeVPS(); 169 124 Void xDecodeSPS();
Note: See TracChangeset for help on using the changeset viewer.