Changeset 467 in SHVCSoftware for branches/SHM-4.0-dev/source/Lib/TLibEncoder
- Timestamp:
- 14 Nov 2013, 00:54:41 (11 years ago)
- Location:
- branches/SHM-4.0-dev/source/Lib/TLibEncoder
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
r466 r467 359 359 { 360 360 WRITE_FLAG(pcVUI->getTilesFixedStructureFlag(), "tiles_fixed_structure_flag"); 361 #if M0464_TILE_BOUNDARY_ALIGNED_FLAG362 if ( pcSPS->getLayerId() > 0 )363 {364 WRITE_FLAG( pcVUI->getTileBoundariesAlignedFlag( ) ? 1 : 0 , "tile_boundaries_aligned_flag" );365 }366 #endif367 361 WRITE_FLAG(pcVUI->getMotionVectorsOverPicBoundariesFlag(), "motion_vectors_over_pic_boundaries_flag"); 368 362 WRITE_FLAG(pcVUI->getRestrictedRefPicListsFlag(), "restricted_ref_pic_lists_flag"); … … 454 448 #endif 455 449 WRITE_CODE( pcSPS->getVPSId (), 4, "sps_video_parameter_set_id" ); 456 #if S PS_SUB_LAYER_INFO450 #if SVC_EXTENSION 457 451 if(pcSPS->getLayerId() == 0) 458 452 { … … 460 454 WRITE_CODE( pcSPS->getMaxTLayers() - 1, 3, "sps_max_sub_layers_minus1" ); 461 455 WRITE_FLAG( pcSPS->getTemporalIdNestingFlag() ? 1 : 0, "sps_temporal_id_nesting_flag" ); 462 #if S PS_SUB_LAYER_INFO456 #if SVC_EXTENSION 463 457 } 464 458 #endif … … 670 664 WRITE_FLAG( 0, "inter_view_mv_vert_constraint_flag" ); 671 665 #endif 672 #if SCALED_REF_LAYER_OFFSETS673 666 if( pcSPS->getLayerId() > 0 ) 674 667 { … … 683 676 } 684 677 } 685 #endif686 678 #if M0463_VUI_EXT_ILP_REF 687 679 //// sps_extension_vui_parameters( ) … … 828 820 } 829 821 822 #if SVC_EXTENSION 830 823 #if VPS_EXTNS 831 824 Void TEncCavlc::codeVPSExtension (TComVPS *vps) … … 843 836 } 844 837 845 #if VPS_SPLIT_FLAG846 838 for(j = 0; j < vps->getNumScalabilityTypes() - vps->getSplittingFlag(); j++) 847 #else848 for(j = 0; j < vps->getNumScalabilityTypes(); j++)849 #endif850 839 { 851 840 WRITE_CODE( vps->getDimensionIdLen(j) - 1, 3, "dimension_id_len_minus1[j]" ); … … 871 860 WRITE_CODE( vps->getLayerIdInNuh(i), 6, "layer_id_in_nuh[i]" ); 872 861 } 873 #if VPS_SPLIT_FLAG 874 if( !vps->getSplittingFlag())875 #endif 862 863 if( !vps->getSplittingFlag() ) 864 { 876 865 for(j = 0; j < vps->getNumScalabilityTypes(); j++) 877 866 { … … 879 868 WRITE_CODE( vps->getDimensionId(i, j), bits, "dimension_id[i][j]" ); 880 869 } 870 } 881 871 } 882 872 #endif … … 893 883 } 894 884 #endif 895 #if VPS_MOVE_DIR_DEPENDENCY_FLAG896 885 #if VPS_EXTN_DIRECT_REF_LAYERS 897 886 for( Int layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++) … … 902 891 } 903 892 } 904 #endif905 893 #endif 906 894 #if JCTVC_M0203_INTERLAYER_PRED_IDC … … 926 914 #if VPS_EXTN_PROFILE_INFO 927 915 // Profile-tier-level signalling 928 #if VPS_PROFILE_OUTPUT_LAYERS929 916 WRITE_CODE( vps->getNumLayerSets() - 1 , 10, "vps_number_layer_sets_minus1" ); 930 917 WRITE_CODE( vps->getNumProfileTierLevel() - 1, 6, "vps_num_profile_tier_level_minus1"); 931 918 for(Int idx = 1; idx <= vps->getNumProfileTierLevel() - 1; idx++) 932 #else933 for(Int idx = 1; idx <= vps->getNumLayerSets() - 1; idx++)934 #endif935 919 { 936 920 WRITE_FLAG( vps->getProfilePresentFlag(idx), "vps_profile_present_flag[i]" ); 937 921 if( !vps->getProfilePresentFlag(idx) ) 938 922 { 939 #if VPS_PROFILE_OUTPUT_LAYERS940 923 WRITE_CODE( vps->getProfileLayerSetRef(idx) - 1, 6, "profile_ref_minus1[i]" ); 941 #else942 WRITE_UVLC( vps->getProfileLayerSetRef(idx) - 1, "vps_profile_layer_set_ref_minus1[i]" );943 #endif944 924 } 945 925 codePTL( vps->getPTLForExtn(idx), vps->getProfilePresentFlag(idx), vps->getMaxTLayers() - 1 ); … … 947 927 #endif 948 928 949 #if VPS_PROFILE_OUTPUT_LAYERS950 929 Int numOutputLayerSets = vps->getNumOutputLayerSets() ; 951 930 WRITE_FLAG( (numOutputLayerSets > vps->getNumLayerSets()), "more_output_layer_sets_than_default_flag" ); … … 982 961 WRITE_CODE( vps->getProfileLevelTierIdx(i), numBits, "profile_level_tier_idx[i]" ); 983 962 } 984 #else985 #if VPS_EXTN_OP_LAYER_SETS986 // Target output layer signalling987 WRITE_UVLC( vps->getNumOutputLayerSets(), "vps_num_output_layer_sets");988 for(i = 0; i < vps->getNumOutputLayerSets(); i++)989 {990 #if VPS_OUTPUT_LAYER_SET_IDX991 assert(vps->getOutputLayerSetIdx(i) > 0);992 WRITE_UVLC( vps->getOutputLayerSetIdx(i) - 1, "vps_output_layer_set_idx_minus1[i]");993 #else994 WRITE_UVLC( vps->getOutputLayerSetIdx(i), "vps_output_layer_set_idx[i]");995 #endif996 Int lsIdx = vps->getOutputLayerSetIdx(i);997 for(j = 0; j <= vps->getMaxLayerId(); j++)998 {999 if(vps->getLayerIdIncludedFlag(lsIdx, j))1000 {1001 WRITE_FLAG( vps->getOutputLayerFlag(lsIdx, j), "vps_output_layer_flag[lsIdx][j]");1002 }1003 }1004 }1005 #endif1006 #endif1007 963 1008 964 #if REPN_FORMAT_IN_VPS … … 1040 996 WRITE_FLAG(vps->getCrossLayerIrapAlignFlag(), "cross_layer_irap_aligned_flag"); 1041 997 #endif 1042 #if !VPS_MOVE_DIR_DEPENDENCY_FLAG1043 #if VPS_EXTN_DIRECT_REF_LAYERS1044 for( Int layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++)1045 {1046 for( Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++)1047 {1048 WRITE_FLAG(vps->getDirectDependencyFlag(layerCtr, refLayerCtr), "direct_dependency_flag[i][j]" );1049 }1050 }1051 #endif1052 #endif1053 998 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS 1054 999 WRITE_UVLC( vps->getDirectDepTypeLen()-2, "direct_dep_type_len_minus2"); … … 1184 1129 } 1185 1130 #endif 1131 #endif //SVC_EXTENSION 1186 1132 1187 1133 Void TEncCavlc::codeSliceHeader ( TComSlice* pcSlice ) … … 1229 1175 if ( !pcSlice->getDependentSliceSegmentFlag() ) 1230 1176 { 1231 1177 #if SVC_EXTENSION 1232 1178 #if POC_RESET_FLAG 1233 1179 Int iBits = 0; … … 1249 1195 } 1250 1196 #else 1251 #if SH_DISCARDABLE_FLAG1252 1197 if (pcSlice->getPPS()->getNumExtraSliceHeaderBits()>0) 1253 1198 { … … 1260 1205 WRITE_FLAG(0, "slice_reserved_undetermined_flag[]"); 1261 1206 } 1262 #else 1207 #endif 1208 #else //SVC_EXTENSION 1263 1209 for (Int i = 0; i < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++) 1264 1210 { … … 1266 1212 WRITE_FLAG(0, "slice_reserved_undetermined_flag[]"); 1267 1213 } 1268 #endif 1269 #endif 1214 #endif //SVC_EXTENSION 1270 1215 1271 1216 WRITE_UVLC( pcSlice->getSliceType(), "slice_type" ); -
branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r466 r467 753 753 pcSlice->setNalUnitType(getNalUnitType(pocCurr, m_iLastIDR)); 754 754 #if SVC_EXTENSION 755 #if ILR_RESTR && ILR_RESTR_FIX 755 if (m_layerId > 0) 756 { 756 757 Int interLayerPredLayerIdcTmp[MAX_VPS_LAYER_ID_PLUS1]; 757 758 Int activeNumILRRefIdxTmp = 0; 758 #endif 759 if (m_layerId > 0) 760 { 759 761 760 for( Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ ) 762 761 { … … 769 768 pcSlice->setBaseColPic( *cListPic, refLayerIdc ); 770 769 771 #if ILR_RESTR && ILR_RESTR_FIX772 770 // Apply temporal layer restriction to inter-layer prediction 773 771 Int maxTidIlRefPicsPlus1 = m_pcEncTop->getVPS()->getMaxTidIlRefPicsPlus1(pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getLayerId()); … … 780 778 continue; // ILP is not valid due to temporal layer restriction 781 779 } 782 #endif 783 784 #if SCALED_REF_LAYER_OFFSETS 780 785 781 const Window &scalEL = m_pcEncTop->getScaledRefLayerWindow(refLayerIdc); 786 782 … … 790 786 Int widthEL = pcPic->getPicYuvRec()->getWidth() - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset(); 791 787 Int heightEL = pcPic->getPicYuvRec()->getHeight() - scalEL.getWindowTopOffset() - scalEL.getWindowBottomOffset(); 792 #else 793 const Window &confBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getConformanceWindow(); 794 const Window &confEL = pcPic->getPicYuvRec()->getConformanceWindow(); 795 796 Int widthBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset(); 797 Int heightBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset(); 798 799 Int widthEL = pcPic->getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset(); 800 Int heightEL = pcPic->getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset(); 801 #endif 788 802 789 g_mvScalingFactor[refLayerIdc][0] = widthEL == widthBL ? 4096 : Clip3(-4096, 4095, ((widthEL << 8) + (widthBL >> 1)) / widthBL); 803 790 g_mvScalingFactor[refLayerIdc][1] = heightEL == heightBL ? 4096 : Clip3(-4096, 4095, ((heightEL << 8) + (heightBL >> 1)) / heightBL); … … 823 810 } 824 811 825 #if ILR_RESTR && ILR_RESTR_FIX826 812 // Update the list of active inter-layer pictures 827 813 for ( Int i = 0; i < activeNumILRRefIdxTmp; i++) … … 835 821 pcSlice->setInterLayerPredEnabledFlag(false); 836 822 } 837 #endif838 823 839 824 if( pocCurr % m_pcCfg->getIntraPeriod() == 0 ) … … 1616 1601 pcSlice->setSliceSegmentCurStartCUAddr ( startCUAddrSlice ); 1617 1602 pcSlice->setSliceBits(0); 1603 #if SVC_EXTENSION 1604 // copy reference list modification info from the first slice, assuming that this information is the same across all slices in the picture 1605 memcpy( pcSlice->getRefPicListModification(), pcPic->getSlice(0)->getRefPicListModification(), sizeof(TComRefPicListModification) ); 1606 #endif 1618 1607 uiNumSlices ++; 1619 1608 } -
branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncTop.cpp
r466 r467 88 88 m_bMFMEnabledFlag = false; 89 89 #endif 90 #if SCALED_REF_LAYER_OFFSETS91 90 m_numScaledRefLayerOffsets = 0; 92 #endif93 #endif94 91 #if POC_RESET_FLAG 95 92 m_pocAdjustmentValue = 0; 96 93 #endif 94 #endif //SVC_EXTENSION 97 95 } 98 96 … … 175 173 } 176 174 } 175 176 #if LAYER_CTB 177 memcpy(g_auiLayerZscanToRaster[m_layerId], g_auiZscanToRaster, sizeof( g_auiZscanToRaster ) ); 178 memcpy(g_auiLayerRasterToZscan[m_layerId], g_auiRasterToZscan, sizeof( g_auiRasterToZscan ) ); 179 memcpy(g_auiLayerRasterToPelX[m_layerId], g_auiRasterToPelX, sizeof( g_auiRasterToPelX ) ); 180 memcpy(g_auiLayerRasterToPelY[m_layerId], g_auiRasterToPelY, sizeof( g_auiRasterToPelY ) ); 181 #endif 177 182 } 178 183 … … 871 876 #if SVC_EXTENSION 872 877 m_cSPS.setLayerId(m_layerId); 873 #endif874 878 #if REF_IDX_MFM 875 879 #if !M0457_COL_PICTURE_SIGNALING … … 877 881 #endif 878 882 #endif 879 #if SCALED_REF_LAYER_OFFSETS880 883 m_cSPS.setNumScaledRefLayerOffsets(m_numScaledRefLayerOffsets); 881 884 for(Int i = 0; i < m_cSPS.getNumScaledRefLayerOffsets(); i++) … … 883 886 m_cSPS.getScaledRefLayerWindow(i) = m_scaledRefLayerWindow[i]; 884 887 } 885 #endif 888 #endif //SVC_EXTENSION 886 889 ProfileTierLevel& profileTierLevel = *m_cSPS.getPTL()->getGeneralPTL(); 887 890 profileTierLevel.setLevelIdc(m_level); -
branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncTop.h
r466 r467 140 140 Int m_ilSampleOnlyPred; 141 141 #endif 142 #if SCALED_REF_LAYER_OFFSETS143 142 UInt m_numScaledRefLayerOffsets; 144 143 Window m_scaledRefLayerWindow[MAX_LAYERS]; 145 #endif146 144 #if POC_RESET_FLAG 147 145 Int m_pocAdjustmentValue; 148 146 #endif 149 #endif 147 #endif //SVC_EXTENSION 150 148 protected: 151 149 Void xGetNewPicBuffer ( TComPic*& rpcPic ); ///< get picture buffer which will be processed … … 209 207 Int getNumPicRcvd () { return m_iNumPicRcvd; } 210 208 Void setNumPicRcvd ( Int num ) { m_iNumPicRcvd = num; } 211 #if SCALED_REF_LAYER_OFFSETS212 209 Void setNumScaledRefLayerOffsets(Int x) { m_numScaledRefLayerOffsets = x; } 213 210 UInt getNumScaledRefLayerOffsets() { return m_numScaledRefLayerOffsets; } 214 211 Window& getScaledRefLayerWindow(Int x) { return m_scaledRefLayerWindow[x]; } 215 #endif 216 #endif 212 #endif //SVC_EXTENSION 217 213 218 214 // ------------------------------------------------------------------------------------------------------------------- -
branches/SHM-4.0-dev/source/Lib/TLibEncoder/WeightPredAnalysis.cpp
r466 r467 293 293 #if O0194_WEIGHTED_PREDICTION_CGS 294 294 // make sure the reference frames other than ILR are not using weighted prediction 295 if (!(slice->getRefPic(eRefPicList, refIdxTemp)->isILR(1))){ 295 if (!(slice->getRefPic(eRefPicList, refIdxTemp)->isILR(1))) 296 { 296 297 continue; 297 298 }
Note: See TracChangeset for help on using the changeset viewer.