Changeset 1235 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibEncoder
- Timestamp:
- 13 Jul 2015, 20:38:11 (10 years ago)
- Location:
- branches/SHM-dev/source/Lib/TLibEncoder
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.cpp
r1185 r1235 55 55 56 56 #if O0164_MULTI_LAYER_HRD 57 Void SEIWriter::xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComVPS *vps,TComSPS *sps, const SEIScalableNesting* nestingSeiPtr, const SEIBspNesting* bspNestingSeiPtr)57 Void SEIWriter::xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting* nestingSeiPtr, const SEIBspNesting* bspNestingSeiPtr) 58 58 #else 59 Void SEIWriter::xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComSPS *sps)59 Void SEIWriter::xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, const TComSPS *sps) 60 60 #endif 61 61 { … … 215 215 */ 216 216 #if O0164_MULTI_LAYER_HRD 217 Void SEIWriter::writeSEImessage(TComBitIf& bs, const SEI& sei, TComVPS *vps,TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei)217 Void SEIWriter::writeSEImessage(TComBitIf& bs, const SEI& sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei) 218 218 #else 219 Void SEIWriter::writeSEImessage(TComBitIf& bs, const SEI& sei, TComSPS *sps)219 Void SEIWriter::writeSEImessage(TComBitIf& bs, const SEI& sei, const TComSPS *sps) 220 220 #endif 221 221 { … … 341 341 342 342 #if SVC_EXTENSION 343 Void SEIWriter::xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei,TComVPS *vps)344 { 345 TComHRD *hrd;343 Void SEIWriter::xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps) 344 { 345 const TComHRD *hrd; 346 346 if( bspNestingSei ) // If DU info SEI contained inside a BSP nesting SEI message 347 347 { … … 352 352 Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1; 353 353 std::vector<Int> hrdIdx(maxValues, 0); 354 std::vector< TComHRD*> hrdVec;354 std::vector<const TComHRD*> hrdVec; 355 355 std::vector<Int> syntaxElemLen(maxValues, 0); 356 356 for(Int i = 0; i < maxValues; i++) … … 376 376 else 377 377 { 378 TComVUI *vui = sps->getVuiParameters();378 const TComVUI *vui = sps->getVuiParameters(); 379 379 hrd = vui->getHrdParameters(); 380 380 } … … 392 392 } 393 393 #else 394 Void SEIWriter::xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, TComSPS *sps)395 { 396 TComVUI *vui = sps->getVuiParameters();394 Void SEIWriter::xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, const TComSPS *sps) 395 { 396 const TComVUI *vui = sps->getVuiParameters(); 397 397 WRITE_UVLC(sei.m_decodingUnitIdx, "decoding_unit_idx"); 398 398 if(vui->getHrdParameters()->getSubPicCpbParamsInPicTimingSEIFlag()) … … 409 409 410 410 #if SVC_EXTENSION 411 Void SEIWriter::xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei,TComVPS *vps)411 Void SEIWriter::xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps) 412 412 #else 413 Void SEIWriter::xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, TComSPS *sps)413 Void SEIWriter::xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, const TComSPS *sps) 414 414 #endif 415 415 { 416 416 Int i, nalOrVcl; 417 417 #if SVC_EXTENSION 418 TComHRD *hrd;418 const TComHRD *hrd; 419 419 if( bspNestingSei ) // If BP SEI contained inside a BSP nesting SEI message 420 420 { … … 425 425 Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1; 426 426 std::vector<Int> hrdIdx(maxValues, 0); 427 std::vector< TComHRD*> hrdVec;427 std::vector<const TComHRD*> hrdVec; 428 428 std::vector<Int> syntaxElemLen(maxValues, 0); 429 429 for(i = 0; i < maxValues; i++) … … 448 448 else 449 449 { 450 TComVUI *vui = sps->getVuiParameters();450 const TComVUI *vui = sps->getVuiParameters(); 451 451 hrd = vui->getHrdParameters(); 452 452 } 453 453 // To be done: When contained in an BSP HRD SEI message, the hrd structure is to be chosen differently. 454 454 #else 455 TComVUI *vui = sps->getVuiParameters();456 TComHRD *hrd = vui->getHrdParameters();455 const TComVUI *vui = sps->getVuiParameters(); 456 const TComHRD *hrd = vui->getHrdParameters(); 457 457 #endif 458 458 … … 495 495 496 496 #if SVC_EXTENSION 497 Void SEIWriter::xWriteSEIPictureTiming(const SEIPictureTiming& sei, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei,TComVPS *vps)497 Void SEIWriter::xWriteSEIPictureTiming(const SEIPictureTiming& sei, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps) 498 498 #else 499 Void SEIWriter::xWriteSEIPictureTiming(const SEIPictureTiming& sei, TComSPS *sps)499 Void SEIWriter::xWriteSEIPictureTiming(const SEIPictureTiming& sei, const TComSPS *sps) 500 500 #endif 501 501 { 502 502 Int i; 503 503 #if SVC_EXTENSION 504 TComHRD *hrd;505 TComVUI *vui = sps->getVuiParameters();504 const TComHRD *hrd; 505 const TComVUI *vui = sps->getVuiParameters(); 506 506 if( bspNestingSei ) // If BP SEI contained inside a BSP nesting SEI message 507 507 { … … 512 512 Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1; 513 513 std::vector<Int> hrdIdx(maxValues, 0); 514 std::vector< TComHRD*> hrdVec;514 std::vector<const TComHRD*> hrdVec; 515 515 std::vector<Int> syntaxElemLen(maxValues, 0); 516 516 for(i = 0; i < maxValues; i++) … … 543 543 // To be done: When contained in an BSP HRD SEI message, the hrd structure is to be chosen differently. 544 544 #else 545 TComVUI *vui = sps->getVuiParameters();546 TComHRD *hrd = vui->getHrdParameters();545 const TComVUI *vui = sps->getVuiParameters(); 546 const TComHRD *hrd = vui->getHrdParameters(); 547 547 #endif 548 548 … … 752 752 753 753 #if O0164_MULTI_LAYER_HRD 754 Void SEIWriter::xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComVPS *vps,TComSPS *sps)754 Void SEIWriter::xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, const TComVPS *vps, const TComSPS *sps) 755 755 #else 756 Void SEIWriter::xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComSPS *sps)756 Void SEIWriter::xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, const TComSPS *sps) 757 757 #endif 758 758 { … … 1130 1130 1131 1131 #if O0164_MULTI_LAYER_HRD 1132 Void SEIWriter::xWriteSEIBspNesting(TComBitIf& bs, const SEIBspNesting &sei, TComVPS *vps,TComSPS *sps, const SEIScalableNesting &nestingSei)1132 Void SEIWriter::xWriteSEIBspNesting(TComBitIf& bs, const SEIBspNesting &sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting &nestingSei) 1133 1133 { 1134 1134 WRITE_UVLC( sei.m_bspIdx, "bsp_idx" ); … … 1149 1149 } 1150 1150 1151 Void SEIWriter::xWriteSEIBspInitialArrivalTime(const SEIBspInitialArrivalTime &sei, TComVPS *vps,TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei)1151 Void SEIWriter::xWriteSEIBspInitialArrivalTime(const SEIBspInitialArrivalTime &sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei) 1152 1152 { 1153 1153 assert(vps->getVpsVuiPresentFlag()); 1154 1154 1155 #if SVC_EXTENSION1156 1155 Int psIdx = bspNestingSei.m_seiPartitioningSchemeIdx; 1157 1156 Int seiOlsIdx = bspNestingSei.m_seiOlsIdx; … … 1159 1158 Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1; 1160 1159 std::vector<Int> hrdIdx(maxValues, 0); 1161 std::vector< TComHRD*> hrdVec;1160 std::vector<const TComHRD*> hrdVec; 1162 1161 std::vector<Int> syntaxElemLen(maxValues, 0); 1163 1162 for(Int i = 0; i < maxValues; i++) … … 1191 1190 } 1192 1191 } 1193 #else1194 UInt schedCombCnt = vps->getNumBspSchedCombinations(nestingSei.m_nestingOpIdx[0]);1195 UInt len;1196 UInt hrdIdx;1197 1198 if (schedCombCnt > 0)1199 {1200 hrdIdx = vps->getBspCombHrdIdx(nestingSei.m_nestingOpIdx[0], 0, bspNestingSei.m_bspIdx);1201 }1202 else1203 {1204 hrdIdx = 0;1205 }1206 1207 TComHRD *hrd = vps->getBspHrd(hrdIdx);1208 1209 if (hrd->getNalHrdParametersPresentFlag() || hrd->getVclHrdParametersPresentFlag())1210 {1211 len = hrd->getInitialCpbRemovalDelayLengthMinus1() + 1;1212 }1213 else1214 {1215 len = 23 + 1;1216 }1217 1218 if (hrd->getNalHrdParametersPresentFlag())1219 {1220 for(UInt i = 0; i < schedCombCnt; i++)1221 {1222 WRITE_CODE( sei.m_nalInitialArrivalDelay[i], len, "nal_initial_arrival_delay" );1223 }1224 }1225 #if BSP_INIT_ARRIVAL_SEI1226 if( hrd->getVclHrdParametersPresentFlag() )1227 #else1228 else1229 #endif1230 {1231 for(UInt i = 0; i < schedCombCnt; i++)1232 {1233 WRITE_CODE( sei.m_vclInitialArrivalDelay[i], len, "vcl_initial_arrival_delay" );1234 }1235 }1236 #endif1237 1192 } 1238 1193 -
branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.h
r1185 r1235 51 51 52 52 #if O0164_MULTI_LAYER_HRD 53 Void writeSEImessage(TComBitIf& bs, const SEI& sei, TComVPS *vps,TComSPS *sps, const SEIScalableNesting* nestingSei=NULL, const SEIBspNesting* bspNestingSei=NULL);53 Void writeSEImessage(TComBitIf& bs, const SEI& sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting* nestingSei=NULL, const SEIBspNesting* bspNestingSei=NULL); 54 54 #else 55 Void writeSEImessage(TComBitIf& bs, const SEI& sei, TComSPS *sps);55 Void writeSEImessage(TComBitIf& bs, const SEI& sei, const TComSPS *sps); 56 56 #endif 57 57 58 58 protected: 59 59 #if O0164_MULTI_LAYER_HRD 60 Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComVPS *vps,TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei);60 Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei); 61 61 #else 62 Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComSPS *sps);62 Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, const TComSPS *sps); 63 63 #endif 64 64 Void xWriteSEIuserDataUnregistered(const SEIuserDataUnregistered &sei); … … 66 66 Void xWriteSEIDecodedPictureHash(const SEIDecodedPictureHash& sei); 67 67 #if SVC_EXTENSION 68 Void xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei,TComVPS *vps);69 Void xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei,TComVPS *vps);70 Void xWriteSEIPictureTiming(const SEIPictureTiming& sei, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei,TComVPS *vps);68 Void xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps); 69 Void xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps); 70 Void xWriteSEIPictureTiming(const SEIPictureTiming& sei, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps); 71 71 #else 72 Void xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, TComSPS *sps);73 Void xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, TComSPS *sps);74 Void xWriteSEIPictureTiming(const SEIPictureTiming& sei, TComSPS *sps);72 Void xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, const TComSPS *sps); 73 Void xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, const TComSPS *sps); 74 Void xWriteSEIPictureTiming(const SEIPictureTiming& sei, const TComSPS *sps); 75 75 #endif 76 76 TComSPS *m_pSPS; … … 85 85 Void xWriteSEISOPDescription(const SEISOPDescription& sei); 86 86 #if O0164_MULTI_LAYER_HRD 87 Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComVPS *vps,TComSPS *sps);87 Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, const TComVPS *vps, const TComSPS *sps); 88 88 #else 89 Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComSPS *sps);89 Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, const TComSPS *sps); 90 90 #endif 91 91 Void xWriteSEITempMotionConstrainedTileSets(TComBitIf& bs, const SEITempMotionConstrainedTileSets& sei); … … 110 110 #endif 111 111 #if Q0189_TMVP_CONSTRAINTS 112 Void xWriteSEITMVPConstraints 112 Void xWriteSEITMVPConstraints(const SEITMVPConstrains &sei); 113 113 #endif 114 114 #if Q0247_FRAME_FIELD_INFO 115 Void xWriteSEIFrameFieldInfo 115 Void xWriteSEIFrameFieldInfo(const SEIFrameFieldInfo &sei); 116 116 #endif 117 117 #if O0164_MULTI_LAYER_HRD 118 Void xWriteSEIBspNesting(TComBitIf& bs, const SEIBspNesting &sei, TComVPS *vps,TComSPS *sps, const SEIScalableNesting &nestingSei);119 Void xWriteSEIBspInitialArrivalTime(const SEIBspInitialArrivalTime &sei, TComVPS *vps,TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei);118 Void xWriteSEIBspNesting(TComBitIf& bs, const SEIBspNesting &sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting &nestingSei); 119 Void xWriteSEIBspInitialArrivalTime(const SEIBspInitialArrivalTime &sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei); 120 120 Void xCodeHrdParameters( TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 ); 121 121 #endif -
branches/SHM-dev/source/Lib/TLibEncoder/TEnc3DAsymLUT.cpp
r1214 r1235 509 509 TComSlice * pSlice = pCurPic->getSlice(pCurPic->getCurrSliceIdx()); 510 510 UInt refLayerId = pSlice->getVPS()->getRefLayerId(pSlice->getLayerId(), refLayerIdc); 511 const Window &scalEL = pSlice->getPPS()->getScaledRefLayerWindowForLayer(refLayerId);511 Window scalEL = pSlice->getPPS()->getScaledRefLayerWindowForLayer(refLayerId); 512 512 TComPicYuv *pcRecPicBL = pSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(); 513 513 // borders of down-sampled picture -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
r1231 r1235 96 96 } 97 97 98 Void TEncCavlc::codeShortTermRefPicSet( TComSPS* pcSPS,TComReferencePictureSet* rps, Bool calledFromSliceHeader, Int idx)98 Void TEncCavlc::codeShortTermRefPicSet( const TComReferencePictureSet* rps, Bool calledFromSliceHeader, Int idx) 99 99 { 100 100 #if PRINT_RPS_INFO … … 153 153 154 154 155 Void TEncCavlc::codePPS( TComPPS* pcPPS156 155 #if CGS_3D_ASYMLUT 157 , TEnc3DAsymLUT * pc3DAsymLUT 158 #endif 159 ) 156 Void TEncCavlc::codePPS( const TComPPS* pcPPS, TEnc3DAsymLUT * pc3DAsymLUT ) 157 #else 158 Void TEncCavlc::codePPS( const TComPPS* pcPPS ) 159 #endif 160 160 { 161 161 #if ENC_DEC_TRACE 162 162 xTracePPSHeader (pcPPS); 163 163 #endif 164 165 const UInt numberValidComponents = getNumberValidComponents(pcPPS->getSPS()->getChromaFormatIdc());166 164 167 165 WRITE_UVLC( pcPPS->getPPSId(), "pps_pic_parameter_set_id" ); … … 184 182 } 185 183 186 WRITE_SVLC( COMPONENT_Cb<numberValidComponents ? (pcPPS->getQpOffset(COMPONENT_Cb)) : 0, "pps_cb_qp_offset" ); 187 WRITE_SVLC( COMPONENT_Cr<numberValidComponents ? (pcPPS->getQpOffset(COMPONENT_Cr)) : 0, "pps_cr_qp_offset" ); 188 189 assert(numberValidComponents <= 3); // if more than 3 components (eg 4:4:4:4), then additional offsets will have to go in extension area... 184 WRITE_SVLC( pcPPS->getQpOffset(COMPONENT_Cb), "pps_cb_qp_offset" ); 185 WRITE_SVLC( pcPPS->getQpOffset(COMPONENT_Cr), "pps_cr_qp_offset" ); 190 186 191 187 WRITE_FLAG( pcPPS->getSliceChromaQpFlag() ? 1 : 0, "pps_slice_chroma_qp_offsets_present_flag" ); … … 232 228 if( pcPPS->getScalingListPresentFlag() ) 233 229 { 234 codeScalingList( m_pcSlice->getScalingList() );230 codeScalingList( pcPPS->getScalingList() ); 235 231 } 236 232 WRITE_FLAG( pcPPS->getListsModificationPresentFlag(), "lists_modification_present_flag"); … … 320 316 WRITE_CODE( pcPPS->getRefLocationOffsetLayerId(k), 6, "ref_loc_offset_layer_id" ); 321 317 WRITE_FLAG( pcPPS->getScaledRefLayerOffsetPresentFlag(k) ? 1 : 0, "scaled_ref_layer_offset_prsent_flag" ); 322 if (pcPPS->getScaledRefLayerOffsetPresentFlag(k))318 if( pcPPS->getScaledRefLayerOffsetPresentFlag(k) ) 323 319 { 324 320 Window scaledWindow = pcPPS->getScaledRefLayerWindow(k); … … 328 324 WRITE_SVLC( scaledWindow.getWindowBottomOffset() >> 1, "scaled_ref_layer_bottom_offset" ); 329 325 } 326 330 327 WRITE_FLAG( pcPPS->getRefRegionOffsetPresentFlag(k) ? 1 : 0, "ref_region_offset_prsent_flag" ); 331 if (pcPPS->getRefRegionOffsetPresentFlag(k)) 328 329 if( pcPPS->getRefRegionOffsetPresentFlag(k) ) 332 330 { 333 Window refWindow = pcPPS->getRefLayerWindow(k);331 const Window refWindow = pcPPS->getRefLayerWindow(k); 334 332 WRITE_SVLC( refWindow.getWindowLeftOffset() >> 1, "ref_region_left_offset" ); 335 333 WRITE_SVLC( refWindow.getWindowTopOffset() >> 1, "ref_region_top_offset" ); … … 337 335 WRITE_SVLC( refWindow.getWindowBottomOffset() >> 1, "ref_region_bottom_offset" ); 338 336 } 337 339 338 WRITE_FLAG( pcPPS->getResamplePhaseSetPresentFlag(k) ? 1 : 0, "resample_phase_set_present_flag" ); 340 if (pcPPS->getResamplePhaseSetPresentFlag(k)) 339 340 if( pcPPS->getResamplePhaseSetPresentFlag(k) ) 341 341 { 342 342 WRITE_UVLC( pcPPS->getPhaseHorLuma(k), "phase_hor_luma" ); … … 367 367 } 368 368 369 Void TEncCavlc::codeVUI( TComVUI *pcVUI,TComSPS* pcSPS )369 Void TEncCavlc::codeVUI( const TComVUI *pcVUI, const TComSPS* pcSPS ) 370 370 { 371 371 #if ENC_DEC_TRACE … … 421 421 WRITE_UVLC(defaultDisplayWindow.getWindowBottomOffset()/ TComSPS::getWinUnitY(pcSPS->getChromaFormatIdc()), "def_disp_win_bottom_offset"); 422 422 } 423 TimingInfo *timingInfo = pcVUI->getTimingInfo();423 const TimingInfo *timingInfo = pcVUI->getTimingInfo(); 424 424 WRITE_FLAG(timingInfo->getTimingInfoPresentFlag(), "vui_timing_info_present_flag"); 425 425 if(timingInfo->getTimingInfoPresentFlag()) … … 453 453 } 454 454 455 Void TEncCavlc::codeHrdParameters( TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 )455 Void TEncCavlc::codeHrdParameters( const TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 ) 456 456 { 457 457 if( commonInfPresentFlag ) … … 484 484 { 485 485 WRITE_FLAG( hrd->getFixedPicRateFlag( i ) ? 1 : 0, "fixed_pic_rate_general_flag"); 486 Bool fixedPixRateWithinCvsFlag = true; 486 487 if( !hrd->getFixedPicRateFlag( i ) ) 487 488 { 489 fixedPixRateWithinCvsFlag = hrd->getFixedPicRateWithinCvsFlag( i ); 488 490 WRITE_FLAG( hrd->getFixedPicRateWithinCvsFlag( i ) ? 1 : 0, "fixed_pic_rate_within_cvs_flag"); 489 491 } 490 else 491 { 492 hrd->setFixedPicRateWithinCvsFlag( i, true ); 493 } 494 if( hrd->getFixedPicRateWithinCvsFlag( i ) ) 492 if( fixedPixRateWithinCvsFlag ) 495 493 { 496 494 WRITE_UVLC( hrd->getPicDurationInTcMinus1( i ), "elemental_duration_in_tc_minus1"); … … 526 524 } 527 525 528 Void TEncCavlc::codeSPS( TComSPS* pcSPS )526 Void TEncCavlc::codeSPS( const TComSPS* pcSPS ) 529 527 { 530 528 #if SVC_EXTENSION … … 662 660 if(pcSPS->getScalingListPresentFlag()) 663 661 { 664 codeScalingList( m_pcSlice->getScalingList() );662 codeScalingList( pcSPS->getScalingList() ); 665 663 } 666 664 #if SVC_EXTENSION … … 683 681 assert( pcSPS->getMaxTLayers() > 0 ); 684 682 685 TComRPSList* rpsList = pcSPS->getRPSList(); 686 TComReferencePictureSet* rps; 683 const TComRPSList* rpsList = pcSPS->getRPSList(); 687 684 688 685 WRITE_UVLC(rpsList->getNumberOfReferencePictureSets(), "num_short_term_ref_pic_sets" ); 689 686 for(Int i=0; i < rpsList->getNumberOfReferencePictureSets(); i++) 690 687 { 691 rps = rpsList->getReferencePictureSet(i);692 codeShortTermRefPicSet( pcSPS,rps,false, i);688 const TComReferencePictureSet*rps = rpsList->getReferencePictureSet(i); 689 codeShortTermRefPicSet( rps,false, i); 693 690 } 694 691 WRITE_FLAG( pcSPS->getLongTermRefsPresent() ? 1 : 0, "long_term_ref_pics_present_flag" ); … … 778 775 } 779 776 780 Void TEncCavlc::codeVPS( TComVPS* pcVPS )777 Void TEncCavlc::codeVPS( const TComVPS* pcVPS ) 781 778 { 782 779 WRITE_CODE( pcVPS->getVPSId(), 4, "vps_video_parameter_set_id" ); … … 824 821 assert( pcVPS->getMaxNuhReservedZeroLayerId() < MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1 ); 825 822 WRITE_CODE( pcVPS->getMaxNuhReservedZeroLayerId(), 6, "vps_max_nuh_reserved_zero_layer_id" ); 826 pcVPS->setMaxOpSets(1);827 823 WRITE_UVLC( pcVPS->getMaxOpSets() - 1, "vps_max_op_sets_minus1" ); 828 824 for( UInt opsIdx = 1; opsIdx <= ( pcVPS->getMaxOpSets() - 1 ); opsIdx ++ ) … … 832 828 { 833 829 // Only applicable for version 1 834 pcVPS->setLayerIdIncludedFlag( true, opsIdx, i );830 // pcVPS->setLayerIdIncludedFlag( true, opsIdx, i ); 835 831 #endif 836 832 WRITE_FLAG( pcVPS->getLayerIdIncludedFlag( opsIdx, i ) ? 1 : 0, "layer_id_included_flag[opsIdx][i]" ); … … 838 834 } 839 835 840 TimingInfo *timingInfo = pcVPS->getTimingInfo();836 const TimingInfo *timingInfo = pcVPS->getTimingInfo(); 841 837 WRITE_FLAG(timingInfo->getTimingInfoPresentFlag(), "vps_timing_info_present_flag"); 842 838 if(timingInfo->getTimingInfoPresentFlag()) … … 849 845 WRITE_UVLC(timingInfo->getNumTicksPocDiffOneMinus1(), "vps_num_ticks_poc_diff_one_minus1"); 850 846 } 851 pcVPS->setNumHrdParameters( 0 );852 847 WRITE_UVLC( pcVPS->getNumHrdParameters(), "vps_num_hrd_parameters" ); 853 848 854 849 if( pcVPS->getNumHrdParameters() > 0 ) 855 850 { 856 pcVPS->createHrdParamBuffer(); 857 } 858 for( UInt i = 0; i < pcVPS->getNumHrdParameters(); i ++ ) 859 { 860 // Only applicable for version 1 861 pcVPS->setHrdOpSetIdx( 0, i ); 862 WRITE_UVLC( pcVPS->getHrdOpSetIdx( i ), "hrd_op_set_idx" ); 863 if( i > 0 ) 864 { 865 WRITE_FLAG( pcVPS->getCprmsPresentFlag( i ) ? 1 : 0, "cprms_present_flag[i]" ); 866 } 867 codeHrdParameters(pcVPS->getHrdParameters(i), pcVPS->getCprmsPresentFlag( i ), pcVPS->getMaxTLayers() - 1); 851 for( UInt i = 0; i < pcVPS->getNumHrdParameters(); i ++ ) 852 { 853 // Only applicable for version 1 854 WRITE_UVLC( pcVPS->getHrdOpSetIdx( i ), "hrd_op_set_idx" ); 855 if( i > 0 ) 856 { 857 WRITE_FLAG( pcVPS->getCprmsPresentFlag( i ) ? 1 : 0, "cprms_present_flag[i]" ); 858 } 859 codeHrdParameters(pcVPS->getHrdParameters(i), pcVPS->getCprmsPresentFlag( i ), pcVPS->getMaxTLayers() - 1); 860 } 868 861 } 869 862 } … … 1004 997 { 1005 998 #endif 1006 TComReferencePictureSet* rps = pcSlice->getRPS();999 const TComReferencePictureSet* rps = pcSlice->getRPS(); 1007 1000 1008 1001 // check for bitstream restriction stating that: … … 1023 1016 { 1024 1017 WRITE_FLAG( 0, "short_term_ref_pic_set_sps_flag"); 1025 codeShortTermRefPicSet( pcSlice->getSPS(),rps, true, pcSlice->getSPS()->getRPSList()->getNumberOfReferencePictureSets());1018 codeShortTermRefPicSet( rps, true, pcSlice->getSPS()->getRPSList()->getNumberOfReferencePictureSets()); 1026 1019 } 1027 1020 else … … 1247 1240 { 1248 1241 SliceType sliceType = pcSlice->getSliceType(); 1249 Int encCABACTableIdx = pcSlice->getPPS()->getEncCABACTableIdx();1242 SliceType encCABACTableIdx = pcSlice->getEncCABACTableIdx(); 1250 1243 Bool encCabacInitFlag = (sliceType!=encCABACTableIdx && encCABACTableIdx!=I_SLICE) ? true : false; 1251 1244 pcSlice->setCabacInitFlag( encCabacInitFlag ); … … 1318 1311 } 1319 1312 1320 Void TEncCavlc::codePTL( TComPTL* pcPTL, Bool profilePresentFlag, Int maxNumSubLayersMinus1)1313 Void TEncCavlc::codePTL( const TComPTL* pcPTL, Bool profilePresentFlag, Int maxNumSubLayersMinus1) 1321 1314 { 1322 1315 if(profilePresentFlag) … … 1364 1357 } 1365 1358 } 1366 Void TEncCavlc::codeProfileTier( ProfileTierLevel* ptl )1359 Void TEncCavlc::codeProfileTier( const ProfileTierLevel* ptl ) 1367 1360 { 1368 1361 WRITE_CODE( ptl->getProfileSpace(), 2 , "XXX_profile_space[]"); … … 1734 1727 * \param scalingList quantization matrix information 1735 1728 */ 1736 Void TEncCavlc::codeScalingList( TComScalingList* scalingList ) 1737 { 1738 UInt listId,sizeId; 1739 Bool scalingListPredModeFlag; 1740 1729 Void TEncCavlc::codeScalingList( const TComScalingList &scalingList ) 1730 { 1741 1731 //for each size 1742 for( sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++)1743 { 1744 Int predListStep = (sizeId == SCALING_LIST_32x32? (SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES) : 1); // if 32x32, skip over chroma entries.1745 1746 for( listId = 0; listId < SCALING_LIST_NUM; listId+=predListStep)1747 { 1748 scalingListPredModeFlag = scalingList->checkPredMode( sizeId, listId);1732 for(UInt sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++) 1733 { 1734 const Int predListStep = (sizeId == SCALING_LIST_32x32? (SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES) : 1); // if 32x32, skip over chroma entries. 1735 1736 for(UInt listId = 0; listId < SCALING_LIST_NUM; listId+=predListStep) 1737 { 1738 Bool scalingListPredModeFlag = scalingList.getScalingListPredModeFlag(sizeId, listId); 1749 1739 WRITE_FLAG( scalingListPredModeFlag, "scaling_list_pred_mode_flag" ); 1750 1740 if(!scalingListPredModeFlag)// Copy Mode … … 1753 1743 { 1754 1744 // adjust the code, to cope with the missing chroma entries 1755 WRITE_UVLC( ((Int)listId - (Int)scalingList ->getRefMatrixId (sizeId,listId)) / (SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES), "scaling_list_pred_matrix_id_delta");1745 WRITE_UVLC( ((Int)listId - (Int)scalingList.getRefMatrixId (sizeId,listId)) / (SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES), "scaling_list_pred_matrix_id_delta"); 1756 1746 } 1757 1747 else 1758 1748 { 1759 WRITE_UVLC( (Int)listId - (Int)scalingList ->getRefMatrixId (sizeId,listId), "scaling_list_pred_matrix_id_delta");1749 WRITE_UVLC( (Int)listId - (Int)scalingList.getRefMatrixId (sizeId,listId), "scaling_list_pred_matrix_id_delta"); 1760 1750 } 1761 1751 } 1762 1752 else// DPCM Mode 1763 1753 { 1764 xCodeScalingList( scalingList, sizeId, listId);1754 xCodeScalingList(&scalingList, sizeId, listId); 1765 1755 } 1766 1756 } … … 1773 1763 * \param listIdc list index 1774 1764 */ 1775 Void TEncCavlc::xCodeScalingList( TComScalingList* scalingList, UInt sizeId, UInt listId)1765 Void TEncCavlc::xCodeScalingList(const TComScalingList* scalingList, UInt sizeId, UInt listId) 1776 1766 { 1777 1767 Int coefNum = min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId]); … … 1779 1769 Int nextCoef = SCALING_LIST_START_VALUE; 1780 1770 Int data; 1781 Int *src = scalingList->getScalingListAddress(sizeId, listId);1771 const Int *src = scalingList->getScalingListAddress(sizeId, listId); 1782 1772 if( sizeId > SCALING_LIST_8x8 ) 1783 1773 { … … 1814 1804 } 1815 1805 return false; 1816 }1817 Bool TComScalingList::checkPredMode(UInt sizeId, UInt listId)1818 {1819 Int predListStep = (sizeId == SCALING_LIST_32x32? (SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES) : 1); // if 32x32, skip over chroma entries.1820 1821 for(Int predListIdx = (Int)listId ; predListIdx >= 0; predListIdx-=predListStep)1822 {1823 if( !memcmp(getScalingListAddress(sizeId,listId),((listId == predListIdx) ?1824 getScalingListDefaultAddress(sizeId, predListIdx): getScalingListAddress(sizeId, predListIdx)),sizeof(Int)*min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId])) // check value of matrix1825 && ((sizeId < SCALING_LIST_16x16) || (getScalingListDC(sizeId,listId) == getScalingListDC(sizeId,predListIdx)))) // check DC value1826 {1827 setRefMatrixId(sizeId, listId, predListIdx);1828 return false;1829 }1830 }1831 return true;1832 1806 } 1833 1807 … … 1947 1921 } 1948 1922 1949 Void TEncCavlc::codeVPSExtension (TComVPS *vps)1923 Void TEncCavlc::codeVPSExtension( const TComVPS *vps ) 1950 1924 { 1951 1925 Int NumOutputLayersInOutputLayerSet[MAX_VPS_LAYER_SETS_PLUS1]; … … 2071 2045 for( Int idx = vps->getBaseLayerInternalFlag() ? 2 : 1; idx < vps->getNumProfileTierLevel(); idx++ ) 2072 2046 { 2073 vps->setProfilePresentFlag(idx, true);2074 2075 2047 WRITE_FLAG( vps->getProfilePresentFlag(idx), "vps_profile_present_flag[i]" ); 2076 2048 … … 2216 2188 WRITE_CODE(1, 8, "vps_non_vui_extension_data_byte"); 2217 2189 } 2218 2219 vps->setVpsVuiPresentFlag(true); 2190 2220 2191 WRITE_FLAG( vps->getVpsVuiPresentFlag() ? 1 : 0, "vps_vui_present_flag" ); 2221 2192 … … 2231 2202 } 2232 2203 2233 Void TEncCavlc::codeRepFormat( RepFormat *repFormat )2204 Void TEncCavlc::codeRepFormat( const RepFormat *repFormat ) 2234 2205 { 2235 2206 WRITE_CODE( repFormat->getPicWidthVpsInLumaSamples (), 16, "pic_width_vps_in_luma_samples" ); … … 2264 2235 } 2265 2236 2266 Void TEncCavlc::codeVpsDpbSizeTable( TComVPS *vps)2237 Void TEncCavlc::codeVpsDpbSizeTable( const TComVPS *vps ) 2267 2238 { 2268 2239 for( Int i = 1; i < vps->getNumOutputLayerSets(); i++ ) … … 2297 2268 } 2298 2269 2299 Void TEncCavlc::codeVPSVUI (TComVPS *vps)2270 Void TEncCavlc::codeVPSVUI( const TComVPS *vps ) 2300 2271 { 2301 2272 Int i,j; 2302 2273 WRITE_FLAG(vps->getCrossLayerPictureTypeAlignFlag(), "cross_layer_pic_type_aligned_flag"); 2303 if (!vps->getCrossLayerPictureTypeAlignFlag()) 2274 2275 if( !vps->getCrossLayerPictureTypeAlignFlag() ) 2304 2276 { 2305 2277 WRITE_FLAG(vps->getCrossLayerIrapAlignFlag(), "cross_layer_irap_aligned_flag"); … … 2308 2280 { 2309 2281 // When not present, the value of cross_layer_irap_aligned_flag is inferred to be equal to vps_vui_present_flag, 2310 // i.e. it is true in this function 2311 vps->setCrossLayerIrapAlignFlag( true ); 2282 assert( vps->getCrossLayerIrapAlignFlag() == true ); 2312 2283 } 2313 2284 … … 2465 2436 } 2466 2437 2467 Void TEncCavlc::codeSPSExtension( TComSPS* pcSPS )2438 Void TEncCavlc::codeSPSExtension( const TComSPS* pcSPS ) 2468 2439 { 2469 2440 // more syntax elements to be written here … … 2473 2444 } 2474 2445 2475 Void TEncCavlc::codeVpsVuiBspHrdParams( TComVPS * const vps)2446 Void TEncCavlc::codeVpsVuiBspHrdParams( const TComVPS* vps ) 2476 2447 { 2477 2448 WRITE_UVLC( vps->getVpsNumAddHrdParams(), "vps_num_add_hrd_params" ); … … 2528 2499 } 2529 2500 2530 WRITE_CODE(vps->getBspHrdIdx(h, i, t, j, k), numBits, "bsp_ comb_hrd_idx[h][i][t][j][k]");2501 WRITE_CODE(vps->getBspHrdIdx(h, i, t, j, k), numBits, "bsp_hrd_idx[h][i][t][j][k]"); 2531 2502 } 2532 2503 2533 WRITE_UVLC( vps->getBspSchedIdx(h, i, t, j, k), "bsp_ comb_sched_idx[h][i][t][j][k]");2504 WRITE_UVLC( vps->getBspSchedIdx(h, i, t, j, k), "bsp_sched_idx[h][i][t][j][k]"); 2534 2505 } 2535 2506 } -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.h
r1224 r1235 75 75 TComSlice* m_pcSlice; 76 76 77 Void codeShortTermRefPicSet ( TComSPS* pcSPS,TComReferencePictureSet* pcRPS, Bool calledFromSliceHeader, Int idx );77 Void codeShortTermRefPicSet ( const TComReferencePictureSet* pcRPS, Bool calledFromSliceHeader, Int idx ); 78 78 Bool findMatchingLTRP ( TComSlice* pcSlice, UInt *ltrpsIndex, Int ltrpPOC, Bool usedFlag ); 79 79 … … 81 81 82 82 Void resetEntropy (); 83 Void determineCabacInitIdx () {};83 SliceType determineCabacInitIdx () { assert(0); return I_SLICE; }; 84 84 85 85 Void setBitstream ( TComBitIf* p ) { m_pcBitIf = p; } … … 87 87 Void resetBits () { m_pcBitIf->resetBits(); } 88 88 UInt getNumberOfWrittenBits() { return m_pcBitIf->getNumberOfWrittenBits(); } 89 Void codeVPS ( TComVPS* pcVPS ); 90 Void codeVUI ( TComVUI *pcVUI, TComSPS* pcSPS ); 91 Void codeSPS ( TComSPS* pcSPS ); 92 Void codePPS ( TComPPS* pcPPS 89 Void codeVPS ( const TComVPS* pcVPS ); 90 Void codeVUI ( const TComVUI *pcVUI, const TComSPS* pcSPS ); 91 Void codeSPS ( const TComSPS* pcSPS ); 93 92 #if CGS_3D_ASYMLUT 94 , TEnc3DAsymLUT * pc3DAsymLUT 93 Void codePPS ( const TComPPS* pcPPS, TEnc3DAsymLUT * pc3DAsymLUT ); 94 #else 95 Void codePPS ( const TComPPS* pcPPS ); 95 96 #endif 96 );97 97 Void codeSliceHeader ( TComSlice* pcSlice ); 98 Void codePTL ( TComPTL* pcPTL, Bool profilePresentFlag, Int maxNumSubLayersMinus1);99 Void codeProfileTier ( ProfileTierLevel* ptl );100 Void codeHrdParameters ( TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 );98 Void codePTL ( const TComPTL* pcPTL, Bool profilePresentFlag, Int maxNumSubLayersMinus1); 99 Void codeProfileTier ( const ProfileTierLevel* ptl ); 100 Void codeHrdParameters ( const TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 ); 101 101 Void codeTilesWPPEntryPoint( TComSlice* pSlice ); 102 102 Void codeTerminatingBit ( UInt uilsLast ); … … 146 146 Void xCodePredWeightTable ( TComSlice* pcSlice ); 147 147 148 Void codeScalingList ( TComScalingList*scalingList );149 Void xCodeScalingList ( TComScalingList* scalingList, UInt sizeId, UInt listId);148 Void codeScalingList ( const TComScalingList &scalingList ); 149 Void xCodeScalingList ( const TComScalingList* scalingList, UInt sizeId, UInt listId); 150 150 Void codeDFFlag ( UInt uiCode, const Char *pSymbolName ); 151 151 Void codeDFSvlc ( Int iCode, const Char *pSymbolName ); … … 154 154 155 155 #if SVC_EXTENSION 156 Void codeSliceHeaderExtn( TComSlice* slice, Int shBitsWrittenTillNow );157 Void codeSPSExtension ( TComSPS* pcSPS);158 Void codeVPSExtension ( TComVPS* pcVPS);159 Void codeVPSVUI ( TComVPS *vps);160 Void codeRepFormat ( RepFormat *repFormat );161 Void codeVpsDpbSizeTable ( TComVPS *vps );162 Void codeVpsVuiBspHrdParams( TComVPS * const );156 Void codeSliceHeaderExtn ( TComSlice* slice, Int shBitsWrittenTillNow ); 157 Void codeSPSExtension ( const TComSPS* sps ); 158 Void codeVPSExtension ( const TComVPS* vps ); 159 Void codeVPSVUI ( const TComVPS* vps ); 160 Void codeRepFormat ( const RepFormat *repFormat ); 161 Void codeVpsDpbSizeTable ( const TComVPS *vps ); 162 Void codeVpsVuiBspHrdParams( const TComVPS * const ); 163 163 164 164 #if CGS_3D_ASYMLUT -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h
r1230 r1235 702 702 Void setWaveFrontSynchro(Int iWaveFrontSynchro) { m_iWaveFrontSynchro = iWaveFrontSynchro; } 703 703 Int getWaveFrontsynchro() { return m_iWaveFrontSynchro; } 704 Void setWaveFrontSubstreams(Int iWaveFrontSubstreams) { m_iWaveFrontSubstreams = iWaveFrontSubstreams; }705 Int getWaveFrontSubstreams() { return m_iWaveFrontSubstreams; }706 704 Void setDecodedPictureHashSEIEnabled(Int b) { m_decodedPictureHashSEIEnabled = b; } 707 705 Int getDecodedPictureHashSEIEnabled() { return m_decodedPictureHashSEIEnabled; } -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCu.cpp
r1203 r1235 407 407 const UInt numberValidComponents = rpcBestCU->getPic()->getNumberValidComponents(); 408 408 409 if( (g_uiMaxCUWidth>>uiDepth) >= rpcTempCU->getSlice()->getPPS()->getMinCuDQPSize() )409 if( (g_uiMaxCUWidth>>uiDepth) >= (g_uiMaxCUWidth >> ( rpcTempCU->getSlice()->getPPS()->getMaxCuDQPDepth())) ) 410 410 { 411 411 Int idQP = m_pcEncCfg->getMaxDeltaQP(); … … 601 601 602 602 //! Try AMP (SIZE_2NxnU, SIZE_2NxnD, SIZE_nLx2N, SIZE_nRx2N) 603 if( pcPic->getSlice(0)->getSPS()->getAMPAcc(uiDepth))603 if(pcSlice->getSPS()->getUseAMP() && uiDepth < g_uiMaxCUDepth-g_uiAddCUDepth ) 604 604 { 605 605 #if AMP_ENC_SPEEDUP … … 805 805 } 806 806 807 if( (g_uiMaxCUWidth>>uiDepth) == rpcTempCU->getSlice()->getPPS()->getMinCuDQPSize() )807 if( (g_uiMaxCUWidth>>uiDepth) == (g_uiMaxCUWidth >> ( rpcTempCU->getSlice()->getPPS()->getMaxCuDQPDepth())) ) 808 808 { 809 809 Int idQP = m_pcEncCfg->getMaxDeltaQP(); … … 816 816 #endif 817 817 } 818 else if( (g_uiMaxCUWidth>>uiDepth) > rpcTempCU->getSlice()->getPPS()->getMinCuDQPSize() )818 else if( (g_uiMaxCUWidth>>uiDepth) > (g_uiMaxCUWidth >> ( rpcTempCU->getSlice()->getPPS()->getMaxCuDQPDepth())) ) 819 819 { 820 820 iMinQP = iBaseQP; … … 909 909 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 910 910 911 if( (g_uiMaxCUWidth>>uiDepth) == rpcTempCU->getSlice()->getPPS()->getMinCuDQPSize() && rpcTempCU->getSlice()->getPPS()->getUseDQP())911 if( (g_uiMaxCUWidth>>uiDepth) == (g_uiMaxCUWidth >> ( rpcTempCU->getSlice()->getPPS()->getMaxCuDQPDepth())) && rpcTempCU->getSlice()->getPPS()->getUseDQP()) 912 912 { 913 913 Bool hasResidual = false; … … 1079 1079 { 1080 1080 UInt uiQNumParts = ( pcPic->getNumPartitionsInCtu() >> (uiDepth<<1) )>>2; 1081 if( (g_uiMaxCUWidth>>uiDepth) == pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP())1081 if( (g_uiMaxCUWidth>>uiDepth) == (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuDQPDepth())) && pcCU->getSlice()->getPPS()->getUseDQP()) 1082 1082 { 1083 1083 setdQPFlag(true); 1084 1084 } 1085 1085 1086 if( (g_uiMaxCUWidth>>uiDepth) == pcCU->getSlice()->getPPS()->getMinCuChromaQpAdjSize() && pcCU->getSlice()->getUseChromaQpAdj())1086 if( (g_uiMaxCUWidth>>uiDepth) == (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuChromaQpAdjDepth())) && pcCU->getSlice()->getUseChromaQpAdj()) 1087 1087 { 1088 1088 setCodeChromaQpAdjFlag(true); … … 1106 1106 } 1107 1107 1108 if( (g_uiMaxCUWidth>>uiDepth) >= pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP())1108 if( (g_uiMaxCUWidth>>uiDepth) >= (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuDQPDepth())) && pcCU->getSlice()->getPPS()->getUseDQP()) 1109 1109 { 1110 1110 setdQPFlag(true); 1111 1111 } 1112 1112 1113 if( (g_uiMaxCUWidth>>uiDepth) >= pcCU->getSlice()->getPPS()->getMinCuChromaQpAdjSize() && pcCU->getSlice()->getUseChromaQpAdj())1113 if( (g_uiMaxCUWidth>>uiDepth) >= (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuChromaQpAdjDepth())) && pcCU->getSlice()->getUseChromaQpAdj()) 1114 1114 { 1115 1115 setCodeChromaQpAdjFlag(true); … … 1659 1659 UInt uiDepth = pcCU->getDepth( 0 ); 1660 1660 1661 if( pcCU->getSlice()->getPPS()->getUseDQP() && (g_uiMaxCUWidth>>uiDepth) >= pcCU->getSlice()->getPPS()->getMinCuDQPSize() )1661 if( pcCU->getSlice()->getPPS()->getUseDQP() && (g_uiMaxCUWidth>>uiDepth) >= (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuDQPDepth())) ) 1662 1662 { 1663 1663 if ( pcCU->getQtRootCbf( 0) ) -
branches/SHM-dev/source/Lib/TLibEncoder/TEncEntropy.cpp
r1212 r1235 79 79 80 80 #if CGS_3D_ASYMLUT 81 Void TEncEntropy::encodePPS( TComPPS* pcPPS, TEnc3DAsymLUT * pc3DAsymLUT )81 Void TEncEntropy::encodePPS( const TComPPS* pcPPS, TEnc3DAsymLUT * pc3DAsymLUT ) 82 82 { 83 83 m_pcEntropyCoderIf->codePPS( pcPPS, pc3DAsymLUT ); … … 85 85 } 86 86 #else 87 Void TEncEntropy::encodePPS( TComPPS* pcPPS )87 Void TEncEntropy::encodePPS( const TComPPS* pcPPS ) 88 88 { 89 89 m_pcEntropyCoderIf->codePPS( pcPPS ); … … 92 92 #endif 93 93 94 Void TEncEntropy::encodeSPS( TComSPS* pcSPS )94 Void TEncEntropy::encodeSPS( const TComSPS* pcSPS ) 95 95 { 96 96 m_pcEntropyCoderIf->codeSPS( pcSPS ); … … 107 107 } 108 108 109 Void TEncEntropy::encodeVPS( TComVPS* pcVPS )109 Void TEncEntropy::encodeVPS( const TComVPS* pcVPS ) 110 110 { 111 111 m_pcEntropyCoderIf->codeVPS( pcVPS ); … … 739 739 } 740 740 741 /** encode quantization matrix742 * \param scalingList quantization matrix information743 */744 Void TEncEntropy::encodeScalingList( TComScalingList* scalingList )745 {746 m_pcEntropyCoderIf->codeScalingList( scalingList );747 }748 749 741 #if SVC_EXTENSION 750 742 Void TEncEntropy::encodeSliceHeaderExtn( TComSlice* pSlice, Int shBitsWrittenTillNow ) -
branches/SHM-dev/source/Lib/TLibEncoder/TEncEntropy.h
r1212 r1235 64 64 public: 65 65 virtual Void resetEntropy () = 0; 66 virtual VoiddetermineCabacInitIdx () = 0;66 virtual SliceType determineCabacInitIdx () = 0; 67 67 virtual Void setBitstream ( TComBitIf* p ) = 0; 68 68 virtual Void setSlice ( TComSlice* p ) = 0; … … 70 70 virtual UInt getNumberOfWrittenBits() = 0; 71 71 72 virtual Void codeVPS ( TComVPS* pcVPS ) = 0; 73 virtual Void codeSPS ( TComSPS* pcSPS ) = 0; 74 virtual Void codePPS ( TComPPS* pcPPS 72 virtual Void codeVPS ( const TComVPS* pcVPS ) = 0; 73 virtual Void codeSPS ( const TComSPS* pcSPS ) = 0; 75 74 #if CGS_3D_ASYMLUT 76 , TEnc3DAsymLUT * pc3DAsymLUT 77 #endif 78 ) = 0; 75 virtual Void codePPS ( const TComPPS* pcPPS, TEnc3DAsymLUT * pc3DAsymLUT ) = 0; 76 #else 77 virtual Void codePPS ( const TComPPS* pcPPS ) = 0; 78 #endif 79 79 virtual Void codeSliceHeader ( TComSlice* pcSlice ) = 0; 80 80 … … 82 82 virtual Void codeTerminatingBit ( UInt uilsLast ) = 0; 83 83 virtual Void codeSliceFinish () = 0; 84 virtual Void codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList ) = 0; 85 virtual Void codeScalingList ( TComScalingList* scalingList ) = 0; 84 virtual Void codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList ) = 0; 86 85 87 86 public: … … 140 139 UInt getNumberOfWrittenBits () { return m_pcEntropyCoderIf->getNumberOfWrittenBits(); } 141 140 Void resetEntropy () { m_pcEntropyCoderIf->resetEntropy(); } 142 Void determineCabacInitIdx () {m_pcEntropyCoderIf->determineCabacInitIdx(); }141 SliceType determineCabacInitIdx () { return m_pcEntropyCoderIf->determineCabacInitIdx(); } 143 142 144 143 Void encodeSliceHeader ( TComSlice* pcSlice ); … … 149 148 150 149 public: 151 Void encodeVPS ( TComVPS* pcVPS);150 Void encodeVPS ( const TComVPS* pcVPS); 152 151 // SPS 153 Void encodeSPS ( TComSPS* pcSPS ); 154 Void encodePPS ( TComPPS* pcPPS 152 Void encodeSPS ( const TComSPS* pcSPS ); 155 153 #if CGS_3D_ASYMLUT 156 , TEnc3DAsymLUT * pc3DAsymLUT 157 #endif 158 ); 154 Void encodePPS ( const TComPPS* pcPPS, TEnc3DAsymLUT * pc3DAsymLUT ); 155 #else 156 Void encodePPS ( const TComPPS* pcPPS ); 157 #endif 159 158 Void encodeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool bRD = false ); 160 159 Void encodeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); … … 184 183 Void encodeChromaQpAdjustment ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 185 184 186 Void encodeScalingList ( TComScalingList* scalingList );187 188 185 Void encodeCrossComponentPrediction( TComTU &rTu, ComponentID compID ); 189 186 -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r1232 r1235 216 216 } 217 217 218 SEIActiveParameterSets* TEncGOP::xCreateSEIActiveParameterSets ( TComSPS *sps)218 SEIActiveParameterSets* TEncGOP::xCreateSEIActiveParameterSets (const TComSPS *sps) 219 219 { 220 220 SEIActiveParameterSets *seiActiveParameterSets = new SEIActiveParameterSets(); … … 374 374 } 375 375 376 SEITempMotionConstrainedTileSets* TEncGOP::xCreateSEITempMotionConstrainedTileSets ( )376 SEITempMotionConstrainedTileSets* TEncGOP::xCreateSEITempMotionConstrainedTileSets (const TComPPS *pps) 377 377 { 378 TComPPS *pps = m_pcEncTop->getPPS();379 378 SEITempMotionConstrainedTileSets *sei = new SEITempMotionConstrainedTileSets(); 380 379 if(pps->getTilesEnabledFlag()) … … 490 489 } 491 490 492 Void TEncGOP::xCreateLeadingSEIMessages (/*SEIMessages seiMessages,*/ AccessUnit &accessUnit, TComSPS *sps)491 Void TEncGOP::xCreateLeadingSEIMessages (/*SEIMessages seiMessages,*/ AccessUnit &accessUnit, const TComSPS *sps, const TComPPS *pps) 493 492 { 494 493 OutputNALUnit nalu(NAL_UNIT_PREFIX_SEI); … … 579 578 if(m_pcCfg->getTMCTSSEIEnabled()) 580 579 { 581 SEITempMotionConstrainedTileSets *sei_tmcts = xCreateSEITempMotionConstrainedTileSets ( );580 SEITempMotionConstrainedTileSets *sei_tmcts = xCreateSEITempMotionConstrainedTileSets (pps); 582 581 583 582 nalu = NALUnit(NAL_UNIT_PREFIX_SEI); … … 1123 1122 // Slice data initialization 1124 1123 pcPic->clearSliceBuffer(); 1125 assert(pcPic->getNumAllocatedSlice() == 1);1124 pcPic->allocateNewSlice(); 1126 1125 m_pcSliceEncoder->setSliceIdx(0); 1127 1126 pcPic->setCurrSliceIdx(0); 1128 1127 #if SVC_EXTENSION 1129 1128 pcPic->setLayerId( m_layerId ); 1130 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getSPS(), m_pcEncTop->getPPS(), m_pcEncTop->getVPS(),isField );1131 #else 1132 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getSPS(), m_pcEncTop->getPPS(), isField );1129 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, isField ); 1130 #else 1131 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, &(pcPic->getPicSym()->getSPS()), &(pcPic->getPicSym()->getPPS()), isField ); 1133 1132 #endif 1134 1133 … … 1252 1251 //set default slice level flag to the same as SPS level flag 1253 1252 pcSlice->setLFCrossSliceBoundaryFlag( pcSlice->getPPS()->getLoopFilterAcrossSlicesEnabledFlag() ); 1254 pcSlice->setScalingList ( m_pcEncTop->getScalingList() );1255 if(m_pcEncTop->getUseScalingListId() == SCALING_LIST_OFF)1256 {1257 m_pcEncTop->getTrQuant()->setFlatScalingList(pcSlice->getSPS()->getChromaFormatIdc());1258 m_pcEncTop->getTrQuant()->setUseScalingList(false);1259 m_pcEncTop->getSPS()->setScalingListPresentFlag(false);1260 m_pcEncTop->getPPS()->setScalingListPresentFlag(false);1261 }1262 else if(m_pcEncTop->getUseScalingListId() == SCALING_LIST_DEFAULT)1263 {1264 #if SVC_EXTENSION1265 // inferring of the scaling list can be moved to the config file1266 UInt refLayerId = 0;1267 if( m_layerId > 0 && !m_pcEncTop->getVPS()->getNonHEVCBaseLayerFlag() && m_pcEncTop->getVPS()->getRecursiveRefLayerFlag( m_layerId, refLayerId ) )1268 {1269 m_pcEncTop->getSPS()->setInferScalingListFlag( true );1270 m_pcEncTop->getSPS()->setScalingListRefLayerId( refLayerId );1271 m_pcEncTop->getSPS()->setScalingListPresentFlag( false );1272 m_pcEncTop->getPPS()->setInferScalingListFlag( false );1273 m_pcEncTop->getPPS()->setScalingListPresentFlag( false );1274 1275 // infer the scaling list from the reference layer1276 pcSlice->setScalingList ( m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(refLayerId)]->getScalingList() );1277 }1278 else1279 {1280 #endif1281 pcSlice->setDefaultScalingList ();1282 m_pcEncTop->getSPS()->setScalingListPresentFlag(false);1283 m_pcEncTop->getPPS()->setScalingListPresentFlag(false);1284 1285 #if SVC_EXTENSION1286 }1287 #endif1288 1289 m_pcEncTop->getTrQuant()->setScalingList(pcSlice->getScalingList(), pcSlice->getSPS()->getChromaFormatIdc());1290 m_pcEncTop->getTrQuant()->setUseScalingList(true);1291 }1292 else if(m_pcEncTop->getUseScalingListId() == SCALING_LIST_FILE_READ)1293 {1294 #if SVC_EXTENSION1295 // inferring of the scaling list can be moved to the config file1296 UInt refLayerId = 0;1297 if( m_layerId > 0 && !m_pcEncTop->getVPS()->getNonHEVCBaseLayerFlag() && m_pcEncTop->getVPS()->getRecursiveRefLayerFlag( m_layerId, refLayerId ) )1298 {1299 m_pcEncTop->getSPS()->setInferScalingListFlag( true );1300 m_pcEncTop->getSPS()->setScalingListRefLayerId( refLayerId );1301 m_pcEncTop->getSPS()->setScalingListPresentFlag( false );1302 m_pcEncTop->getPPS()->setInferScalingListFlag( false );1303 m_pcEncTop->getPPS()->setScalingListPresentFlag( false );1304 1305 // infer the scaling list from the reference layer1306 pcSlice->setScalingList ( m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(refLayerId)]->getScalingList() );1307 }1308 else1309 {1310 #endif1311 pcSlice->setDefaultScalingList ();1312 if(pcSlice->getScalingList()->xParseScalingList(m_pcCfg->getScalingListFile()))1313 {1314 Bool bParsedScalingList=false; // Use of boolean so that assertion outputs useful string1315 assert(bParsedScalingList);1316 exit(1);1317 }1318 pcSlice->getScalingList()->checkDcOfMatrix();1319 m_pcEncTop->getSPS()->setScalingListPresentFlag(pcSlice->checkDefaultScalingList());1320 m_pcEncTop->getPPS()->setScalingListPresentFlag(false);1321 1322 #if SVC_EXTENSION1323 }1324 #endif1325 1326 m_pcEncTop->getTrQuant()->setScalingList(pcSlice->getScalingList(), pcSlice->getSPS()->getChromaFormatIdc());1327 m_pcEncTop->getTrQuant()->setUseScalingList(true);1328 }1329 else1330 {1331 printf("error : ScalingList == %d no support\n",m_pcEncTop->getUseScalingListId());1332 assert(0);1333 }1334 1253 1335 1254 if(pcSlice->getSliceType()==B_SLICE&&m_pcCfg->getGOPEntry(iGOPid).m_sliceType=='P') … … 1381 1300 1382 1301 // conformance check: when ScaledRefRegionWidthInSamplesY is equal to RefLayerRegionWidthInSamplesY, PhaseHorY shall be equal to 0, when ScaledRefRegionWidthInSamplesC is equal to RefLayerRegionWidthInSamplesC, PhaseHorC shall be equal to 0, when ScaledRefRegionHeightInSamplesY is equal to RefLayerRegionHeightInSamplesY, PhaseVerY shall be equal to 0, and when ScaledRefRegionHeightInSamplesC is equal to RefLayerRegionHeightInSamplesC, PhaseVerC shall be equal to 0. 1383 Bool phaseSetPresentFlag; 1384 Int phaseHorLuma, phaseVerLuma, phaseHorChroma, phaseVerChroma; 1385 pcSlice->getPPS()->getResamplingPhase( refLayerId, phaseSetPresentFlag, phaseHorLuma, phaseVerLuma, phaseHorChroma, phaseVerChroma ); 1386 1387 assert( ( (widthEL != widthBL) || (phaseHorLuma == 0 && phaseHorChroma == 0) ) 1388 && ( (heightEL != heightBL) || (phaseVerLuma == 0 && phaseVerChroma == 0) ) ); 1302 const ResamplingPhase &resamplingPhase = pcSlice->getPPS()->getResamplingPhase( refLayerId ); 1303 1304 assert( ( (widthEL != widthBL) || (resamplingPhase.phaseHorLuma == 0 && resamplingPhase.phaseHorChroma == 0) ) 1305 && ( (heightEL != heightBL) || (resamplingPhase.phaseVerLuma == 0 && resamplingPhase.phaseVerChroma == 0) ) ); 1389 1306 1390 1307 g_mvScalingFactor[refLayerIdc][0] = widthEL == widthBL ? 4096 : Clip3(-4096, 4095, ((widthEL << 8) + (widthBL >> 1)) / widthBL); … … 1418 1335 Bool bSignalPPS = m_bSeqFirst; 1419 1336 bSignalPPS |= m_pcCfg->getGOPSize() > 1 ? pocCurr % m_pcCfg->getIntraPeriod() == 0 : pocCurr % m_pcCfg->getFrameRate() == 0; 1420 xDetermin3DAsymLUT( pcSlice , pcPic , refLayerIdc , m_pcCfg , bSignalPPS ); 1337 xDetermin3DAsymLUT( pcSlice, pcPic, refLayerIdc, m_pcCfg, bSignalPPS ); 1338 1339 // update PPS in TEncTop and TComPicSym classes 1340 m_pcEncTop->getPPS()->setCGSOutputBitDepthY( m_Enc3DAsymLUTPPS.getOutputBitDepthY() ); 1341 m_pcEncTop->getPPS()->setCGSOutputBitDepthC( m_Enc3DAsymLUTPPS.getOutputBitDepthC() ); 1342 pcPic->getPicSym()->getPPSToUpdate()->setCGSOutputBitDepthY( m_Enc3DAsymLUTPPS.getOutputBitDepthY() ); 1343 pcPic->getPicSym()->getPPSToUpdate()->setCGSOutputBitDepthC( m_Enc3DAsymLUTPPS.getOutputBitDepthC() ); 1344 1421 1345 m_Enc3DAsymLUTPPS.colorMapping( pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), m_pColorMappedPic ); 1422 1346 pBaseColRec = m_pColorMappedPic; … … 1608 1532 if(lTid==pcSlice->getTLayer()) 1609 1533 { 1610 TComReferencePictureSet* nRPS = pcSlice->getSPS()->getRPSList()->getReferencePictureSet(ii);1534 const TComReferencePictureSet* nRPS = pcSlice->getSPS()->getRPSList()->getReferencePictureSet(ii); 1611 1535 for(Int jj=0;jj<nRPS->getNumberOfPictures();jj++) 1612 1536 { … … 1725 1649 if(lTid==pcSlice->getTLayer()) 1726 1650 { 1727 TComReferencePictureSet* nRPS = pcSlice->getSPS()->getRPSList()->getReferencePictureSet(ii);1651 const TComReferencePictureSet* nRPS = pcSlice->getSPS()->getRPSList()->getReferencePictureSet(ii); 1728 1652 for(Int jj=0; jj<nRPS->getNumberOfPictures(); jj++) 1729 1653 { … … 1844 1768 pcSlice->setSliceType ( P_SLICE ); 1845 1769 } 1770 pcSlice->setEncCABACTableIdx(m_pcSliceEncoder->getEncCABACTableIdx()); 1846 1771 1847 1772 if (pcSlice->getSliceType() == B_SLICE) … … 1894 1819 pcSlice->setEnableTMVPFlag(1); 1895 1820 } 1896 pcSlice->getSPS()->setTMVPFlagsPresent(1);1897 1821 } 1898 1822 else if (m_pcEncTop->getTMVPModeId() == 1) 1899 1823 { 1900 pcSlice->getSPS()->setTMVPFlagsPresent(1);1901 1824 #if SVC_EXTENSION 1902 1825 if( pcSlice->getIdrPicFlag() ) … … 1910 1833 else 1911 1834 { 1912 pcSlice->getSPS()->setTMVPFlagsPresent(0);1913 1835 pcSlice->setEnableTMVPFlag(0); 1914 1836 } … … 2026 1948 pcPic->getSlice(pcSlice->getSliceIdx())->setMvdL1ZeroFlag(pcSlice->getMvdL1ZeroFlag()); 2027 1949 2028 pcPic->getPicSym()->initTiles(pcSlice->getPPS());2029 pcPic->getPicSym()->initCtuTsRsAddrMaps();2030 2031 1950 Double lambda = 0.0; 2032 1951 Int actualHeadBits = 0; … … 2114 2033 2115 2034 // Allocate some coders, now the number of tiles are known. 2116 const Int numSubstreams = pcSlice->getPPS()->getNumSubstreams(); 2035 const Int numSubstreamsColumns = (pcSlice->getPPS()->getNumTileColumnsMinus1() + 1); 2036 const Int numSubstreamRows = pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag() ? pcPic->getFrameHeightInCtus() : (pcSlice->getPPS()->getNumTileRowsMinus1() + 1); 2037 const Int numSubstreams = numSubstreamRows * numSubstreamsColumns; 2117 2038 std::vector<TComOutputBitstream> substreamsOut(numSubstreams); 2118 2039 … … 2138 2059 m_pcSliceEncoder->setSliceIdx ( uiNumSliceSegments ); 2139 2060 pcSlice = pcPic->getSlice ( uiNumSliceSegments ); 2061 assert(pcSlice->getPPS()!=0); 2140 2062 pcSlice->copySliceInfo ( pcPic->getSlice(uiNumSliceSegments-1) ); 2141 2063 pcSlice->setSliceIdx ( uiNumSliceSegments ); … … 2151 2073 pcSlice->setDependentSliceSegmentFlag(bNextSegmentIsDependentSlice); 2152 2074 pcSlice->setSliceSegmentCurStartCtuTsAddr ( curSliceSegmentEnd ); 2075 // TODO: optimise cabac_init during compress slice to improve multi-slice operation 2076 // pcSlice->setEncCABACTableIdx(m_pcSliceEncoder->getEncCABACTableIdx()); 2153 2077 uiNumSliceSegments ++; 2154 2078 } … … 2177 2101 if ( m_pcCfg->getDeblockingFilterMetric() ) 2178 2102 { 2179 dblMetric(pcPic, uiNumSliceSegments);2103 applyDeblockingFilterMetric(pcPic, uiNumSliceSegments); 2180 2104 } 2181 2105 m_pcLoopFilter->loopFilterPic( pcPic ); … … 2185 2109 m_pcEntropyCoder->setEntropyCoder ( m_pcCavlcCoder, pcSlice ); 2186 2110 2187 / * write various header sets. */2111 // write various header sets. 2188 2112 if ( m_bSeqFirst ) 2189 2113 { … … 2222 2146 2223 2147 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 2224 if (m_bSeqFirst) 2225 { 2226 pcSlice->getSPS()->setNumLongTermRefPicSPS(m_numLongTermRefPicSPS); 2227 assert (m_numLongTermRefPicSPS <= MAX_NUM_LONG_TERM_REF_PICS); 2228 for (Int k = 0; k < m_numLongTermRefPicSPS; k++) 2229 { 2230 pcSlice->getSPS()->setLtRefPicPocLsbSps(k, m_ltRefPicPocLsbSps[k]); 2231 pcSlice->getSPS()->setUsedByCurrPicLtSPSFlag(k, m_ltRefPicUsedByCurrPicFlag[k]); 2232 } 2233 } 2234 if( m_pcCfg->getPictureTimingSEIEnabled() || m_pcCfg->getDecodingUnitInfoSEIEnabled() ) 2235 { 2236 UInt maxCU = m_pcCfg->getSliceArgument(); 2237 UInt numDU = ( m_pcCfg->getSliceMode() == FIXED_NUMBER_OF_CTU ) ? ( pcPic->getNumberOfCtusInFrame() / maxCU ) : ( 0 ); 2238 if( pcPic->getNumberOfCtusInFrame() % maxCU != 0 || numDU == 0 ) 2239 { 2240 numDU ++; 2241 } 2242 pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->setNumDU( numDU ); 2243 pcSlice->getSPS()->setHrdParameters( m_pcCfg->getFrameRate(), numDU, m_pcCfg->getTargetBitrate(), ( m_pcCfg->getIntraPeriod() > 0 ) ); 2244 } 2245 if( m_pcCfg->getBufferingPeriodSEIEnabled() || m_pcCfg->getPictureTimingSEIEnabled() || m_pcCfg->getDecodingUnitInfoSEIEnabled() ) 2246 { 2247 pcSlice->getSPS()->getVuiParameters()->setHrdParametersPresentFlag( true ); 2248 } 2249 2148 2250 2149 #if SVC_EXTENSION 2251 2150 // dependency constraint … … 2285 2184 actualTotalBits += UInt(accessUnit.back()->m_nalUnitData.str().size()) * 8; 2286 2185 2287 xCreateLeadingSEIMessages(accessUnit, pcSlice->getSPS() );2186 xCreateLeadingSEIMessages(accessUnit, pcSlice->getSPS(), pcSlice->getPPS()); 2288 2187 2289 2188 #if O0164_MULTI_LAYER_HRD … … 2776 2675 } 2777 2676 #endif 2677 2678 pcSlice->setEncCABACTableIdx(m_pcSliceEncoder->getEncCABACTableIdx()); 2778 2679 2779 2680 tmpBitsBeforeWriting = m_pcEntropyCoder->getNumberOfWrittenBits(); … … 3089 2990 || ( pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getVclHrdParametersPresentFlag() ) ) ) 3090 2991 { 3091 TComVUI *vui = pcSlice->getSPS()->getVuiParameters();3092 TComHRD *hrd = vui->getHrdParameters();2992 const TComVUI *vui = pcSlice->getSPS()->getVuiParameters(); 2993 const TComHRD *hrd = vui->getHrdParameters(); 3093 2994 3094 2995 if( hrd->getSubPicCpbParamsPresentFlag() ) … … 4094 3995 } 4095 3996 4096 Void TEncGOP:: dblMetric( TComPic* pcPic, UInt uiNumSlices )3997 Void TEncGOP::applyDeblockingFilterMetric( TComPic* pcPic, UInt uiNumSlices ) 4097 3998 { 4098 3999 TComPicYuv* pcPicYuvRec = pcPic->getPicYuvRec(); … … 4819 4720 4820 4721 #if CGS_3D_ASYMLUT 4821 Void TEncGOP::xDetermin3DAsymLUT( TComSlice * pSlice , TComPic * pCurPic , UInt refLayerIdc , TEncCfg * pCfg, Bool bSignalPPS )4722 Void TEncGOP::xDetermin3DAsymLUT( TComSlice * pSlice, TComPic * pCurPic, UInt refLayerIdc, TEncCfg * pCfg, Bool bSignalPPS ) 4822 4723 { 4823 4724 Int nCGSFlag = pSlice->getPPS()->getCGSFlag(); … … 4884 4785 } 4885 4786 } 4886 pSlice->getPPS()->setCGSOutputBitDepthY( m_Enc3DAsymLUTPPS.getOutputBitDepthY() );4887 pSlice->getPPS()->setCGSOutputBitDepthC( m_Enc3DAsymLUTPPS.getOutputBitDepthC() );4888 4787 } 4889 4788 -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.h
r1212 r1235 236 236 Double xCalculateRVM(); 237 237 238 SEIActiveParameterSets* xCreateSEIActiveParameterSets ( TComSPS *sps);238 SEIActiveParameterSets* xCreateSEIActiveParameterSets (const TComSPS *sps); 239 239 SEIFramePacking* xCreateSEIFramePacking(); 240 240 SEISegmentedRectFramePacking* xCreateSEISegmentedRectFramePacking(); 241 241 SEIDisplayOrientation* xCreateSEIDisplayOrientation(); 242 242 SEIToneMappingInfo* xCreateSEIToneMappingInfo(); 243 SEITempMotionConstrainedTileSets* xCreateSEITempMotionConstrainedTileSets ( );243 SEITempMotionConstrainedTileSets* xCreateSEITempMotionConstrainedTileSets (const TComPPS *pps); 244 244 SEIKneeFunctionInfo* xCreateSEIKneeFunctionInfo(); 245 245 SEIChromaSamplingFilterHint* xCreateSEIChromaSamplingFilterHint(Bool bChromaLocInfoPresent, Int iHorFilterIndex, Int iVerFilterIdc); 246 246 247 Void xCreateLeadingSEIMessages (/*SEIMessages seiMessages,*/ AccessUnit &accessUnit, TComSPS *sps);247 Void xCreateLeadingSEIMessages (/*SEIMessages seiMessages,*/ AccessUnit &accessUnit, const TComSPS *sps, const TComPPS *pps); 248 248 Int xGetFirstSeiLocation (AccessUnit &accessUnit); 249 249 Void xResetNonNestedSEIPresentFlags() … … 258 258 m_nestedPictureTimingSEIPresentInAU = false; 259 259 } 260 Void dblMetric( TComPic* pcPic, UInt uiNumSlices );260 Void applyDeblockingFilterMetric( TComPic* pcPic, UInt uiNumSlices ); 261 261 262 262 #if Q0074_COLOUR_REMAPPING_SEI … … 290 290 Void downScalePic( TComPicYuv* pcYuvSrc, TComPicYuv* pcYuvDest); 291 291 Void downScaleComponent2x2( const Pel* pSrc, Pel* pDest, const Int iSrcStride, const Int iDestStride, const Int iSrcWidth, const Int iSrcHeight, const Int inputBitDepth, const Int outputBitDepth ); 292 inline Short 292 inline Short xClip( Short x , Int bitdepth ); 293 293 Void initDs(Int iWidth, Int iHeight, Int iType); 294 Void filterImg( 295 Pel *src, 296 Int iSrcStride, 297 Pel *dst, 298 Int iDstStride, 299 Int height1, 300 Int width1, 301 Int shift, 302 Int plane); 294 Void filterImg( Pel *src, Int iSrcStride, Pel *dst, Int iDstStride, Int height1, Int width1, Int shift, Int plane); 303 295 304 296 Int get_mem2DintWithPad(Int ***array2D, Int dim0, Int dim1, Int iPadY, Int iPadX); -
branches/SHM-dev/source/Lib/TLibEncoder/TEncPic.cpp
r1029 r1235 128 128 129 129 #if SVC_EXTENSION 130 Void TEncPic::create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 131 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual ) 130 Void TEncPic::create( const TComVPS& vps, const TComSPS &sps, const TComPPS &pps, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual, const UInt layerId ) 132 131 { 133 TComPic::create( iWidth, iHeight, chromaFormat, uiMaxWidth, uiMaxHeight, uiMaxDepth, 134 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSps, bIsVirtual ); 132 TComPic::create( vps, sps, pps, uiMaxWidth, uiMaxHeight, uiMaxDepth, bIsVirtual, layerId ); 133 134 const Int iWidth = vps.getPicWidthInLumaSamples(&sps, layerId); 135 const Int iHeight = vps.getPicHeightInLumaSamples(&sps, layerId); 135 136 #else 136 Void TEncPic::create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 137 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, Bool bIsVirtual ) 137 Void TEncPic::create( const TComSPS &sps, const TComPPS &pps, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual ) 138 138 { 139 TComPic::create( iWidth, iHeight, chromaFormat, uiMaxWidth, uiMaxHeight, uiMaxDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, bIsVirtual ); 139 TComPic::create( sps, pps, uiMaxWidth, uiMaxHeight, uiMaxDepth, bIsVirtual ); 140 141 const Int iWidth = sps.getPicWidthInLumaSamples(); 142 const Int iHeight = sps.getPicHeightInLumaSamples(); 140 143 #endif 141 144 m_uiMaxAQDepth = uiMaxAQDepth; -
branches/SHM-dev/source/Lib/TLibEncoder/TEncPic.h
r1029 r1235 106 106 107 107 #if SVC_EXTENSION 108 Void create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 109 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual=false ); 108 Void create( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual /* = false*/, const UInt layerId ); 110 109 #else //SVC_EXTENSION 111 Void create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 112 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, Bool bIsVirtual = false ); 110 Void create( const TComSPS &sps, const TComPPS &pps, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual /* = false*/ ); 113 111 #endif //SVC_EXTENSION 114 112 -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSbac.cpp
r1230 r1235 109 109 SliceType eSliceType = m_pcSlice->getSliceType(); 110 110 111 Int encCABACTableIdx = m_pcSlice->getPPS()->getEncCABACTableIdx();111 SliceType encCABACTableIdx = m_pcSlice->getEncCABACTableIdx();; 112 112 if (!m_pcSlice->isIntra() && (encCABACTableIdx==B_SLICE || encCABACTableIdx==P_SLICE) && m_pcSlice->getPPS()->getCabacInitPresentFlag()) 113 113 { 114 eSliceType = (SliceType)encCABACTableIdx;114 eSliceType = encCABACTableIdx; 115 115 } 116 116 … … 161 161 * stores the index of the closest table. This index is used for the next P/B slice when cabac_init_present_flag is true. 162 162 */ 163 VoidTEncSbac::determineCabacInitIdx()163 SliceType TEncSbac::determineCabacInitIdx() 164 164 { 165 165 Int qp = m_pcSlice->getSliceQp(); … … 214 214 } 215 215 } 216 m_pcSlice->getPPS()->setEncCABACTableIdx( bestSliceType );216 return bestSliceType; 217 217 } 218 218 else 219 219 { 220 m_pcSlice->getPPS()->setEncCABACTableIdx( I_SLICE );221 } 222 } 223 224 Void TEncSbac::codeVPS( TComVPS* pcVPS )220 return I_SLICE; 221 } 222 } 223 224 Void TEncSbac::codeVPS( const TComVPS* pcVPS ) 225 225 { 226 226 assert (0); … … 228 228 } 229 229 230 Void TEncSbac::codeSPS( TComSPS* pcSPS )230 Void TEncSbac::codeSPS( const TComSPS* pcSPS ) 231 231 { 232 232 assert (0); … … 234 234 } 235 235 236 Void TEncSbac::codePPS( TComPPS* pcPPS237 236 #if CGS_3D_ASYMLUT 238 , TEnc3DAsymLUT * pc3DAsymLUT 237 Void TEncSbac::codePPS( const TComPPS* pcPPS, TEnc3DAsymLUT * pc3DAsymLUT ) 238 #else 239 Void TEncSbac::codePPS( const TComPPS* pcPPS ) 239 240 #endif 240 )241 241 { 242 242 assert (0); … … 459 459 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 0) ); 460 460 m_pcBinIf->encodeBin( 1, m_cCUPartSizeSCModel.get( 0, 0, 1) ); 461 if ( pcCU->getSlice()->getSPS()->get AMPAcc( uiDepth ))461 if ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < g_uiMaxCUDepth-g_uiAddCUDepth ) 462 462 { 463 463 if (eSize == SIZE_2NxN) … … 485 485 } 486 486 487 if ( pcCU->getSlice()->getSPS()->get AMPAcc( uiDepth ))487 if ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < g_uiMaxCUDepth-g_uiAddCUDepth ) 488 488 { 489 489 if (eSize == SIZE_Nx2N) -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSbac.h
r1212 r1235 75 75 // Virtual list 76 76 Void resetEntropy (); 77 VoiddetermineCabacInitIdx ();77 SliceType determineCabacInitIdx (); 78 78 Void setBitstream ( TComBitIf* p ) { m_pcBitIf = p; m_pcBinIf->init( p ); } 79 79 Void setSlice ( TComSlice* p ) { m_pcSlice = p; } … … 87 87 //--SBAC RD 88 88 89 Void codeVPS ( TComVPS* pcVPS ); 90 Void codeSPS ( TComSPS* pcSPS ); 91 Void codePPS ( TComPPS* pcPPS 89 Void codeVPS ( const TComVPS* pcVPS ); 90 Void codeSPS ( const TComSPS* pcSPS ); 92 91 #if CGS_3D_ASYMLUT 93 , TEnc3DAsymLUT * pc3DAsymLUT 92 Void codePPS ( const TComPPS* pcPPS, TEnc3DAsymLUT * pc3DAsymLUT ); 93 #else 94 Void codePPS ( const TComPPS* pcPPS ); 94 95 #endif 95 );96 96 Void codeSliceHeader ( TComSlice* pcSlice ); 97 97 Void codeTilesWPPEntryPoint ( TComSlice* pSlice ); … … 103 103 Void codeSaoUflc ( UInt uiLength, UInt uiCode ); 104 104 Void codeSAOSign ( UInt uiCode); //<! code SAO offset sign 105 Void codeScalingList ( TComScalingList* /*scalingList*/ ){ assert (0); return;};106 105 107 106 #if SVC_EXTENSION -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.cpp
r1234 r1235 3945 3945 #if SVC_EXTENSION 3946 3946 // Check WP for B-slices 3947 if ( pcCU->getSlice()->getPPS()->getUseWP())3947 if( pcCU->getSlice()->testWeightPred() ) 3948 3948 #else 3949 if ( pcCU->getSlice()-> getPPS()->getUseWP() && pcCU->getSlice()->getSliceType()==P_SLICE )3949 if ( pcCU->getSlice()->testWeightPred() && pcCU->getSlice()->getSliceType()==P_SLICE ) 3950 3950 #endif 3951 3951 { … … 3959 3959 #if SVC_EXTENSION 3960 3960 // Check WP for B-slices 3961 if ( pcCU->getSlice()->getPPS()->getUseWP())3961 if ( pcCU->getSlice()->testWeightPred() ) 3962 3962 #else 3963 if ( pcCU->getSlice()-> getPPS()->getUseWP() && pcCU->getSlice()->getSliceType()==P_SLICE )3963 if ( pcCU->getSlice()->testWeightPred() && pcCU->getSlice()->getSliceType()==P_SLICE ) 3964 3964 #endif 3965 3965 { … … 5584 5584 assert( pcCU->getDepth( 0 ) == pcCU->getDepth( uiAbsPartIdx ) ); 5585 5585 const UInt uiTrMode = pcCU->getTransformIdx( uiAbsPartIdx ); 5586 TComSPS *sps=pcCU->getSlice()->getSPS();5586 const TComSPS *sps=pcCU->getSlice()->getSPS(); 5587 5587 5588 5588 if( uiCurrTrMode == uiTrMode ) … … 5973 5973 5974 5974 TComSlice *pcSlice = pcCU->getSlice(); 5975 TComPPS *pps = pcCU->getSlice()->getPPS();5976 5975 WPScalingParam *wp0 , *wp1; 5977 5976 5978 m_cDistParam.bApplyWeight = ( pcSlice->getSliceType()==P_SLICE && p ps->getUseWP() ) || ( pcSlice->getSliceType()==B_SLICE && pps->getWPBiPred() ) ;5977 m_cDistParam.bApplyWeight = ( pcSlice->getSliceType()==P_SLICE && pcSlice->testWeightPred() ) || ( pcSlice->getSliceType()==B_SLICE && pcSlice->testWeightBiPred() ) ; 5979 5978 5980 5979 if ( !m_cDistParam.bApplyWeight ) return; -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSlice.cpp
r1203 r1235 48 48 49 49 TEncSlice::TEncSlice() 50 : m_encCABACTableIdx(I_SLICE) 50 51 { 51 52 m_apcPicYuvPred = NULL; … … 220 221 #if SVC_EXTENSION 221 222 //\param vps VPS associated with the slice 222 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS, TComVPS *vps,Bool isField )223 #else 224 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS,TComPPS *pPPS, Bool isField )223 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, Bool isField ) 224 #else 225 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, const TComSPS* pSPS, const TComPPS *pPPS, Bool isField ) 225 226 #endif 226 227 { … … 229 230 230 231 rpcSlice = pcPic->getSlice(0); 231 rpcSlice->setSPS( pSPS );232 rpcSlice->setPPS( pPPS );233 232 rpcSlice->setSliceBits(0); 234 233 rpcSlice->setPic( pcPic ); 235 234 #if SVC_EXTENSION 235 const TComPPS* pPPS = &pcPic->getPicSym()->getPPS(); 236 236 237 UInt layerId = pcPic->getLayerId(); 237 rpcSlice->setVPS( vps );238 238 rpcSlice->initSlice( layerId ); 239 239 #else … … 501 501 else if (rpcSlice->getPPS()->getDeblockingFilterControlPresentFlag()) 502 502 { 503 rpcSlice->getPPS()->setDeblockingFilterOverrideEnabledFlag( !m_pcCfg->getLoopFilterOffsetInPPS() ); 504 rpcSlice->setDeblockingFilterOverrideFlag( !m_pcCfg->getLoopFilterOffsetInPPS() ); 505 rpcSlice->getPPS()->setPicDisableDeblockingFilterFlag( m_pcCfg->getLoopFilterDisable() ); 506 rpcSlice->setDeblockingFilterDisable( m_pcCfg->getLoopFilterDisable() ); 503 rpcSlice->setDeblockingFilterOverrideFlag( rpcSlice->getPPS()->getDeblockingFilterOverrideEnabledFlag() ); 504 rpcSlice->setDeblockingFilterDisable( rpcSlice->getPPS()->getPicDisableDeblockingFilterFlag() ); 507 505 if ( !rpcSlice->getDeblockingFilterDisable()) 508 506 { 509 if ( !m_pcCfg->getLoopFilterOffsetInPPS() && eSliceType!=I_SLICE) 510 { 511 rpcSlice->getPPS()->setDeblockingFilterBetaOffsetDiv2( m_pcCfg->getGOPEntry(iGOPid).m_betaOffsetDiv2 + m_pcCfg->getLoopFilterBetaOffset() ); 512 rpcSlice->getPPS()->setDeblockingFilterTcOffsetDiv2( m_pcCfg->getGOPEntry(iGOPid).m_tcOffsetDiv2 + m_pcCfg->getLoopFilterTcOffset() ); 507 if ( rpcSlice->getDeblockingFilterOverrideFlag() && eSliceType!=I_SLICE) 508 { 513 509 rpcSlice->setDeblockingFilterBetaOffsetDiv2( m_pcCfg->getGOPEntry(iGOPid).m_betaOffsetDiv2 + m_pcCfg->getLoopFilterBetaOffset() ); 514 510 rpcSlice->setDeblockingFilterTcOffsetDiv2( m_pcCfg->getGOPEntry(iGOPid).m_tcOffsetDiv2 + m_pcCfg->getLoopFilterTcOffset() ); … … 516 512 else 517 513 { 518 rpcSlice->getPPS()->setDeblockingFilterBetaOffsetDiv2( m_pcCfg->getLoopFilterBetaOffset() );519 rpcSlice->getPPS()->setDeblockingFilterTcOffsetDiv2( m_pcCfg->getLoopFilterTcOffset() );520 514 rpcSlice->setDeblockingFilterBetaOffsetDiv2( m_pcCfg->getLoopFilterBetaOffset() ); 521 515 rpcSlice->setDeblockingFilterTcOffsetDiv2( m_pcCfg->getLoopFilterTcOffset() ); … … 558 552 #endif 559 553 560 xStoreWPparam( pPPS->getUseWP(), pPPS->getWPBiPred() );561 562 554 #if SVC_EXTENSION 563 555 if( layerId > 0 ) … … 792 784 793 785 xEstimateWPParamSlice( pcSlice ); 794 pcSlice->initWpScaling( );786 pcSlice->initWpScaling(pcSlice->getSPS()); 795 787 796 788 // check WP on/off … … 1010 1002 m_lastSliceSegmentEndContextState.loadContexts( m_pppcRDSbacCoder[0][CI_CURR_BEST] );//ctx end of dep.slice 1011 1003 } 1012 xRestoreWPparam( pcSlice );1013 1004 1014 1005 // stop use of temporary bit counter object. 1015 1006 m_pppcRDSbacCoder[0][CI_CURR_BEST]->setBitstream(NULL); 1016 1007 m_pcRDGoOnSbacCoder->setBitstream(NULL); // stop use of tempBitCounter. 1008 1009 // TODO: optimise cabac_init during compress slice to improve multi-slice operation 1010 //if (pcSlice->getPPS()->getCabacInitPresentFlag() && !pcSlice->getPPS()->getDependentSliceSegmentsEnabledFlag()) 1011 //{ 1012 // m_encCABACTableIdx = m_pcEntropyCoder->determineCabacInitIdx(); 1013 //} 1014 //else 1015 //{ 1016 // m_encCABACTableIdx = pcSlice->getSliceType(); 1017 //} 1017 1018 } 1018 1019 … … 1198 1199 #endif 1199 1200 1200 if (pcSlice->getPPS()->getCabacInitPresentFlag()) 1201 { 1202 if (pcSlice->getPPS()->getDependentSliceSegmentsEnabledFlag()) 1203 { 1204 pcSlice->getPPS()->setEncCABACTableIdx( pcSlice->getSliceType() ); 1205 } 1206 else 1207 { 1208 m_pcEntropyCoder->determineCabacInitIdx(); 1209 } 1210 } 1201 if (pcSlice->getPPS()->getCabacInitPresentFlag() && !pcSlice->getPPS()->getDependentSliceSegmentsEnabledFlag()) 1202 { 1203 m_encCABACTableIdx = m_pcEntropyCoder->determineCabacInitIdx(); 1204 } 1205 else 1206 { 1207 m_encCABACTableIdx = pcSlice->getSliceType(); 1208 } 1209 1211 1210 numBinsCoded = m_pcBinCABAC->getBinsCoded(); 1212 1211 } -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSlice.h
r1201 r1235 98 98 TEncSbac m_lastSliceSegmentEndContextState; ///< context storage for state at the end of the previous slice-segment (used for dependent slices only). 99 99 TEncSbac m_entropyCodingSyncContextState; ///< context storate for state of contexts at the wavefront/WPP/entropy-coding-sync second CTU of tile-row 100 SliceType m_encCABACTableIdx; 100 101 101 102 #if SVC_EXTENSION && JCTVC_M0259_LAMBDAREFINEMENT … … 120 121 /// preparation of slice encoding (reference marking, QP and lambda) 121 122 #if SVC_EXTENSION 122 Void initEncSlice ( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, 123 Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS, TComVPS *vps, Bool isField ); 123 Void initEncSlice ( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, Bool isField ); 124 124 Void estimateILWpParam ( TComSlice* pcSlice ); 125 125 #else 126 126 Void initEncSlice ( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, 127 Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS,TComPPS *pPPS, Bool isField );127 Int iGOPid, TComSlice*& rpcSlice, const TComSPS* pSPS, const TComPPS *pPPS, Bool isField ); 128 128 #endif 129 129 … … 143 143 Void setSliceIdx(UInt i) { m_uiSliceIdx = i; } 144 144 145 SliceType getEncCABACTableIdx() const { return m_encCABACTableIdx; } 146 145 147 private: 146 148 Double xGetQPValueAccordingToLambda ( Double lambda ); -
branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp
r1226 r1235 185 185 m_cSliceEncoder. destroy(); 186 186 m_cCuEncoder. destroy(); 187 if (m_cSPS.getUseSAO()) 188 { 189 m_cEncSAO.destroyEncData(); 190 m_cEncSAO.destroy(); 191 } 187 m_cEncSAO. destroyEncData(); 188 m_cEncSAO. destroy(); 192 189 m_cLoopFilter. destroy(); 193 190 m_cRateCtrl. destroy(); … … 232 229 // initialize SPS 233 230 xInitSPS(); 234 235 // set the VPS profile information 236 #if SVC_EXTENSION 237 m_cVPS.getTimingInfo()->setTimingInfoPresentFlag ( true ); 238 #else 239 *m_cVPS.getPTL() = *m_cSPS.getPTL(); 240 m_cVPS.getTimingInfo()->setTimingInfoPresentFlag ( false ); 241 #endif 231 xInitVPS(); 232 242 233 m_cRdCost.setCostMode(m_costMode); 243 234 244 235 // initialize PPS 245 m_cPPS.setSPS(&m_cSPS);246 236 xInitPPS(); 247 237 xInitRPS(isFieldCoding); … … 271 261 272 262 m_iMaxRefPicNum = 0; 263 264 xInitScalingLists(); 265 273 266 #if SVC_EXTENSION 274 267 m_iSPSIdCnt ++; … … 276 269 xInitILRP(); 277 270 #endif 271 } 272 273 Void TEncTop::xInitScalingLists() 274 { 275 // Initialise scaling lists 276 // The encoder will only use the SPS scaling lists. The PPS will never be marked present. 277 278 if(getUseScalingListId() == SCALING_LIST_OFF) 279 { 280 #if SVC_EXTENSION 281 getTrQuant()->setFlatScalingList(m_cVPS.getChromaFormatIdc(&m_cSPS, m_layerId)); 282 #else 283 getTrQuant()->setFlatScalingList(m_cSPS.getChromaFormatIdc()); 284 #endif 285 getTrQuant()->setUseScalingList(false); 286 m_cSPS.setScalingListPresentFlag(false); 287 m_cPPS.setScalingListPresentFlag(false); 288 } 289 else if(getUseScalingListId() == SCALING_LIST_DEFAULT) 290 { 291 #if SVC_EXTENSION 292 // inferring of the scaling list can be moved to the config file 293 UInt refLayerId = 0; 294 if( m_layerId > 0 && !m_cVPS.getNonHEVCBaseLayerFlag() && m_cVPS.getRecursiveRefLayerFlag( m_layerId, refLayerId ) ) 295 { 296 m_cSPS.setInferScalingListFlag( true ); 297 m_cSPS.setScalingListRefLayerId( refLayerId ); 298 m_cSPS.setScalingListPresentFlag( false ); 299 m_cPPS.setInferScalingListFlag( false ); 300 m_cPPS.setScalingListPresentFlag( false ); 301 302 // infer the scaling list from the reference layer 303 getTrQuant()->setScalingList( &m_ppcTEncTop[m_cVPS.getLayerIdxInVps(refLayerId)]->getSPS()->getScalingList(), m_cSPS.getChromaFormatIdc() ); 304 } 305 else 306 { 307 #endif 308 m_cSPS.getScalingList().setDefaultScalingList (); 309 m_cSPS.setScalingListPresentFlag(false); 310 m_cPPS.setScalingListPresentFlag(false); 311 getTrQuant()->setScalingList(&(m_cSPS.getScalingList()), m_cSPS.getChromaFormatIdc()); 312 #if SVC_EXTENSION 313 } 314 #endif 315 getTrQuant()->setUseScalingList(true); 316 } 317 else if(getUseScalingListId() == SCALING_LIST_FILE_READ) 318 { 319 #if SVC_EXTENSION 320 // inferring of the scaling list can be moved to the config file 321 UInt refLayerId = 0; 322 if( m_layerId > 0 && !m_cVPS.getNonHEVCBaseLayerFlag() && m_cVPS.getRecursiveRefLayerFlag( m_layerId, refLayerId ) ) 323 { 324 m_cSPS.setInferScalingListFlag( true ); 325 m_cSPS.setScalingListRefLayerId( refLayerId ); 326 m_cSPS.setScalingListPresentFlag( false ); 327 m_cPPS.setInferScalingListFlag( false ); 328 m_cPPS.setScalingListPresentFlag( false ); 329 330 // infer the scaling list from the reference layer 331 getTrQuant()->setScalingList( &m_ppcTEncTop[m_cVPS.getLayerIdxInVps(refLayerId)]->getSPS()->getScalingList(), m_cSPS.getChromaFormatIdc() ); 332 } 333 else 334 { 335 #endif 336 m_cSPS.getScalingList().setDefaultScalingList (); 337 if(m_cSPS.getScalingList().xParseScalingList(getScalingListFile())) 338 { 339 Bool bParsedScalingList=false; // Use of boolean so that assertion outputs useful string 340 assert(bParsedScalingList); 341 exit(1); 342 } 343 m_cSPS.getScalingList().checkDcOfMatrix(); 344 m_cSPS.setScalingListPresentFlag(m_cSPS.getScalingList().checkDefaultScalingList()); 345 m_cPPS.setScalingListPresentFlag(false); 346 getTrQuant()->setScalingList(&(m_cSPS.getScalingList()), m_cSPS.getChromaFormatIdc()); 347 #if SVC_EXTENSION 348 } 349 #endif 350 getTrQuant()->setUseScalingList(true); 351 } 352 else 353 { 354 printf("error : ScalingList == %d not supported\n",getUseScalingListId()); 355 assert(0); 356 } 357 358 // Prepare delta's: 359 for(UInt sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++) 360 { 361 const Int predListStep = (sizeId == SCALING_LIST_32x32? (SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES) : 1); // if 32x32, skip over chroma entries. 362 363 for(UInt listId = 0; listId < SCALING_LIST_NUM; listId+=predListStep) 364 { 365 m_cSPS.getScalingList().checkPredMode( sizeId, listId ); 366 } 367 } 368 278 369 } 279 370 … … 585 676 Void TEncTop::xGetNewPicBuffer ( TComPic*& rpcPic ) 586 677 { 678 // At this point, the SPS and PPS can be considered activated - they are copied to the new TComPic. 679 587 680 TComSlice::sortPicList(m_cListPic); 588 681 … … 611 704 for( UInt i = 0; i < m_cVPS.getNumDirectRefLayers( m_layerId ); i++ ) 612 705 { 613 const Window scalEL = getPPS()->getScaledRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));614 const Window altRL = getPPS()->getRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));706 const Window scalEL = m_cPPS.getScaledRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i)); 707 const Window altRL = m_cPPS.getRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i)); 615 708 Bool equalOffsets = scalEL.hasEqualOffset(altRL); 616 Bool zeroPhase = getPPS()->hasZeroResamplingPhase(m_cVPS.getRefLayerId(m_layerId, i));709 Bool zeroPhase = m_cPPS.hasZeroResamplingPhase(m_cVPS.getRefLayerId(m_layerId, i)); 617 710 618 711 TEncTop *pcEncTopBase = (TEncTop *)getRefLayerEnc( i ); … … 643 736 } 644 737 645 pcEPic->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1 , 646 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics, &m_cSPS); 738 pcEPic->create( m_cVPS, m_cSPS, m_cPPS, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1, false, m_layerId); 647 739 #else //SVC_EXTENSION 648 pcEPic->create( m_ iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1, m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics);740 pcEPic->create( m_cSPS, m_cPPS, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1, false); 649 741 #endif //SVC_EXTENSION 650 742 rpcPic = pcEPic; … … 659 751 for( UInt i = 0; i < m_cVPS.getNumDirectRefLayers( m_layerId ); i++ ) 660 752 { 661 const Window scalEL = getPPS()->getScaledRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));662 const Window altRL = getPPS()->getRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));753 const Window scalEL = m_cPPS.getScaledRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i)); 754 const Window altRL = m_cPPS.getRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i)); 663 755 Bool equalOffsets = scalEL.hasEqualOffset(altRL); 664 Bool zeroPhase = getPPS()->hasZeroResamplingPhase(m_cVPS.getRefLayerId(m_layerId, i));756 Bool zeroPhase = m_cPPS.hasZeroResamplingPhase(m_cVPS.getRefLayerId(m_layerId, i)); 665 757 666 758 TEncTop *pcEncTopBase = (TEncTop *)getRefLayerEnc( i ); … … 688 780 } 689 781 690 rpcPic->create( m_ iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics, &m_cSPS);782 rpcPic->create( m_cVPS, m_cSPS, m_cPPS, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, false, m_layerId ); 691 783 #else //SVC_EXTENSION 692 rpcPic->create( m_ iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics, false );784 rpcPic->create( m_cSPS, m_cPPS, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, false ); 693 785 #endif //SVC_EXTENSION 694 786 } … … 705 797 rpcPic->getPicYuvRec()->setBorderExtension(false); 706 798 } 799 800 Void TEncTop::xInitVPS() 801 { 802 // The SPS must have already been set up. 803 // set the VPS profile information. 804 #if SVC_EXTENSION 805 m_cVPS.setVpsVuiPresentFlag( true ); 806 #else 807 *m_cVPS.getPTL() = *m_cSPS.getPTL(); 808 m_cVPS.setMaxOpSets(1); 809 #endif 810 m_cVPS.getTimingInfo()->setTimingInfoPresentFlag ( false ); 811 m_cVPS.setNumHrdParameters( 0 ); 812 813 m_cVPS.createHrdParamBuffer(); 814 for( UInt i = 0; i < m_cVPS.getNumHrdParameters(); i ++ ) 815 { 816 m_cVPS.setHrdOpSetIdx( 0, i ); 817 m_cVPS.setCprmsPresentFlag( false, i ); 818 // Set up HrdParameters here. 819 } 820 } 821 707 822 708 823 Void TEncTop::xInitSPS() … … 781 896 m_cSPS.setQuadtreeTUMaxDepthIntra( m_uiQuadtreeTUMaxDepthIntra ); 782 897 898 m_cSPS.setTMVPFlagsPresent((getTMVPModeId() == 2 || getTMVPModeId() == 1)); 899 783 900 m_cSPS.setTMVPFlagsPresent(false); 784 901 785 902 m_cSPS.setMaxTrSize ( 1 << m_uiQuadtreeTULog2MaxSize ); 786 787 Int i; 788 789 for (i = 0; i < g_uiMaxCUDepth-g_uiAddCUDepth; i++ ) 790 { 791 m_cSPS.setAMPAcc( i, m_useAMP ); 792 //m_cSPS.setAMPAcc( i, 1 ); 793 } 794 903 795 904 m_cSPS.setUseAMP ( m_useAMP ); 796 797 for (i = g_uiMaxCUDepth-g_uiAddCUDepth; i < g_uiMaxCUDepth; i++ )798 {799 m_cSPS.setAMPAcc(i, 0);800 }801 802 905 803 906 for (UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++) … … 830 933 m_cSPS.setTemporalIdNestingFlag( ( m_maxTempLayer == 1 ) ? true : false ); 831 934 832 for ( i = 0; i < min(m_cSPS.getMaxTLayers(),(UInt) MAX_TLAYER); i++ )935 for ( Int i = 0; i < min(m_cSPS.getMaxTLayers(),(UInt) MAX_TLAYER); i++ ) 833 936 { 834 937 #if SVC_EXTENSION … … 841 944 m_cSPS.setPCMFilterDisableFlag ( m_bPCMFilterDisableFlag ); 842 945 m_cSPS.setDisableIntraReferenceSmoothing( m_disableIntraReferenceSmoothing ); 843 m_cSPS.setScalingListFlag ( (m_useScalingListId == 0) ? 0 : 1 );946 m_cSPS.setScalingListFlag ( (m_useScalingListId == SCALING_LIST_OFF) ? 0 : 1 ); 844 947 m_cSPS.setUseStrongIntraSmoothing( m_useStrongIntraSmoothing ); 845 948 m_cSPS.setVuiParametersPresentFlag(getVuiParametersPresentFlag()); … … 880 983 pcVUI->setLog2MaxMvLengthVertical(getLog2MaxMvLengthVertical()); 881 984 } 985 m_cSPS.setNumLongTermRefPicSPS(NUM_LONG_TERM_REF_PIC_SPS); 986 assert (NUM_LONG_TERM_REF_PIC_SPS <= MAX_NUM_LONG_TERM_REF_PICS); 987 for (Int k = 0; k < NUM_LONG_TERM_REF_PIC_SPS; k++) 988 { 989 m_cSPS.setLtRefPicPocLsbSps(k, 0); 990 m_cSPS.setUsedByCurrPicLtSPSFlag(k, 0); 991 } 992 if( getPictureTimingSEIEnabled() || getDecodingUnitInfoSEIEnabled() ) 993 { 994 #if SVC_EXTENSION 995 const UInt picWidth = m_cVPS.getPicWidthInLumaSamples(&m_cSPS, m_layerId); 996 const UInt picHeight= m_cVPS.getPicWidthInLumaSamples(&m_cSPS, m_layerId); 997 #else 998 const UInt picWidth = m_cSPS.getPicWidthInLumaSamples(); 999 const UInt picHeight= m_cSPS.getPicWidthInLumaSamples(); 1000 #endif 1001 1002 const UInt frameWidthInCtus = ( picWidth + g_uiMaxCUWidth -1 ) / g_uiMaxCUWidth; 1003 const UInt frameHeightInCtus = ( picHeight + g_uiMaxCUHeight - 1 ) / g_uiMaxCUHeight; 1004 const UInt numCtusInFrame = frameWidthInCtus * frameHeightInCtus; 1005 1006 UInt maxCU = getSliceArgument(); 1007 UInt numDU = ( getSliceMode() == FIXED_NUMBER_OF_CTU ) ? ( numCtusInFrame / maxCU ) : ( 0 ); 1008 if( numCtusInFrame % maxCU != 0 || numDU == 0 ) 1009 { 1010 numDU ++; 1011 } 1012 m_cSPS.getVuiParameters()->getHrdParameters()->setNumDU( numDU ); 1013 m_cSPS.setHrdParameters( getFrameRate(), numDU, getTargetBitrate(), ( getIntraPeriod() > 0 ) ); 1014 } 1015 if( getBufferingPeriodSEIEnabled() || getPictureTimingSEIEnabled() || getDecodingUnitInfoSEIEnabled() ) 1016 { 1017 m_cSPS.getVuiParameters()->setHrdParametersPresentFlag( true ); 1018 } 1019 882 1020 } 883 1021 … … 892 1030 } 893 1031 894 if (m_costMode==COST_SEQUENCE_LEVEL_LOSSLESS || m_costMode==COST_LOSSLESS_CODING) bUseDQP=false; 895 896 if(bUseDQP) 1032 if (m_costMode==COST_SEQUENCE_LEVEL_LOSSLESS || m_costMode==COST_LOSSLESS_CODING) 1033 { 1034 bUseDQP=false; 1035 } 1036 1037 1038 if ( m_RCEnableRateControl ) 1039 { 1040 m_cPPS.setUseDQP(true); 1041 m_cPPS.setMaxCuDQPDepth( 0 ); 1042 } 1043 else if(bUseDQP) 897 1044 { 898 1045 m_cPPS.setUseDQP(true); 899 1046 m_cPPS.setMaxCuDQPDepth( m_iMaxCuDQPDepth ); 900 m_cPPS.setMinCuDQPSize( m_cPPS.getSPS()->getMaxCUWidth() >> ( m_cPPS.getMaxCuDQPDepth()) );901 1047 } 902 1048 else … … 904 1050 m_cPPS.setUseDQP(false); 905 1051 m_cPPS.setMaxCuDQPDepth( 0 ); 906 m_cPPS.setMinCuDQPSize( m_cPPS.getSPS()->getMaxCUWidth() >> ( m_cPPS.getMaxCuDQPDepth()) );907 1052 } 908 1053 … … 919 1064 } 920 1065 921 if ( m_RCEnableRateControl )922 {923 m_cPPS.setUseDQP(true);924 m_cPPS.setMaxCuDQPDepth( 0 );925 m_cPPS.setMinCuDQPSize( m_cPPS.getSPS()->getMaxCUWidth() >> ( m_cPPS.getMaxCuDQPDepth()) );926 }927 928 m_cPPS.setMinCuChromaQpAdjSize( m_cPPS.getSPS()->getMaxCUWidth() >> ( m_cPPS.getMaxCuChromaQpAdjDepth()) );929 930 1066 m_cPPS.setQpOffset(COMPONENT_Cb, m_chromaCbQpOffset ); 931 1067 m_cPPS.setQpOffset(COMPONENT_Cr, m_chromaCrQpOffset ); 932 1068 933 m_cPPS.setNumSubstreams(m_iWaveFrontSubstreams);934 1069 m_cPPS.setEntropyCodingSyncEnabledFlag( m_iWaveFrontSynchro > 0 ); 935 1070 m_cPPS.setTilesEnabledFlag( (m_iNumColumnsMinus1 > 0 || m_iNumRowsMinus1 > 0) ); … … 952 1087 { 953 1088 m_cPPS.setDeblockingFilterControlPresentFlag (m_DeblockingFilterControlPresent ); 1089 1090 if (m_cPPS.getDeblockingFilterControlPresentFlag()) 1091 { 1092 m_cPPS.setDeblockingFilterOverrideEnabledFlag( !getLoopFilterOffsetInPPS() ); 1093 m_cPPS.setPicDisableDeblockingFilterFlag( getLoopFilterDisable() ); 1094 } 1095 } 1096 1097 if (m_cPPS.getDeblockingFilterControlPresentFlag() && ! m_cPPS.getPicDisableDeblockingFilterFlag()) 1098 { 1099 m_cPPS.setDeblockingFilterBetaOffsetDiv2( getLoopFilterBetaOffset() ); 1100 m_cPPS.setDeblockingFilterTcOffsetDiv2( getLoopFilterTcOffset() ); 954 1101 } 955 1102 m_cPPS.setLog2ParallelMergeLevelMinus2 (m_log2ParallelMergeLevelMinus2 ); … … 1076 1223 rps->setInterRPSPrediction(ge.m_interRPSPrediction > 0); // not very clean, converting anything > 0 to true. 1077 1224 rps->setDeltaRIdxMinus1(0); // index to the Reference RPS is always the previous one. 1078 TComReferencePictureSet* RPSRef = rpsList->getReferencePictureSet(i-1); // get the reference RPS1225 TComReferencePictureSet* RPSRef = i>0 ? rpsList->getReferencePictureSet(i-1): NULL; // get the reference RPS 1079 1226 1080 1227 if (ge.m_interRPSPrediction == 2) // Automatic generation of the inter RPS idc based on the RIdx provided. 1081 1228 { 1229 assert (RPSRef!=NULL); 1082 1230 Int deltaRPS = getGOPEntry(i-1).m_POC - ge.m_POC; // the ref POC - current POC 1083 1231 Int numRefDeltaPOC = RPSRef->getNumberOfPictures(); … … 1108 1256 else if (ge.m_interRPSPrediction == 1) // inter RPS idc based on the RefIdc values provided in config file. 1109 1257 { 1258 assert (RPSRef!=NULL); 1110 1259 rps->setDeltaRPS(ge.m_deltaRPS); 1111 1260 rps->setNumRefIdc(ge.m_numRefIdc); … … 1266 1415 } 1267 1416 1268 slice->setRPS(getSPS()->getRPSList()->getReferencePictureSet(slice->getRPSidx())); 1417 TComReferencePictureSet *rps=slice->getLocalRPS(); 1418 (*rps) = *(slice->getSPS()->getRPSList()->getReferencePictureSet(slice->getRPSidx())); 1419 slice->setRPS(rps); 1269 1420 slice->getRPS()->setNumberOfPictures(slice->getRPS()->getNumberOfNegativePictures()+slice->getRPS()->getNumberOfPositivePictures()); 1270 1421 } … … 1313 1464 1314 1465 // # substreams is "per tile" when tiles are independent. 1315 if (m_iWaveFrontSynchro )1316 {1317 m_cPPS.setNumSubstreams(m_iWaveFrontSubstreams * (m_iNumColumnsMinus1+1));1318 }1319 else1320 {1321 m_cPPS.setNumSubstreams((m_iNumRowsMinus1+1) * (m_iNumColumnsMinus1+1));1322 }1323 1466 } 1324 1467 … … 1404 1547 picHeight = repFormat->getPicHeightVpsInLumaSamples(); 1405 1548 1406 if( m_layerId > 0)1549 if( m_layerId > 0 ) 1407 1550 { 1408 1551 g_bitDepth[CHANNEL_TYPE_LUMA] = bitDepthY; … … 1413 1556 g_uiAddCUDepth = max (0, m_cSPS.getLog2MinCodingBlockSize() - (Int)m_cSPS.getQuadtreeTULog2MinSize() ); 1414 1557 1415 Int numReorderPics[MAX_TLAYER];1416 Window &conformanceWindow = repFormat->getConformanceWindowVps();1417 Window defaultDisplayWindow = m_cSPS.getVuiParametersPresentFlag() ? m_cSPS.getVuiParameters()->getDefaultDisplayWindow() : Window();1418 1419 1558 if (m_cIlpPic[0] == NULL) 1420 1559 { … … 1422 1561 { 1423 1562 m_cIlpPic[j] = new TComPic; 1424 #if AUXILIARY_PICTURES 1425 m_cIlpPic[j]->create(picWidth, picHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, &m_cSPS, true); 1426 #else 1427 m_cIlpPic[j]->create(picWidth, picHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, &m_cSPS, true); 1428 #endif 1563 m_cIlpPic[j]->create(m_cVPS, m_cSPS, m_cPPS, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true, m_layerId); 1429 1564 for (Int i=0; i<m_cIlpPic[j]->getPicSym()->getNumberOfCtusInFrame(); i++) 1430 1565 { … … 1462 1597 } 1463 1598 1464 Window& TEncTop::getScaledRefLayerWindowForLayer(Int layerId) 1465 { 1466 static Window win; 1467 1599 Window TEncTop::getScaledRefLayerWindowForLayer(Int layerId) 1600 { 1468 1601 for (Int i = 0; i < m_numRefLayerLocationOffsets; i++) 1469 1602 { … … 1474 1607 } 1475 1608 1476 win.resetWindow(); // scaled reference layer offsets are inferred to be zero when not present 1477 return win; 1478 } 1479 1480 Window& TEncTop::getRefLayerWindowForLayer(Int layerId) 1481 { 1482 static Window win; 1483 1609 return Window(); 1610 } 1611 1612 Window TEncTop::getRefLayerWindowForLayer(Int layerId) 1613 { 1484 1614 for (Int i = 0; i < m_numRefLayerLocationOffsets; i++) 1485 1615 { … … 1490 1620 } 1491 1621 1492 win.resetWindow(); // reference offsets are inferred to be zero when not present 1493 return win; 1622 return Window(); 1494 1623 } 1495 1624 #endif //SVC_EXTENSION -
branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.h
r1226 r1235 93 93 TEncCu m_cCuEncoder; ///< CU encoder 94 94 // SPS 95 TComSPS m_cSPS; ///< SPS 96 TComPPS m_cPPS; ///< PPS 95 TComSPS m_cSPS; ///< SPS. This is the base value. This is copied to TComPicSym 96 TComPPS m_cPPS; ///< PPS. This is the base value. This is copied to TComPicSym 97 97 // RD cost computation 98 98 TComRdCost m_cRdCost; ///< RD cost computation class … … 110 110 TEncPreanalyzer m_cPreanalyzer; ///< image characteristics analyzer for TM5-step3-like adaptive QP 111 111 112 TComScalingList m_scalingList; ///< quantization matrix information113 112 TEncRateCtrl m_cRateCtrl; ///< Rate control class 114 113 … … 148 147 protected: 149 148 Void xGetNewPicBuffer ( TComPic*& rpcPic ); ///< get picture buffer which will be processed 149 Void xInitVPS (); ///< initialize VPS from encoder options 150 150 Void xInitSPS (); ///< initialize SPS from encoder options 151 151 Void xInitPPS (); ///< initialize PPS from encoder options 152 Void xInitScalingLists(); ///< initialize scaling lists 152 153 153 154 Void xInitPPSforTiles (); … … 187 188 TEncSbac* getRDGoOnSbacCoder () { return &m_cRDGoOnSbacCoder; } 188 189 TEncRateCtrl* getRateCtrl () { return &m_cRateCtrl; } 189 TComSPS* getSPS () { return &m_cSPS; }190 TComPPS* getPPS () { return &m_cPPS; }191 190 Void selectReferencePictureSet(TComSlice* slice, Int POCCurr, Int GOPid ); 192 191 Int getReferencePictureSetIdxForSOP(TComSlice* slice, Int POCCurr, Int GOPid ); 193 TComScalingList* getScalingList () { return &m_scalingList; }194 192 // ------------------------------------------------------------------------------------------------------------------- 195 193 // encoder function … … 198 196 /// encode several number of pictures until end-of-sequence 199 197 #if SVC_EXTENSION 198 TComSPS* getSPS() { return &m_cSPS; } 199 #if CGS_3D_ASYMLUT 200 TComPPS* getPPS() { return &m_cPPS; } 201 #endif 200 202 Void setLayerEnc(TEncTop** p) { m_ppcTEncTop = p; } 201 203 TEncTop** getLayerEnc() { return m_ppcTEncTop; } … … 203 205 Int getNumPicRcvd() { return m_iNumPicRcvd; } 204 206 Void setNumPicRcvd( Int num ) { m_iNumPicRcvd = num; } 205 Void setNumRefLayerLocationOffsets(Int x) { m_numRefLayerLocationOffsets = x; }206 UInt getNumRefLayerLocationOffsets() { return m_numRefLayerLocationOffsets; }207 Void setNumRefLayerLocationOffsets(Int x) { m_numRefLayerLocationOffsets = x; } 208 UInt getNumRefLayerLocationOffsets() { return m_numRefLayerLocationOffsets; } 207 209 Void setRefLocationOffsetLayerId(Int x, UInt id) { m_refLocationOffsetLayerId[x] = id; } 208 210 UInt getRefLocationOffsetLayerId(Int x) { return m_refLocationOffsetLayerId[x]; } 209 Window &getScaledRefLayerWindowForLayer(Int layerId);211 Window getScaledRefLayerWindowForLayer(Int layerId); 210 212 Window& getScaledRefLayerWindow(Int x) { return m_scaledRefLayerWindow[x]; } 211 213 Void setNumRefLayerOffsets(Int x) { m_numRefLayerOffsets = x; } … … 213 215 Void setRefLayerId(Int layerIdx, UInt layerId) { m_refLayerId[layerIdx] = layerId; } 214 216 UInt getRefLayerId(Int layerIdx) { return m_refLayerId[layerIdx]; } 215 Window &getRefLayerWindowForLayer(Int layerId);216 Window& getRefLayerWindow(Int x) { return m_refLayerWindow[x]; }217 Window getRefLayerWindowForLayer(Int layerId); 218 Window& getRefLayerWindow(Int x) { return m_refLayerWindow[x]; } 217 219 Bool getScaledRefLayerOffsetPresentFlag(Int x) { return m_scaledRefLayerOffsetPresentFlag[x]; } 218 Void setScaledRefLayerOffsetPresentFlag(Int x, Bool b) { m_scaledRefLayerOffsetPresentFlag[x] = b; }219 Bool getRefRegionOffsetPresentFlag(Int x) { return m_refRegionOffsetPresentFlag[x]; }220 Void setRefRegionOffsetPresentFlag(Int x, Bool b) { m_refRegionOffsetPresentFlag[x] = b; }221 Int getPhaseHorLuma(Int x) { return m_phaseHorLuma[x]; }222 Int getPhaseVerLuma(Int x) { return m_phaseVerLuma[x]; }223 Int getPhaseHorChroma(Int x) { return m_phaseHorChroma[x]; }224 Int getPhaseVerChroma(Int x) { return m_phaseVerChroma[x]; }225 Void setPhaseHorLuma(Int x, Int val) { m_phaseHorLuma[x] = val; }226 Void setPhaseVerLuma(Int x, Int val) { m_phaseVerLuma[x] = val; }227 Void setPhaseHorChroma(Int x, Int val) { m_phaseHorChroma[x] = val; }228 Void setPhaseVerChroma(Int x, Int val) { m_phaseVerChroma[x] = val; }220 Void setScaledRefLayerOffsetPresentFlag(Int x, Bool b) { m_scaledRefLayerOffsetPresentFlag[x] = b; } 221 Bool getRefRegionOffsetPresentFlag(Int x) { return m_refRegionOffsetPresentFlag[x]; } 222 Void setRefRegionOffsetPresentFlag(Int x, Bool b) { m_refRegionOffsetPresentFlag[x] = b; } 223 Int getPhaseHorLuma(Int x) { return m_phaseHorLuma[x]; } 224 Int getPhaseVerLuma(Int x) { return m_phaseVerLuma[x]; } 225 Int getPhaseHorChroma(Int x) { return m_phaseHorChroma[x]; } 226 Int getPhaseVerChroma(Int x) { return m_phaseVerChroma[x]; } 227 Void setPhaseHorLuma(Int x, Int val) { m_phaseHorLuma[x] = val; } 228 Void setPhaseVerLuma(Int x, Int val) { m_phaseVerLuma[x] = val; } 229 Void setPhaseHorChroma(Int x, Int val) { m_phaseHorChroma[x] = val; } 230 Void setPhaseVerChroma(Int x, Int val) { m_phaseVerChroma[x] = val; } 229 231 Bool getResamplePhaseSetPresentFlag(Int x) { return m_resamplePhaseSetPresentFlag[x]; } 230 Void setResamplePhaseSetPresentFlag(Int x, Bool b) { m_resamplePhaseSetPresentFlag[x] = b; }231 232 TComPic** getIlpList() { return m_cIlpPic; }233 Void setMFMEnabledFlag(Bool flag) { m_bMFMEnabledFlag = flag; }234 Bool getMFMEnabledFlag() { return m_bMFMEnabledFlag; }232 Void setResamplePhaseSetPresentFlag(Int x, Bool b) { m_resamplePhaseSetPresentFlag[x] = b; } 233 234 TComPic** getIlpList() { return m_cIlpPic; } 235 Void setMFMEnabledFlag(Bool flag) { m_bMFMEnabledFlag = flag; } 236 Bool getMFMEnabledFlag() { return m_bMFMEnabledFlag; } 235 237 Void setInterLayerWeightedPredFlag(Bool flag) { m_interLayerWeightedPredFlag = flag; } 236 238 Bool getInterLayerWeightedPredFlag() { return m_interLayerWeightedPredFlag; } -
branches/SHM-dev/source/Lib/TLibEncoder/WeightPredAnalysis.cpp
r1202 r1235 47 47 WeightPredAnalysis::WeightPredAnalysis() 48 48 { 49 m_weighted_pred_flag = false;50 m_weighted_bipred_flag = false;51 52 49 for ( UInt lst =0 ; lst<NUM_REF_PIC_LIST_01 ; lst++ ) 53 50 { … … 121 118 } 122 119 123 124 /** store weighted_pred_flag and weighted_bipred_idc values125 * \param weighted_pred_flag126 * \param weighted_bipred_idc127 * \returns Void128 */129 Void WeightPredAnalysis::xStoreWPparam(const Bool weighted_pred_flag, const Bool weighted_bipred_flag)130 {131 m_weighted_pred_flag = weighted_pred_flag;132 m_weighted_bipred_flag = weighted_bipred_flag;133 }134 135 136 /** restore weighted_pred_flag and weighted_bipred_idc values137 * \param TComSlice *slice138 * \returns Void139 */140 Void WeightPredAnalysis::xRestoreWPparam(TComSlice *const slice)141 {142 slice->getPPS()->setUseWP (m_weighted_pred_flag);143 slice->getPPS()->setWPBiPred(m_weighted_bipred_flag);144 }145 146 147 120 /** check weighted pred or non-weighted pred 148 121 * \param TComSlice *slice … … 168 141 if(iPresentCnt==0) 169 142 { 170 slice-> getPPS()->setUseWP(false);171 slice-> getPPS()->setWPBiPred(false);143 slice->setTestWeightPred(false); 144 slice->setTestWeightBiPred(false); 172 145 173 146 for ( UInt lst=0 ; lst<NUM_REF_PIC_LIST_01 ; lst++ ) … … 188 161 slice->setWpScaling( m_wp ); 189 162 } 163 else 164 { 165 slice->setTestWeightPred(slice->getPPS()->getUseWP()); 166 slice->setTestWeightBiPred(slice->getPPS()->getWPBiPred()); 167 } 190 168 } 191 169 … … 213 191 } while (validRangeFlag == false); 214 192 215 // selecting whether WP is used, or not 193 // selecting whether WP is used, or not (fast search) 194 // NOTE: This is not operating on a slice, but the entire picture. 216 195 xSelectWP(slice, iDenom); 217 196 -
branches/SHM-dev/source/Lib/TLibEncoder/WeightPredAnalysis.h
r1029 r1235 46 46 private: 47 47 48 // member variables 49 Bool m_weighted_pred_flag; 50 Bool m_weighted_bipred_flag; 48 // member variables 51 49 WPScalingParam m_wp[NUM_REF_PIC_LIST_01][MAX_NUM_REF][MAX_NUM_COMPONENT]; 52 50 … … 75 73 Void xCalcACDCParamSlice (TComSlice *const slice); 76 74 Void xEstimateWPParamSlice(TComSlice *const slice); 77 Void xStoreWPparam (const Bool weighted_pred_flag, const Bool weighted_bipred_flag);78 Void xRestoreWPparam (TComSlice *const slice);79 75 Void xCheckWPEnable (TComSlice *const slice); 80 76 };
Note: See TracChangeset for help on using the changeset viewer.