Changeset 815 in SHVCSoftware for trunk/source/Lib/TLibEncoder
- Timestamp:
- 30 Jun 2014, 06:13:06 (10 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/SHM-6-dev merged: 715-751,753-814
- Property svn:mergeinfo changed
-
trunk/source
- Property svn:mergeinfo changed
/branches/SHM-6-dev/source merged: 715-726,728-744,746-751,753-802,804-814
- Property svn:mergeinfo changed
-
trunk/source/Lib/TLibEncoder/SEIwrite.cpp
r713 r815 87 87 fprintf( g_hTrace, "=========== Tone Mapping Info SEI message ===========\n"); 88 88 break; 89 #if P0050_KNEE_FUNCTION_SEI 90 case SEI::KNEE_FUNCTION_INFO: 91 fprintf( g_hTrace, "=========== Knee Function Information SEI message ===========\n"); 92 break; 93 #endif 89 94 #if Q0074_SEI_COLOR_MAPPING 90 95 case SEI::COLOR_MAPPING_INFO: … … 123 128 case SEI::BSP_HRD: 124 129 fprintf( g_hTrace, "=========== Bitstream parition HRD parameters SEI message ===========\n"); 130 break; 131 #endif 132 #if Q0078_ADD_LAYER_SETS 133 case SEI::OUTPUT_LAYER_SET_NESTING: 134 fprintf(g_hTrace, "=========== Output layer set nesting SEI message ===========\n"); 135 break; 136 case SEI::VPS_REWRITING: 137 fprintf(g_hTrace, "=========== VPS rewriting SEI message ===========\n"); 125 138 break; 126 139 #endif … … 177 190 xWriteSEIToneMappingInfo(*static_cast<const SEIToneMappingInfo*>(&sei)); 178 191 break; 192 #if P0050_KNEE_FUNCTION_SEI 193 case SEI::KNEE_FUNCTION_INFO: 194 xWriteSEIKneeFunctionInfo(*static_cast<const SEIKneeFunctionInfo*>(&sei)); 195 break; 196 #endif 179 197 #if Q0074_SEI_COLOR_MAPPING 180 198 case SEI::COLOR_MAPPING_INFO: … … 217 235 case SEI::BSP_HRD: 218 236 xWriteSEIBspHrd(*static_cast<const SEIBspHrd*>(&sei), sps, nestingSei); 237 break; 238 #endif 239 #if Q0078_ADD_LAYER_SETS 240 case SEI::OUTPUT_LAYER_SET_NESTING: 241 xWriteSEIOutputLayerSetNesting(bs, *static_cast<const SEIOutputLayerSetNesting*>(&sei), vps, sps); 242 break; 243 case SEI::VPS_REWRITING: 244 xWriteSEIVPSRewriting(*static_cast<const SEIVPSRewriting*>(&sei)); 245 break; 246 #endif 247 #if Q0189_TMVP_CONSTRAINTS 248 case SEI::TMVP_CONSTRAINTS: 249 xWriteSEITMVPConstraints(*static_cast<const SEITMVPConstrains*>(&sei)); 250 break; 251 #endif 252 #if Q0247_FRAME_FIELD_INFO 253 case SEI::FRAME_FIELD_INFO: 254 xWriteSEIFrameFieldInfo(*static_cast<const SEIFrameFieldInfo*>(&sei)); 219 255 break; 220 256 #endif … … 575 611 xWriteByteAlign(); 576 612 } 577 613 #if P0050_KNEE_FUNCTION_SEI 614 Void SEIWriter::xWriteSEIKneeFunctionInfo(const SEIKneeFunctionInfo &sei) 615 { 616 WRITE_UVLC( sei.m_kneeId, "knee_function_id" ); 617 WRITE_FLAG( sei.m_kneeCancelFlag, "knee_function_cancel_flag" ); 618 if ( !sei.m_kneeCancelFlag ) 619 { 620 WRITE_FLAG( sei.m_kneePersistenceFlag, "knee_function_persistence_flag" ); 621 WRITE_FLAG( sei.m_kneeMappingFlag, "mapping_flag" ); 622 WRITE_CODE( (UInt)sei.m_kneeInputDrange , 32, "input_d_range" ); 623 WRITE_CODE( (UInt)sei.m_kneeInputDispLuminance, 32, "input_disp_luminance" ); 624 WRITE_CODE( (UInt)sei.m_kneeOutputDrange, 32, "output_d_range" ); 625 WRITE_CODE( (UInt)sei.m_kneeOutputDispLuminance, 32, "output_disp_luminance" ); 626 WRITE_UVLC( sei.m_kneeNumKneePointsMinus1, "num_knee_points_minus1" ); 627 for(Int i = 0; i <= sei.m_kneeNumKneePointsMinus1; i++ ) 628 { 629 WRITE_CODE( (UInt)sei.m_kneeInputKneePoint[i], 10,"input_knee_point" ); 630 WRITE_CODE( (UInt)sei.m_kneeOutputKneePoint[i], 10, "output_knee_point" ); 631 } 632 } 633 xWriteByteAlign(); 634 } 635 #endif 578 636 #if Q0074_SEI_COLOR_MAPPING 579 637 Void SEIWriter::xWriteSEIColorMappingInfo(const SEIColorMappingInfo& sei) … … 815 873 #endif 816 874 875 #if Q0189_TMVP_CONSTRAINTS 876 Void SEIWriter::xWriteSEITMVPConstraints (const SEITMVPConstrains &sei) 877 { 878 WRITE_UVLC( sei.prev_pics_not_used_flag , "prev_pics_not_used_flag" ); 879 WRITE_UVLC( sei.no_intra_layer_col_pic_flag , "no_intra_layer_col_pic_flag" ); 880 xWriteByteAlign(); 881 } 882 #endif 883 884 #if Q0247_FRAME_FIELD_INFO 885 Void SEIWriter::xWriteSEIFrameFieldInfo (const SEIFrameFieldInfo &sei) 886 { 887 WRITE_CODE( sei.m_ffinfo_picStruct , 4, "ffinfo_pic_struct" ); 888 WRITE_CODE( sei.m_ffinfo_sourceScanType, 2, "ffinfo_source_scan_type" ); 889 WRITE_FLAG( sei.m_ffinfo_duplicateFlag ? 1 : 0, "ffinfo_duplicate_flag" ); 890 xWriteByteAlign(); 891 } 892 #endif 893 817 894 #if O0164_MULTI_LAYER_HRD 818 895 Void SEIWriter::xWriteSEIBspNesting(TComBitIf& bs, const SEIBspNesting &sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei) … … 893 970 for (UInt i = 0; i <= sei.m_seiNumBitstreamPartitionsMinus1[lsIdx]; i++) 894 971 { 972 #if HRD_BPB 973 UInt nl=0; 895 974 for (UInt j = 0; j < sei.m_vpsMaxLayers; j++) 896 975 { 897 976 if (sei.m_layerIdIncludedFlag[lsIdx][j]) 898 977 { 978 nl++; 979 } 980 } 981 for (UInt j = 0; j < nl; j++) 982 { 983 #else 984 for (UInt j = 0; j < sei.m_vpsMaxLayers; j++) 985 { 986 if (sei.m_layerIdIncludedFlag[lsIdx][j]) 987 { 988 #endif 899 989 WRITE_FLAG( sei.m_seiLayerInBspFlag[lsIdx][i][j], "sei_layer_in_bsp_flag[lsIdx][i][j]" ); 900 990 } 901 } 991 #if !HRD_BPB 992 } 993 #endif 902 994 } 903 995 WRITE_UVLC( sei.m_seiNumBspSchedCombinationsMinus1[lsIdx], "sei_num_bsp_sched_combinations_minus1[i]"); … … 988 1080 #endif 989 1081 1082 #if Q0078_ADD_LAYER_SETS 1083 1084 Void SEIWriter::xWriteSEIOutputLayerSetNesting(TComBitIf& bs, const SEIOutputLayerSetNesting &sei, TComVPS *vps, TComSPS *sps) 1085 { 1086 WRITE_FLAG(sei.m_olsFlag, "ols_flag"); 1087 WRITE_UVLC(sei.m_numOlsIndicesMinus1, "num_ols_indices_minus1"); 1088 1089 for (Int i = 0; i <= sei.m_numOlsIndicesMinus1; i++) 1090 { 1091 WRITE_UVLC(sei.m_olsIdx[i], "ols_idx[i]"); 1092 } 1093 1094 while (m_pcBitIf->getNumberOfWrittenBits() % 8 != 0) 1095 { 1096 WRITE_FLAG(0, "ols_nesting_zero_bit"); 1097 } 1098 1099 // write nested SEI messages 1100 for (SEIMessages::const_iterator it = sei.m_nestedSEIs.begin(); it != sei.m_nestedSEIs.end(); it++) 1101 { 1102 writeSEImessage(bs, *(*it), vps, sps); 1103 } 1104 } 1105 1106 Void SEIWriter::xWriteSEIVPSRewriting(const SEIVPSRewriting &sei) 1107 { 1108 //sei.nalu-> 1109 } 1110 1111 #endif 1112 990 1113 #endif //SVC_EXTENSION 991 1114 -
trunk/source/Lib/TLibEncoder/SEIwrite.h
r713 r815 72 72 Void xWriteSEIGradualDecodingRefreshInfo(const SEIGradualDecodingRefreshInfo &sei); 73 73 Void xWriteSEIToneMappingInfo(const SEIToneMappingInfo& sei); 74 #if P0050_KNEE_FUNCTION_SEI 75 Void xWriteSEIKneeFunctionInfo(const SEIKneeFunctionInfo &sei); 76 #endif 74 77 #if Q0074_SEI_COLOR_MAPPING 75 78 Void xWriteSEIColorMappingInfo(const SEIColorMappingInfo& sei); … … 92 95 Void xWriteSEISubBitstreamProperty(const SEISubBitstreamProperty &sei); 93 96 #endif 97 #if Q0189_TMVP_CONSTRAINTS 98 Void xWriteSEITMVPConstraints (const SEITMVPConstrains &sei); 99 #endif 100 #if Q0247_FRAME_FIELD_INFO 101 Void xWriteSEIFrameFieldInfo (const SEIFrameFieldInfo &sei); 102 #endif 94 103 #if O0164_MULTI_LAYER_HRD 95 104 Void xWriteSEIBspNesting(TComBitIf& bs, const SEIBspNesting &sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei); … … 98 107 Void xCodeHrdParameters( TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 ); 99 108 #endif 109 #if Q0078_ADD_LAYER_SETS 110 Void xWriteSEIOutputLayerSetNesting(TComBitIf& bs, const SEIOutputLayerSetNesting &sei, TComVPS *vps, TComSPS *sps); 111 Void xWriteSEIVPSRewriting(const SEIVPSRewriting &sei); 112 #endif 100 113 #endif //SVC_EXTENSION 101 114 }; -
trunk/source/Lib/TLibEncoder/TEnc3DAsymLUT.cpp
r713 r815 276 276 Int nStrideILRY = pRecPic->getStride(); 277 277 Int nStrideILRC = pRecPic->getCStride(); 278 Int nWidth = m_pDsOrigPic->getWidth(); //should exclude the padding;279 Int nHeight= m_pDsOrigPic->getHeight();280 278 xReset3DArray( m_pColorInfo , xGetYSize() , xGetUSize() , xGetVSize() ); 281 279 xReset3DArray( m_pColorInfoC , xGetYSize() , xGetUSize() , xGetVSize() ); 282 280 283 281 //alignment padding 284 Pel *pU = pRecPic->getCbAddr(); 285 Pel *pV = pRecPic->getCrAddr(); 286 pU[(nWidth>>1)] = pU[(nWidth>>1)-1]; 287 pV[(nWidth>>1)] = pV[(nWidth>>1)-1]; 288 memcpy(pU-nStrideILRC, pU, ((nWidth>>1)+1)*sizeof(Pel)); 289 memcpy(pV-nStrideILRC, pV, ((nWidth>>1)+1)*sizeof(Pel)); 290 pU += nStrideILRC+ (nWidth>>1); 291 pV += nStrideILRC+ (nWidth>>1); 292 293 for( Int y = 1 ; y < (nHeight>>1) ; y ++ ) 294 { 295 *pU = pU[-1]; 296 *pV = pV[-1]; 297 pU += nStrideILRC; 298 pV += nStrideILRC; 299 } 300 memcpy(pU-(nWidth>>1), pU-(nWidth>>1)-nStrideILRC, ((nWidth>>1)+1)*sizeof(Pel)); 301 memcpy(pV-(nWidth>>1), pV-(nWidth>>1)-nStrideILRC, ((nWidth>>1)+1)*sizeof(Pel)); 302 303 for( Int i = 0 ; i < nHeight ; i++ ) 304 { 305 Int posSrcY = i * nStrideSrcY; 306 Int posIRLY = i * nStrideILRY; 307 Int posSrcUV = ( i >> 1 ) * nStrideSrcC; 308 Int posIRLUV = ( i >> 1 ) * nStrideILRC; 309 for( Int j = 0 ; j < nWidth ; j++ , posSrcY++ , posIRLY++ , posSrcUV += !( j & 0x01 ) , posIRLUV += !( j & 0x01 ) ) 282 pRecPic->setBorderExtension( false ); 283 pRecPic->extendPicBorder(); 284 285 TComSlice * pSlice = pCurPic->getSlice(pCurPic->getCurrSliceIdx()); 286 UInt refLayerId = pSlice->getVPS()->getRefLayerId(pSlice->getLayerId(), refLayerIdc); 287 const Window &scalEL = pSlice->getSPS()->getScaledRefLayerWindowForLayer(refLayerId); 288 TComPicYuv *pcRecPicBL = pSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(); 289 // borders of down-sampled picture 290 Int leftDS = (scalEL.getWindowLeftOffset()*g_posScalingFactor[refLayerIdc][0]+(1<<15))>>16; 291 Int rightDS = pcRecPicBL->getWidth() - 1 + (((scalEL.getWindowRightOffset())*g_posScalingFactor[refLayerIdc][0]+(1<<15))>>16); 292 Int topDS = (((scalEL.getWindowTopOffset())*g_posScalingFactor[refLayerIdc][1]+(1<<15))>>16); 293 Int bottomDS = pcRecPicBL->getHeight() - 1 + (((scalEL.getWindowBottomOffset())*g_posScalingFactor[refLayerIdc][1]+(1<<15))>>16); 294 // overlapped region 295 Int left = max( 0 , leftDS ); 296 Int right = min( pcRecPicBL->getWidth() - 1 , rightDS ); 297 Int top = max( 0 , topDS ); 298 Int bottom = min( pcRecPicBL->getHeight() - 1 , bottomDS ); 299 // since we do data collection only for overlapped region, the border extension is good enough 300 301 for( Int i = top ; i <= bottom ; i++ ) 302 { 303 Int iDS = i-topDS; 304 Int jDS = left-leftDS; 305 Int posSrcY = iDS * nStrideSrcY + jDS; 306 Int posIRLY = i * nStrideILRY + left; 307 Int posSrcUV = ( iDS >> 1 ) * nStrideSrcC + (jDS>>1); 308 Int posIRLUV = ( i >> 1 ) * nStrideILRC + (left>>1); 309 for( Int j = left ; j <= right ; j++ , posSrcY++ , posIRLY++ , posSrcUV += !( j & 0x01 ) , posIRLUV += !( j & 0x01 ) ) 310 310 { 311 311 Int Y = pSrcY[posSrcY]; -
trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
r713 r815 256 256 WRITE_FLAG( pcPPS->getSliceHeaderExtensionPresentFlag() ? 1 : 0, "slice_segment_header_extension_present_flag"); 257 257 #if P0166_MODIFIED_PPS_EXTENSION 258 WRITE_FLAG( 1, "pps_extension_flag" ); 259 if( 1 ) //pps_extension_flag 258 WRITE_FLAG( pcPPS->getExtensionFlag() ? 1 : 0, "pps_extension_flag" ); 259 260 if( pcPPS->getExtensionFlag() ) 260 261 { 261 262 #if !POC_RESET_IDC … … 638 639 } 639 640 640 #if SPS_EXTENSION 641 WRITE_FLAG( 1, "sps_extension_flag" ); 642 if( 1 ) // if( sps_extension_flag ) 641 #if SVC_EXTENSION 642 WRITE_FLAG( pcSPS->getExtensionFlag() ? 1 : 0, "sps_extension_flag" ); 643 644 if( pcSPS->getExtensionFlag() ) 643 645 { 644 646 #if O0142_CONDITIONAL_SPS_EXTENSION … … 661 663 #endif 662 664 } 663 #if SPS_EXTENSION 665 666 #if SVC_EXTENSION 664 667 Void TEncCavlc::codeSPSExtension( TComSPS* pcSPS ) 665 668 { … … 688 691 } 689 692 } 690 #endif 693 #endif //SVC_EXTENSION 694 691 695 Void TEncCavlc::codeVPS( TComVPS* pcVPS ) 692 696 { … … 703 707 WRITE_CODE( pcVPS->getVPSId(), 4, "vps_video_parameter_set_id" ); 704 708 WRITE_CODE( 3, 2, "vps_reserved_three_2bits" ); 705 #if VPS_RENAME709 #if SVC_EXTENSION 706 710 WRITE_CODE( pcVPS->getMaxLayers() - 1, 6, "vps_max_layers_minus1" ); 707 711 #else … … 734 738 } 735 739 736 #if VPS_RENAME740 #if SVC_EXTENSION 737 741 assert( pcVPS->getNumHrdParameters() <= MAX_VPS_LAYER_SETS_PLUS1 ); 738 742 assert( pcVPS->getMaxLayerId() < MAX_VPS_LAYER_ID_PLUS1 ); … … 741 745 #endif 742 746 WRITE_CODE( pcVPS->getMaxLayerId(), 6, "vps_max_layer_id" ); 747 #if Q0078_ADD_LAYER_SETS 748 WRITE_UVLC(pcVPS->getVpsNumLayerSetsMinus1(), "vps_num_layer_sets_minus1"); 749 for (UInt opsIdx = 1; opsIdx <= pcVPS->getVpsNumLayerSetsMinus1(); opsIdx++) 750 #else 743 751 WRITE_UVLC( pcVPS->getNumLayerSets() - 1, "vps_num_layer_sets_minus1" ); 744 for( UInt opsIdx = 1; opsIdx <= ( pcVPS->getNumLayerSets() - 1 ); opsIdx ++ ) 752 for (UInt opsIdx = 1; opsIdx <= (pcVPS->getNumLayerSets() - 1); opsIdx++) 753 #endif 745 754 { 746 755 // Operation point set … … 798 807 } 799 808 } 800 #if VPS_EXTNS809 #if SVC_EXTENSION 801 810 // When MaxLayersMinus1 is greater than 0, vps_extension_flag shall be equal to 1. 802 811 if( pcVPS->getMaxLayers() > 1 ) … … 832 841 833 842 #if SVC_EXTENSION 834 #if VPS_EXTNS835 843 Void TEncCavlc::codeVPSExtension (TComVPS *vps) 836 844 { … … 846 854 #if !P0307_REMOVE_VPS_VUI_OFFSET 847 855 #if O0109_MOVE_VPS_VUI_FLAG 848 #if !VPS_VUI849 WRITE_FLAG( 0, "vps_vui_present_flag" );850 vps->setVpsVuiPresentFlag(false);851 #else852 856 WRITE_FLAG( 1, "vps_vui_present_flag" ); 853 857 vps->setVpsVuiPresentFlag(true); 854 #endif855 858 if ( vps->getVpsVuiPresentFlag() ) 856 859 { … … 879 882 } 880 883 881 #if SPL_FLG_CHK 884 // The value of dimBitOffset[ NumScalabilityTypes ] is set equal to 6. 882 885 if(vps->getSplittingFlag()) 883 886 { … … 889 892 assert(splDimSum<=6); 890 893 } 891 #endif892 894 893 895 WRITE_FLAG( vps->getNuhLayerIdPresentFlag(), "vps_nuh_layer_id_present_flag" ); … … 957 959 } 958 960 #endif 959 #if N0120_MAX_TID_REF_PRESENT_FLAG960 961 WRITE_FLAG( vps->getMaxTidRefPresentFlag(), "max_tid_ref_present_flag"); 961 962 if (vps->getMaxTidRefPresentFlag()) … … 976 977 } 977 978 } 978 #else 979 for( i = 0; i < vps->getMaxLayers() - 1; i++) 980 { 981 #if O0225_MAX_TID_FOR_REF_LAYERS 982 for( j = i+1; j <= vps->getMaxLayers() - 1; j++) 983 { 984 if(vps->getDirectDependencyFlag(j, i)) 985 { 986 WRITE_CODE(vps->getMaxTidIlRefPicsPlus1(i,j), 3, "max_tid_il_ref_pics_plus1[i][j]" ); 987 } 988 } 989 #else 990 WRITE_CODE(vps->getMaxTidIlRefPicsPlus1(i), 3, "max_tid_il_ref_pics_plus1[i]" ); 991 #endif 992 } 993 #endif 994 #if ILP_SSH_SIG 995 WRITE_FLAG( vps->getIlpSshSignalingEnabledFlag(), "all_ref_layers_active_flag" ); 996 #endif 979 WRITE_FLAG( vps->getIlpSshSignalingEnabledFlag(), "all_ref_layers_active_flag" ); 997 980 #if VPS_EXTN_PROFILE_INFO 998 981 // Profile-tier-level signalling … … 1016 999 #endif 1017 1000 1001 #if Q0078_ADD_LAYER_SETS 1002 if (vps->getNumIndependentLayers() > 1) 1003 { 1004 WRITE_UVLC( vps->getNumAddLayerSets(), "num_add_layer_sets" ); 1005 for (i = 0; i < vps->getNumAddLayerSets(); i++) 1006 { 1007 for (j = 1; j < vps->getNumIndependentLayers(); j++) 1008 { 1009 int len = 1; 1010 while ((1 << len) < (vps->getNumLayersInTreePartition(j) + 1)) 1011 { 1012 len++; 1013 } 1014 WRITE_CODE(vps->getHighestLayerIdxPlus1(i, j), len, "highest_layer_idx_plus1[i][j]"); 1015 } 1016 } 1017 } 1018 #endif 1019 1018 1020 #if !VPS_EXTN_UEV_CODING 1019 1021 Int numOutputLayerSets = vps->getNumOutputLayerSets() ; … … 1027 1029 Int numAddOutputLayerSets = numOutputLayerSets - (Int)vps->getNumLayerSets(); 1028 1030 1029 // The value of num_add_o utput_layer_sets shall be in the range of 0 to 1023, inclusive.1031 // The value of num_add_olss shall be in the range of 0 to 1023, inclusive. 1030 1032 assert( numAddOutputLayerSets >= 0 && numAddOutputLayerSets < 1024 ); 1031 1033 … … 1033 1035 if( vps->getNumLayerSets() > 1 ) 1034 1036 { 1035 WRITE_UVLC( numAddOutputLayerSets, "num_add_o utput_layer_sets" );1036 WRITE_CODE( vps->getDefaultTargetOutputLayerIdc(), 2, "default_ target_output_layer_idc" );1037 WRITE_UVLC( numAddOutputLayerSets, "num_add_olss" ); 1038 WRITE_CODE( vps->getDefaultTargetOutputLayerIdc(), 2, "default_output_layer_idc" ); 1037 1039 } 1038 1040 #else … … 1065 1067 numBits++; 1066 1068 } 1067 WRITE_CODE( vps->getOutputLayerSetIdx(i) - 1, numBits, " output_layer_set_idx_minus1");1069 WRITE_CODE( vps->getOutputLayerSetIdx(i) - 1, numBits, "layer_set_idx_for_ols_minus1"); 1068 1070 #if P0295_DEFAULT_OUT_LAYER_IDC 1069 1071 } 1072 #if Q0078_ADD_LAYER_SETS 1073 if ( i > vps->getVpsNumLayerSetsMinus1() || vps->getDefaultTargetOutputLayerIdc() >= 2 ) //Instead of == 2, >= 2 is used to follow the agreement that value 3 should be interpreted as 2 1074 #else 1070 1075 if ( i > (vps->getNumLayerSets() - 1) || vps->getDefaultTargetOutputLayerIdc() >= 2 ) //Instead of == 2, >= 2 is used to follow the agreement that value 3 should be interpreted as 2 1076 #endif 1071 1077 { 1072 1078 #endif … … 1217 1223 WRITE_FLAG(vps->getPhaseAlignFlag(), "cross_layer_phase_alignment_flag" ); 1218 1224 #endif 1219 #if N0147_IRAP_ALIGN_FLAG &&!IRAP_ALIGN_FLAG_IN_VPS_VUI1225 #if !IRAP_ALIGN_FLAG_IN_VPS_VUI 1220 1226 WRITE_FLAG(vps->getCrossLayerIrapAlignFlag(), "cross_layer_irap_aligned_flag"); 1221 1227 #endif … … 1286 1292 1287 1293 #if !O0109_MOVE_VPS_VUI_FLAG 1288 #if !VPS_VUI1289 WRITE_FLAG( 0, "vps_vui_present_flag" );1290 #else1291 1294 WRITE_FLAG( 1, "vps_vui_present_flag" ); 1292 1295 if(1) // Should be conditioned on the value of vps_vui_present_flag … … 1303 1306 codeVPSVUI(vps); 1304 1307 } 1305 #endif1306 1308 #else 1307 1309 #if P0307_REMOVE_VPS_VUI_OFFSET … … 1326 1328 #endif // 0109_MOVE_VPS_FLAG 1327 1329 } 1328 #endif 1330 1329 1331 #if REPN_FORMAT_IN_VPS 1330 1332 Void TEncCavlc::codeRepFormat( RepFormat *repFormat ) … … 1371 1373 { 1372 1374 #if DPB_PARAMS_MAXTLAYERS 1375 #if BITRATE_PICRATE_SIGNALLING 1376 Int * MaxSubLayersInLayerSetMinus1 = new Int[vps->getNumLayerSets()]; 1377 for(Int i = 0; i < vps->getNumLayerSets(); i++) 1378 #else 1373 1379 Int * MaxSubLayersInLayerSetMinus1 = new Int[vps->getNumOutputLayerSets()]; 1374 1380 for(Int i = 1; i < vps->getNumOutputLayerSets(); i++) 1381 #endif 1375 1382 { 1376 1383 UInt maxSLMinus1 = 0; … … 1380 1387 Int optLsIdx = i; 1381 1388 #endif 1389 #if BITRATE_PICRATE_SIGNALLING 1390 optLsIdx = i; 1391 #endif 1382 1392 for(Int k = 0; k < vps->getNumLayersInIdList(optLsIdx); k++ ) { 1383 1393 Int lId = vps->getLayerSetLayerIdList(optLsIdx, k); … … 1385 1395 } 1386 1396 MaxSubLayersInLayerSetMinus1[ i ] = maxSLMinus1; 1387 } 1388 #endif 1397 #if BITRATE_PICRATE_SIGNALLING 1398 vps->setMaxSLayersInLayerSetMinus1(i,MaxSubLayersInLayerSetMinus1[ i ]); 1399 #endif 1400 } 1401 #endif 1402 1389 1403 1390 1404 for(Int i = 1; i < vps->getNumOutputLayerSets(); i++) … … 1395 1409 WRITE_FLAG( vps->getSubLayerFlagInfoPresentFlag( i ), "sub_layer_flag_info_present_flag[i]"); 1396 1410 #if DPB_PARAMS_MAXTLAYERS 1411 #if BITRATE_PICRATE_SIGNALLING 1412 for(Int j = 0; j <= MaxSubLayersInLayerSetMinus1[ vps->getOutputLayerSetIdx( i ) ]; j++) 1413 #else 1397 1414 for(Int j = 0; j <= MaxSubLayersInLayerSetMinus1[ i ]; j++) 1415 #endif 1398 1416 #else 1399 1417 for(Int j = 0; j < vps->getMaxTLayers(); j++) … … 1407 1425 { 1408 1426 #if CHANGE_NUMSUBDPB_IDX 1427 #if RESOLUTION_BASED_DPB 1409 1428 for(Int k = 0; k < vps->getNumSubDpbs(layerSetIdxForOutputLayerSet); k++) 1429 #else 1430 for(Int k = 0; k < vps->getNumLayersInIdList( layerSetIdxForOutputLayerSet ); k++) 1431 #endif 1410 1432 #else 1411 1433 for(Int k = 0; k < vps->getNumSubDpbs(i); k++) … … 1430 1452 } 1431 1453 #endif 1432 #if VPS_VUI 1454 1433 1455 Void TEncCavlc::codeVPSVUI (TComVPS *vps) 1434 1456 { … … 1451 1473 } 1452 1474 #endif 1453 #if VPS_VUI_BITRATE_PICRATE1454 1475 WRITE_FLAG( vps->getBitRatePresentVpsFlag(), "bit_rate_present_vps_flag" ); 1455 1476 WRITE_FLAG( vps->getPicRatePresentVpsFlag(), "pic_rate_present_vps_flag" ); … … 1457 1478 if( vps->getBitRatePresentVpsFlag() || vps->getPicRatePresentVpsFlag() ) 1458 1479 { 1480 #if Q0078_ADD_LAYER_SETS 1481 for( i = 0; i <= vps->getVpsNumLayerSetsMinus1(); i++ ) 1482 #else 1459 1483 for( i = 0; i < vps->getNumLayerSets(); i++ ) 1460 { 1484 #endif 1485 { 1486 #if BITRATE_PICRATE_SIGNALLING 1487 for( j = 0; j <= vps->getMaxSLayersInLayerSetMinus1(i); j++ ) 1488 #else 1461 1489 for( j = 0; j < vps->getMaxTLayers(); j++ ) 1490 #endif 1462 1491 { 1463 1492 if( vps->getBitRatePresentVpsFlag() ) … … 1482 1511 } 1483 1512 } 1484 #endif1485 1513 #if VPS_VUI_VIDEO_SIGNAL_MOVE 1486 1514 WRITE_FLAG( vps->getVideoSigPresentVpsFlag(), "video_signal_info_idx_present_flag" ); … … 1519 1547 } 1520 1548 #endif 1521 #if TILE_BOUNDARY_ALIGNED_FLAG 1549 1522 1550 for(i = 1; i < vps->getMaxLayers(); i++) 1523 1551 { … … 1534 1562 } 1535 1563 } 1536 #endif1537 1564 #if VPS_VUI_TILES_NOT_IN_USE__FLAG 1538 1565 } … … 1627 1654 codeHrdParameters(vps->getBspHrd(i), i==0 ? 1 : vps->getBspCprmsPresentFlag(i), vps->getMaxTLayers()-1); 1628 1655 } 1656 #if Q0078_ADD_LAYER_SETS 1657 for( UInt h = 1; h <= vps->getVpsNumLayerSetsMinus1(); h++ ) 1658 #else 1629 1659 for( UInt h = 1; h <= (vps->getNumLayerSets()-1); h++ ) 1660 #endif 1630 1661 { 1631 1662 WRITE_UVLC( vps->getNumBitstreamPartitions(h), "num_bitstream_partitions[i]"); … … 1642 1673 if (vps->getNumBitstreamPartitions(h)) 1643 1674 { 1675 #if Q0182_MULTI_LAYER_HRD_UPDATE 1676 WRITE_UVLC(vps->getNumBspSchedCombinations(h) - 1, "num_bsp_sched_combinations_minus1[h]"); 1677 #else 1644 1678 WRITE_UVLC( vps->getNumBspSchedCombinations(h), "num_bsp_sched_combinations[h]"); 1679 #endif 1645 1680 for( i = 0; i < vps->getNumBspSchedCombinations(h); i++ ) 1646 1681 { … … 1673 1708 #endif 1674 1709 } 1675 #endif1676 1710 #endif //SVC_EXTENSION 1677 1711 … … 1811 1845 } 1812 1846 #else 1847 #if POC_RESET_IDC_ENCODER 1848 Int picOrderCntLSB; 1849 if( pcSlice->getPocResetIdc() == 2 ) // i.e. the LSB is reset 1850 { 1851 picOrderCntLSB = pcSlice->getPicOrderCntLsb(); // This will be the LSB value w.r.t to the previous POC reset period. 1852 } 1853 else 1854 { 1855 picOrderCntLSB = (pcSlice->getPOC() + (1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1); 1856 } 1857 #else 1813 1858 Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1); 1859 #endif 1814 1860 #endif 1815 1861 WRITE_CODE( picOrderCntLSB, pcSlice->getSPS()->getBitsForPOC(), "pic_order_cnt_lsb"); … … 1940 1986 1941 1987 #if SVC_EXTENSION 1942 #if ILP_SSH_SIG1943 #if ILP_SSH_SIG_FIX1944 1988 if((pcSlice->getLayerId() > 0) && !(pcSlice->getVPS()->getIlpSshSignalingEnabledFlag()) && (pcSlice->getNumILRRefIdx() > 0) ) 1945 #else1946 if((pcSlice->getLayerId() > 0) && pcSlice->getVPS()->getIlpSshSignalingEnabledFlag() && (pcSlice->getNumILRRefIdx() > 0) )1947 #endif1948 #else1949 if((pcSlice->getLayerId() > 0) && (pcSlice->getNumILRRefIdx() > 0) )1950 #endif1951 1989 { 1952 1990 WRITE_FLAG(pcSlice->getInterLayerPredEnabledFlag(),"inter_layer_pred_enabled_flag"); … … 1964 2002 WRITE_CODE(pcSlice->getActiveNumILRRefIdx() - 1, numBits,"num_inter_layer_ref_pics_minus1"); 1965 2003 } 1966 #if ILP_NUM_REF_CHK 2004 1967 2005 if( pcSlice->getNumILRRefIdx() != pcSlice->getActiveNumILRRefIdx() ) 1968 2006 { 1969 #endif 1970 for(Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ )1971 {1972 WRITE_CODE(pcSlice->getInterLayerPredLayerIdc(i),numBits,"inter_layer_pred_layer_idc[i]");2007 for(Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ ) 2008 { 2009 WRITE_CODE(pcSlice->getInterLayerPredLayerIdc(i),numBits,"inter_layer_pred_layer_idc[i]"); 2010 } 1973 2011 } 1974 #if ILP_NUM_REF_CHK1975 }1976 #endif1977 2012 } 1978 2013 } … … 2294 2329 { 2295 2330 Int tmpBitsBeforeWriting = getNumberOfWrittenBits(); 2331 Int maxPocLsb = 1 << slice->getSPS()->getBitsForPOC(); 2296 2332 if(slice->getPPS()->getSliceHeaderExtensionPresentFlag()) 2297 2333 { … … 2336 2372 { 2337 2373 UInt lengthVal = 1; 2338 UInt tempVal = slice->getPocMsbVal() + 1;2374 UInt tempVal = (slice->getPocMsbVal() / maxPocLsb) + 1; 2339 2375 assert ( tempVal ); 2340 2376 while( 1 != tempVal ) … … 2373 2409 if( slice->getPocMsbValPresentFlag() ) 2374 2410 { 2375 WRITE_UVLC( slice->getPocMsbVal(), "poc_msb_val" ); 2411 assert( slice->getPocMsbVal() % maxPocLsb == 0 ); 2412 WRITE_UVLC( slice->getPocMsbVal() / maxPocLsb, "poc_msb_val" ); 2376 2413 } 2377 2414 for (Int i = 0; i < shExtnAdditionalBits; i++) 2378 2415 { 2416 #if Q0146_SSH_EXT_DATA_BIT 2417 WRITE_FLAG( 1, "slice_segment_header_extension_data_bit"); 2418 #else 2379 2419 WRITE_FLAG( 1, "slice_segment_header_extension_reserved_bit"); 2420 #endif 2380 2421 } 2381 2422 } -
trunk/source/Lib/TLibEncoder/TEncCavlc.h
r713 r815 159 159 Void codeDFSvlc ( Int iCode, const Char *pSymbolName ); 160 160 161 #if SPS_EXTENSION 162 Void codeSPSExtension ( TComSPS* pcSPS ); 163 #if VPS_EXTNS 164 Void codeVPSExtension ( TComVPS* pcVPS ); 165 #endif 166 #if VPS_VUI 167 Void codeVPSVUI (TComVPS *vps); 168 #endif 161 #if SVC_EXTENSION 162 Void codeSPSExtension ( TComSPS* pcSPS ); 163 Void codeVPSExtension ( TComVPS* pcVPS ); 164 Void codeVPSVUI ( TComVPS *vps ); 169 165 #if REPN_FORMAT_IN_VPS 170 Void codeRepFormat 166 Void codeRepFormat ( RepFormat *repFormat ); 171 167 #endif 172 168 #if VPS_DPB_SIZE_TABLE 173 Void codeVpsDpbSizeTable 169 Void codeVpsDpbSizeTable (TComVPS *vps); 174 170 #endif 175 171 #if Q0048_CGS_3D_ASYMLUT -
trunk/source/Lib/TLibEncoder/TEncCfg.h
r713 r815 248 248 Int* m_codedPivotValue; 249 249 Int* m_targetPivotValue; 250 #if P0050_KNEE_FUNCTION_SEI 251 Bool m_kneeSEIEnabled; 252 Int m_kneeSEIId; 253 Bool m_kneeSEICancelFlag; 254 Bool m_kneeSEIPersistenceFlag; 255 Bool m_kneeSEIMappingFlag; 256 Int m_kneeSEIInputDrange; 257 Int m_kneeSEIInputDispLuminance; 258 Int m_kneeSEIOutputDrange; 259 Int m_kneeSEIOutputDispLuminance; 260 Int m_kneeSEINumKneePointsMinus1; 261 Int* m_kneeSEIInputKneePoint; 262 Int* m_kneeSEIOutputKneePoint; 263 #endif 250 264 #if Q0074_SEI_COLOR_MAPPING 251 265 Char* m_seiColorMappingFile; … … 262 276 Int m_SOPDescriptionSEIEnabled; 263 277 Int m_scalableNestingSEIEnabled; 278 #if Q0189_TMVP_CONSTRAINTS 279 Int m_TMVPConstraintsSEIEnabled; 280 #endif 264 281 //====== Weighted Prediction ======== 265 282 Bool m_useWeightedPred; //< Use of Weighting Prediction (P_SLICE) … … 348 365 Bool m_motionPredEnabledFlag[MAX_VPS_LAYER_ID_PLUS1]; 349 366 #endif 350 #if N0120_MAX_TID_REF_CFG351 367 Int m_maxTidIlRefPicsPlus1; 352 #endif353 368 #if AUXILIARY_PICTURES 354 369 ChromaFormat m_chromaFormatIDC; … … 670 685 Void setTMISEIExtendedWhiteLevelLumaCodeValue(Int b) { m_extendedWhiteLevelLumaCodeValue =b; } 671 686 Int getTMISEIExtendedWhiteLevelLumaCodeValue() { return m_extendedWhiteLevelLumaCodeValue; } 687 #if P0050_KNEE_FUNCTION_SEI 688 Void setKneeSEIEnabled(Int b) { m_kneeSEIEnabled = b; } 689 Bool getKneeSEIEnabled() { return m_kneeSEIEnabled; } 690 Void setKneeSEIId(Int b) { m_kneeSEIId = b; } 691 Int getKneeSEIId() { return m_kneeSEIId; } 692 Void setKneeSEICancelFlag(Bool b) { m_kneeSEICancelFlag=b; } 693 Bool getKneeSEICancelFlag() { return m_kneeSEICancelFlag; } 694 Void setKneeSEIPersistenceFlag(Bool b) { m_kneeSEIPersistenceFlag = b; } 695 Bool getKneeSEIPersistenceFlag() { return m_kneeSEIPersistenceFlag; } 696 Void setKneeSEIMappingFlag(Bool b) { m_kneeSEIMappingFlag = b; } 697 Bool getKneeSEIMappingFlag() { return m_kneeSEIMappingFlag; } 698 Void setKneeSEIInputDrange(Int b) { m_kneeSEIInputDrange = b; } 699 Int getKneeSEIInputDrange() { return m_kneeSEIInputDrange; } 700 Void setKneeSEIInputDispLuminance(Int b) { m_kneeSEIInputDispLuminance = b; } 701 Int getKneeSEIInputDispLuminance() { return m_kneeSEIInputDispLuminance; } 702 Void setKneeSEIOutputDrange(Int b) { m_kneeSEIOutputDrange = b; } 703 Int getKneeSEIOutputDrange() { return m_kneeSEIOutputDrange; } 704 Void setKneeSEIOutputDispLuminance(Int b) { m_kneeSEIOutputDispLuminance = b; } 705 Int getKneeSEIOutputDispLuminance() { return m_kneeSEIOutputDispLuminance; } 706 Void setKneeSEINumKneePointsMinus1(Int b) { m_kneeSEINumKneePointsMinus1 = b; } 707 Int getKneeSEINumKneePointsMinus1() { return m_kneeSEINumKneePointsMinus1; } 708 Void setKneeSEIInputKneePoint(Int *p) { m_kneeSEIInputKneePoint = p; } 709 Int* getKneeSEIInputKneePoint() { return m_kneeSEIInputKneePoint; } 710 Void setKneeSEIOutputKneePoint(Int *p) { m_kneeSEIOutputKneePoint = p; } 711 Int* getKneeSEIOutputKneePoint() { return m_kneeSEIOutputKneePoint; } 712 #endif 672 713 #if Q0074_SEI_COLOR_MAPPING 673 714 Void setColorMappingInfoSEIFile( Char* nameFile ) { m_seiColorMappingFile = nameFile; } … … 695 736 Int getSOPDescriptionSEIEnabled() { return m_SOPDescriptionSEIEnabled; } 696 737 Void setScalableNestingSEIEnabled(Int b) { m_scalableNestingSEIEnabled = b; } 738 #if Q0189_TMVP_CONSTRAINTS 739 void setTMVPConstraintsSEIEnabled(Int b) { m_TMVPConstraintsSEIEnabled = b; } 740 #endif 697 741 Int getScalableNestingSEIEnabled() { return m_scalableNestingSEIEnabled; } 742 #if Q0189_TMVP_CONSTRAINTS 743 Int getTMVPConstraintsSEIEnabled() { return m_TMVPConstraintsSEIEnabled; } 744 #endif 698 745 Void setUseWP ( Bool b ) { m_useWeightedPred = b; } 699 746 Void setWPBiPred ( Bool b ) { m_useWeightedBiPred = b; } … … 877 924 Void setMotionPredEnabledFlag (Int i,Bool flag) { m_motionPredEnabledFlag[i] = flag; } 878 925 #endif 879 #if N0120_MAX_TID_REF_CFG880 926 Int getMaxTidIlRefPicsPlus1 () { return m_maxTidIlRefPicsPlus1; } 881 927 Void setMaxTidIlRefPicsPlus1 (Int num) { m_maxTidIlRefPicsPlus1 = num; } 882 #endif883 928 #if LAYERS_NOT_PRESENT_SEI 884 929 Void setLayersNotPresentSEIEnabled(Int b) { m_layersNotPresentSEIEnabled = b; } -
trunk/source/Lib/TLibEncoder/TEncCu.cpp
r595 r815 696 696 #if (ENCODER_FAST_MODE) 697 697 if( rpcBestCU->getSlice()->getSliceType() == I_SLICE || 698 rpcBestCU->getPredictionMode(0) == MODE_NONE || // if there is no valid inter prediction 698 699 !testInter || 699 700 rpcBestCU->getCbf( 0, TEXT_LUMA ) != 0 || … … 701 702 rpcBestCU->getCbf( 0, TEXT_CHROMA_V ) != 0 ) // avoid very complex intra if it is unlikely 702 703 #else 703 if( rpcBestCU->getSlice()->getSliceType() == I_SLICE || 704 rpcBestCU->getCbf( 0, TEXT_LUMA ) != 0 || 705 rpcBestCU->getCbf( 0, TEXT_CHROMA_U ) != 0 || 706 rpcBestCU->getCbf( 0, TEXT_CHROMA_V ) != 0 ) // avoid very complex intra if it is unlikely 707 #endif 704 if( rpcBestCU->getSlice()->getSliceType() == I_SLICE || 705 rpcBestCU->getCbf( 0, TEXT_LUMA ) != 0 || 706 rpcBestCU->getCbf( 0, TEXT_CHROMA_U ) != 0 || 707 rpcBestCU->getCbf( 0, TEXT_CHROMA_V ) != 0 ) // avoid very complex intra if it is unlikely 708 #endif 709 { 710 xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); 711 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 712 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth ) 708 713 { 709 xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); 710 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 711 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth ) 714 if( rpcTempCU->getWidth(0) > ( 1 << rpcTempCU->getSlice()->getSPS()->getQuadtreeTULog2MinSize() ) ) 712 715 { 713 if( rpcTempCU->getWidth(0) > ( 1 << rpcTempCU->getSlice()->getSPS()->getQuadtreeTULog2MinSize() ) ) 714 { 715 xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_NxN ); 716 xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_NxN ); 716 717 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 717 }718 718 } 719 719 } 720 } 720 721 721 722 // test PCM … … 734 735 #if (ENCODER_FAST_MODE) 735 736 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 736 if(pcPic->getLayerId() > 0 && !m_disableILP) 737 #else 738 if(pcPic->getLayerId() > 0) 739 #endif 740 { 741 for(Int refLayer = 0; refLayer < pcSlice->getActiveNumILRRefIdx(); refLayer++) 742 { 743 xCheckRDCostILRUni( rpcBestCU, rpcTempCU, pcSlice->getInterLayerPredLayerIdc(refLayer)); 744 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 737 if(pcPic->getLayerId() > 0 && !m_disableILP) 738 #else 739 if(pcPic->getLayerId() > 0) 740 #endif 741 { 742 for(Int refLayer = 0; refLayer < pcSlice->getActiveNumILRRefIdx(); refLayer++) 743 { 744 xCheckRDCostILRUni( rpcBestCU, rpcTempCU, pcSlice->getVPS()->getRefLayerId( pcSlice->getLayerId(), pcSlice->getInterLayerPredLayerIdc(refLayer) ) ); 745 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 746 } 745 747 } 746 }747 748 #endif 748 749 … … 821 822 822 823 if ( m_pcEncCfg->getCUTransquantBypassFlagForceValue() ) 823 824 { 824 825 iMaxQP = iMinQP; // If all blocks are forced into using transquant bypass, do not loop here. 825 826 } 826 827 827 828 for (Int iQP=iMinQP; iQP<=iMaxQP; iQP++) … … 1476 1477 rpcTempCU->setPredModeSubParts ( MODE_INTER, 0, uhDepth ); 1477 1478 1479 #if SVC_EXTENSION 1480 #if AMP_MRG 1481 rpcTempCU->setMergeAMP (true); 1482 Bool ret = m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], false, bUseMRG ); 1483 #else 1484 Bool ret = m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth] ); 1485 #endif 1486 1487 if( !ret ) 1488 { 1489 return; 1490 } 1491 #else 1478 1492 #if AMP_MRG 1479 1493 rpcTempCU->setMergeAMP (true); … … 1481 1495 #else 1482 1496 m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth] ); 1497 #endif 1483 1498 #endif 1484 1499 -
trunk/source/Lib/TLibEncoder/TEncGOP.cpp
r713 r815 92 92 m_bRefreshPending = 0; 93 93 m_pocCRA = 0; 94 #if POC_RESET_IDC_ENCODER 95 m_pocCraWithoutReset = 0; 96 m_associatedIrapPocBeforeReset = 0; 97 #endif 94 98 m_numLongTermRefPicSPS = 0; 95 99 ::memset(m_ltRefPicPocLsbSps, 0, sizeof(m_ltRefPicPocLsbSps)); … … 103 107 m_associatedIRAPPOC = 0; 104 108 #endif 105 #if SVC_ UPSAMPLING109 #if SVC_EXTENSION 106 110 m_pcPredSearch = NULL; 107 #endif108 111 #if Q0048_CGS_3D_ASYMLUT 109 112 m_temp = NULL; 110 113 m_pColorMappedPic = NULL; 111 114 #endif 115 #if POC_RESET_IDC_ENCODER 116 m_lastPocPeriodId = -1; 117 #endif 118 #endif //SVC_EXTENSION 112 119 return; 113 120 } … … 173 180 #if SVC_EXTENSION 174 181 m_ppcTEncTop = pcTEncTop->getLayerEnc(); 175 #endif176 #if SVC_UPSAMPLING177 182 m_pcPredSearch = pcTEncTop->getPredSearch(); ///< encoder search class 178 #endif179 183 #if Q0048_CGS_3D_ASYMLUT 180 184 if( pcTEncTop->getLayerId() ) … … 185 189 { 186 190 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 191 m_pColorMappedPic->create( m_ppcTEncTop[0]->getSourceWidth(), m_ppcTEncTop[0]->getSourceHeight(), m_ppcTEncTop[0]->getChromaFormatIDC(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, NULL ); 192 } 193 } 194 #endif 195 #endif //SVC_EXTENSION 191 196 } 192 197 … … 327 332 } 328 333 334 #if P0050_KNEE_FUNCTION_SEI 335 SEIKneeFunctionInfo* TEncGOP::xCreateSEIKneeFunctionInfo() 336 { 337 SEIKneeFunctionInfo *seiKneeFunctionInfo = new SEIKneeFunctionInfo(); 338 seiKneeFunctionInfo->m_kneeId = m_pcCfg->getKneeSEIId(); 339 seiKneeFunctionInfo->m_kneeCancelFlag = m_pcCfg->getKneeSEICancelFlag(); 340 if ( !seiKneeFunctionInfo->m_kneeCancelFlag ) 341 { 342 seiKneeFunctionInfo->m_kneePersistenceFlag = m_pcCfg->getKneeSEIPersistenceFlag(); 343 seiKneeFunctionInfo->m_kneeMappingFlag = m_pcCfg->getKneeSEIMappingFlag(); 344 seiKneeFunctionInfo->m_kneeInputDrange = m_pcCfg->getKneeSEIInputDrange(); 345 seiKneeFunctionInfo->m_kneeInputDispLuminance = m_pcCfg->getKneeSEIInputDispLuminance(); 346 seiKneeFunctionInfo->m_kneeOutputDrange = m_pcCfg->getKneeSEIOutputDrange(); 347 seiKneeFunctionInfo->m_kneeOutputDispLuminance = m_pcCfg->getKneeSEIOutputDispLuminance(); 348 349 seiKneeFunctionInfo->m_kneeNumKneePointsMinus1 = m_pcCfg->getKneeSEINumKneePointsMinus1(); 350 Int* piInputKneePoint = m_pcCfg->getKneeSEIInputKneePoint(); 351 Int* piOutputKneePoint = m_pcCfg->getKneeSEIOutputKneePoint(); 352 if(piInputKneePoint&&piOutputKneePoint) 353 { 354 seiKneeFunctionInfo->m_kneeInputKneePoint.resize(seiKneeFunctionInfo->m_kneeNumKneePointsMinus1+1); 355 seiKneeFunctionInfo->m_kneeOutputKneePoint.resize(seiKneeFunctionInfo->m_kneeNumKneePointsMinus1+1); 356 for(Int i=0; i<=seiKneeFunctionInfo->m_kneeNumKneePointsMinus1; i++) 357 { 358 seiKneeFunctionInfo->m_kneeInputKneePoint[i] = piInputKneePoint[i]; 359 seiKneeFunctionInfo->m_kneeOutputKneePoint[i] = piOutputKneePoint[i]; 360 } 361 } 362 } 363 return seiKneeFunctionInfo; 364 } 365 #endif 366 329 367 #if Q0074_SEI_COLOR_MAPPING 330 368 SEIColorMappingInfo* TEncGOP::xCreateSEIColorMappingInfo( Char* file ) … … 477 515 delete sei; 478 516 } 517 #if P0050_KNEE_FUNCTION_SEI 518 if(m_pcCfg->getKneeSEIEnabled()) 519 { 520 SEIKneeFunctionInfo *sei = xCreateSEIKneeFunctionInfo(); 521 522 nalu = NALUnit(NAL_UNIT_PREFIX_SEI); 523 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 524 #if O0164_MULTI_LAYER_HRD 525 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, m_pcEncTop->getVPS(), sps); 526 #else 527 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps); 528 #endif 529 writeRBSPTrailingBits(nalu.m_Bitstream); 530 accessUnit.push_back(new NALUnitEBSP(nalu)); 531 delete sei; 532 } 533 #endif 479 534 #if Q0074_SEI_COLOR_MAPPING 480 535 if(m_pcCfg->getColorMappingInfoSEIFile()) … … 554 609 TEncSbac* pcSbacCoders = NULL; 555 610 TComOutputBitstream* pcSubstreamsOut = NULL; 611 #if Q0108_TSA_STSA 612 Int flagTSTA = 0; 613 #endif 556 614 557 615 xInitGOP( iPOCLast, iNumPicRcvd, rcListPic, rcListPicYuvRecOut, isField ); … … 855 913 } 856 914 #endif 915 #if POC_RESET_IDC_ENCODER 916 pcSlice->setPocValueBeforeReset( pocCurr ); 917 // Check if the current picture is to be assigned as a reset picture 918 determinePocResetIdc(pocCurr, pcSlice); 919 920 // If reset, do the following steps: 921 if( pcSlice->getPocResetIdc() ) 922 { 923 updatePocValuesOfPics(pocCurr, pcSlice); 924 } 925 else 926 { 927 // Check the base layer picture is IDR. If so, just set current POC equal to 0 (alignment of POC) 928 if( ( m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshType() == 2) && ( pocCurr % m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshInterval() == 0 ) ) 929 { 930 m_pcEncTop->setPocAdjustmentValue( pocCurr ); 931 } 932 // else 933 { 934 // Just subtract POC by the current cumulative POC delta 935 pcSlice->setPOC( pocCurr - m_pcEncTop->getPocAdjustmentValue() ); 936 } 937 938 Int maxPocLsb = 1 << pcSlice->getSPS()->getBitsForPOC(); 939 pcSlice->setPocMsbVal( pcSlice->getPOC() - ( pcSlice->getPOC() & (maxPocLsb-1) ) ); 940 } 941 // Update the POC of current picture, pictures in the DPB, including references inside the reference pictures 942 943 #endif 944 857 945 #if O0149_CROSS_LAYER_BLA_FLAG 858 946 if( m_layerId == 0 && (getNalUnitType(pocCurr, m_iLastIDR, isField) == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType(pocCurr, m_iLastIDR, isField) == NAL_UNIT_CODED_SLICE_IDR_N_LP) ) … … 1012 1100 if (m_layerId > 0) 1013 1101 { 1014 Int interLayerPredLayerIdcTmp[MAX_VPS_LAYER_ID_PLUS1];1015 Int activeNumILRRefIdxTmp = 0;1102 Int interLayerPredLayerIdcTmp[MAX_VPS_LAYER_ID_PLUS1]; 1103 Int activeNumILRRefIdxTmp = 0; 1016 1104 1017 1105 for( Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ ) 1018 1106 { 1019 1107 UInt refLayerIdc = pcSlice->getInterLayerPredLayerIdc(i); 1108 UInt refLayerId = pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc); 1020 1109 #if VPS_EXTN_DIRECT_REF_LAYERS 1021 1110 TComList<TComPic*> *cListPic = m_ppcTEncTop[m_layerId]->getRefLayerEnc(refLayerIdc)->getListPic(); … … 1041 1130 1042 1131 #if O0098_SCALED_REF_LAYER_ID 1043 const Window &scalEL = m_pcEncTop->getScaledRefLayerWindowForLayer( pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc));1132 const Window &scalEL = m_pcEncTop->getScaledRefLayerWindowForLayer(refLayerId); 1044 1133 #else 1045 1134 const Window &scalEL = m_pcEncTop->getScaledRefLayerWindow(refLayerIdc); … … 1088 1177 } 1089 1178 #endif 1090 #if SVC_UPSAMPLING 1091 if( pcPic->isSpatialEnhLayer(refLayerIdc)) 1092 { 1179 #if SVC_EXTENSION 1180 if( pcPic->isSpatialEnhLayer(refLayerIdc) ) 1181 { 1182 // check for the sample prediction picture type 1183 if( m_ppcTEncTop[m_layerId]->getSamplePredEnabledFlag(refLayerId) ) 1184 { 1093 1185 #if P0312_VERT_PHASE_ADJ 1094 //when PhasePositionEnableFlag is equal to 1, set vertPhasePositionFlag to 0 if BL is top field and 1 if bottom1095 if( scalEL.getVertPhasePositionEnableFlag() )1096 {1097 pcSlice->setVertPhasePositionFlag( pcSlice->getPOC()%2, refLayerIdc );1098 }1186 //when PhasePositionEnableFlag is equal to 1, set vertPhasePositionFlag to 0 if BL is top field and 1 if bottom 1187 if( scalEL.getVertPhasePositionEnableFlag() ) 1188 { 1189 pcSlice->setVertPhasePositionFlag( pcSlice->getPOC()%2, refLayerIdc ); 1190 } 1099 1191 #endif 1100 1192 #if O0215_PHASE_ALIGNMENT 1101 1193 #if O0194_JOINT_US_BITSHIFT 1102 1194 #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() );1195 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() ); 1196 #else 1197 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() ); 1106 1198 #endif 1107 1199 #else 1108 1200 #if Q0048_CGS_3D_ASYMLUT 1109 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() );1110 #else 1111 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() );1201 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() ); 1202 #else 1203 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() ); 1112 1204 #endif 1113 1205 #endif … … 1115 1207 #if O0194_JOINT_US_BITSHIFT 1116 1208 #if Q0048_CGS_3D_ASYMLUT 1117 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL );1118 #else 1119 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL );1209 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL ); 1210 #else 1211 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL ); 1120 1212 #endif 1121 1213 #else 1122 1214 #if Q0048_CGS_3D_ASYMLUT 1123 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL ); 1124 #else 1125 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL ); 1126 #endif 1127 #endif 1128 #endif 1215 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL ); 1216 #else 1217 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL ); 1218 #endif 1219 #endif 1220 #endif 1221 } 1129 1222 } 1130 1223 else … … 1137 1230 } 1138 1231 pcSlice->setFullPelBaseRec ( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc) ); 1139 #endif 1232 #endif //SVC_EXTENSION 1140 1233 } 1141 1234 … … 1154 1247 pcSlice->setInterLayerPredEnabledFlag(false); 1155 1248 } 1156 1249 1157 1250 if( pocCurr % m_pcCfg->getIntraPeriod() == 0 ) 1158 1251 { 1159 #if N0147_IRAP_ALIGN_FLAG1160 1252 if(pcSlice->getVPS()->getCrossLayerIrapAlignFlag()) 1161 1253 { … … 1172 1264 } 1173 1265 else 1174 #endif 1175 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_CRA); 1176 1177 #if IDR_ALIGNMENT 1178 TComList<TComPic*> *cListPic = m_ppcTEncTop[m_layerId]->getRefLayerEnc(0)->getListPic(); 1179 TComPic* picLayer0 = pcSlice->getRefPic(*cListPic, pcSlice->getPOC() ); 1180 if( picLayer0->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || picLayer0->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) 1181 { 1182 pcSlice->setNalUnitType(picLayer0->getSlice(0)->getNalUnitType()); 1183 } 1184 else 1185 { 1266 { 1267 #if !ALIGN_IRAP_BUGFIX 1186 1268 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_CRA); 1187 } 1188 #endif 1189 } 1190 1269 #endif 1270 } 1271 } 1272 1191 1273 if( pcSlice->getActiveNumILRRefIdx() == 0 && pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA ) 1192 1274 { … … 1196 1278 { 1197 1279 if( (pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && 1198 1199 1280 (pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) && 1281 pcSlice->getSliceType() == B_SLICE ) 1200 1282 { 1201 1283 pcSlice->setSliceType(P_SLICE); 1202 1284 } 1203 } 1285 } 1204 1286 } 1205 1287 #endif //#if SVC_EXTENSION … … 1207 1289 { 1208 1290 if (pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_TRAIL_R && 1291 #if SVC_EXTENSION 1292 ( m_iGopSize != 1 || m_ppcTEncTop[m_layerId]->getIntraPeriod() > 1 ) ) 1293 #else 1209 1294 !(m_iGopSize == 1 && pcSlice->getSliceType() == I_SLICE)) 1295 #endif 1210 1296 // Add this condition to avoid POC issues with encoder_intra_main.cfg configuration (see #1127 in bug tracker) 1211 1297 { … … 1232 1318 { 1233 1319 m_associatedIRAPType = pcSlice->getNalUnitType(); 1320 #if POC_RESET_IDC_ENCODER 1321 m_associatedIRAPPOC = pcSlice->getPOC(); 1322 m_associatedIrapPocBeforeReset = pocCurr; 1323 #else 1234 1324 m_associatedIRAPPOC = pocCurr; 1325 #endif 1235 1326 } 1236 1327 pcSlice->setAssociatedIRAPType(m_associatedIRAPType); 1237 1328 pcSlice->setAssociatedIRAPPOC(m_associatedIRAPPOC); 1329 #if POC_RESET_IDC_ENCODER 1330 pcSlice->setAssociatedIrapPocBeforeReset(m_associatedIrapPocBeforeReset); 1331 #endif 1238 1332 #endif 1239 1333 #endif … … 1243 1337 #else 1244 1338 pcSlice->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, rcListPic); 1339 #endif 1340 #if POC_RESET_IDC_ENCODER 1341 // m_pocCRA may have been update here; update m_pocCraWithoutReset 1342 m_pocCraWithoutReset = m_pocCRA + m_pcEncTop->getPocAdjustmentValue(); 1245 1343 #endif 1246 1344 m_pcEncTop->selectReferencePictureSet(pcSlice, pocCurr, iGOPid); … … 1280 1378 #endif 1281 1379 #if ALIGNED_BUMPING 1380 #if POC_RESET_IDC_ENCODER 1381 pcSlice->checkLeadingPictureRestrictions(rcListPic, true); 1382 #else 1282 1383 pcSlice->checkLeadingPictureRestrictions(rcListPic); 1384 #endif 1283 1385 #endif 1284 1386 pcSlice->applyReferencePictureSet(rcListPic, pcSlice->getRPS()); … … 1293 1395 if(pcSlice->isTemporalLayerSwitchingPoint(rcListPic) || pcSlice->getSPS()->getTemporalIdNestingFlag()) 1294 1396 { 1295 #if ALIGN_TSA_STSA_PICS1397 #if !Q0108_TSA_STSA 1296 1398 if( pcSlice->getLayerId() > 0 ) 1297 1399 { … … 1392 1494 if(isSTSA==true) 1393 1495 { 1394 #if ALIGN_TSA_STSA_PICS1496 #if !Q0108_TSA_STSA 1395 1497 if( pcSlice->getLayerId() > 0 ) 1396 1498 { … … 1461 1563 } 1462 1564 } 1565 #if Q0108_TSA_STSA 1566 else if( ( pcSlice->getTLayer() == 0 && pcSlice->getLayerId() > 0) // only for enhancement layer and with temporal layer 0 1567 && !( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N 1568 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_R 1569 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N 1570 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R 1571 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL 1572 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP 1573 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA 1574 ) 1575 ) 1576 { 1577 Bool isSTSA=true; 1578 for(Int ii=iGOPid+1; ii < m_pcCfg->getGOPSize() && isSTSA; ii++) 1579 { 1580 Int lTid= m_pcCfg->getGOPEntry(ii).m_temporalId; 1581 if(lTid==pcSlice->getTLayer()) 1582 { 1583 TComReferencePictureSet* nRPS = pcSlice->getSPS()->getRPSList()->getReferencePictureSet(ii); 1584 for(Int jj=0; jj<nRPS->getNumberOfPictures(); jj++) 1585 { 1586 if(nRPS->getUsed(jj)) 1587 { 1588 Int tPoc=m_pcCfg->getGOPEntry(ii).m_POC+nRPS->getDeltaPOC(jj); 1589 Int kk=0; 1590 for(kk=0; kk<m_pcCfg->getGOPSize(); kk++) 1591 { 1592 if(m_pcCfg->getGOPEntry(kk).m_POC==tPoc) 1593 { 1594 break; 1595 } 1596 } 1597 Int tTid=m_pcCfg->getGOPEntry(kk).m_temporalId; 1598 if(tTid >= pcSlice->getTLayer()) 1599 { 1600 isSTSA = false; 1601 break; 1602 } 1603 } 1604 } 1605 } 1606 } 1607 if(isSTSA==true) 1608 { 1609 #if !Q0108_TSA_STSA 1610 if( pcSlice->getLayerId() > 0 ) 1611 { 1612 Bool oneRefLayerSTSA = false, oneRefLayerNotSTSA = false; 1613 for( Int i = 0; i < pcSlice->getLayerId(); i++) 1614 { 1615 TComList<TComPic *> *cListPic = m_ppcTEncTop[i]->getListPic(); 1616 TComPic *lowerLayerPic = pcSlice->getRefPic(*cListPic, pcSlice->getPOC()); 1617 if( lowerLayerPic && pcSlice->getVPS()->getDirectDependencyFlag(pcSlice->getLayerId(), i) ) 1618 { 1619 if( ( lowerLayerPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_N ) || 1620 ( lowerLayerPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_R ) 1621 ) 1622 { 1623 if(pcSlice->getTemporalLayerNonReferenceFlag() ) 1624 { 1625 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_N); 1626 } 1627 else 1628 { 1629 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_R ); 1630 } 1631 oneRefLayerSTSA = true; 1632 } 1633 else 1634 { 1635 oneRefLayerNotSTSA = true; 1636 } 1637 } 1638 } 1639 assert( !( oneRefLayerNotSTSA && oneRefLayerSTSA ) ); // Only one variable should be true - failure of this assert means 1640 // that two independent reference layers that are not dependent on 1641 // each other, but are reference for current layer have inconsistency 1642 if( oneRefLayerNotSTSA /*&& !oneRefLayerSTSA*/ ) // No reference layer is STSA - set current as TRAIL 1643 { 1644 if(pcSlice->getTemporalLayerNonReferenceFlag() ) 1645 { 1646 pcSlice->setNalUnitType( NAL_UNIT_CODED_SLICE_TRAIL_N ); 1647 } 1648 else 1649 { 1650 pcSlice->setNalUnitType( NAL_UNIT_CODED_SLICE_TRAIL_R ); 1651 } 1652 } 1653 else // This means there is no reference layer picture for current picture in this AU 1654 { 1655 if(pcSlice->getTemporalLayerNonReferenceFlag() ) 1656 { 1657 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_N); 1658 } 1659 else 1660 { 1661 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_R ); 1662 } 1663 } 1664 } 1665 #else 1666 if(pcSlice->getTemporalLayerNonReferenceFlag()) 1667 { 1668 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_N); 1669 flagTSTA = 1; 1670 } 1671 else 1672 { 1673 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_R); 1674 flagTSTA = 1; 1675 } 1676 #endif 1677 } 1678 } 1679 #endif 1680 1463 1681 arrangeLongtermPicturesInRPS(pcSlice, rcListPic); 1464 1682 TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification(); … … 1471 1689 if( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() ) 1472 1690 { 1473 #if POC_RESET_FLAG 1474 if ( pocCurr > 0 1691 #if POC_RESET_FLAG || POC_RESET_IDC_ENCODER 1692 if ( pocCurr > 0 && pcSlice->isRADL() && pcPic->getSlice(0)->getBaseColPic(pcPic->getSlice(0)->getInterLayerPredLayerIdc(0))->getSlice(0)->isRASL()) 1475 1693 #else 1476 1694 if (pcSlice->getPOC()>0 && pcSlice->isRADL() && pcPic->getSlice(0)->getBaseColPic(pcPic->getSlice(0)->getInterLayerPredLayerIdc(0))->getSlice(0)->isRASL()) … … 1480 1698 pcSlice->setInterLayerPredEnabledFlag(0); 1481 1699 } 1482 if( pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA ) 1700 #if Q0108_TSA_STSA 1701 if( ( pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA ) || flagTSTA == 1 ) 1702 #else 1703 if( pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA ) 1704 #endif 1483 1705 { 1484 1706 pcSlice->setNumRefIdx(REF_PIC_LIST_0, pcSlice->getActiveNumILRRefIdx()); … … 1489 1711 pcSlice->setNumRefIdx(REF_PIC_LIST_0, pcSlice->getNumRefIdx(REF_PIC_LIST_0)+pcSlice->getActiveNumILRRefIdx()); 1490 1712 pcSlice->setNumRefIdx(REF_PIC_LIST_1, pcSlice->getNumRefIdx(REF_PIC_LIST_1)+pcSlice->getActiveNumILRRefIdx()); 1713 } 1714 1715 // check for the reference pictures whether there is at least one either temporal picture or ILRP with sample prediction type 1716 if( pcSlice->getNumRefIdx( REF_PIC_LIST_0 ) - pcSlice->getActiveNumILRRefIdx() == 0 && pcSlice->getNumRefIdx( REF_PIC_LIST_1 ) - pcSlice->getActiveNumILRRefIdx() == 0 ) 1717 { 1718 Bool foundSamplePredPicture = false; 1719 1720 for( Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ ) 1721 { 1722 if( m_ppcTEncTop[m_layerId]->getSamplePredEnabledFlag( pcSlice->getVPS()->getRefLayerId( m_layerId, pcSlice->getInterLayerPredLayerIdc(i) ) ) ) 1723 { 1724 foundSamplePredPicture = true; 1725 break; 1726 } 1727 } 1728 1729 if( !foundSamplePredPicture ) 1730 { 1731 pcSlice->setSliceType(I_SLICE); 1732 pcSlice->setInterLayerPredEnabledFlag(0); 1733 pcSlice->setActiveNumILRRefIdx(0); 1734 } 1491 1735 } 1492 1736 } … … 1520 1764 // Set reference list 1521 1765 pcSlice->setRefPicList ( rcListPic ); 1522 #endif //SVC_EXTENSION1766 #endif 1523 1767 pcSlice->setRefPicListModificationSvc(); 1524 1768 pcSlice->setRefPicList( rcListPic, false, m_pcEncTop->getIlpList()); … … 1532 1776 1533 1777 for(Int colIdx = 0; colIdx < pcSlice->getNumRefIdx( RefPicList(1 - ColFromL0Flag) ); colIdx++) 1534 { 1535 if( pcSlice->getRefPic( RefPicList(1 - ColFromL0Flag), colIdx)->isILR(m_layerId) 1778 { 1779 RefPicList refList = RefPicList(1 - ColFromL0Flag); 1780 TComPic* refPic = pcSlice->getRefPic(refList, colIdx); 1781 1782 // It is a requirement of bitstream conformance when the collocated picture, used for temporal motion vector prediction, is an inter-layer reference picture, 1783 // VpsInterLayerMotionPredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture. 1784 if( refPic->isILR(m_layerId) && m_ppcTEncTop[m_layerId]->getMotionPredEnabledFlag( refPic->getLayerId() ) 1536 1785 #if MFM_ENCCONSTRAINT 1537 && pcSlice->getBaseColPic( *m_ppcTEncTop[ pcSlice->getRefPic( RefPicList(1 - ColFromL0Flag), colIdx)->getLayerId()]->getListPic() )->checkSameRefInfo() == true1786 && pcSlice->getBaseColPic( *m_ppcTEncTop[refPic->getLayerId()]->getListPic() )->checkSameRefInfo() == true 1538 1787 #endif 1539 1788 ) … … 1549 1798 ColFromL0Flag = 1 - ColFromL0Flag; 1550 1799 for(Int colIdx = 0; colIdx < pcSlice->getNumRefIdx( RefPicList(1 - ColFromL0Flag) ); colIdx++) 1551 { 1552 if( pcSlice->getRefPic( RefPicList(1 - ColFromL0Flag), colIdx)->isILR(m_layerId) 1800 { 1801 RefPicList refList = RefPicList(1 - ColFromL0Flag); 1802 TComPic* refPic = pcSlice->getRefPic(refList, colIdx); 1803 1804 // It is a requirement of bitstream conformance when the collocated picture, used for temporal motion vector prediction, is an inter-layer reference picture, 1805 // VpsInterLayerMotionPredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture. 1806 if( refPic->isILR(m_layerId) && m_ppcTEncTop[m_layerId]->getMotionPredEnabledFlag( refPic->getLayerId() ) 1553 1807 #if MFM_ENCCONSTRAINT 1554 && pcSlice->getBaseColPic( *m_ppcTEncTop[ pcSlice->getRefPic( RefPicList(1 - ColFromL0Flag), colIdx)->getLayerId()]->getListPic() )->checkSameRefInfo() == true1808 && pcSlice->getBaseColPic( *m_ppcTEncTop[refPic->getLayerId()]->getListPic() )->checkSameRefInfo() == true 1555 1809 #endif 1556 1810 ) … … 1650 1904 pcSlice->setEnableTMVPFlag(0); 1651 1905 } 1906 1907 #if SVC_EXTENSION 1908 if( m_layerId > 0 && !pcSlice->isIntra() ) 1909 { 1910 Int colFromL0Flag = 1; 1911 Int colRefIdx = 0; 1912 1913 // check whether collocated picture is valid 1914 if( pcSlice->getEnableTMVPFlag() ) 1915 { 1916 colFromL0Flag = pcSlice->getColFromL0Flag(); 1917 colRefIdx = pcSlice->getColRefIdx(); 1918 1919 TComPic* refPic = pcSlice->getRefPic(RefPicList(1-colFromL0Flag), colRefIdx); 1920 1921 assert( refPic ); 1922 1923 // It is a requirement of bitstream conformance when the collocated picture, used for temporal motion vector prediction, is an inter-layer reference picture, 1924 // VpsInterLayerMotionPredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture. 1925 if( refPic->isILR(m_layerId) && !m_ppcTEncTop[m_layerId]->getMotionPredEnabledFlag(refPic->getLayerId()) ) 1926 { 1927 pcSlice->setEnableTMVPFlag(false); 1928 pcSlice->setMFMEnabledFlag(false); 1929 colRefIdx = 0; 1930 } 1931 } 1932 1933 // remove motion only ILRP from the end of the colFromL0Flag reference picture list 1934 RefPicList refList = RefPicList(colFromL0Flag); 1935 Int numRefIdx = pcSlice->getNumRefIdx(refList); 1936 1937 if( numRefIdx > 0 ) 1938 { 1939 for( Int refIdx = pcSlice->getNumRefIdx(refList) - 1; refIdx > 0; refIdx-- ) 1940 { 1941 TComPic* refPic = pcSlice->getRefPic(refList, refIdx); 1942 1943 if( !refPic->isILR(m_layerId) || ( refPic->isILR(m_layerId) && m_ppcTEncTop[m_layerId]->getSamplePredEnabledFlag( refPic->getLayerId() ) ) ) 1944 { 1945 break; 1946 } 1947 else 1948 { 1949 assert( numRefIdx > 1 ); 1950 numRefIdx--; 1951 } 1952 } 1953 1954 pcSlice->setNumRefIdx( refList, numRefIdx ); 1955 } 1956 1957 // remove motion only ILRP from the end of the (1-colFromL0Flag) reference picture list up to colRefIdx 1958 refList = RefPicList(1 - colFromL0Flag); 1959 numRefIdx = pcSlice->getNumRefIdx(refList); 1960 1961 if( numRefIdx > 0 ) 1962 { 1963 for( Int refIdx = pcSlice->getNumRefIdx(refList) - 1; refIdx > colRefIdx; refIdx-- ) 1964 { 1965 TComPic* refPic = pcSlice->getRefPic(refList, refIdx); 1966 1967 if( !refPic->isILR(m_layerId) || ( refPic->isILR(m_layerId) && m_ppcTEncTop[m_layerId]->getSamplePredEnabledFlag( refPic->getLayerId() ) ) ) 1968 { 1969 break; 1970 } 1971 else 1972 { 1973 assert( numRefIdx > 1 ); 1974 numRefIdx--; 1975 } 1976 } 1977 1978 pcSlice->setNumRefIdx( refList, numRefIdx ); 1979 } 1980 1981 assert( pcSlice->getNumRefIdx(REF_PIC_LIST_0) > 0 && ( pcSlice->isInterP() || (pcSlice->isInterB() && pcSlice->getNumRefIdx(REF_PIC_LIST_1) > 0) ) ); 1982 } 1983 #endif 1984 1652 1985 /////////////////////////////////////////////////////////////////////////////////////////////////// Compress a slice 1653 1986 // Slice compression … … 1700 2033 1701 2034 Int sliceQP = m_pcCfg->getInitialQP(); 1702 #if POC_RESET_FLAG 2035 #if POC_RESET_FLAG || POC_RESET_IDC_ENCODER 1703 2036 if ( ( pocCurr == 0 && m_pcCfg->getInitialQP() > 0 ) || ( frameLevel == 0 && m_pcCfg->getForceIntraQP() ) ) // QP is specified 1704 2037 #else … … 1983 2316 { 1984 2317 #if SVC_EXTENSION 1985 #if VPS_NUH_LAYER_ID 1986 OutputNALUnit nalu(NAL_UNIT_VPS, 0, 0 ); // The value of nuh_layer_id of VPS NAL unit shall be equal to 0. 1987 #else 1988 OutputNALUnit nalu(NAL_UNIT_VPS, 0, m_layerId); 1989 #endif 2318 OutputNALUnit nalu( NAL_UNIT_VPS, 0, 0 ); // The value of nuh_layer_id of VPS NAL unit shall be equal to 0. 1990 2319 #if AVC_BASE 1991 2320 if( ( m_layerId == 1 && m_pcEncTop->getVPS()->getAvcBaseLayerFlag() ) || ( m_layerId == 0 && !m_pcEncTop->getVPS()->getAvcBaseLayerFlag() ) ) … … 2021 2350 nalu = NALUnit(NAL_UNIT_SPS); 2022 2351 #endif 2352 #if Q0078_ADD_LAYER_SETS 2353 if (m_pcEncTop->getVPS()->getNumDirectRefLayers(m_layerId) == 0 && m_pcEncTop->getVPS()->getNumAddLayerSets() > 0) 2354 { 2355 nalu.m_layerId = 0; // For independent base layer rewriting 2356 } 2357 #endif 2023 2358 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 2024 2359 if (m_bSeqFirst) … … 2058 2393 #else 2059 2394 nalu = NALUnit(NAL_UNIT_PPS); 2395 #endif 2396 #if Q0078_ADD_LAYER_SETS 2397 if (m_pcEncTop->getVPS()->getNumDirectRefLayers(m_layerId) == 0 && m_pcEncTop->getVPS()->getNumAddLayerSets() > 0) 2398 { 2399 nalu.m_layerId = 0; // For independent base layer rewriting 2400 } 2060 2401 #endif 2061 2402 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); … … 2155 2496 writeSOP = false; 2156 2497 } 2498 #if Q0189_TMVP_CONSTRAINTS 2499 if( m_pcEncTop->getTMVPConstraintsSEIEnabled() == 1 && 2500 (m_pcEncTop->getTMVPModeId() == 1 || m_pcEncTop->getTMVPModeId() == 2) && 2501 pcSlice->getLayerId() >0 && 2502 (pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP)) 2503 { 2504 OutputNALUnit nalu(NAL_UNIT_PREFIX_SEI); 2505 SEITMVPConstrains seiTMVPConstrains; 2506 m_pcEntropyCoder->setEntropyCoder(m_pcCavlcCoder, pcSlice); 2507 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 2508 seiTMVPConstrains.no_intra_layer_col_pic_flag = 1; 2509 seiTMVPConstrains.prev_pics_not_used_flag = 1; 2510 #if O0164_MULTI_LAYER_HRD 2511 m_seiWriter.writeSEImessage( nalu.m_Bitstream, seiTMVPConstrains, m_pcEncTop->getVPS(), pcSlice->getSPS() ); 2512 #else 2513 m_seiWriter.writeSEImessage( nalu.m_Bitstream, seiTMVPConstrains, pcSlice->getSPS() ); 2514 #endif 2515 writeRBSPTrailingBits(nalu.m_Bitstream); 2516 accessUnit.push_back(new NALUnitEBSP(nalu)); 2517 } 2518 #endif 2519 #if Q0247_FRAME_FIELD_INFO 2520 if( pcSlice->getLayerId()> 0 && 2521 ( (m_pcCfg->getProgressiveSourceFlag() && m_pcCfg->getInterlacedSourceFlag()) || m_pcCfg->getFrameFieldInfoPresentFlag())) 2522 { 2523 OutputNALUnit nalu(NAL_UNIT_PREFIX_SEI); 2524 SEIFrameFieldInfo seiFFInfo; 2525 m_pcEntropyCoder->setEntropyCoder(m_pcCavlcCoder, pcSlice); 2526 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 2527 seiFFInfo.m_ffinfo_picStruct = (isField && pcSlice->getPic()->isTopField())? 1 : isField? 2 : 0; 2528 #if O0164_MULTI_LAYER_HRD 2529 m_seiWriter.writeSEImessage( nalu.m_Bitstream, seiFFInfo, m_pcEncTop->getVPS(), pcSlice->getSPS() ); 2530 #else 2531 m_seiWriter.writeSEImessage( nalu.m_Bitstream, seiFFInfo, pcSlice->getSPS() ); 2532 #endif 2533 writeRBSPTrailingBits(nalu.m_Bitstream); 2534 accessUnit.push_back(new NALUnitEBSP(nalu)); 2535 } 2536 #endif 2157 2537 2158 2538 if( ( m_pcCfg->getPictureTimingSEIEnabled() || m_pcCfg->getDecodingUnitInfoSEIEnabled() ) && … … 2185 2565 } 2186 2566 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 . 2187 #if POC_RESET_FLAG 2567 #if POC_RESET_FLAG || POC_RESET_IDC_ENCODER 2188 2568 pictureTimingSEI.m_picDpbOutputDelay = pcSlice->getSPS()->getNumReorderPics(pcSlice->getSPS()->getMaxTLayers()-1) + pocCurr - m_totalCoded; 2189 2569 #else … … 2313 2693 SEIRecoveryPoint sei_recovery_point; 2314 2694 sei_recovery_point.m_recoveryPocCnt = 0; 2315 #if POC_RESET_FLAG 2695 #if POC_RESET_FLAG || POC_RESET_IDC_ENCODER 2316 2696 sei_recovery_point.m_exactMatchingFlag = ( pocCurr == 0 ) ? (true) : (false); 2317 2697 #else … … 3068 3448 #endif 3069 3449 } 3450 3451 #if POC_RESET_IDC_ENCODER 3452 Void TEncGOP::determinePocResetIdc(Int const pocCurr, TComSlice *const slice) 3453 { 3454 // If one picture in the AU is IDR, and another picture is not IDR, set the poc_reset_idc to 1 or 2 3455 // If BL picture in the AU is IDR, and another picture is not IDR, set the poc_reset_idc to 2 3456 // If BL picture is IRAP, and another picture is non-IRAP, then the poc_reset_idc is equal to 1 or 2. 3457 if( slice->getSliceIdx() == 0 ) // First slice - compute, copy for other slices 3458 { 3459 Int needReset = false; 3460 Int resetDueToBL = false; 3461 if( slice->getVPS()->getMaxLayers() > 1 ) 3462 { 3463 // If IRAP is refreshed in this access unit for base layer 3464 if( (m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshType() == 1 || m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshType() == 2) 3465 && ( pocCurr % m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshInterval() == 0 ) 3466 ) 3467 { 3468 // Check if the IRAP refresh interval of any layer does not match that of the base layer 3469 for(Int i = 1; i < slice->getVPS()->getMaxLayers(); i++) 3470 { 3471 Bool refreshIntervalFlag = ( pocCurr % m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshInterval() == 0 ); 3472 Bool refreshTypeFlag = ( m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshType() == m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshType() ); 3473 if( !(refreshIntervalFlag && refreshTypeFlag) ) 3474 { 3475 needReset = true; 3476 resetDueToBL = true; 3477 break; 3478 } 3479 } 3480 } 3481 } 3482 3483 if( !needReset )// No need reset due to base layer IRAP 3484 { 3485 // Check if EL IDRs results in POC Reset 3486 for(Int i = 1; i < slice->getVPS()->getMaxLayers() && !needReset; i++) 3487 { 3488 Bool idrFlag = ( (m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshType() == 2) 3489 && ( pocCurr % m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshInterval() == 0 ) 3490 ); 3491 for(Int j = 0; j < slice->getVPS()->getMaxLayers(); j++) 3492 { 3493 if( j == i ) 3494 { 3495 continue; 3496 } 3497 Bool idrOtherPicFlag = ( (m_ppcTEncTop[j]->getGOPEncoder()->getIntraRefreshType() == 2) 3498 && ( pocCurr % m_ppcTEncTop[j]->getGOPEncoder()->getIntraRefreshInterval() == 0 ) 3499 ); 3500 3501 if( idrFlag != idrOtherPicFlag ) 3502 { 3503 needReset = true; 3504 break; 3505 } 3506 } 3507 } 3508 } 3509 if( needReset ) 3510 { 3511 if( m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshType() == 2 ) // BL IDR refresh, assuming BL picture present 3512 { 3513 if( resetDueToBL ) 3514 { 3515 slice->setPocResetIdc( 2 ); // Full reset needed 3516 } 3517 else 3518 { 3519 slice->setPocResetIdc( 1 ); // Due to IDR in EL 3520 } 3521 } 3522 else 3523 { 3524 slice->setPocResetIdc( 1 ); // Only MSB reset 3525 } 3526 3527 // Start a new POC reset period 3528 if (m_layerId == 0) // Assuming BL picture is always present at encoder; for other AU structures, need to change this 3529 { 3530 Int periodId = rand() % 64; 3531 m_lastPocPeriodId = (periodId == m_lastPocPeriodId) ? (periodId + 1) % 64 : periodId ; 3532 } 3533 else 3534 { 3535 m_lastPocPeriodId = m_ppcTEncTop[0]->getGOPEncoder()->getLastPocPeriodId(); 3536 } 3537 slice->setPocResetPeriodId(m_lastPocPeriodId); 3538 } 3539 else 3540 { 3541 slice->setPocResetIdc( 0 ); 3542 } 3543 } 3544 } 3545 3546 Void TEncGOP::updatePocValuesOfPics(Int const pocCurr, TComSlice *const slice) 3547 { 3548 3549 Int pocAdjustValue = pocCurr - m_pcEncTop->getPocAdjustmentValue(); 3550 3551 // New POC reset period 3552 Int maxPocLsb, pocLsbVal, pocMsbDelta, pocLsbDelta, deltaPocVal; 3553 3554 maxPocLsb = 1 << slice->getSPS()->getBitsForPOC(); 3555 pocLsbVal = (slice->getPocResetIdc() == 3) 3556 ? slice->getPocLsbVal() 3557 : pocAdjustValue % maxPocLsb; 3558 pocMsbDelta = pocAdjustValue - pocLsbVal; 3559 pocLsbDelta = (slice->getPocResetIdc() == 2 || ( slice->getPocResetIdc() == 3 && slice->getFullPocResetFlag() )) 3560 ? pocLsbVal 3561 : 0; 3562 deltaPocVal = pocMsbDelta + pocLsbDelta; 3563 3564 // Decrement value of associatedIrapPoc of the TEncGop object 3565 this->m_associatedIRAPPOC -= deltaPocVal; 3566 3567 // Decrememnt the value of m_pocCRA 3568 this->m_pocCRA -= deltaPocVal; 3569 3570 // Iterate through all pictures in the DPB 3571 TComList<TComPic*>::iterator iterPic = getListPic()->begin(); 3572 while( iterPic != getListPic()->end() ) 3573 { 3574 TComPic *dpbPic = *iterPic; 3575 3576 if( dpbPic->getReconMark() ) 3577 { 3578 for(Int i = dpbPic->getNumAllocatedSlice() - 1; i >= 0; i--) 3579 { 3580 TComSlice *dpbPicSlice = dpbPic->getSlice( i ); 3581 TComReferencePictureSet *dpbPicRps = dpbPicSlice->getRPS(); 3582 3583 // Decrement POC of slice 3584 dpbPicSlice->setPOC( dpbPicSlice->getPOC() - deltaPocVal ); 3585 3586 // Decrement POC value stored in the RPS of each such slice 3587 for( Int j = dpbPicRps->getNumberOfPictures() - 1; j >= 0; j-- ) 3588 { 3589 dpbPicRps->setPOC( j, dpbPicRps->getPOC(j) - deltaPocVal ); 3590 } 3591 3592 // Decrement value of refPOC 3593 dpbPicSlice->decrementRefPocValues( deltaPocVal ); 3594 3595 // Update value of associatedIrapPoc of each slice 3596 dpbPicSlice->setAssociatedIRAPPOC( dpbPicSlice->getAssociatedIRAPPOC() - deltaPocVal ); 3597 } 3598 } 3599 iterPic++; 3600 } 3601 3602 // Actual POC value before reset 3603 Int adjustedPocValue = pocCurr - m_pcEncTop->getPocAdjustmentValue(); 3604 3605 // Set MSB value before reset 3606 Int tempLsbVal = adjustedPocValue & (maxPocLsb - 1); 3607 slice->setPocMsbVal( adjustedPocValue - tempLsbVal); 3608 3609 // Set LSB value before reset - this is needed in the case of resetIdc = 2 3610 slice->setPicOrderCntLsb( tempLsbVal ); 3611 3612 // Cumulative delta 3613 m_pcEncTop->setPocAdjustmentValue( m_pcEncTop->getPocAdjustmentValue() + deltaPocVal ); 3614 3615 // New LSB value, after reset 3616 adjustedPocValue = pocCurr - m_pcEncTop->getPocAdjustmentValue(); 3617 Int newLsbVal = adjustedPocValue & (maxPocLsb - 1); 3618 3619 // Set value of POC current picture after RESET 3620 if( slice->getPocResetIdc() == 1 ) 3621 { 3622 slice->setPOC( newLsbVal ); 3623 } 3624 else if( slice->getPocResetIdc() == 2 ) 3625 { 3626 slice->setPOC( 0 ); 3627 } 3628 else if( slice->getPocResetIdc() == 3 ) 3629 { 3630 Int picOrderCntMsb = slice->getCurrMsb( newLsbVal, 3631 slice->getFullPocResetFlag() ? 0 : slice->getPocLsbVal(), 3632 0, 3633 maxPocLsb ); 3634 slice->setPOC( picOrderCntMsb + newLsbVal ); 3635 } 3636 else 3637 { 3638 assert(0); 3639 } 3640 } 3641 #endif 3642 3070 3643 3071 3644 #if !SVC_EXTENSION … … 3516 4089 if( pcSlice->getRefPic(RefPicList(iRefList), iRefIndex)->isILR(m_layerId) ) 3517 4090 { 4091 #if POC_RESET_IDC_ENCODER 4092 printf( "%d(%d)", pcSlice->getRefPOC(RefPicList(iRefList), iRefIndex), pcSlice->getRefPic(RefPicList(iRefList), iRefIndex)->getLayerId() ); 4093 #else 3518 4094 printf( "%d(%d)", pcSlice->getRefPOC(RefPicList(iRefList), iRefIndex)-pcSlice->getLastIDR(), pcSlice->getRefPic(RefPicList(iRefList), iRefIndex)->getLayerId() ); 4095 #endif 3519 4096 } 3520 4097 else 3521 4098 { 4099 #if POC_RESET_IDC_ENCODER 4100 printf ("%d", pcSlice->getRefPOC(RefPicList(iRefList), iRefIndex)); 4101 #else 3522 4102 printf ("%d", pcSlice->getRefPOC(RefPicList(iRefList), iRefIndex)-pcSlice->getLastIDR()); 4103 #endif 3523 4104 } 3524 4105 #endif … … 3747 4328 } 3748 4329 } 4330 4331 #if POC_RESET_IDC_ENCODER 4332 if(m_pocCraWithoutReset > 0 && this->m_associatedIRAPType == NAL_UNIT_CODED_SLICE_CRA) 4333 { 4334 if(pocCurr < m_pocCraWithoutReset) 4335 #else 3749 4336 if(m_pocCRA>0) 3750 4337 { 3751 4338 if(pocCurr<m_pocCRA) 4339 #endif 3752 4340 { 3753 4341 // All leading pictures are being marked as TFD pictures here since current encoder uses all … … 4287 4875 4288 4876 if(!m_temp) 4877 { 4289 4878 initDs(iWidth, iHeight, m_pcCfg->getIntraPeriod()>1); 4879 } 4290 4880 4291 4881 filterImg(pcYuvSrc->getLumaAddr(), pcYuvSrc->getStride(), pcYuvDest->getLumaAddr(), pcYuvDest->getStride(), iHeight, iWidth, inputBitDepth-outputBitDepth, 0); … … 4294 4884 } 4295 4885 } 4296 const int TEncGOP::m_phase_filter_0_t0[4][13]={4886 const Int TEncGOP::m_phase_filter_0_t0[4][13]={ 4297 4887 {0, 2, -3, -9, 6, 39, 58, 39, 6, -9, -3, 2, 0}, 4298 4888 {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}, // … … 4301 4891 }; 4302 4892 4303 const int TEncGOP::m_phase_filter_0_t1[4][13]={4893 const Int TEncGOP::m_phase_filter_0_t1[4][13]={ 4304 4894 {0, 4, 0, -12, 0, 40, 64, 40, 0, -12, 0, 4, 0}, 4305 4895 {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}, // … … 4307 4897 {0, 0, 1, -5, -7, 13, 47, 57, 31, -1, -8,-1, 1} 4308 4898 }; 4309 const int TEncGOP::m_phase_filter_0_t1_chroma[4][13]={4899 const Int TEncGOP::m_phase_filter_0_t1_chroma[4][13]={ 4310 4900 {0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0}, 4311 4901 {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}, // … … 4314 4904 }; 4315 4905 4316 const int TEncGOP::m_phase_filter_1[8][13]={4906 const Int TEncGOP::m_phase_filter_1[8][13]={ 4317 4907 {0, 0, 5, -6, -10,37, 76, 37,-10, -6, 5, 0, 0}, 4318 4908 {0, -1, 5, -3, -12,29, 75, 45, -7, -8, 5, 0, 0}, … … 4325 4915 }; 4326 4916 4917 #if CGS_GCC_NO_VECTORIZATION 4918 #ifdef __GNUC__ 4919 #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) 4920 #if GCC_VERSION > 40600 4921 __attribute__((optimize("no-tree-vectorize"))) 4922 #endif 4923 #endif 4924 #endif 4327 4925 Void TEncGOP::filterImg( 4328 4926 Pel *src, … … 4377 4975 // pad temp (vertical) 4378 4976 for (k=-(length>>1); k<0; k++) 4379 memcpy(m_temp[k], m_temp[0], width2*sizeof(int)); 4977 { 4978 memcpy(m_temp[k], m_temp[0], width2*sizeof(Int)); 4979 } 4380 4980 for (k=height1; k<(height1+(length>>1)); k++) 4381 memcpy(m_temp[k], m_temp[k-1], (width2)* sizeof(int)); 4981 { 4982 memcpy(m_temp[k], m_temp[k-1], (width2)* sizeof(Int)); 4983 } 4382 4984 4383 4985 // vertical filtering … … 4400 5002 } 4401 5003 iSum=((iSum + shift_round) >> shift2); 4402 *p_dst++ = ( short)(iSum > iMax ? iMax : (iSum < 0 ? 0 : iSum));5004 *p_dst++ = (Short)(iSum > iMax ? iMax : (iSum < 0 ? 0 : iSum)); 4403 5005 } 4404 5006 p_dst_line += iDstStride; … … 4455 5057 { 4456 5058 if (*array2D) 5059 { 4457 5060 xFree(array2D[-iPadY]-iPadX); 5061 } 4458 5062 else 5063 { 4459 5064 printf("free_mem2DintWithPad: trying to free unused memory\r\nPress Any Key\r\n"); 5065 } 4460 5066 4461 5067 free (&array2D[-iPadY]); -
trunk/source/Lib/TLibEncoder/TEncGOP.h
r713 r815 113 113 Bool m_bRefreshPending; 114 114 Int m_pocCRA; 115 #if POC_RESET_IDC_ENCODER 116 Int m_pocCraWithoutReset; 117 Int m_associatedIrapPocBeforeReset; 118 #endif 115 119 std::vector<Int> m_storedStartCUAddrForEncodingSlice; 116 120 std::vector<Int> m_storedStartCUAddrForEncodingSliceSegment; … … 135 139 UInt m_layerId; 136 140 TEncTop** m_ppcTEncTop; 137 #if SVC_UPSAMPLING138 141 TEncSearch* m_pcPredSearch; ///< encoder search class 139 #endif140 142 #if Q0048_CGS_3D_ASYMLUT 141 143 TEnc3DAsymLUT m_Enc3DAsymLUTPicUpdate; … … 154 156 Int **m_temp; 155 157 #endif 158 #if POC_RESET_IDC_ENCODER 159 Int m_lastPocPeriodId; 160 #endif 156 161 #endif 157 162 … … 172 177 #else 173 178 Void compressGOP ( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRec, std::list<AccessUnit>& accessUnitsInGOP, Bool isField, Bool isTff ); 179 #endif 180 #if POC_RESET_IDC_ENCODER 181 Void determinePocResetIdc( Int const pocCurr, TComSlice *const slice); 182 Int getIntraRefreshInterval() { return m_pcCfg->getIntraPeriod(); } 183 Int getIntraRefreshType() { return m_pcCfg->getDecodingRefreshType(); } 184 // Int getIntraRefreshInterval () { return (m_pcCfg) ? m_pcCfg->getIntraPeriod() : 0; } 185 Int getLastPocPeriodId() { return m_lastPocPeriodId; } 186 Void setLastPocPeriodId(Int x) { m_lastPocPeriodId = x; } 187 Void updatePocValuesOfPics( Int const pocCurr, TComSlice *const slice); 174 188 #endif 175 189 Void xAttachSliceDataToNalUnit (OutputNALUnit& rNalu, TComOutputBitstream*& rpcBitstreamRedirect); … … 209 223 210 224 SEIToneMappingInfo* xCreateSEIToneMappingInfo(); 225 #if P0050_KNEE_FUNCTION_SEI 226 SEIKneeFunctionInfo* xCreateSEIKneeFunctionInfo(); 227 #endif 211 228 #if Q0074_SEI_COLOR_MAPPING 212 229 SEIColorMappingInfo* xCreateSEIColorMappingInfo( Char* file ); -
trunk/source/Lib/TLibEncoder/TEncPic.cpp
r595 r815 126 126 * \return Void 127 127 */ 128 #if SVC_EXTENSION 128 129 #if AUXILIARY_PICTURES 129 #if SVC_UPSAMPLING130 130 Void TEncPic::create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 131 131 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual ) 132 133 #else134 135 Void TEncPic::create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth,136 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, Bool bIsVirtual )137 #endif138 132 { 139 #if SVC_UPSAMPLING140 133 TComPic::create( iWidth, iHeight, chromaFormat, uiMaxWidth, uiMaxHeight, uiMaxDepth, 141 134 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSps, bIsVirtual ); 142 135 #else 143 TComPic::create( iWidth, iHeight, chromaFormat, uiMaxWidth, uiMaxHeight, uiMaxDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, bIsVirtual ); 136 Void TEncPic::create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 137 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual ) 138 { 139 TComPic::create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, 140 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSps, bIsVirtual ); 144 141 #endif 145 142 m_uiMaxAQDepth = uiMaxAQDepth; … … 153 150 } 154 151 } 155 #else 156 #if SVC_UPSAMPLING 157 Void TEncPic::create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 158 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual ) 159 160 #else 152 #else //SVC_EXTENSION 161 153 Void TEncPic::create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 162 154 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, Bool bIsVirtual ) 163 #endif164 155 { 165 #if SVC_UPSAMPLING166 TComPic::create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth,167 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSps, bIsVirtual );168 #else169 156 TComPic::create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, 170 157 conformanceWindow, defaultDisplayWindow, numReorderPics, bIsVirtual ); 171 #endif172 158 m_uiMaxAQDepth = uiMaxAQDepth; 173 159 if ( uiMaxAQDepth > 0 ) … … 180 166 } 181 167 } 182 #endif 168 #endif //SVC_EXTENSION 183 169 184 170 /** Clean up -
trunk/source/Lib/TLibEncoder/TEncPic.h
r595 r815 41 41 #include "TLibCommon/CommonDef.h" 42 42 #include "TLibCommon/TComPic.h" 43 #if SVC_ UPSAMPLING43 #if SVC_EXTENSION 44 44 #include "TLibCommon/TComSlice.h" 45 45 #endif … … 105 105 virtual ~TEncPic(); 106 106 107 #if SVC_EXTENSION 107 108 #if AUXILIARY_PICTURES 108 #if SVC_UPSAMPLING109 109 Void create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 110 110 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual=false ); 111 111 #else 112 Void create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth,113 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, Bool bIsVirtual = false );114 115 #endif116 #else117 #if SVC_UPSAMPLING118 112 Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 119 113 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual = false ); 120 #else 114 #endif 115 #else //SVC_EXTENSION 121 116 Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 122 117 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, Bool bIsVirtual = false ); 123 #endif 124 #endif 118 #endif //SVC_EXTENSION 119 125 120 virtual Void destroy(); 126 121 -
trunk/source/Lib/TLibEncoder/TEncSearch.cpp
r713 r815 3102 3102 * \returns Void 3103 3103 */ 3104 #if SVC_EXTENSION 3105 #if AMP_MRG 3106 Bool TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG ) 3107 #else 3108 Bool TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes ) 3109 #endif 3110 #else 3104 3111 #if AMP_MRG 3105 3112 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG ) 3106 3113 #else 3107 3114 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes ) 3115 #endif 3108 3116 #endif 3109 3117 { … … 3215 3223 #endif 3216 3224 3225 #if SVC_EXTENSION 3226 Bool doneUniPred = false; 3227 #endif 3228 3217 3229 // Uni-directional prediction 3218 3230 for ( Int iRefList = 0; iRefList < iNumPredDir; iRefList++ ) … … 3222 3234 for ( Int iRefIdxTemp = 0; iRefIdxTemp < pcCU->getSlice()->getNumRefIdx(eRefPicList); iRefIdxTemp++ ) 3223 3235 { 3236 #if SVC_EXTENSION 3237 TComPic* pcPic = pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxTemp ); 3238 3239 // motion search only for the ILRP with sample prediction type 3240 if( pcPic->isILR( pcCU->getLayerId() ) && !pcCU->getSlice()->getVPS()->isSamplePredictionType( pcCU->getLayerId(), pcPic->getLayerId() ) ) 3241 { 3242 continue; 3243 } 3244 3224 3245 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 3225 if (pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxTemp )->isILR(pcCU->getLayerId()) && m_disableILP)3246 if( pcPic->isILR(pcCU->getLayerId()) && m_disableILP ) 3226 3247 { 3227 3248 continue; 3228 3249 } 3229 3250 #endif 3230 #if (ENCODER_FAST_MODE) 3231 TComPic* pcPic = pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxTemp ); 3251 #if (ENCODER_FAST_MODE) 3232 3252 if( pcPic->isILR(pcCU->getLayerId()) && (ePartSize == SIZE_2Nx2N) ) 3233 3253 { 3234 3254 continue; 3235 3255 } 3256 #endif 3257 doneUniPred = true; 3236 3258 #endif 3237 3259 … … 3342 3364 } 3343 3365 } 3366 3367 #if SVC_EXTENSION 3368 if( pcCU->getLayerId() && !doneUniPred ) 3369 { 3370 // there is no valid reference pictures for inter prediction 3371 return false; 3372 } 3373 #endif 3374 3344 3375 // Bi-directional prediction 3345 3376 #if REF_IDX_ME_ZEROMV … … 3462 3493 #if (ENCODER_FAST_MODE) 3463 3494 Bool testRefIdx = true; 3464 pcPic = pcCU->getSlice()->getRefPic( RefPicList(iRefList) , iRefIdxTemp ); 3495 pcPic = pcCU->getSlice()->getRefPic( RefPicList(iRefList) , iRefIdxTemp ); 3496 3497 // motion search only for the ILRP with sample prediction type 3498 if( pcPic->isILR( pcCU->getLayerId() ) && !pcCU->getSlice()->getVPS()->isSamplePredictionType( pcCU->getLayerId(), pcPic->getLayerId() ) ) 3499 { 3500 continue; 3501 } 3502 3465 3503 if(pcPic->isILR(pcCU->getLayerId()) && (ePartSize == SIZE_2Nx2N)) 3466 3504 { … … 3781 3819 setWpScalingDistParam( pcCU, -1, REF_PIC_LIST_X ); 3782 3820 3821 #if SVC_EXTENSION 3822 return true; 3823 #else 3783 3824 return; 3825 #endif 3784 3826 } 3785 3827 … … 5967 6009 Bool TEncSearch::predInterSearchILRUni( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, UInt refLayerId ) 5968 6010 { 5969 rpcPredYuv->clear(); 5970 rpcRecoYuv->clear(); 5971 5972 Int iNumPredDir = pcCU->getSlice()->isInterP() ? 1 : 2; 5973 5974 TComMv cMv[2]; 5975 TComMv cMvPred[2][33]; 5976 TComMv cMvTemp[2][33]; 5977 TComMv TempMv; 5978 5979 Int iRefIdx[2]={0,0}; 5980 5981 Int aaiMvpIdx[2][33]; 5982 Int aaiMvpNum[2][33]; 5983 5984 UInt uiMbBits[3] = {1, 1, 0}; 5985 UInt uiLastMode = 0; 5986 5987 UInt uiCost[2] = { MAX_UINT, MAX_UINT }; //uni, rdCost 5988 UInt uiCostTemp; 5989 UInt biPDistTemp = MAX_INT; 5990 UInt uiBitsTemp; 5991 5992 PartSize ePartSize = pcCU->getPartitionSize( 0 ); //2Nx2N 5993 Int iPartIdx = 0; //one PU in CU 5994 UInt uiPartAddr; 5995 Int iRoiWidth, iRoiHeight; 5996 Bool bILRSearched = false; 5997 5998 xGetBlkBits( ePartSize, pcCU->getSlice()->isInterP(), iPartIdx, uiLastMode, uiMbBits); 5999 pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iRoiWidth, iRoiHeight ); 6000 6001 for( Int iRefList = 0; iRefList < iNumPredDir; iRefList++) //list 6002 { 6003 if(bILRSearched) 6004 continue; 6005 6006 RefPicList eRefPicList = ( iRefList ? REF_PIC_LIST_1 : REF_PIC_LIST_0 ); 6007 6008 Int iRefIdxTemp = -1; 6009 Bool foundILR = false; 6010 6011 for( Int refIdx = 0; refIdx < pcCU->getSlice()->getNumRefIdx(eRefPicList); refIdx++ ) 6012 { 6013 if( pcCU->getSlice()->getRefPic(eRefPicList, refIdx)->isILR(pcCU->getLayerId()) && pcCU->getSlice()->getRefPic(eRefPicList, refIdx)->getLayerId() == refLayerId ) 6014 { 6015 iRefIdxTemp = refIdx; 6016 foundILR = true; 6017 bILRSearched = true; 6018 break; 6019 } 6020 } 6021 6022 if(!foundILR) //no ILR in eRefPiclist 6023 { 6024 continue; 6025 } 6026 6027 uiBitsTemp = uiMbBits[iRefList]; 6028 if ( pcCU->getSlice()->getNumRefIdx(eRefPicList) > 1 ) 6029 { 6030 uiBitsTemp += iRefIdxTemp+1; 6031 if ( iRefIdxTemp == pcCU->getSlice()->getNumRefIdx(eRefPicList)-1 ) uiBitsTemp--; 6032 } 6033 6034 xEstimateMvPredAMVP( pcCU, pcOrgYuv, iPartIdx, eRefPicList, iRefIdxTemp, cMvPred[iRefList][iRefIdxTemp], false, &biPDistTemp); 6035 aaiMvpIdx[iRefList][iRefIdxTemp] = pcCU->getMVPIdx(eRefPicList, uiPartAddr); 6036 aaiMvpNum[iRefList][iRefIdxTemp] = pcCU->getMVPNum(eRefPicList, uiPartAddr); 6037 6038 uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdx[iRefList][iRefIdxTemp]][AMVP_MAX_NUM_CANDS]; 6039 6040 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp ); 6041 xCheckBestMVP(pcCU, eRefPicList, cMvTemp[iRefList][iRefIdxTemp], cMvPred[iRefList][iRefIdxTemp], aaiMvpIdx[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp); 6042 6043 if( uiCostTemp < uiCost[iRefList] ) 6044 { 6045 uiCost[iRefList] = uiCostTemp; 6046 6047 cMv[iRefList] = cMvTemp[iRefList][iRefIdxTemp]; 6048 iRefIdx[iRefList] = iRefIdxTemp; 6049 6050 pcCU->getCUMvField(eRefPicList)->setAllMv( cMv[iRefList], ePartSize, uiPartAddr, 0, iPartIdx ); 6051 pcCU->getCUMvField(eRefPicList)->setAllRefIdx( iRefIdx[iRefList], ePartSize, uiPartAddr, 0, iPartIdx ); 6052 } 6053 } 6054 6055 if( uiCost[0] == MAX_UINT && uiCost[1] == MAX_UINT ) //no ILR in both list0 and list1 6056 { 6057 return false; 6058 } 6059 6060 // Clear Motion Field 6061 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( TComMvField(), ePartSize, uiPartAddr, 0, iPartIdx ); 6062 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( TComMvField(), ePartSize, uiPartAddr, 0, iPartIdx ); 6063 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvd ( TComMv(), ePartSize, uiPartAddr, 0, iPartIdx ); 6064 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvd ( TComMv(), ePartSize, uiPartAddr, 0, iPartIdx ); 6065 6066 pcCU->setMVPIdxSubParts( -1, REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6067 pcCU->setMVPNumSubParts( -1, REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6068 pcCU->setMVPIdxSubParts( -1, REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6069 pcCU->setMVPNumSubParts( -1, REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6070 6071 if( uiCost[0] <= uiCost[1] ) //list0 ILR 6072 { 6073 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMv ( cMv[0], ePartSize, uiPartAddr, 0, iPartIdx ); 6074 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllRefIdx( iRefIdx[0], ePartSize, uiPartAddr, 0, iPartIdx ); 6075 6076 TempMv = cMv[0] - cMvPred[0][iRefIdx[0]]; 6077 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvd( TempMv, ePartSize, uiPartAddr, 0, iPartIdx ); 6078 6079 pcCU->setInterDirSubParts( 1, uiPartAddr, iPartIdx, pcCU->getDepth(0) ); 6080 6081 pcCU->setMVPIdxSubParts( aaiMvpIdx[0][iRefIdx[0]], REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6082 pcCU->setMVPNumSubParts( aaiMvpNum[0][iRefIdx[0]], REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6083 } 6084 else if( uiCost[1] < uiCost[0] ) //list1 ILR 6085 { 6086 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMv ( cMv[1], ePartSize, uiPartAddr, 0, iPartIdx ); 6087 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllRefIdx( iRefIdx[1], ePartSize, uiPartAddr, 0, iPartIdx ); 6088 6089 TempMv = cMv[1] - cMvPred[1][iRefIdx[1]]; 6090 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvd( TempMv, ePartSize, uiPartAddr, 0, iPartIdx ); 6091 6092 pcCU->setInterDirSubParts( 2, uiPartAddr, iPartIdx, pcCU->getDepth(0) ); 6093 6094 pcCU->setMVPIdxSubParts( aaiMvpIdx[1][iRefIdx[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6095 pcCU->setMVPNumSubParts( aaiMvpNum[1][iRefIdx[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6096 } 6097 else 6098 { 6099 assert(0); 6100 } 6101 6102 pcCU->setMergeFlagSubParts( false, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 6103 6104 motionCompensation ( pcCU, rpcPredYuv, REF_PIC_LIST_X, iPartIdx ); 6105 setWpScalingDistParam( pcCU, -1, REF_PIC_LIST_X ); 6106 6107 return true; 6011 rpcPredYuv->clear(); 6012 rpcRecoYuv->clear(); 6013 6014 Int iNumPredDir = pcCU->getSlice()->isInterP() ? 1 : 2; 6015 6016 TComMv cMv[2]; 6017 TComMv cMvPred[2][33]; 6018 TComMv cMvTemp[2][33]; 6019 TComMv TempMv; 6020 6021 Int iRefIdx[2]={0,0}; 6022 6023 Int aaiMvpIdx[2][33]; 6024 Int aaiMvpNum[2][33]; 6025 6026 UInt uiMbBits[3] = {1, 1, 0}; 6027 UInt uiLastMode = 0; 6028 6029 UInt uiCost[2] = { MAX_UINT, MAX_UINT }; //uni, rdCost 6030 UInt uiCostTemp; 6031 UInt biPDistTemp = MAX_INT; 6032 UInt uiBitsTemp; 6033 6034 PartSize ePartSize = pcCU->getPartitionSize( 0 ); //2Nx2N 6035 Int iPartIdx = 0; //one PU in CU 6036 UInt uiPartAddr; 6037 Int iRoiWidth, iRoiHeight; 6038 Bool bILRSearched = false; 6039 6040 xGetBlkBits( ePartSize, pcCU->getSlice()->isInterP(), iPartIdx, uiLastMode, uiMbBits); 6041 pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iRoiWidth, iRoiHeight ); 6042 6043 for( Int iRefList = 0; iRefList < iNumPredDir; iRefList++) //list 6044 { 6045 if(bILRSearched) 6046 { 6047 continue; 6048 } 6049 6050 RefPicList eRefPicList = ( iRefList ? REF_PIC_LIST_1 : REF_PIC_LIST_0 ); 6051 6052 Int iRefIdxTemp = -1; 6053 Bool foundILR = false; 6054 6055 for( Int refIdx = 0; refIdx < pcCU->getSlice()->getNumRefIdx(eRefPicList); refIdx++ ) 6056 { 6057 TComPic* refPic = pcCU->getSlice()->getRefPic(eRefPicList, refIdx); 6058 6059 // ILRP has to be for the sample prediction type 6060 if( refPic->isILR(pcCU->getLayerId()) && refPic->getLayerId() == refLayerId && pcCU->getSlice()->getVPS()->isSamplePredictionType( pcCU->getLayerId(), refLayerId ) ) 6061 { 6062 iRefIdxTemp = refIdx; 6063 foundILR = true; 6064 bILRSearched = true; 6065 break; 6066 } 6067 } 6068 6069 if(!foundILR) //no ILR in eRefPiclist 6070 { 6071 continue; 6072 } 6073 6074 uiBitsTemp = uiMbBits[iRefList]; 6075 if ( pcCU->getSlice()->getNumRefIdx(eRefPicList) > 1 ) 6076 { 6077 uiBitsTemp += iRefIdxTemp+1; 6078 if ( iRefIdxTemp == pcCU->getSlice()->getNumRefIdx(eRefPicList)-1 ) uiBitsTemp--; 6079 } 6080 6081 xEstimateMvPredAMVP( pcCU, pcOrgYuv, iPartIdx, eRefPicList, iRefIdxTemp, cMvPred[iRefList][iRefIdxTemp], false, &biPDistTemp); 6082 aaiMvpIdx[iRefList][iRefIdxTemp] = pcCU->getMVPIdx(eRefPicList, uiPartAddr); 6083 aaiMvpNum[iRefList][iRefIdxTemp] = pcCU->getMVPNum(eRefPicList, uiPartAddr); 6084 6085 uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdx[iRefList][iRefIdxTemp]][AMVP_MAX_NUM_CANDS]; 6086 6087 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp ); 6088 xCheckBestMVP(pcCU, eRefPicList, cMvTemp[iRefList][iRefIdxTemp], cMvPred[iRefList][iRefIdxTemp], aaiMvpIdx[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp); 6089 6090 if( uiCostTemp < uiCost[iRefList] ) 6091 { 6092 uiCost[iRefList] = uiCostTemp; 6093 6094 cMv[iRefList] = cMvTemp[iRefList][iRefIdxTemp]; 6095 iRefIdx[iRefList] = iRefIdxTemp; 6096 6097 pcCU->getCUMvField(eRefPicList)->setAllMv( cMv[iRefList], ePartSize, uiPartAddr, 0, iPartIdx ); 6098 pcCU->getCUMvField(eRefPicList)->setAllRefIdx( iRefIdx[iRefList], ePartSize, uiPartAddr, 0, iPartIdx ); 6099 } 6100 } 6101 6102 if( uiCost[0] == MAX_UINT && uiCost[1] == MAX_UINT ) //no ILR in both list0 and list1 6103 { 6104 return false; 6105 } 6106 6107 // Clear Motion Field 6108 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( TComMvField(), ePartSize, uiPartAddr, 0, iPartIdx ); 6109 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( TComMvField(), ePartSize, uiPartAddr, 0, iPartIdx ); 6110 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvd ( TComMv(), ePartSize, uiPartAddr, 0, iPartIdx ); 6111 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvd ( TComMv(), ePartSize, uiPartAddr, 0, iPartIdx ); 6112 6113 pcCU->setMVPIdxSubParts( -1, REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6114 pcCU->setMVPNumSubParts( -1, REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6115 pcCU->setMVPIdxSubParts( -1, REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6116 pcCU->setMVPNumSubParts( -1, REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6117 6118 if( uiCost[0] <= uiCost[1] ) //list0 ILR 6119 { 6120 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMv ( cMv[0], ePartSize, uiPartAddr, 0, iPartIdx ); 6121 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllRefIdx( iRefIdx[0], ePartSize, uiPartAddr, 0, iPartIdx ); 6122 6123 TempMv = cMv[0] - cMvPred[0][iRefIdx[0]]; 6124 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvd( TempMv, ePartSize, uiPartAddr, 0, iPartIdx ); 6125 6126 pcCU->setInterDirSubParts( 1, uiPartAddr, iPartIdx, pcCU->getDepth(0) ); 6127 6128 pcCU->setMVPIdxSubParts( aaiMvpIdx[0][iRefIdx[0]], REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6129 pcCU->setMVPNumSubParts( aaiMvpNum[0][iRefIdx[0]], REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6130 } 6131 else if( uiCost[1] < uiCost[0] ) //list1 ILR 6132 { 6133 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMv ( cMv[1], ePartSize, uiPartAddr, 0, iPartIdx ); 6134 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllRefIdx( iRefIdx[1], ePartSize, uiPartAddr, 0, iPartIdx ); 6135 6136 TempMv = cMv[1] - cMvPred[1][iRefIdx[1]]; 6137 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvd( TempMv, ePartSize, uiPartAddr, 0, iPartIdx ); 6138 6139 pcCU->setInterDirSubParts( 2, uiPartAddr, iPartIdx, pcCU->getDepth(0) ); 6140 6141 pcCU->setMVPIdxSubParts( aaiMvpIdx[1][iRefIdx[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6142 pcCU->setMVPNumSubParts( aaiMvpNum[1][iRefIdx[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6143 } 6144 else 6145 { 6146 assert(0); 6147 } 6148 6149 pcCU->setMergeFlagSubParts( false, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 6150 6151 motionCompensation ( pcCU, rpcPredYuv, REF_PIC_LIST_X, iPartIdx ); 6152 setWpScalingDistParam( pcCU, -1, REF_PIC_LIST_X ); 6153 6154 return true; 6108 6155 } 6109 6156 #endif -
trunk/source/Lib/TLibEncoder/TEncSearch.h
r595 r815 126 126 127 127 #if SVC_EXTENSION 128 TEncTop** m_ppcTEncTop;129 128 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 130 129 Bool m_disableILP; 131 130 #endif 132 #endif //SVC_EXTEN AION131 #endif //SVC_EXTENSION 133 132 134 133 public: … … 194 193 195 194 /// encoder estimation - inter prediction (non-skip) 195 #if SVC_EXTENSION 196 Bool predInterSearch ( TComDataCU* pcCU, 197 #else 196 198 Void predInterSearch ( TComDataCU* pcCU, 199 #endif 197 200 TComYuv* pcOrgYuv, 198 201 TComYuv*& rpcPredYuv, -
trunk/source/Lib/TLibEncoder/TEncTop.cpp
r713 r815 89 89 #endif 90 90 m_numScaledRefLayerOffsets = 0; 91 #if POC_RESET_FLAG 91 #if POC_RESET_FLAG || POC_RESET_IDC_ENCODER 92 92 m_pocAdjustmentValue = 0; 93 93 #endif … … 810 810 811 811 //only for scalable extension 812 #if SCALABILITY_MASK_E0104 813 assert( m_cVPS.getScalabilityMask(2) == true ); 814 #else 815 assert( m_cVPS.getScalabilityMask(1) == true ); 816 #endif 812 assert( m_cVPS.getScalabilityMask( SCALABILITY_ID ) == true ); 817 813 } 818 814 } … … 820 816 #endif 821 817 818 #if SVC_EXTENSION 822 819 #if AUXILIARY_PICTURES 823 #if SVC_UPSAMPLING824 820 pcEPic->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1 , 825 821 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics, &m_cSPS); 826 822 #else 827 pcEPic->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1 ,828 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics);829 #endif830 #else831 #if SVC_UPSAMPLING832 823 pcEPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1 , 833 824 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics, &m_cSPS); 834 #else 825 #endif 826 #else //SVC_EXTENSION 835 827 pcEPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1 , 836 828 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics); 837 #endif 838 #endif 829 #endif //SVC_EXTENSION 839 830 rpcPic = pcEPic; 840 831 } … … 879 870 880 871 //only for scalable extension 881 #if SCALABILITY_MASK_E0104 882 assert( m_cVPS.getScalabilityMask(2) == true ); 883 #else 884 assert( m_cVPS.getScalabilityMask(1) == true ); 885 #endif 872 assert( m_cVPS.getScalabilityMask( SCALABILITY_ID ) == true ); 886 873 } 887 874 } … … 889 876 #endif 890 877 878 #if SVC_EXTENSION 891 879 #if AUXILIARY_PICTURES 892 #if SVC_UPSAMPLING893 880 rpcPic->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 894 881 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics, &m_cSPS); 895 882 #else 896 rpcPic->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,897 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics);898 #endif899 #else900 #if SVC_UPSAMPLING901 883 rpcPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 902 884 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics, &m_cSPS); 903 #else 885 #endif 886 #else //SVC_EXTENSION 904 887 rpcPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 905 888 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics); 906 #endif 907 #endif 889 #endif //SVC_EXTENSION 908 890 } 909 891 m_cListPic.pushBack( rpcPic ); … … 922 904 { 923 905 #if SVC_EXTENSION 906 m_cSPS.setExtensionFlag( m_layerId > 0 ? true : false ); 907 908 #if Q0078_ADD_LAYER_SETS 909 if (getNumDirectRefLayers() == 0 && getNumAddLayerSets() > 0) 910 { 911 m_cSPS.setLayerId(0); // layer ID 0 for independent layers 912 } 913 else 914 { 915 m_cSPS.setLayerId(m_layerId); 916 } 917 #else 924 918 m_cSPS.setLayerId(m_layerId); 919 #endif 925 920 m_cSPS.setNumScaledRefLayerOffsets(m_numScaledRefLayerOffsets); 926 921 for(Int i = 0; i < m_cSPS.getNumScaledRefLayerOffsets(); i++) … … 1082 1077 Void TEncTop::xInitPPS() 1083 1078 { 1084 #if SCALINGLIST_INFERRING1085 m_cPPS.setLayerId( m_layerId );1086 #endif1087 1088 1079 m_cPPS.setConstrainedIntraPred( m_bUseConstrainedIntraPred ); 1089 1080 Bool bUseDQP = (getMaxCuDQPDepth() > 0)? true : false; … … 1181 1172 } 1182 1173 #if SVC_EXTENSION 1183 if (!m_layerId) 1174 #if SCALINGLIST_INFERRING 1175 m_cPPS.setLayerId( m_layerId ); 1176 #endif 1177 1178 #if Q0078_ADD_LAYER_SETS 1179 if (getNumDirectRefLayers() == 0 && getNumAddLayerSets() > 0) 1180 { 1181 m_cPPS.setLayerId(0); // layer ID 0 for independent layers 1182 } 1183 #endif 1184 1185 if( m_layerId > 0 ) 1186 { 1187 m_cPPS.setListsModificationPresentFlag(true); 1188 m_cPPS.setExtensionFlag(true); 1189 } 1190 else 1184 1191 { 1185 1192 m_cPPS.setListsModificationPresentFlag(false); 1186 } 1187 else 1188 { 1189 m_cPPS.setListsModificationPresentFlag(true); 1190 } 1191 1192 m_cPPS.setPPSId ( m_iPPSIdCnt ); 1193 m_cPPS.setSPSId ( m_iSPSIdCnt ); 1194 #endif 1193 m_cPPS.setExtensionFlag(false); 1194 } 1195 1196 m_cPPS.setPPSId( m_iPPSIdCnt ); 1197 m_cPPS.setSPSId( m_iSPSIdCnt ); 1195 1198 #if POC_RESET_FLAG 1196 1199 m_cPPS.setNumExtraSliceHeaderBits( 2 ); … … 1205 1208 m_cPPS.setCGSFlag( m_nCGSFlag ); 1206 1209 #endif 1210 #if POC_RESET_IDC_ENCODER 1211 m_cPPS.setPocResetInfoPresentFlag( true ); 1212 m_cPPS.setExtensionFlag( true ); 1213 m_cPPS.setSliceHeaderExtensionPresentFlag( true ); 1214 #endif 1215 #endif //SVC_EXTENSION 1207 1216 } 1208 1217 … … 1582 1591 { 1583 1592 m_cIlpPic[j] = new TComPic; 1584 #if SVC_UPSAMPLING1585 1593 #if AUXILIARY_PICTURES 1586 1594 m_cIlpPic[j]->create(m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, &m_cSPS, true); 1587 1595 #else 1588 1596 m_cIlpPic[j]->create(m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, &m_cSPS, true); 1589 #endif1590 #else1591 m_cIlpPic[j]->create(m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true);1592 1597 #endif 1593 1598 for (Int i=0; i<m_cIlpPic[j]->getPicSym()->getNumberOfCUsInFrame(); i++) … … 1649 1654 { 1650 1655 m_cIlpPic[j] = new TComPic; 1651 #if SVC_UPSAMPLING1652 1656 #if AUXILIARY_PICTURES 1653 1657 m_cIlpPic[j]->create(picWidth, picHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, &m_cSPS, true); 1654 1658 #else 1655 1659 m_cIlpPic[j]->create(picWidth, picHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, &m_cSPS, true); 1656 #endif1657 #else1658 m_cIlpPic[j]->create(m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true);1659 1660 #endif 1660 1661 for (Int i=0; i<m_cIlpPic[j]->getPicSym()->getNumberOfCUsInFrame(); i++) -
trunk/source/Lib/TLibEncoder/TEncTop.h
r713 r815 142 142 Bool m_vertPhasePositionEnableFlag[MAX_LAYERS]; 143 143 #endif 144 #if POC_RESET_FLAG 144 #if POC_RESET_FLAG || POC_RESET_IDC_ENCODER 145 145 Int m_pocAdjustmentValue; 146 146 #endif … … 153 153 #if O0194_WEIGHTED_PREDICTION_CGS 154 154 Bool m_interLayerWeightedPredFlag; 155 #endif 156 #if Q0078_ADD_LAYER_SETS 157 int m_numAddLayerSets; 155 158 #endif 156 159 #endif //SVC_EXTENSION … … 254 257 TEncTop* getRefLayerEnc(UInt refLayerIdc); 255 258 #endif 256 #if POC_RESET_FLAG 259 #if POC_RESET_FLAG || POC_RESET_IDC_ENCODER 257 260 Int getPocAdjustmentValue() { return m_pocAdjustmentValue;} 258 261 Void setPocAdjustmentValue(Int x) { m_pocAdjustmentValue = x; } … … 268 271 Void setNoOutputOfPriorPicsFlags(Bool x) { m_noOutputOfPriorPicsFlags = x; } 269 272 #endif 273 #if Q0078_ADD_LAYER_SETS 274 Void setNumAddLayerSets(Int x) { m_numAddLayerSets = x; } 275 Int getNumAddLayerSets() { return m_numAddLayerSets; } 276 #endif 270 277 #else //SVC_EXTENSION 271 278 Void encode( Bool bEos, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut,
Note: See TracChangeset for help on using the changeset viewer.