Changeset 537 in 3DVCSoftware for branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder
- Timestamp:
- 13 Jul 2013, 15:51:26 (11 years ago)
- Location:
- branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/SEIwrite.cpp
r446 r537 84 84 fprintf( g_hTrace, "=========== Decoding Unit Information SEI message ===========\n"); 85 85 break; 86 #if J0149_TONE_MAPPING_SEI87 86 case SEI::TONE_MAPPING_INFO: 88 87 fprintf( g_hTrace, "=========== Tone Mapping Info SEI message ===========\n"); 89 88 break; 90 #endif91 #if L0208_SOP_DESCRIPTION_SEI92 89 case SEI::SOP_DESCRIPTION: 93 90 fprintf( g_hTrace, "=========== SOP Description SEI message ===========\n"); 94 91 break; 95 #endif96 #if K0180_SCALABLE_NESTING_SEI97 92 case SEI::SCALABLE_NESTING: 98 93 fprintf( g_hTrace, "=========== Scalable Nesting SEI message ===========\n"); 99 94 break; 100 #endif101 95 default: 102 96 fprintf( g_hTrace, "=========== Unknown SEI message ===========\n"); … … 106 100 #endif 107 101 108 #if K0180_SCALABLE_NESTING_SEI109 102 void SEIWriter::xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComSPS *sps) 110 #else111 void SEIWriter::xWriteSEIpayloadData(const SEI& sei, TComSPS *sps)112 #endif113 103 { 114 104 switch (sei.payloadType()) … … 147 137 xWriteSEIGradualDecodingRefreshInfo(*static_cast<const SEIGradualDecodingRefreshInfo*>(&sei)); 148 138 break; 149 #if J0149_TONE_MAPPING_SEI150 139 case SEI::TONE_MAPPING_INFO: 151 140 xWriteSEIToneMappingInfo(*static_cast<const SEIToneMappingInfo*>(&sei)); 152 141 break; 153 #endif154 #if L0208_SOP_DESCRIPTION_SEI155 142 case SEI::SOP_DESCRIPTION: 156 143 xWriteSEISOPDescription(*static_cast<const SEISOPDescription*>(&sei)); 157 144 break; 158 #endif159 #if K0180_SCALABLE_NESTING_SEI160 145 case SEI::SCALABLE_NESTING: 161 146 xWriteSEIScalableNesting(bs, *static_cast<const SEIScalableNesting*>(&sei), sps); 162 147 break; 163 #endif164 148 default: 165 149 assert(!"Unhandled SEI message"); … … 179 163 setBitstream(&bs_count); 180 164 181 182 #if K0180_SCALABLE_NESTING_SEI183 165 184 166 #if ENC_DEC_TRACE … … 191 173 #endif 192 174 193 #else194 195 #if ENC_DEC_TRACE196 g_HLSTraceEnable = false;197 #endif198 xWriteSEIpayloadData(sei, sps);199 #if ENC_DEC_TRACE200 g_HLSTraceEnable = true;201 #endif202 203 #endif204 205 175 UInt payload_data_num_bits = bs_count.getNumberOfWrittenBits(); 206 176 assert(0 == payload_data_num_bits % 8); … … 209 179 210 180 #if ENC_DEC_TRACE 211 #if K0180_SCALABLE_NESTING_SEI212 181 if (g_HLSTraceEnable) 213 #endif214 182 xTraceSEIHeader(); 215 183 #endif … … 231 199 /* payloadData */ 232 200 #if ENC_DEC_TRACE 233 #if K0180_SCALABLE_NESTING_SEI234 201 if (g_HLSTraceEnable) 235 #endif236 202 xTraceSEIMessageType(sei.payloadType()); 237 203 #endif 238 204 239 #if K0180_SCALABLE_NESTING_SEI240 205 xWriteSEIpayloadData(bs, sei, sps); 241 #else242 xWriteSEIpayloadData(sei, sps);243 #endif244 206 } 245 207 … … 296 258 { 297 259 WRITE_CODE(sei.activeVPSId, 4, "active_vps_id"); 298 #if L0047_APS_FLAGS299 260 WRITE_FLAG(sei.m_fullRandomAccessFlag, "full_random_access_flag"); 300 261 WRITE_FLAG(sei.m_noParamSetUpdateFlag, "no_param_set_update_flag"); 301 #endif302 262 WRITE_UVLC(sei.numSpsIdsMinus1, "num_sps_ids_minus1"); 303 263 … … 330 290 WRITE_CODE( sei.m_duSptCpbRemovalDelay, (vui->getHrdParameters()->getDuCpbRemovalDelayLengthMinus1() + 1), "du_spt_cpb_removal_delay"); 331 291 } 332 #if L0044_DU_DPB_OUTPUT_DELAY_HRD333 292 WRITE_FLAG( sei.m_dpbOutputDuDelayPresentFlag, "dpb_output_du_delay_present_flag"); 334 293 if(sei.m_dpbOutputDuDelayPresentFlag) … … 336 295 WRITE_CODE(sei.m_picSptDpbOutputDuDelay, vui->getHrdParameters()->getDpbOutputDelayDuLengthMinus1() + 1, "pic_spt_dpb_output_du_delay"); 337 296 } 338 #endif339 297 xWriteByteAlign(); 340 298 } … … 351 309 WRITE_FLAG( sei.m_rapCpbParamsPresentFlag, "rap_cpb_params_present_flag" ); 352 310 } 353 #if L0328_SPLICING354 311 WRITE_FLAG( sei.m_concatenationFlag, "concatenation_flag"); 355 312 WRITE_CODE( sei.m_auCpbRemovalDelayDelta - 1, ( hrd->getCpbRemovalDelayLengthMinus1() + 1 ), "au_cpb_removal_delay_delta_minus1" ); 356 #endif357 #if L0044_CPB_DPB_DELAY_OFFSET358 313 if( sei.m_rapCpbParamsPresentFlag ) 359 314 { … … 361 316 WRITE_CODE( sei.m_dpbDelayOffset, hrd->getDpbOutputDelayLengthMinus1() + 1, "dpb_delay_offset" ); 362 317 } 363 #endif364 318 for( nalOrVcl = 0; nalOrVcl < 2; nalOrVcl ++ ) 365 319 { … … 387 341 TComHRD *hrd = vui->getHrdParameters(); 388 342 389 #if !L0045_CONDITION_SIGNALLING390 // This condition was probably OK before the pic_struct, progressive_source_idc, duplicate_flag were added391 if( !hrd->getNalHrdParametersPresentFlag() && !hrd->getVclHrdParametersPresentFlag() )392 return;393 #endif394 343 if( vui->getFrameFieldInfoPresentFlag() ) 395 344 { 396 345 WRITE_CODE( sei.m_picStruct, 4, "pic_struct" ); 397 #if L0046_RENAME_PROG_SRC_IDC398 346 WRITE_CODE( sei.m_sourceScanType, 2, "source_scan_type" ); 399 #else400 WRITE_CODE( sei.m_progressiveSourceIdc, 2, "progressive_source_idc" );401 #endif402 347 WRITE_FLAG( sei.m_duplicateFlag ? 1 : 0, "duplicate_flag" ); 403 348 } 404 349 405 #if L0045_CONDITION_SIGNALLING406 350 if( hrd->getCpbDpbDelaysPresentFlag() ) 407 351 { 408 #endif409 352 WRITE_CODE( sei.m_auCpbRemovalDelay - 1, ( hrd->getCpbRemovalDelayLengthMinus1() + 1 ), "au_cpb_removal_delay_minus1" ); 410 353 WRITE_CODE( sei.m_picDpbOutputDelay, ( hrd->getDpbOutputDelayLengthMinus1() + 1 ), "pic_dpb_output_delay" ); 411 #if L0044_DU_DPB_OUTPUT_DELAY_HRD412 354 if(hrd->getSubPicCpbParamsPresentFlag()) 413 355 { 414 356 WRITE_CODE(sei.m_picDpbOutputDuDelay, hrd->getDpbOutputDelayDuLengthMinus1()+1, "pic_dpb_output_du_delay" ); 415 357 } 416 #endif417 358 if( hrd->getSubPicCpbParamsPresentFlag() && hrd->getSubPicCpbParamsInPicTimingSEIFlag() ) 418 359 { … … 432 373 } 433 374 } 434 #if L0045_CONDITION_SIGNALLING 435 } 436 #endif 375 } 437 376 xWriteByteAlign(); 438 377 } … … 471 410 472 411 WRITE_CODE( sei.m_arrangementReservedByte, 8, "frame_packing_arrangement_reserved_byte" ); 473 #if L0045_PERSISTENCE_FLAGS474 412 WRITE_FLAG( sei.m_arrangementPersistenceFlag, "frame_packing_arrangement_persistence_flag" ); 475 #else476 WRITE_UVLC( sei.m_arrangementRepetetionPeriod, "frame_packing_arrangement_repetition_period" );477 #endif478 413 } 479 414 … … 483 418 } 484 419 485 #if J0149_TONE_MAPPING_SEI486 420 Void SEIWriter::xWriteSEIToneMappingInfo(const SEIToneMappingInfo& sei) 487 421 { … … 555 489 xWriteByteAlign(); 556 490 } 557 #endif558 491 559 492 Void SEIWriter::xWriteSEIDisplayOrientation(const SEIDisplayOrientation &sei) … … 565 498 WRITE_FLAG( sei.verFlip, "ver_flip" ); 566 499 WRITE_CODE( sei.anticlockwiseRotation, 16, "anticlockwise_rotation" ); 567 #if L0045_PERSISTENCE_FLAGS568 500 WRITE_FLAG( sei.persistenceFlag, "display_orientation_persistence_flag" ); 569 #else570 WRITE_UVLC( sei.repetitionPeriod, "display_orientation_repetition_period" );571 #endif572 #if !REMOVE_SINGLE_SEI_EXTENSION_FLAGS573 WRITE_FLAG( sei.extensionFlag, "display_orientation_extension_flag" );574 assert( !sei.extensionFlag );575 #endif576 501 } 577 502 xWriteByteAlign(); … … 591 516 } 592 517 593 #if L0208_SOP_DESCRIPTION_SEI594 518 Void SEIWriter::xWriteSEISOPDescription(const SEISOPDescription& sei) 595 519 { … … 612 536 xWriteByteAlign(); 613 537 } 614 #endif 615 616 #if K0180_SCALABLE_NESTING_SEI 538 617 539 Void SEIWriter::xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComSPS *sps) 618 540 { … … 656 578 } 657 579 } 658 #endif659 580 660 581 Void SEIWriter::xWriteByteAlign() -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/SEIwrite.h
r446 r537 50 50 51 51 protected: 52 #if K0180_SCALABLE_NESTING_SEI53 52 Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComSPS *sps); 54 #else55 Void xWriteSEIpayloadData(const SEI& sei, TComSPS *sps);56 #endif57 53 Void xWriteSEIuserDataUnregistered(const SEIuserDataUnregistered &sei); 58 54 Void xWriteSEIActiveParameterSets(const SEIActiveParameterSets& sei); … … 67 63 Void xWriteSEITemporalLevel0Index(const SEITemporalLevel0Index &sei); 68 64 Void xWriteSEIGradualDecodingRefreshInfo(const SEIGradualDecodingRefreshInfo &sei); 69 #if J0149_TONE_MAPPING_SEI70 65 Void xWriteSEIToneMappingInfo(const SEIToneMappingInfo& sei); 71 #endif72 #if L0208_SOP_DESCRIPTION_SEI73 66 Void xWriteSEISOPDescription(const SEISOPDescription& sei); 74 #endif75 #if K0180_SCALABLE_NESTING_SEI76 67 Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComSPS *sps); 77 #endif78 68 Void xWriteByteAlign(); 79 69 }; -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCavlc.cpp
r534 r537 172 172 WRITE_UVLC( pcPPS->getSPSId(), "pps_seq_parameter_set_id" ); 173 173 WRITE_FLAG( pcPPS->getDependentSliceSegmentsEnabledFlag() ? 1 : 0, "dependent_slice_segments_enabled_flag" ); 174 #if L0255_MOVE_PPS_FLAGS175 174 WRITE_FLAG( pcPPS->getOutputFlagPresentFlag() ? 1 : 0, "output_flag_present_flag" ); 176 175 WRITE_CODE( pcPPS->getNumExtraSliceHeaderBits(), 3, "num_extra_slice_header_bits"); 177 #endif178 176 WRITE_FLAG( pcPPS->getSignHideFlag(), "sign_data_hiding_flag" ); 179 177 WRITE_FLAG( pcPPS->getCabacInitPresentFlag() ? 1 : 0, "cabac_init_present_flag" ); … … 195 193 WRITE_FLAG( pcPPS->getUseWP() ? 1 : 0, "weighted_pred_flag" ); // Use of Weighting Prediction (P_SLICE) 196 194 WRITE_FLAG( pcPPS->getWPBiPred() ? 1 : 0, "weighted_bipred_flag" ); // Use of Weighting Bi-Prediction (B_SLICE) 197 #if !L0255_MOVE_PPS_FLAGS198 WRITE_FLAG( pcPPS->getOutputFlagPresentFlag() ? 1 : 0, "output_flag_present_flag" );199 #endif200 195 WRITE_FLAG( pcPPS->getTransquantBypassEnableFlag() ? 1 : 0, "transquant_bypass_enable_flag" ); 201 196 WRITE_FLAG( pcPPS->getTilesEnabledFlag() ? 1 : 0, "tiles_enabled_flag" ); … … 244 239 WRITE_FLAG( pcPPS->getListsModificationPresentFlag(), "lists_modification_present_flag"); 245 240 WRITE_UVLC( pcPPS->getLog2ParallelMergeLevelMinus2(), "log2_parallel_merge_level_minus2"); 246 #if !L0255_MOVE_PPS_FLAGS247 WRITE_CODE( pcPPS->getNumExtraSliceHeaderBits(), 3, "num_extra_slice_header_bits");248 #endif249 241 WRITE_FLAG( pcPPS->getSliceHeaderExtensionPresentFlag() ? 1 : 0, "slice_segment_header_extension_present_flag"); 250 242 WRITE_FLAG( 0, "pps_extension_flag" ); … … 305 297 WRITE_UVLC(defaultDisplayWindow.getWindowBottomOffset(), "def_disp_win_bottom_offset"); 306 298 } 307 #if L0043_TIMING_INFO308 299 TimingInfo *timingInfo = pcVUI->getTimingInfo(); 309 300 WRITE_FLAG(timingInfo->getTimingInfoPresentFlag(), "vui_timing_info_present_flag"); … … 317 308 WRITE_UVLC(timingInfo->getNumTicksPocDiffOneMinus1(), "vui_num_ticks_poc_diff_one_minus1"); 318 309 } 319 #endif320 310 WRITE_FLAG(pcVUI->getHrdParametersPresentFlag(), "hrd_parameters_present_flag"); 321 311 if( pcVUI->getHrdParametersPresentFlag() ) … … 323 313 codeHrdParameters(pcVUI->getHrdParameters(), 1, pcSPS->getMaxTLayers() - 1 ); 324 314 } 325 #if L0043_TIMING_INFO 326 } 327 #endif 328 #if !L0043_TIMING_INFO 329 WRITE_FLAG( pcVUI->getPocProportionalToTimingFlag(), "poc_proportional_to_timing_flag" ); 330 if( pcVUI->getPocProportionalToTimingFlag() && pcVUI->getHrdParameters()->getTimingInfoPresentFlag() ) 331 { 332 WRITE_UVLC( pcVUI->getNumTicksPocDiffOneMinus1(), "num_ticks_poc_diff_one_minus1" ); 333 } 334 #endif 315 } 335 316 336 317 WRITE_FLAG(pcVUI->getBitstreamRestrictionFlag(), "bitstream_restriction_flag"); … … 346 327 WRITE_FLAG(pcVUI->getMotionVectorsOverPicBoundariesFlag(), "motion_vectors_over_pic_boundaries_flag"); 347 328 WRITE_FLAG(pcVUI->getRestrictedRefPicListsFlag(), "restricted_ref_pic_lists_flag"); 348 #if L0043_MSS_IDC349 329 WRITE_UVLC(pcVUI->getMinSpatialSegmentationIdc(), "min_spatial_segmentation_idc"); 350 #else351 WRITE_CODE(pcVUI->getMinSpatialSegmentationIdc(), 8, "min_spatial_segmentation_idc");352 #endif353 330 WRITE_UVLC(pcVUI->getMaxBytesPerPicDenom(), "max_bytes_per_pic_denom"); 354 331 WRITE_UVLC(pcVUI->getMaxBitsPerMinCuDenom(), "max_bits_per_mincu_denom"); … … 362 339 if( commonInfPresentFlag ) 363 340 { 364 #if !L0043_TIMING_INFO365 WRITE_FLAG( hrd->getTimingInfoPresentFlag() ? 1 : 0, "timing_info_present_flag" );366 if( hrd->getTimingInfoPresentFlag() )367 {368 WRITE_CODE( hrd->getNumUnitsInTick(), 32, "num_units_in_tick" );369 WRITE_CODE( hrd->getTimeScale(), 32, "time_scale" );370 }371 #endif372 341 WRITE_FLAG( hrd->getNalHrdParametersPresentFlag() ? 1 : 0 , "nal_hrd_parameters_present_flag" ); 373 342 WRITE_FLAG( hrd->getVclHrdParametersPresentFlag() ? 1 : 0 , "vcl_hrd_parameters_present_flag" ); … … 380 349 WRITE_CODE( hrd->getDuCpbRemovalDelayLengthMinus1(), 5, "du_cpb_removal_delay_length_minus1" ); 381 350 WRITE_FLAG( hrd->getSubPicCpbParamsInPicTimingSEIFlag() ? 1 : 0, "sub_pic_cpb_params_in_pic_timing_sei_flag" ); 382 #if L0044_DU_DPB_OUTPUT_DELAY_HRD383 351 WRITE_CODE( hrd->getDpbOutputDelayDuLengthMinus1(), 5, "dpb_output_delay_du_length_minus1" ); 384 #endif385 352 } 386 353 WRITE_CODE( hrd->getBitRateScale(), 4, "bit_rate_scale" ); … … 411 378 WRITE_UVLC( hrd->getPicDurationInTcMinus1( i ), "elemental_duration_in_tc_minus1"); 412 379 } 413 #if L0372414 380 else 415 381 { … … 420 386 WRITE_UVLC( hrd->getCpbCntMinus1( i ), "cpb_cnt_minus1"); 421 387 } 422 #else423 WRITE_FLAG( hrd->getLowDelayHrdFlag( i ) ? 1 : 0, "low_delay_hrd_flag");424 WRITE_UVLC( hrd->getCpbCntMinus1( i ), "cpb_cnt_minus1");425 #endif426 388 427 389 for( nalOrVcl = 0; nalOrVcl < 2; nalOrVcl ++ ) … … 436 398 if( hrd->getSubPicCpbParamsPresentFlag() ) 437 399 { 438 #if L0363_DU_BIT_RATE 400 WRITE_UVLC( hrd->getDuCpbSizeValueMinus1( i, j, nalOrVcl ), "cpb_size_du_value_minus1"); 439 401 WRITE_UVLC( hrd->getDuBitRateValueMinus1( i, j, nalOrVcl ), "bit_rate_du_value_minus1"); 440 #endif441 WRITE_UVLC( hrd->getDuCpbSizeValueMinus1( i, j, nalOrVcl ), "cpb_size_du_value_minus1");442 402 } 443 403 WRITE_FLAG( hrd->getCbrFlag( i, j, nalOrVcl ) ? 1 : 0, "cbr_flag"); … … 499 459 for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++) 500 460 { 501 #if L0323_DPB502 461 WRITE_UVLC( pcSPS->getMaxDecPicBuffering(i) - 1, "sps_max_dec_pic_buffering_minus1[i]" ); 503 #else504 WRITE_UVLC( pcSPS->getMaxDecPicBuffering(i), "sps_max_dec_pic_buffering[i]" );505 #endif506 462 WRITE_UVLC( pcSPS->getNumReorderPics(i), "sps_num_reorder_pics[i]" ); 507 WRITE_UVLC( pcSPS->getMaxLatencyIncrease(i), "sps_max_latency_increase [i]" );463 WRITE_UVLC( pcSPS->getMaxLatencyIncrease(i), "sps_max_latency_increase_plus1[i]" ); 508 464 if (!subLayerOrderingInfoPresentFlag) 509 465 { … … 642 598 #endif 643 599 codePTL( pcVPS->getPTL(), true, pcVPS->getMaxTLayers() - 1 ); 644 #if SIGNAL_BITRATE_PICRATE_IN_VPS645 codeBitratePicRateInfo(pcVPS->getBitratePicrateInfo(), 0, pcVPS->getMaxTLayers() - 1);646 #endif647 600 const Bool subLayerOrderingInfoPresentFlag = 1; 648 601 WRITE_FLAG(subLayerOrderingInfoPresentFlag, "vps_sub_layer_ordering_info_present_flag"); 649 602 for(UInt i=0; i <= pcVPS->getMaxTLayers()-1; i++) 650 603 { 651 #if L0323_DPB652 604 WRITE_UVLC( pcVPS->getMaxDecPicBuffering(i) - 1, "vps_max_dec_pic_buffering_minus1[i]" ); 653 #else654 WRITE_UVLC( pcVPS->getMaxDecPicBuffering(i), "vps_max_dec_pic_buffering[i]" );655 #endif656 605 WRITE_UVLC( pcVPS->getNumReorderPics(i), "vps_num_reorder_pics[i]" ); 657 WRITE_UVLC( pcVPS->getMaxLatencyIncrease(i), "vps_max_latency_increase [i]" );606 WRITE_UVLC( pcVPS->getMaxLatencyIncrease(i), "vps_max_latency_increase_plus1[i]" ); 658 607 if (!subLayerOrderingInfoPresentFlag) 659 608 { … … 676 625 assert( pcVPS->getMaxNuhReservedZeroLayerId() < MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1 ); 677 626 WRITE_CODE( pcVPS->getMaxNuhReservedZeroLayerId(), 6, "vps_max_nuh_reserved_zero_layer_id" ); 678 679 627 pcVPS->setMaxOpSets(1); 680 628 WRITE_UVLC( pcVPS->getMaxOpSets() - 1, "vps_max_op_sets_minus1" ); … … 690 638 } 691 639 } 692 #if L0043_TIMING_INFO693 640 TimingInfo *timingInfo = pcVPS->getTimingInfo(); 694 641 WRITE_FLAG(timingInfo->getTimingInfoPresentFlag(), "vps_timing_info_present_flag"); … … 702 649 WRITE_UVLC(timingInfo->getNumTicksPocDiffOneMinus1(), "vps_num_ticks_poc_diff_one_minus1"); 703 650 } 704 #endif705 651 pcVPS->setNumHrdParameters( 0 ); 706 652 WRITE_UVLC( pcVPS->getNumHrdParameters(), "vps_num_hrd_parameters" ); … … 721 667 codeHrdParameters(pcVPS->getHrdParameters(i), pcVPS->getCprmsPresentFlag( i ), pcVPS->getMaxTLayers() - 1); 722 668 } 723 #if L0043_TIMING_INFO 724 } 725 #endif 669 } 726 670 #if H_MV 727 671 WRITE_FLAG( 1, "vps_extension_flag" ); … … 983 927 // colour_plane_id u(2) 984 928 985 #if H_MV && !H_MV_FIX1071986 // Temporary fix for FIX1071 should be removed later987 TComReferencePictureSet* rps = pcSlice->getRPS();988 #endif989 929 if( !pcSlice->getIdrPicFlag() ) 990 930 { 991 931 Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC()))%(1<<pcSlice->getSPS()->getBitsForPOC()); 992 932 WRITE_CODE( picOrderCntLSB, pcSlice->getSPS()->getBitsForPOC(), "pic_order_cnt_lsb"); 993 #if !H_MV || H_MV_FIX1071994 933 TComReferencePictureSet* rps = pcSlice->getRPS(); 995 #endif996 #if FIX1071 && H_MV_FIX1071934 935 #if FIX1071 997 936 // check for bitstream restriction stating that: 998 937 // If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0. … … 1006 945 } 1007 946 #endif 1008 #if FIX1071 && !H_MV_FIX1071 1009 // Deal with bitstream restriction stating that: 1010 // – If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0. 1011 // Ideally this process should not be repeated for each slice in a picture 1012 TComReferencePictureSet altRps; 1013 Bool useAltRps = false; 1014 if (pcSlice->getRapPicFlag()) 1015 { 1016 for (Int picIdx = 0; !useAltRps && picIdx < rps->getNumberOfPictures(); picIdx++) 1017 { 1018 useAltRps = rps->getUsed(picIdx); 1019 } 1020 if (useAltRps) 1021 { 1022 memcpy(&altRps, rps, sizeof(TComReferencePictureSet)); 1023 rps = &altRps; 1024 for (Int picIdx = 0; picIdx < rps->getNumberOfPictures(); picIdx++) 1025 { 1026 rps->setUsed(picIdx, false); 1027 } 1028 } 1029 } 1030 if(pcSlice->getRPSidx() < 0 || useAltRps) 1031 #else 947 1032 948 if(pcSlice->getRPSidx() < 0) 1033 #endif1034 949 { 1035 950 WRITE_FLAG( 0, "short_term_ref_pic_set_sps_flag"); … … 1188 1103 pcSlice->setNumRefIdx(REF_PIC_LIST_1, 0); 1189 1104 } 1190 #if H_MV && !H_MV_FIX1071 1191 // Temporary fix for FIX1071 should be removed later 1192 if( pcSlice->getPPS()->getListsModificationPresentFlag() && pcSlice->getNumRpsCurrTempList( rps ) > 1) 1193 #else 1105 1194 1106 if( pcSlice->getPPS()->getListsModificationPresentFlag() && pcSlice->getNumRpsCurrTempList() > 1) 1195 #endif1196 1107 { 1197 1108 TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification(); … … 1385 1296 WRITE_CODE( pcPTL->getGeneralPTL()->getLevelIdc(), 8, "general_level_idc" ); 1386 1297 1387 #if L0363_BYTE_ALIGN1388 1298 for (Int i = 0; i < maxNumSubLayersMinus1; i++) 1389 1299 { … … 1407 1317 } 1408 1318 } 1409 #endif1410 1319 1411 1320 for(Int i = 0; i < maxNumSubLayersMinus1; i++) 1412 1321 { 1413 #if !L0363_BYTE_ALIGN1414 if(profilePresentFlag)1415 {1416 WRITE_FLAG( pcPTL->getSubLayerProfilePresentFlag(i), "sub_layer_profile_present_flag[i]" );1417 }1418 1419 WRITE_FLAG( pcPTL->getSubLayerLevelPresentFlag(i), "sub_layer_level_present_flag[i]" );1420 #endif1421 1322 if( profilePresentFlag && pcPTL->getSubLayerProfilePresentFlag(i) ) 1422 1323 { … … 1439 1340 } 1440 1341 1441 #if L0046_CONSTRAINT_FLAGS1442 1342 WRITE_FLAG(ptl->getProgressiveSourceFlag(), "general_progressive_source_flag"); 1443 1343 WRITE_FLAG(ptl->getInterlacedSourceFlag(), "general_interlaced_source_flag"); … … 1448 1348 WRITE_CODE(0 , 16, "XXX_reserved_zero_44bits[16..31]"); 1449 1349 WRITE_CODE(0 , 12, "XXX_reserved_zero_44bits[32..43]"); 1450 #elif L0363_MORE_BITS 1451 WRITE_CODE(0 , 16, "XXX_reserved_zero_48bits[0..15]"); 1452 WRITE_CODE(0 , 16, "XXX_reserved_zero_48bits[16..31]"); 1453 WRITE_CODE(0 , 16, "XXX_reserved_zero_48bits[32..47]"); 1454 #else 1455 WRITE_CODE(0 , 16, "XXX_reserved_zero_16bits[]"); 1456 #endif 1457 } 1458 #if SIGNAL_BITRATE_PICRATE_IN_VPS 1459 Void TEncCavlc::codeBitratePicRateInfo(TComBitRatePicRateInfo *info, Int tempLevelLow, Int tempLevelHigh) 1460 { 1461 for(Int i = tempLevelLow; i <= tempLevelHigh; i++) 1462 { 1463 WRITE_FLAG( info->getBitRateInfoPresentFlag(i), "bit_rate_info_present_flag[i]" ); 1464 WRITE_FLAG( info->getPicRateInfoPresentFlag(i), "pic_rate_info_present_flag[i]" ); 1465 if(info->getBitRateInfoPresentFlag(i)) 1466 { 1467 WRITE_CODE( info->getAvgBitRate(i), 16, "avg_bit_rate[i]" ); 1468 WRITE_CODE( info->getMaxBitRate(i), 16, "max_bit_rate[i]" ); 1469 } 1470 if(info->getPicRateInfoPresentFlag(i)) 1471 { 1472 WRITE_CODE( info->getConstantPicRateIdc(i), 2, "constant_pic_rate_idc[i]" ); 1473 WRITE_CODE( info->getAvgPicRate(i), 16, "avg_pic_rate[i]" ); 1474 } 1475 } 1476 } 1477 #endif 1350 } 1351 1478 1352 /** 1479 1353 - write wavefront substreams sizes for the slice header. … … 1545 1419 for (UInt idx=0; idx<numEntryPointOffsets; idx++) 1546 1420 { 1547 #if L0116_ENTRY_POINT1548 1421 WRITE_CODE(entryPointOffset[ idx ]-1, offsetLenMinus1+1, "entry_point_offset_minus1"); 1549 #else1550 WRITE_CODE(entryPointOffset[ idx ], offsetLenMinus1+1, "entry_point_offset");1551 #endif1552 1422 } 1553 1423 -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCavlc.h
r504 r537 94 94 Void codePTL ( TComPTL* pcPTL, Bool profilePresentFlag, Int maxNumSubLayersMinus1); 95 95 Void codeProfileTier ( ProfileTierLevel* ptl ); 96 #if SIGNAL_BITRATE_PICRATE_IN_VPS97 Void codeBitratePicRateInfo(TComBitRatePicRateInfo *info, Int tempLevelLow, Int tempLevelHigh);98 #endif99 96 Void codeHrdParameters ( TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 ); 100 97 Void codeTilesWPPEntryPoint( TComSlice* pSlice ); -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCfg.h
r534 r537 135 135 Level::Tier m_levelTier; 136 136 Level::Name m_level; 137 #if L0046_CONSTRAINT_FLAGS138 137 Bool m_progressiveSourceFlag; 139 138 Bool m_interlacedSourceFlag; 140 139 Bool m_nonPackedConstraintFlag; 141 140 Bool m_frameOnlyConstraintFlag; 142 #endif143 141 144 142 //====== Coding Structure ======== … … 177 175 Int m_loopFilterTcOffsetDiv2; 178 176 Bool m_DeblockingFilterControlPresent; 179 #if L0386_DB_METRIC180 177 Bool m_DeblockingFilterMetric; 181 #endif182 178 Bool m_bUseSAO; 183 179 Int m_maxNumOffsetsPerPic; … … 210 206 Bool m_bUseASR; 211 207 Bool m_bUseHADME; 212 #if !L0034_COMBINED_LIST_CLEANUP213 Bool m_bUseLComb;214 #endif215 208 Bool m_useRDOQ; 216 209 Bool m_useRDOQTS; 217 #if L0232_RD_PENALTY218 210 UInt m_rdPenalty; 219 #endif220 211 Bool m_bUseFastEnc; 221 212 Bool m_bUseEarlyCU; … … 258 249 Int m_pictureTimingSEIEnabled; 259 250 Int m_recoveryPointSEIEnabled; 260 #if J0149_TONE_MAPPING_SEI261 251 Bool m_toneMappingInfoSEIEnabled; 262 252 Int m_toneMapId; … … 284 274 Int* m_codedPivotValue; 285 275 Int* m_targetPivotValue; 286 #endif287 276 Int m_framePackingSEIEnabled; 288 277 Int m_framePackingSEIType; … … 294 283 Int m_gradualDecodingRefreshInfoEnabled; 295 284 Int m_decodingUnitInfoSEIEnabled; 296 #if L0208_SOP_DESCRIPTION_SEI297 285 Int m_SOPDescriptionSEIEnabled; 298 #endif299 #if K0180_SCALABLE_NESTING_SEI300 286 Int m_scalableNestingSEIEnabled; 301 #endif302 287 //====== Weighted Prediction ======== 303 288 Bool m_useWeightedPred; //< Use of Weighting Prediction (P_SLICE) … … 312 297 Bool m_RCEnableRateControl; 313 298 Int m_RCTargetBitrate; 299 #if M0036_RC_IMPROVEMENT 300 Int m_RCKeepHierarchicalBit; 301 #else 314 302 Bool m_RCKeepHierarchicalBit; 303 #endif 315 304 Bool m_RCLCULevelRC; 316 305 Bool m_RCUseLCUSeparateModel; … … 389 378 Double m_dLambdaScaleVSO; 390 379 UInt m_uiVSOMode; 391 392 380 // LGE_WVSO_A0119 393 381 Bool m_bUseWVSO; … … 395 383 Int m_iVSDWeight; 396 384 Int m_iDWeight; 397 #endif398 399 385 // SAIT_VSO_EST_A0033 400 386 Bool m_bUseEstimatedVSD; 401 387 Double m_dDispCoeff; 402 388 #endif 403 389 #if H_3D_ARP 404 390 UInt m_uiUseAdvResPred; 405 391 UInt m_uiARPStepNum; 406 392 #endif 407 408 393 #if H_3D_IC 409 394 Bool m_bUseIC; 410 395 #endif 411 412 396 //====== Depth Intra Modes ====== 413 397 #if H_3D_DIM … … 417 401 Bool m_useDLT; 418 402 #endif 419 420 #endif 421 403 #endif 422 404 public: 423 405 TEncCfg() … … 519 501 Void setLoopFilterTcOffset ( Int i ) { m_loopFilterTcOffsetDiv2 = i; } 520 502 Void setDeblockingFilterControlPresent ( Bool b ) { m_DeblockingFilterControlPresent = b; } 521 #if L0386_DB_METRIC522 503 Void setDeblockingFilterMetric ( Bool b ) { m_DeblockingFilterMetric = b; } 523 #endif524 504 525 505 //====== Motion search ======== … … 576 556 Int getLoopFilterTcOffset () { return m_loopFilterTcOffsetDiv2; } 577 557 Bool getDeblockingFilterControlPresent() { return m_DeblockingFilterControlPresent; } 578 #if L0386_DB_METRIC579 558 Bool getDeblockingFilterMetric () { return m_DeblockingFilterMetric; } 580 #endif581 559 582 560 //==== Motion search ======== … … 596 574 Void setUseASR ( Bool b ) { m_bUseASR = b; } 597 575 Void setUseHADME ( Bool b ) { m_bUseHADME = b; } 598 #if !L0034_COMBINED_LIST_CLEANUP599 Void setUseLComb ( Bool b ) { m_bUseLComb = b; }600 #endif601 576 Void setUseRDOQ ( Bool b ) { m_useRDOQ = b; } 602 577 Void setUseRDOQTS ( Bool b ) { m_useRDOQTS = b; } 603 #if L0232_RD_PENALTY604 578 Void setRDpenalty ( UInt b ) { m_rdPenalty = b; } 605 #endif606 579 Void setUseFastEnc ( Bool b ) { m_bUseFastEnc = b; } 607 580 Void setUseEarlyCU ( Bool b ) { m_bUseEarlyCU = b; } … … 620 593 Bool getUseASR () { return m_bUseASR; } 621 594 Bool getUseHADME () { return m_bUseHADME; } 622 #if !L0034_COMBINED_LIST_CLEANUP623 Bool getUseLComb () { return m_bUseLComb; }624 #endif625 595 Bool getUseRDOQ () { return m_useRDOQ; } 626 596 Bool getUseRDOQTS () { return m_useRDOQTS; } 627 #if L0232_RD_PENALTY628 597 Int getRDpenalty () { return m_rdPenalty; } 629 #endif630 598 Bool getUseFastEnc () { return m_bUseFastEnc; } 631 599 Bool getUseEarlyCU () { return m_bUseEarlyCU; } … … 719 687 Void setRecoveryPointSEIEnabled(Int b) { m_recoveryPointSEIEnabled = b; } 720 688 Int getRecoveryPointSEIEnabled() { return m_recoveryPointSEIEnabled; } 721 #if J0149_TONE_MAPPING_SEI722 689 Void setToneMappingInfoSEIEnabled(Bool b) { m_toneMappingInfoSEIEnabled = b; } 723 690 Bool getToneMappingInfoSEIEnabled() { return m_toneMappingInfoSEIEnabled; } … … 770 737 Void setTMISEIExtendedWhiteLevelLumaCodeValue(Int b) { m_extendedWhiteLevelLumaCodeValue =b; } 771 738 Int getTMISEIExtendedWhiteLevelLumaCodeValue() { return m_extendedWhiteLevelLumaCodeValue; } 772 #endif773 739 Void setFramePackingArrangementSEIEnabled(Int b) { m_framePackingSEIEnabled = b; } 774 740 Int getFramePackingArrangementSEIEnabled() { return m_framePackingSEIEnabled; } … … 789 755 Void setDecodingUnitInfoSEIEnabled(Int b) { m_decodingUnitInfoSEIEnabled = b; } 790 756 Int getDecodingUnitInfoSEIEnabled() { return m_decodingUnitInfoSEIEnabled; } 791 #if L0208_SOP_DESCRIPTION_SEI792 757 Void setSOPDescriptionSEIEnabled(Int b) { m_SOPDescriptionSEIEnabled = b; } 793 758 Int getSOPDescriptionSEIEnabled() { return m_SOPDescriptionSEIEnabled; } 794 #endif795 #if K0180_SCALABLE_NESTING_SEI796 759 Void setScalableNestingSEIEnabled(Int b) { m_scalableNestingSEIEnabled = b; } 797 760 Int getScalableNestingSEIEnabled() { return m_scalableNestingSEIEnabled; } 798 #endif799 761 Void setUseWP ( Bool b ) { m_useWeightedPred = b; } 800 762 Void setWPBiPred ( Bool b ) { m_useWeightedBiPred = b; } … … 818 780 Int getTargetBitrate () { return m_RCTargetBitrate; } 819 781 Void setTargetBitrate ( Int bitrate ) { m_RCTargetBitrate = bitrate; } 782 #if M0036_RC_IMPROVEMENT 783 Int getKeepHierBit () { return m_RCKeepHierarchicalBit; } 784 Void setKeepHierBit ( Int i ) { m_RCKeepHierarchicalBit = i; } 785 #else 820 786 Bool getKeepHierBit () { return m_RCKeepHierarchicalBit; } 821 787 Void setKeepHierBit ( Bool b ) { m_RCKeepHierarchicalBit = b; } 788 #endif 822 789 Bool getLCULevelRC () { return m_RCLCULevelRC; } 823 790 Void setLCULevelRC ( Bool b ) { m_RCLCULevelRC = b; } … … 916 883 Void setLog2MaxMvLengthVertical(Int i) { m_log2MaxMvLengthVertical = i; } 917 884 918 #if L0046_CONSTRAINT_FLAGS919 885 Bool getProgressiveSourceFlag() const { return m_progressiveSourceFlag; } 920 886 Void setProgressiveSourceFlag(Bool b) { m_progressiveSourceFlag = b; } … … 928 894 Bool getFrameOnlyConstraintFlag() const { return m_frameOnlyConstraintFlag; } 929 895 Void setFrameOnlyConstraintFlag(Bool b) { m_frameOnlyConstraintFlag = b; } 930 #endif931 896 #if H_3D 932 897 /// 3D Tools -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCu.cpp
r531 r537 103 103 104 104 m_bEncodeDQP = false; 105 #if RATE_CONTROL_LAMBDA_DOMAIN 105 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT 106 106 m_LCUPredictionSAD = 0; 107 107 m_addSADDepth = 0; … … 256 256 m_ppcTempCU[0]->initCU( rpcCU->getPic(), rpcCU->getAddr() ); 257 257 258 #if RATE_CONTROL_LAMBDA_DOMAIN 258 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT 259 259 m_addSADDepth = 0; 260 260 m_LCUPredictionSAD = 0; … … 592 592 } 593 593 594 #if RATE_CONTROL_LAMBDA_DOMAIN 594 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT 595 595 if ( uiDepth <= m_addSADDepth ) 596 596 { … … 862 862 { 863 863 bBoundary = true; 864 #if RATE_CONTROL_LAMBDA_DOMAIN 864 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT 865 865 m_addSADDepth++; 866 866 #endif … … 1348 1348 } 1349 1349 1350 #if RATE_CONTROL_INTRA 1351 Int xCalcHADs8x8_ISlice(Pel *piOrg, Int iStrideOrg) 1352 { 1353 Int k, i, j, jj; 1354 Int diff[64], m1[8][8], m2[8][8], m3[8][8], iSumHad = 0; 1355 1356 for( k = 0; k < 64; k += 8 ) 1357 { 1358 diff[k+0] = piOrg[0] ; 1359 diff[k+1] = piOrg[1] ; 1360 diff[k+2] = piOrg[2] ; 1361 diff[k+3] = piOrg[3] ; 1362 diff[k+4] = piOrg[4] ; 1363 diff[k+5] = piOrg[5] ; 1364 diff[k+6] = piOrg[6] ; 1365 diff[k+7] = piOrg[7] ; 1366 1367 piOrg += iStrideOrg; 1368 } 1369 1370 //horizontal 1371 for (j=0; j < 8; j++) 1372 { 1373 jj = j << 3; 1374 m2[j][0] = diff[jj ] + diff[jj+4]; 1375 m2[j][1] = diff[jj+1] + diff[jj+5]; 1376 m2[j][2] = diff[jj+2] + diff[jj+6]; 1377 m2[j][3] = diff[jj+3] + diff[jj+7]; 1378 m2[j][4] = diff[jj ] - diff[jj+4]; 1379 m2[j][5] = diff[jj+1] - diff[jj+5]; 1380 m2[j][6] = diff[jj+2] - diff[jj+6]; 1381 m2[j][7] = diff[jj+3] - diff[jj+7]; 1382 1383 m1[j][0] = m2[j][0] + m2[j][2]; 1384 m1[j][1] = m2[j][1] + m2[j][3]; 1385 m1[j][2] = m2[j][0] - m2[j][2]; 1386 m1[j][3] = m2[j][1] - m2[j][3]; 1387 m1[j][4] = m2[j][4] + m2[j][6]; 1388 m1[j][5] = m2[j][5] + m2[j][7]; 1389 m1[j][6] = m2[j][4] - m2[j][6]; 1390 m1[j][7] = m2[j][5] - m2[j][7]; 1391 1392 m2[j][0] = m1[j][0] + m1[j][1]; 1393 m2[j][1] = m1[j][0] - m1[j][1]; 1394 m2[j][2] = m1[j][2] + m1[j][3]; 1395 m2[j][3] = m1[j][2] - m1[j][3]; 1396 m2[j][4] = m1[j][4] + m1[j][5]; 1397 m2[j][5] = m1[j][4] - m1[j][5]; 1398 m2[j][6] = m1[j][6] + m1[j][7]; 1399 m2[j][7] = m1[j][6] - m1[j][7]; 1400 } 1401 1402 //vertical 1403 for (i=0; i < 8; i++) 1404 { 1405 m3[0][i] = m2[0][i] + m2[4][i]; 1406 m3[1][i] = m2[1][i] + m2[5][i]; 1407 m3[2][i] = m2[2][i] + m2[6][i]; 1408 m3[3][i] = m2[3][i] + m2[7][i]; 1409 m3[4][i] = m2[0][i] - m2[4][i]; 1410 m3[5][i] = m2[1][i] - m2[5][i]; 1411 m3[6][i] = m2[2][i] - m2[6][i]; 1412 m3[7][i] = m2[3][i] - m2[7][i]; 1413 1414 m1[0][i] = m3[0][i] + m3[2][i]; 1415 m1[1][i] = m3[1][i] + m3[3][i]; 1416 m1[2][i] = m3[0][i] - m3[2][i]; 1417 m1[3][i] = m3[1][i] - m3[3][i]; 1418 m1[4][i] = m3[4][i] + m3[6][i]; 1419 m1[5][i] = m3[5][i] + m3[7][i]; 1420 m1[6][i] = m3[4][i] - m3[6][i]; 1421 m1[7][i] = m3[5][i] - m3[7][i]; 1422 1423 m2[0][i] = m1[0][i] + m1[1][i]; 1424 m2[1][i] = m1[0][i] - m1[1][i]; 1425 m2[2][i] = m1[2][i] + m1[3][i]; 1426 m2[3][i] = m1[2][i] - m1[3][i]; 1427 m2[4][i] = m1[4][i] + m1[5][i]; 1428 m2[5][i] = m1[4][i] - m1[5][i]; 1429 m2[6][i] = m1[6][i] + m1[7][i]; 1430 m2[7][i] = m1[6][i] - m1[7][i]; 1431 } 1432 1433 for (i = 0; i < 8; i++) 1434 { 1435 for (j = 0; j < 8; j++) 1436 { 1437 iSumHad += abs(m2[i][j]); 1438 } 1439 } 1440 iSumHad -= abs(m2[0][0]); 1441 iSumHad =(iSumHad+2)>>2; 1442 return(iSumHad); 1443 } 1444 1445 Int TEncCu::updateLCUDataISlice(TComDataCU* pcCU, Int LCUIdx, Int width, Int height) 1446 { 1447 Int xBl, yBl; 1448 const Int iBlkSize = 8; 1449 1450 Pel* pOrgInit = pcCU->getPic()->getPicYuvOrg()->getLumaAddr(pcCU->getAddr(), 0); 1451 Int iStrideOrig = pcCU->getPic()->getPicYuvOrg()->getStride(); 1452 Pel *pOrg; 1453 1454 Int iSumHad = 0; 1455 for ( yBl=0; (yBl+iBlkSize)<=height; yBl+= iBlkSize) 1456 { 1457 for ( xBl=0; (xBl+iBlkSize)<=width; xBl+= iBlkSize) 1458 { 1459 pOrg = pOrgInit + iStrideOrig*yBl + xBl; 1460 iSumHad += xCalcHADs8x8_ISlice(pOrg, iStrideOrig); 1461 } 1462 } 1463 return(iSumHad); 1464 } 1465 #endif 1466 1350 1467 /** check RD costs for a CU block encoded with merge 1351 1468 * \param rpcBestCU … … 1360 1477 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM]; 1361 1478 #else 1362 TComMvField cMvFieldNeighbours[ MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists1479 TComMvField cMvFieldNeighbours[2 * MRG_MAX_NUM_CANDS]; // double length for mv of both lists 1363 1480 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS]; 1364 1481 #endif … … 1400 1517 Int mergeCandBuffer[MRG_MAX_NUM_CANDS]; 1401 1518 #endif 1402 for( UInt ui = 0; ui < rpcTempCU->getSlice()->getMaxNumMergeCand(); ++ui )1519 for( UInt ui = 0; ui < numValidMergeCand; ++ui ) 1403 1520 { 1404 1521 mergeCandBuffer[ui] = 0; … … 1430 1547 { 1431 1548 for( UInt uiMergeCand = 0; uiMergeCand < numValidMergeCand; ++uiMergeCand ) 1432 { 1433 { 1549 { 1434 1550 #if H_3D_IC 1435 1551 if( rpcTempCU->getSlice()->getApplyIC() && rpcTempCU->getSlice()->getIcSkipParseFlag() ) … … 1443 1559 if(!(uiNoResidual==1 && mergeCandBuffer[uiMergeCand]==1)) 1444 1560 { 1445 1446 1561 if( !(bestIsSkip && uiNoResidual == 0) ) 1447 1562 { … … 1487 1602 m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] ); 1488 1603 // estimate residual and encode everything 1489 1490 1604 #if H_3D_VSO //M2 1491 1605 if( m_pcRdCost->getUseRenModel() ) … … 1498 1612 } 1499 1613 #endif 1500 1501 1614 m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU, 1502 1615 m_ppcOrigYuv [uhDepth], … … 1508 1621 1509 1622 1510 if(uiNoResidual==0) 1511 { 1512 if(rpcTempCU->getQtRootCbf(0) == 0) 1623 if ( uiNoResidual == 0 && rpcTempCU->getQtRootCbf(0) == 0 ) 1513 1624 { 1625 // If no residual when allowing for one, then set mark to not try case where residual is forced to 0 1514 1626 mergeCandBuffer[uiMergeCand] = 1; 1515 1627 } 1516 } 1517 1518 rpcTempCU->setSkipFlagSubParts( rpcTempCU->getQtRootCbf(0) == 0, 0, uhDepth ); 1628 1629 rpcTempCU->setSkipFlagSubParts( rpcTempCU->getQtRootCbf(0) == 0, 0, uhDepth ); 1519 1630 Int orgQP = rpcTempCU->getQP( 0 ); 1520 1631 xCheckDQP( rpcTempCU ); … … 1522 1633 rpcTempCU->initEstData( uhDepth, orgQP ); 1523 1634 1524 1525 1635 if( m_pcEncCfg->getUseFastDecisionForMerge() && !bestIsSkip ) 1526 1636 { 1527 1637 bestIsSkip = rpcBestCU->getQtRootCbf(0) == 0; 1528 1638 } 1529 1530 }1531 1639 } 1532 1640 } … … 1689 1797 #endif 1690 1798 1691 #if RATE_CONTROL_LAMBDA_DOMAIN 1799 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT 1692 1800 if ( m_pcEncCfg->getUseRateCtrl() && m_pcEncCfg->getLCULevelRC() && ePartSize == SIZE_2Nx2N && uhDepth <= m_addSADDepth ) 1693 1801 { -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCu.h
r504 r537 102 102 Bool m_bUseSBACRD; 103 103 TEncRateCtrl* m_pcRateCtrl; 104 #if RATE_CONTROL_LAMBDA_DOMAIN 104 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT 105 105 UInt m_LCUPredictionSAD; 106 106 Int m_addSADDepth; … … 124 124 125 125 Void setBitCounter ( TComBitCounter* pcBitCounter ) { m_pcBitCounter = pcBitCounter; } 126 #if RATE_CONTROL_LAMBDA_DOMAIN 126 #if RATE_CONTROL_LAMBDA_DOMAIN && !M0036_RC_IMPROVEMENT 127 127 UInt getLCUPredictionSAD() { return m_LCUPredictionSAD; } 128 #endif 129 #if RATE_CONTROL_INTRA 130 Int updateLCUDataISlice ( TComDataCU* pcCU, Int LCUIdx, Int width, Int height ); 128 131 #endif 129 132 protected: -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncGOP.cpp
r534 r537 94 94 m_cpbRemovalDelay = 0; 95 95 m_lastBPSEI = 0; 96 #if L0045_NON_NESTED_SEI_RESTRICTIONS97 96 xResetNonNestedSEIPresentFlags(); 98 #if K0180_SCALABLE_NESTING_SEI99 97 xResetNestedSEIPresentFlags(); 100 #endif101 #endif102 98 #if H_MV 103 99 m_layerId = 0; … … 163 159 SEIActiveParameterSets *seiActiveParameterSets = new SEIActiveParameterSets(); 164 160 seiActiveParameterSets->activeVPSId = m_pcCfg->getVPS()->getVPSId(); 165 #if L0047_APS_FLAGS166 161 seiActiveParameterSets->m_fullRandomAccessFlag = false; 167 162 seiActiveParameterSets->m_noParamSetUpdateFlag = false; 168 #endif169 163 seiActiveParameterSets->numSpsIdsMinus1 = 0; 170 164 seiActiveParameterSets->activeSeqParamSetId.resize(seiActiveParameterSets->numSpsIdsMinus1 + 1); … … 179 173 seiFramePacking->m_arrangementCancelFlag = 0; 180 174 seiFramePacking->m_arrangementType = m_pcCfg->getFramePackingArrangementSEIType(); 181 #if L0444_FPA_TYPE182 175 assert((seiFramePacking->m_arrangementType > 2) && (seiFramePacking->m_arrangementType < 6) ); 183 #endif184 176 seiFramePacking->m_quincunxSamplingFlag = m_pcCfg->getFramePackingArrangementSEIQuincunx(); 185 177 seiFramePacking->m_contentInterpretationType = m_pcCfg->getFramePackingArrangementSEIInterpretation(); … … 195 187 seiFramePacking->m_frame1GridPositionY = 0; 196 188 seiFramePacking->m_arrangementReservedByte = 0; 197 #if L0045_PERSISTENCE_FLAGS198 189 seiFramePacking->m_arrangementPersistenceFlag = true; 199 #else200 seiFramePacking->m_arrangementRepetetionPeriod = 1;201 #endif202 190 seiFramePacking->m_upsampledAspectRatio = 0; 203 191 return seiFramePacking; … … 214 202 } 215 203 216 #if J0149_TONE_MAPPING_SEI217 204 SEIToneMappingInfo* TEncGOP::xCreateSEIToneMappingInfo() 218 205 { … … 225 212 assert(seiToneMappingInfo->m_codedDataBitDepth >= 8 && seiToneMappingInfo->m_codedDataBitDepth <= 14); 226 213 seiToneMappingInfo->m_targetBitDepth = m_pcCfg->getTMISEITargetBitDepth(); 227 assert( (seiToneMappingInfo->m_targetBitDepth >= 1 && seiToneMappingInfo->m_targetBitDepth <= 17) || (seiToneMappingInfo->m_targetBitDepth == 255));214 assert( seiToneMappingInfo->m_targetBitDepth >= 1 && seiToneMappingInfo->m_targetBitDepth <= 17 ); 228 215 seiToneMappingInfo->m_modelId = m_pcCfg->getTMISEIModelID(); 229 216 assert(seiToneMappingInfo->m_modelId >=0 &&seiToneMappingInfo->m_modelId<=4); … … 300 287 return seiToneMappingInfo; 301 288 } 302 #endif 289 303 290 Void TEncGOP::xCreateLeadingSEIMessages (/*SEIMessages seiMessages,*/ AccessUnit &accessUnit, TComSPS *sps) 304 291 { … … 315 302 accessUnit.push_back(new NALUnitEBSP(nalu)); 316 303 delete sei; 317 #if L0045_NON_NESTED_SEI_RESTRICTIONS318 304 m_activeParameterSetSEIPresentInAU = true; 319 #endif320 305 } 321 306 … … 342 327 delete sei; 343 328 } 344 #if J0149_TONE_MAPPING_SEI345 329 if(m_pcCfg->getToneMappingInfoSEIEnabled()) 346 330 { … … 354 338 delete sei; 355 339 } 356 #endif357 340 } 358 341 … … 389 372 #endif 390 373 SEIPictureTiming pictureTimingSEI; 391 #if L0208_SOP_DESCRIPTION_SEI392 374 Bool writeSOP = m_pcCfg->getSOPDescriptionSEIEnabled(); 393 #endif394 #if K0180_SCALABLE_NESTING_SEI395 375 // Initialize Scalable Nesting SEI with single layer values 396 376 SEIScalableNesting scalableNestingSEI; … … 403 383 scalableNestingSEI.m_nestingLayerId[0] = 0; 404 384 scalableNestingSEI.m_callerOwnsSEIs = true; 405 #endif406 #if L0044_DU_DPB_OUTPUT_DELAY_HRD407 385 Int picSptDpbOutputDuDelay = 0; 408 #endif409 386 UInt *accumBitsDU = NULL; 410 387 UInt *accumNalsDU = NULL; … … 596 573 pcSlice->getRPS()->setNumberOfLongtermPictures(0); 597 574 598 #if FIX1071 && H_MV_FIX1071575 #if FIX1071 599 576 if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false) != 0) || (pcSlice->isIRAP())) 600 577 { … … 772 749 } 773 750 #endif 774 #if !L0034_COMBINED_LIST_CLEANUP775 if (pcSlice->getSliceType() != B_SLICE || !pcSlice->getSPS()->getUseLComb())776 {777 pcSlice->setNumRefIdx(REF_PIC_LIST_C, 0);778 pcSlice->setRefPicListCombinationFlag(false);779 pcSlice->setRefPicListModificationFlagLC(false);780 }781 else782 {783 pcSlice->setRefPicListCombinationFlag(pcSlice->getSPS()->getUseLComb());784 pcSlice->setNumRefIdx(REF_PIC_LIST_C, pcSlice->getNumRefIdx(REF_PIC_LIST_0));785 }786 #endif787 788 751 if (pcSlice->getSliceType() == B_SLICE) 789 752 { … … 820 783 pcSlice->setRefPOCList(); 821 784 822 #if L0034_COMBINED_LIST_CLEANUP823 785 pcSlice->setList1IdxToList0Idx(); 824 #else825 pcSlice->setNoBackPredFlag( false );826 if ( pcSlice->getSliceType() == B_SLICE && !pcSlice->getRefPicListCombinationFlag())827 {828 if ( pcSlice->getNumRefIdx(RefPicList( 0 ) ) == pcSlice->getNumRefIdx(RefPicList( 1 ) ) )829 {830 pcSlice->setNoBackPredFlag( true );831 Int i;832 for ( i=0; i < pcSlice->getNumRefIdx(RefPicList( 1 ) ); i++ )833 {834 if ( pcSlice->getRefPOC(RefPicList(1), i) != pcSlice->getRefPOC(RefPicList(0), i) )835 {836 pcSlice->setNoBackPredFlag( false );837 break;838 }839 }840 }841 }842 843 if(pcSlice->getNoBackPredFlag())844 {845 pcSlice->setNumRefIdx(REF_PIC_LIST_C, 0);846 }847 pcSlice->generateCombinedList();848 #endif849 786 #if H_3D_TMVP 850 787 if(pcSlice->getLayerId()) … … 943 880 944 881 #if RATE_CONTROL_LAMBDA_DOMAIN 945 Int sliceQP = pcSlice->getSliceQp();946 882 Double lambda = 0.0; 947 883 Int actualHeadBits = 0; … … 959 895 estimatedBits = m_pcRateCtrl->getRCPic()->getTargetBits(); 960 896 897 Int sliceQP = m_pcCfg->getInitialQP(); 961 898 if ( ( pcSlice->getPOC() == 0 && m_pcCfg->getInitialQP() > 0 ) || ( frameLevel == 0 && m_pcCfg->getForceIntraQP() ) ) // QP is specified 962 899 { 963 sliceQP = m_pcCfg->getInitialQP();964 900 Int NumberBFrames = ( m_pcCfg->getGOPSize() - 1 ); 965 901 Double dLambda_scale = 1.0 - Clip3( 0.0, 0.5, 0.05*(Double)NumberBFrames ); … … 972 908 else if ( frameLevel == 0 ) // intra case, but use the model 973 909 { 910 #if RATE_CONTROL_INTRA 911 m_pcSliceEncoder->calCostSliceI(pcPic); 912 #endif 974 913 if ( m_pcCfg->getIntraPeriod() != 1 ) // do not refine allocated bits for all intra case 975 914 { 976 915 Int bits = m_pcRateCtrl->getRCSeq()->getLeftAverageBits(); 916 #if RATE_CONTROL_INTRA 917 bits = m_pcRateCtrl->getRCPic()->getRefineBitsForIntra( bits ); 918 #else 977 919 bits = m_pcRateCtrl->getRCSeq()->getRefineBitsForIntra( bits ); 920 #endif 978 921 if ( bits < 200 ) 979 922 { … … 984 927 985 928 list<TEncRCPic*> listPreviousPicture = m_pcRateCtrl->getPicList(); 929 #if RATE_CONTROL_INTRA 930 m_pcRateCtrl->getRCPic()->getLCUInitTargetBits(); 931 lambda = m_pcRateCtrl->getRCPic()->estimatePicLambda( listPreviousPicture, pcSlice->getSliceType()); 932 #else 986 933 lambda = m_pcRateCtrl->getRCPic()->estimatePicLambda( listPreviousPicture ); 934 #endif 987 935 sliceQP = m_pcRateCtrl->getRCPic()->estimatePicQP( lambda, listPreviousPicture ); 988 936 } … … 990 938 { 991 939 list<TEncRCPic*> listPreviousPicture = m_pcRateCtrl->getPicList(); 940 #if RATE_CONTROL_INTRA 941 lambda = m_pcRateCtrl->getRCPic()->estimatePicLambda( listPreviousPicture, pcSlice->getSliceType()); 942 #else 992 943 lambda = m_pcRateCtrl->getRCPic()->estimatePicLambda( listPreviousPicture ); 944 #endif 993 945 sliceQP = m_pcRateCtrl->getRCPic()->estimatePicQP( lambda, listPreviousPicture ); 994 946 } … … 1199 1151 Bool bLFCrossTileBoundary = pcSlice->getPPS()->getLoopFilterAcrossTilesEnabledFlag(); 1200 1152 m_pcLoopFilter->setCfg(bLFCrossTileBoundary); 1201 #if L0386_DB_METRIC1202 1153 if ( m_pcCfg->getDeblockingFilterMetric() ) 1203 1154 { 1204 1155 dblMetric(pcPic, uiNumSlices); 1205 1156 } 1206 #endif1207 1157 m_pcLoopFilter->loopFilterPic( pcPic ); 1208 1158 … … 1267 1217 UInt maxCU = m_pcCfg->getSliceArgument() >> ( pcSlice->getSPS()->getMaxCUDepth() << 1); 1268 1218 UInt numDU = ( m_pcCfg->getSliceMode() == 1 ) ? ( pcPic->getNumCUsInFrame() / maxCU ) : ( 0 ); 1269 if( pcPic->getNumCUsInFrame() % maxCU != 0 )1219 if( pcPic->getNumCUsInFrame() % maxCU != 0 || numDU == 0 ) 1270 1220 { 1271 1221 numDU ++; … … 1307 1257 } 1308 1258 1309 #if L0208_SOP_DESCRIPTION_SEI1310 1259 if (writeSOP) // write SOP description SEI (if enabled) at the beginning of GOP 1311 1260 { … … 1345 1294 writeSOP = false; 1346 1295 } 1347 #endif1348 1296 1349 1297 if( ( m_pcCfg->getPictureTimingSEIEnabled() || m_pcCfg->getDecodingUnitInfoSEIEnabled() ) && … … 1377 1325 pictureTimingSEI.m_auCpbRemovalDelay = std::max<Int>(1, m_totalCoded - m_lastBPSEI); // Syntax element signalled as minus, hence the . 1378 1326 pictureTimingSEI.m_picDpbOutputDelay = pcSlice->getSPS()->getNumReorderPics(0) + pcSlice->getPOC() - m_totalCoded; 1379 #if L0044_DU_DPB_OUTPUT_DELAY_HRD1380 1327 Int factor = pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getTickDivisorMinus2() + 2; 1381 1328 pictureTimingSEI.m_picDpbOutputDuDelay = factor * pictureTimingSEI.m_picDpbOutputDelay; … … 1384 1331 picSptDpbOutputDuDelay = factor * pictureTimingSEI.m_picDpbOutputDelay; 1385 1332 } 1386 #endif1387 1333 } 1388 1334 … … 1404 1350 sei_buffering_period.m_initialCpbRemovalDelayOffset[0][1] = uiInitialCpbRemovalDelay; 1405 1351 1406 #if L0043_TIMING_INFO1407 1352 Double dTmp = (Double)pcSlice->getSPS()->getVuiParameters()->getTimingInfo()->getNumUnitsInTick() / (Double)pcSlice->getSPS()->getVuiParameters()->getTimingInfo()->getTimeScale(); 1408 #else1409 Double dTmp = (Double)pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getNumUnitsInTick() / (Double)pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getTimeScale();1410 #endif1411 1353 1412 1354 UInt uiTmp = (UInt)( dTmp * 90000.0 ); … … 1419 1361 1420 1362 sei_buffering_period.m_rapCpbParamsPresentFlag = 0; 1421 #if L0328_SPLICING1422 1363 //for the concatenation, it can be set to one during splicing. 1423 1364 sei_buffering_period.m_concatenationFlag = 0; 1424 1365 //since the temporal layer HRD is not ready, we assumed it is fixed 1425 1366 sei_buffering_period.m_auCpbRemovalDelayDelta = 1; 1426 #endif1427 #if L0044_CPB_DPB_DELAY_OFFSET1428 1367 sei_buffering_period.m_cpbDelayOffset = 0; 1429 1368 sei_buffering_period.m_dpbDelayOffset = 0; 1430 #endif1431 1369 1432 1370 m_seiWriter.writeSEImessage( nalu.m_Bitstream, sei_buffering_period, pcSlice->getSPS()); 1433 1371 writeRBSPTrailingBits(nalu.m_Bitstream); 1434 #if L0045_NON_NESTED_SEI_RESTRICTIONS1435 1372 { 1436 1373 UInt seiPositionInAu = xGetFirstSeiLocation(accessUnit); … … 1444 1381 m_bufferingPeriodSEIPresentInAU = true; 1445 1382 } 1446 #else 1447 accessUnit.push_back(new NALUnitEBSP(nalu)); 1448 #endif 1449 1450 #if K0180_SCALABLE_NESTING_SEI 1383 1451 1384 if (m_pcCfg->getScalableNestingSEIEnabled()) 1452 1385 { … … 1458 1391 m_seiWriter.writeSEImessage( naluTmp.m_Bitstream, scalableNestingSEI, pcSlice->getSPS()); 1459 1392 writeRBSPTrailingBits(naluTmp.m_Bitstream); 1460 #if L0045_NON_NESTED_SEI_RESTRICTIONS1461 1393 UInt seiPositionInAu = xGetFirstSeiLocation(accessUnit); 1462 1394 UInt offsetPosition = m_activeParameterSetSEIPresentInAU + m_bufferingPeriodSEIPresentInAU + m_pictureTimingSEIPresentInAU; // Insert BP SEI after non-nested APS, BP and PT SEIs … … 1468 1400 accessUnit.insert(it, new NALUnitEBSP(naluTmp)); 1469 1401 m_nestedBufferingPeriodSEIPresentInAU = true; 1470 #else 1471 accessUnit.push_back(new NALUnitEBSP(naluTmp)); 1472 #endif 1473 } 1474 #endif 1402 } 1475 1403 1476 1404 m_lastBPSEI = m_totalCoded; … … 1935 1863 if ( m_pcCfg->getUseRateCtrl() ) 1936 1864 { 1865 #if !M0036_RC_IMPROVEMENT 1937 1866 Double effectivePercentage = m_pcRateCtrl->getRCPic()->getEffectivePercentage(); 1867 #endif 1938 1868 Double avgQP = m_pcRateCtrl->getRCPic()->calAverageQP(); 1939 1869 Double avgLambda = m_pcRateCtrl->getRCPic()->calAverageLambda(); … … 1942 1872 avgLambda = lambda; 1943 1873 } 1874 #if M0036_RC_IMPROVEMENT 1875 #if RATE_CONTROL_INTRA 1876 m_pcRateCtrl->getRCPic()->updateAfterPicture( actualHeadBits, actualTotalBits, avgQP, avgLambda, pcSlice->getSliceType()); 1877 #else 1878 m_pcRateCtrl->getRCPic()->updateAfterPicture( actualHeadBits, actualTotalBits, avgQP, avgLambda ); 1879 #endif 1880 #else 1944 1881 m_pcRateCtrl->getRCPic()->updateAfterPicture( actualHeadBits, actualTotalBits, avgQP, avgLambda, effectivePercentage ); 1882 #endif 1945 1883 m_pcRateCtrl->getRCPic()->addToPictureLsit( m_pcRateCtrl->getPicList() ); 1946 1884 … … 1962 1900 } 1963 1901 #endif 1902 1964 1903 if( ( m_pcCfg->getPictureTimingSEIEnabled() || m_pcCfg->getDecodingUnitInfoSEIEnabled() ) && 1965 1904 ( pcSlice->getSPS()->getVuiParametersPresentFlag() ) && … … 1996 1935 for( i = ( numDU - 2 ); i >= 0; i -- ) 1997 1936 { 1998 #if L0043_TIMING_INFO1999 1937 ui64Tmp = ( ( ( accumBitsDU[ numDU - 1 ] - accumBitsDU[ i ] ) * ( vui->getTimingInfo()->getTimeScale() / vui->getTimingInfo()->getNumUnitsInTick() ) * ( hrd->getTickDivisorMinus2() + 2 ) ) / ( m_pcCfg->getTargetBitrate() ) ); 2000 #else2001 ui64Tmp = ( ( ( accumBitsDU[ numDU - 1 ] - accumBitsDU[ i ] ) * ( hrd->getTimeScale() / hrd->getNumUnitsInTick() ) * ( hrd->getTickDivisorMinus2() + 2 ) ) / ( m_pcCfg->getTargetBitrate() ) );2002 #endif2003 1938 if( (UInt)ui64Tmp > maxDiff ) 2004 1939 { … … 2012 1947 { 2013 1948 flag = 0; 2014 #if L0043_TIMING_INFO2015 1949 ui64Tmp = ( ( ( accumBitsDU[ numDU - 1 ] - accumBitsDU[ i ] ) * ( vui->getTimingInfo()->getTimeScale() / vui->getTimingInfo()->getNumUnitsInTick() ) * ( hrd->getTickDivisorMinus2() + 2 ) ) / ( m_pcCfg->getTargetBitrate() ) ); 2016 #else2017 ui64Tmp = ( ( ( accumBitsDU[ numDU - 1 ] - accumBitsDU[ i ] ) * ( hrd->getTimeScale() / hrd->getNumUnitsInTick() ) * ( hrd->getTickDivisorMinus2() + 2 ) ) / ( m_pcCfg->getTargetBitrate() ) );2018 #endif2019 1950 2020 1951 if( (UInt)ui64Tmp > maxDiff ) … … 2048 1979 m_seiWriter.writeSEImessage(nalu.m_Bitstream, pictureTimingSEI, pcSlice->getSPS()); 2049 1980 writeRBSPTrailingBits(nalu.m_Bitstream); 2050 #if L0045_NON_NESTED_SEI_RESTRICTIONS2051 1981 UInt seiPositionInAu = xGetFirstSeiLocation(accessUnit); 2052 1982 UInt offsetPosition = m_activeParameterSetSEIPresentInAU … … 2059 1989 accessUnit.insert(it, new NALUnitEBSP(nalu)); 2060 1990 m_pictureTimingSEIPresentInAU = true; 2061 #else 2062 AccessUnit::iterator it = find_if(accessUnit.begin(), accessUnit.end(), mem_fun(&NALUnit::isSlice)); 2063 accessUnit.insert(it, new NALUnitEBSP(nalu)); 2064 #endif 2065 } 2066 #if K0180_SCALABLE_NESTING_SEI 1991 } 2067 1992 if ( m_pcCfg->getScalableNestingSEIEnabled() ) // put picture timing SEI into scalable nesting SEI 2068 1993 { … … 2073 1998 m_seiWriter.writeSEImessage(nalu.m_Bitstream, scalableNestingSEI, pcSlice->getSPS()); 2074 1999 writeRBSPTrailingBits(nalu.m_Bitstream); 2075 #if L0045_NON_NESTED_SEI_RESTRICTIONS2076 2000 UInt seiPositionInAu = xGetFirstSeiLocation(accessUnit); 2077 2001 UInt offsetPosition = m_activeParameterSetSEIPresentInAU … … 2084 2008 accessUnit.insert(it, new NALUnitEBSP(nalu)); 2085 2009 m_nestedPictureTimingSEIPresentInAU = true; 2086 #else2087 AccessUnit::iterator it = find_if(accessUnit.begin(), accessUnit.end(), mem_fun(&NALUnit::isSlice));2088 accessUnit.insert(it, new NALUnitEBSP(nalu));2089 #endif2090 2010 } 2091 #endif2092 2093 2011 } 2094 2012 if( m_pcCfg->getDecodingUnitInfoSEIEnabled() && hrd->getSubPicCpbParamsPresentFlag() ) … … 2102 2020 tempSEI.m_decodingUnitIdx = i; 2103 2021 tempSEI.m_duSptCpbRemovalDelay = pictureTimingSEI.m_duCpbRemovalDelayMinus1[i] + 1; 2104 #if L0044_DU_DPB_OUTPUT_DELAY_HRD2105 2022 tempSEI.m_dpbOutputDuDelayPresentFlag = false; 2106 2023 tempSEI.m_picSptDpbOutputDuDelay = picSptDpbOutputDuDelay; 2107 #endif2108 2024 2109 2025 AccessUnit::iterator it; … … 2115 2031 writeRBSPTrailingBits(nalu.m_Bitstream); 2116 2032 2117 #if L0045_NON_NESTED_SEI_RESTRICTIONS2118 2033 UInt seiPositionInAu = xGetFirstSeiLocation(accessUnit); 2119 2034 UInt offsetPosition = m_activeParameterSetSEIPresentInAU … … 2125 2040 } 2126 2041 accessUnit.insert(it, new NALUnitEBSP(nalu)); 2127 #else2128 it = find_if(accessUnit.begin(), accessUnit.end(), mem_fun(&NALUnit::isSlice));2129 accessUnit.insert(it, new NALUnitEBSP(nalu));2130 #endif2131 2042 } 2132 2043 else … … 2154 2065 } 2155 2066 } 2156 #if L0045_NON_NESTED_SEI_RESTRICTIONS2157 2067 xResetNonNestedSEIPresentFlags(); 2158 #if K0180_SCALABLE_NESTING_SEI2159 2068 xResetNestedSEIPresentFlags(); 2160 #endif2161 #endif2162 2069 pcPic->getPicYuvRec()->copyToPic(pcPicYuvRecOut); 2163 2070 … … 2851 2758 } 2852 2759 2853 #if L0045_NON_NESTED_SEI_RESTRICTIONS2854 2760 /** Function for finding the position to insert the first of APS and non-nested BP, PT, DU info SEI messages. 2855 2761 * \param accessUnit Access Unit of the current picture … … 2871 2777 return seiStartPos; 2872 2778 } 2873 #endif 2874 2875 #if L0386_DB_METRIC 2779 2876 2780 Void TEncGOP::dblMetric( TComPic* pcPic, UInt uiNumSlices ) 2877 2781 { … … 2887 2791 const UInt noCol = (picWidth>>log2maxTB); 2888 2792 const UInt noRows = (picHeight>>log2maxTB); 2793 assert(noCol > 1); 2794 assert(noRows > 1); 2889 2795 UInt64 *colSAD = (UInt64*)malloc(noCol*sizeof(UInt64)); 2890 2796 UInt64 *rowSAD = (UInt64*)malloc(noRows*sizeof(UInt64)); … … 2995 2901 free(rowSAD); 2996 2902 } 2997 #endif 2903 2998 2904 #if H_MV 2999 2905 Void TEncGOP::xSetRefPicListModificationsMv( TComSlice* pcSlice, UInt iGOPid ) -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncGOP.h
r534 r537 128 128 UInt m_tl0Idx; 129 129 UInt m_rapIdx; 130 #if L0045_NON_NESTED_SEI_RESTRICTIONS131 130 Bool m_activeParameterSetSEIPresentInAU; 132 131 Bool m_bufferingPeriodSEIPresentInAU; 133 132 Bool m_pictureTimingSEIPresentInAU; 134 #if K0180_SCALABLE_NESTING_SEI135 133 Bool m_nestedBufferingPeriodSEIPresentInAU; 136 134 Bool m_nestedPictureTimingSEIPresentInAU; 137 #endif138 #endif139 135 public: 140 136 TEncGOP(); … … 199 195 SEIDisplayOrientation* xCreateSEIDisplayOrientation(); 200 196 201 #if J0149_TONE_MAPPING_SEI202 197 SEIToneMappingInfo* xCreateSEIToneMappingInfo(); 203 #endif204 198 205 199 Void xCreateLeadingSEIMessages (/*SEIMessages seiMessages,*/ AccessUnit &accessUnit, TComSPS *sps); 206 #if L0045_NON_NESTED_SEI_RESTRICTIONS207 200 Int xGetFirstSeiLocation (AccessUnit &accessUnit); 208 201 Void xResetNonNestedSEIPresentFlags() … … 212 205 m_pictureTimingSEIPresentInAU = false; 213 206 } 214 #if K0180_SCALABLE_NESTING_SEI215 207 Void xResetNestedSEIPresentFlags() 216 208 { … … 218 210 m_nestedPictureTimingSEIPresentInAU = false; 219 211 } 220 #endif221 #endif222 212 #if H_MV 223 213 Void xSetRefPicListModificationsMv( TComSlice* pcSlice, UInt iGOPid ); 224 214 #endif 225 #if L0386_DB_METRIC226 215 Void dblMetric( TComPic* pcPic, UInt uiNumSlices ); 227 #endif228 216 };// END CLASS DEFINITION TEncGOP 229 217 -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncRateCtrl.cpp
r324 r537 67 67 m_bitsLeft = 0; 68 68 m_useLCUSeparateModel = false; 69 #if M0036_RC_IMPROVEMENT 70 m_adaptiveBit = 0; 71 m_lastLambda = 0.0; 72 #endif 69 73 } 70 74 … … 74 78 } 75 79 80 #if M0036_RC_IMPROVEMENT 81 Void TEncRCSeq::create( Int totalFrames, Int targetBitrate, Int frameRate, Int GOPSize, Int picWidth, Int picHeight, Int LCUWidth, Int LCUHeight, Int numberOfLevel, Bool useLCUSeparateModel, Int adaptiveBit ) 82 #else 76 83 Void TEncRCSeq::create( Int totalFrames, Int targetBitrate, Int frameRate, Int GOPSize, Int picWidth, Int picHeight, Int LCUWidth, Int LCUHeight, Int numberOfLevel, Bool useLCUSeparateModel ) 84 #endif 77 85 { 78 86 destroy(); … … 101 109 m_betaUpdate = 0.025; 102 110 } 103 else 111 #if M0036_RC_IMPROVEMENT 112 else if ( m_seqTargetBpp < 0.2 ) 104 113 { 105 114 m_alphaUpdate = 0.1; 106 115 m_betaUpdate = 0.05; 107 116 } 117 else if ( m_seqTargetBpp < 0.5 ) 118 { 119 m_alphaUpdate = 0.2; 120 m_betaUpdate = 0.1; 121 } 122 else 123 { 124 m_alphaUpdate = 0.4; 125 m_betaUpdate = 0.2; 126 } 127 #else 128 else 129 { 130 m_alphaUpdate = 0.1; 131 m_betaUpdate = 0.05; 132 } 133 #endif 108 134 m_averageBits = (Int)(m_targetBits / totalFrames); 109 135 Int picWidthInBU = ( m_picWidth % m_LCUWidth ) == 0 ? m_picWidth / m_LCUWidth : m_picWidth / m_LCUWidth + 1; … … 146 172 m_framesLeft = m_totalFrames; 147 173 m_bitsLeft = m_targetBits; 174 #if M0036_RC_IMPROVEMENT 175 m_adaptiveBit = adaptiveBit; 176 m_lastLambda = 0.0; 177 #endif 148 178 } 149 179 … … 203 233 for ( Int i=0; i<m_numberOfLevel; i++ ) 204 234 { 235 #if RATE_CONTROL_INTRA 236 if (i>0) 237 { 238 m_picPara[i].m_alpha = 3.2003; 239 m_picPara[i].m_beta = -1.367; 240 } 241 else 242 { 243 m_picPara[i].m_alpha = ALPHA; 244 m_picPara[i].m_beta = BETA2; 245 } 246 #else 205 247 m_picPara[i].m_alpha = 3.2003; 206 248 m_picPara[i].m_beta = -1.367; 249 #endif 207 250 } 208 251 } … … 228 271 for ( Int j=0; j<m_numberOfLCU; j++) 229 272 { 273 #if RATE_CONTROL_INTRA 274 m_LCUPara[i][j].m_alpha = m_picPara[i].m_alpha; 275 m_LCUPara[i][j].m_beta = m_picPara[i].m_beta; 276 #else 230 277 m_LCUPara[i][j].m_alpha = 3.2003; 231 278 m_LCUPara[i][j].m_beta = -1.367; 279 #endif 232 280 } 233 281 } … … 251 299 } 252 300 301 #if !RATE_CONTROL_INTRA 253 302 Int TEncRCSeq::getRefineBitsForIntra( Int orgBits ) 254 303 { … … 264 313 return orgBits * 10; 265 314 } 315 #endif 316 317 #if M0036_RC_IMPROVEMENT 318 Void TEncRCSeq::setAllBitRatio( Double basicLambda, Double* equaCoeffA, Double* equaCoeffB ) 319 { 320 Int* bitsRatio = new Int[m_GOPSize]; 321 for ( Int i=0; i<m_GOPSize; i++ ) 322 { 323 bitsRatio[i] = (Int)( equaCoeffA[i] * pow( basicLambda, equaCoeffB[i] ) * m_numberOfPixel ); 324 } 325 initBitsRatio( bitsRatio ); 326 delete[] bitsRatio; 327 } 328 #endif 266 329 267 330 //GOP level … … 286 349 Int targetBits = xEstGOPTargetBits( encRCSeq, numPic ); 287 350 351 #if M0036_RC_IMPROVEMENT 352 if ( encRCSeq->getAdaptiveBits() > 0 && encRCSeq->getLastLambda() > 0.1 ) 353 { 354 Double targetBpp = (Double)targetBits / encRCSeq->getNumPixel(); 355 Double basicLambda = 0.0; 356 Double* lambdaRatio = new Double[encRCSeq->getGOPSize()]; 357 Double* equaCoeffA = new Double[encRCSeq->getGOPSize()]; 358 Double* equaCoeffB = new Double[encRCSeq->getGOPSize()]; 359 360 if ( encRCSeq->getAdaptiveBits() == 1 ) // for GOP size =4, low delay case 361 { 362 if ( encRCSeq->getLastLambda() < 120.0 ) 363 { 364 lambdaRatio[1] = 0.725 * log( encRCSeq->getLastLambda() ) + 0.5793; 365 lambdaRatio[0] = 1.3 * lambdaRatio[1]; 366 lambdaRatio[2] = 1.3 * lambdaRatio[1]; 367 lambdaRatio[3] = 1.0; 368 } 369 else 370 { 371 lambdaRatio[0] = 5.0; 372 lambdaRatio[1] = 4.0; 373 lambdaRatio[2] = 5.0; 374 lambdaRatio[3] = 1.0; 375 } 376 } 377 else if ( encRCSeq->getAdaptiveBits() == 2 ) // for GOP size = 8, random access case 378 { 379 if ( encRCSeq->getLastLambda() < 90.0 ) 380 { 381 lambdaRatio[0] = 1.0; 382 lambdaRatio[1] = 0.725 * log( encRCSeq->getLastLambda() ) + 0.7963; 383 lambdaRatio[2] = 1.3 * lambdaRatio[1]; 384 lambdaRatio[3] = 3.25 * lambdaRatio[1]; 385 lambdaRatio[4] = 3.25 * lambdaRatio[1]; 386 lambdaRatio[5] = 1.3 * lambdaRatio[1]; 387 lambdaRatio[6] = 3.25 * lambdaRatio[1]; 388 lambdaRatio[7] = 3.25 * lambdaRatio[1]; 389 } 390 else 391 { 392 lambdaRatio[0] = 1.0; 393 lambdaRatio[1] = 4.0; 394 lambdaRatio[2] = 5.0; 395 lambdaRatio[3] = 12.3; 396 lambdaRatio[4] = 12.3; 397 lambdaRatio[5] = 5.0; 398 lambdaRatio[6] = 12.3; 399 lambdaRatio[7] = 12.3; 400 } 401 } 402 403 xCalEquaCoeff( encRCSeq, lambdaRatio, equaCoeffA, equaCoeffB, encRCSeq->getGOPSize() ); 404 basicLambda = xSolveEqua( targetBpp, equaCoeffA, equaCoeffB, encRCSeq->getGOPSize() ); 405 encRCSeq->setAllBitRatio( basicLambda, equaCoeffA, equaCoeffB ); 406 407 delete []lambdaRatio; 408 delete []equaCoeffA; 409 delete []equaCoeffB; 410 } 411 #endif 412 288 413 m_picTargetBitInGOP = new Int[numPic]; 289 414 Int i; … … 297 422 { 298 423 currPicRatio = encRCSeq->getBitRatio( i ); 424 #if M0036_RC_IMPROVEMENT 425 m_picTargetBitInGOP[i] = (Int)( ((Double)targetBits) * currPicRatio / totalPicRatio ); 426 #else 299 427 m_picTargetBitInGOP[i] = targetBits * currPicRatio / totalPicRatio; 428 #endif 300 429 } 301 430 … … 306 435 m_bitsLeft = m_targetBits; 307 436 } 437 438 #if M0036_RC_IMPROVEMENT 439 Void TEncRCGOP::xCalEquaCoeff( TEncRCSeq* encRCSeq, Double* lambdaRatio, Double* equaCoeffA, Double* equaCoeffB, Int GOPSize ) 440 { 441 for ( Int i=0; i<GOPSize; i++ ) 442 { 443 Int frameLevel = encRCSeq->getGOPID2Level(i); 444 Double alpha = encRCSeq->getPicPara(frameLevel).m_alpha; 445 Double beta = encRCSeq->getPicPara(frameLevel).m_beta; 446 equaCoeffA[i] = pow( 1.0/alpha, 1.0/beta ) * pow( lambdaRatio[i], 1.0/beta ); 447 equaCoeffB[i] = 1.0/beta; 448 } 449 } 450 451 Double TEncRCGOP::xSolveEqua( Double targetBpp, Double* equaCoeffA, Double* equaCoeffB, Int GOPSize ) 452 { 453 Double solution = 100.0; 454 Double minNumber = 0.1; 455 Double maxNumber = 10000.0; 456 for ( Int i=0; i<g_RCIterationNum; i++ ) 457 { 458 Double fx = 0.0; 459 for ( Int j=0; j<GOPSize; j++ ) 460 { 461 fx += equaCoeffA[j] * pow( solution, equaCoeffB[j] ); 462 } 463 464 if ( fabs( fx - targetBpp ) < 0.000001 ) 465 { 466 break; 467 } 468 469 if ( fx > targetBpp ) 470 { 471 minNumber = solution; 472 solution = ( solution + maxNumber ) / 2.0; 473 } 474 else 475 { 476 maxNumber = solution; 477 solution = ( solution + minNumber ) / 2.0; 478 } 479 } 480 481 solution = Clip3( 0.1, 10000.0, solution ); 482 return solution; 483 } 484 #endif 308 485 309 486 Void TEncRCGOP::destroy() … … 357 534 358 535 m_LCUs = NULL; 536 #if !M0036_RC_IMPROVEMENT 359 537 m_lastPicture = NULL; 538 #endif 360 539 m_picActualHeaderBits = 0; 540 #if !M0036_RC_IMPROVEMENT 361 541 m_totalMAD = 0.0; 542 #endif 362 543 m_picActualBits = 0; 363 544 m_picQP = 0; … … 384 565 } 385 566 567 #if M0036_RC_IMPROVEMENT 568 targetBits = Int( ((Double)GOPbitsLeft) * currPicRatio / totalPicRatio ); 569 #else 386 570 targetBits = Int( GOPbitsLeft * currPicRatio / totalPicRatio ); 571 #endif 387 572 388 573 if ( targetBits < 100 ) … … 480 665 m_LCUs[LCUIdx].m_lambda = 0.0; 481 666 m_LCUs[LCUIdx].m_targetBits = 0; 667 #if M0036_RC_IMPROVEMENT 668 m_LCUs[LCUIdx].m_bitWeight = 1.0; 669 #else 482 670 m_LCUs[LCUIdx].m_MAD = 0.0; 671 #endif 483 672 Int currWidth = ( (i == picWidthInLCU -1) ? picWidth - LCUWidth *(picWidthInLCU -1) : LCUWidth ); 484 673 Int currHeight = ( (j == picHeightInLCU-1) ? picHeight - LCUHeight*(picHeightInLCU-1) : LCUHeight ); … … 487 676 } 488 677 m_picActualHeaderBits = 0; 678 #if !M0036_RC_IMPROVEMENT 489 679 m_totalMAD = 0.0; 680 #endif 490 681 m_picActualBits = 0; 491 682 m_picQP = 0; 492 683 m_picLambda = 0.0; 493 684 685 #if !M0036_RC_IMPROVEMENT 494 686 m_lastPicture = NULL; 495 687 list<TEncRCPic*>::reverse_iterator it; … … 502 694 } 503 695 } 696 #endif 504 697 } 505 698 … … 515 708 } 516 709 710 711 #if RATE_CONTROL_INTRA 712 Double TEncRCPic::estimatePicLambda( list<TEncRCPic*>& listPreviousPictures, SliceType eSliceType) 713 #else 517 714 Double TEncRCPic::estimatePicLambda( list<TEncRCPic*>& listPreviousPictures ) 715 #endif 518 716 { 519 717 Double alpha = m_encRCSeq->getPicPara( m_frameLevel ).m_alpha; 520 718 Double beta = m_encRCSeq->getPicPara( m_frameLevel ).m_beta; 521 719 Double bpp = (Double)m_targetBits/(Double)m_numberOfPixel; 720 #if RATE_CONTROL_INTRA 721 Double estLambda; 722 if (eSliceType == I_SLICE) 723 { 724 estLambda = calculateLambdaIntra(alpha, beta, pow(m_totalCostIntra/(Double)m_numberOfPixel, BETA1), bpp); 725 } 726 else 727 { 728 estLambda = alpha * pow( bpp, beta ); 729 } 730 #else 522 731 Double estLambda = alpha * pow( bpp, beta ); 732 #endif 733 523 734 Double lastLevelLambda = -1.0; 524 735 Double lastPicLambda = -1.0; … … 566 777 567 778 m_estPicLambda = estLambda; 779 780 #if M0036_RC_IMPROVEMENT 781 Double totalWeight = 0.0; 782 // initial BU bit allocation weight 783 for ( Int i=0; i<m_numberOfLCU; i++ ) 784 { 785 #if RC_FIX 786 Double alphaLCU, betaLCU; 787 if ( m_encRCSeq->getUseLCUSeparateModel() ) 788 { 789 alphaLCU = m_encRCSeq->getLCUPara( m_frameLevel, i ).m_alpha; 790 betaLCU = m_encRCSeq->getLCUPara( m_frameLevel, i ).m_beta; 791 } 792 else 793 { 794 alphaLCU = m_encRCSeq->getPicPara( m_frameLevel ).m_alpha; 795 betaLCU = m_encRCSeq->getPicPara( m_frameLevel ).m_beta; 796 } 797 #else 798 Double alphaLCU = m_encRCSeq->getLCUPara( m_frameLevel, i ).m_alpha; 799 Double betaLCU = m_encRCSeq->getLCUPara( m_frameLevel, i ).m_beta; 800 #endif 801 802 m_LCUs[i].m_bitWeight = m_LCUs[i].m_numberOfPixel * pow( estLambda/alphaLCU, 1.0/betaLCU ); 803 804 if ( m_LCUs[i].m_bitWeight < 0.01 ) 805 { 806 m_LCUs[i].m_bitWeight = 0.01; 807 } 808 totalWeight += m_LCUs[i].m_bitWeight; 809 } 810 for ( Int i=0; i<m_numberOfLCU; i++ ) 811 { 812 Double BUTargetBits = m_targetBits * m_LCUs[i].m_bitWeight / totalWeight; 813 m_LCUs[i].m_bitWeight = BUTargetBits; 814 } 815 #endif 816 568 817 return estLambda; 569 818 } … … 607 856 } 608 857 858 #if RATE_CONTROL_INTRA 859 Double TEncRCPic::getLCUTargetBpp(SliceType eSliceType) 860 #else 609 861 Double TEncRCPic::getLCUTargetBpp() 862 #endif 610 863 { 611 864 Int LCUIdx = getLCUCoded(); 612 865 Double bpp = -1.0; 613 866 Int avgBits = 0; 867 #if !M0036_RC_IMPROVEMENT 614 868 Double totalMAD = -1.0; 615 869 Double MAD = -1.0; 616 870 #endif 871 872 #if RATE_CONTROL_INTRA 873 if (eSliceType == I_SLICE){ 874 Int noOfLCUsLeft = m_numberOfLCU - LCUIdx + 1; 875 Int bitrateWindow = min(4,noOfLCUsLeft); 876 Double MAD = getLCU(LCUIdx).m_costIntra; 877 878 if (m_remainingCostIntra > 0.1 ) 879 { 880 Double weightedBitsLeft = (m_bitsLeft*bitrateWindow+(m_bitsLeft-getLCU(LCUIdx).m_targetBitsLeft)*noOfLCUsLeft)/(Double)bitrateWindow; 881 avgBits = Int( MAD*weightedBitsLeft/m_remainingCostIntra ); 882 } 883 else 884 { 885 avgBits = Int( m_bitsLeft / m_LCULeft ); 886 } 887 m_remainingCostIntra -= MAD; 888 } 889 else 890 { 891 #endif 892 #if M0036_RC_IMPROVEMENT 893 Double totalWeight = 0; 894 for ( Int i=LCUIdx; i<m_numberOfLCU; i++ ) 895 { 896 totalWeight += m_LCUs[i].m_bitWeight; 897 } 898 Int realInfluenceLCU = min( g_RCLCUSmoothWindowSize, getLCULeft() ); 899 avgBits = (Int)( m_LCUs[LCUIdx].m_bitWeight - ( totalWeight - m_bitsLeft ) / realInfluenceLCU + 0.5 ); 900 #else 617 901 if ( m_lastPicture == NULL ) 618 902 { … … 637 921 } 638 922 } 639 640 #if L0033_RC_BUGFIX 923 #endif 924 #if RATE_CONTROL_INTRA 925 } 926 #endif 927 641 928 if ( avgBits < 1 ) 642 929 { 643 930 avgBits = 1; 644 931 } 645 #else646 if ( avgBits < 5 )647 {648 avgBits = 5;649 }650 #endif651 932 652 933 bpp = ( Double )avgBits/( Double )m_LCUs[ LCUIdx ].m_numberOfPixel; … … 716 997 //for Lambda clip, LCU level clip 717 998 Int clipNeighbourQP = g_RCInvalidQPValue; 718 #if L0033_RC_BUGFIX719 999 for ( int i=LCUIdx - 1; i>=0; i-- ) 720 #else721 for ( int i=LCUIdx; i>=0; i-- )722 #endif723 1000 { 724 1001 if ( (getLCU(i)).m_QP > g_RCInvalidQPValue ) … … 773 1050 beta *= ( 1.0 - m_encRCSeq->getBetaUpdate() / 2.0 ); 774 1051 1052 #if M0036_RC_IMPROVEMENT 1053 alpha = Clip3( g_RCAlphaMinValue, g_RCAlphaMaxValue, alpha ); 1054 beta = Clip3( g_RCBetaMinValue, g_RCBetaMaxValue, beta ); 1055 #else 775 1056 alpha = Clip3( 0.05, 20.0, alpha ); 776 1057 beta = Clip3( -3.0, -0.1, beta ); 1058 #endif 777 1059 778 1060 TRCParameter rcPara; … … 787 1069 alpha += m_encRCSeq->getAlphaUpdate() * ( log( inputLambda ) - log( calLambda ) ) * alpha; 788 1070 double lnbpp = log( bpp ); 1071 #if M0036_RC_IMPROVEMENT 1072 lnbpp = Clip3( -5.0, -0.1, lnbpp ); 1073 #else 789 1074 lnbpp = Clip3( -5.0, 1.0, lnbpp ); 1075 #endif 790 1076 beta += m_encRCSeq->getBetaUpdate() * ( log( inputLambda ) - log( calLambda ) ) * lnbpp; 791 1077 1078 #if M0036_RC_IMPROVEMENT 1079 alpha = Clip3( g_RCAlphaMinValue, g_RCAlphaMaxValue, alpha ); 1080 beta = Clip3( g_RCBetaMinValue, g_RCBetaMaxValue, beta ); 1081 #else 792 1082 alpha = Clip3( 0.05, 20.0, alpha ); 793 1083 beta = Clip3( -3.0, -0.1, beta ); 1084 #endif 794 1085 TRCParameter rcPara; 795 1086 rcPara.m_alpha = alpha; … … 799 1090 } 800 1091 1092 #if !M0036_RC_IMPROVEMENT 801 1093 Double TEncRCPic::getEffectivePercentage() 802 1094 { … … 816 1108 return effectivePixelPercentage; 817 1109 } 1110 #endif 818 1111 819 1112 Double TEncRCPic::calAverageQP() … … 871 1164 } 872 1165 1166 #if M0036_RC_IMPROVEMENT 1167 #if RATE_CONTROL_INTRA 1168 Void TEncRCPic::updateAfterPicture( Int actualHeaderBits, Int actualTotalBits, Double averageQP, Double averageLambda, SliceType eSliceType) 1169 #else 1170 Void TEncRCPic::updateAfterPicture( Int actualHeaderBits, Int actualTotalBits, Double averageQP, Double averageLambda ) 1171 #endif 1172 #else 873 1173 Void TEncRCPic::updateAfterPicture( Int actualHeaderBits, Int actualTotalBits, Double averageQP, Double averageLambda, Double effectivePercentage ) 1174 #endif 874 1175 { 875 1176 m_picActualHeaderBits = actualHeaderBits; … … 884 1185 } 885 1186 m_picLambda = averageLambda; 1187 #if !M0036_RC_IMPROVEMENT 886 1188 for ( Int i=0; i<m_numberOfLCU; i++ ) 887 1189 { 888 1190 m_totalMAD += m_LCUs[i].m_MAD; 889 1191 } 1192 #endif 890 1193 891 1194 Double alpha = m_encRCSeq->getPicPara( m_frameLevel ).m_alpha; 892 1195 Double beta = m_encRCSeq->getPicPara( m_frameLevel ).m_beta; 893 1196 #if RATE_CONTROL_INTRA 1197 if (eSliceType == I_SLICE) 1198 { 1199 updateAlphaBetaIntra(&alpha, &beta); 1200 } 1201 else 1202 { 1203 #endif 894 1204 // update parameters 895 1205 Double picActualBits = ( Double )m_picActualBits; … … 898 1208 Double inputLambda = m_picLambda; 899 1209 1210 #if M0036_RC_IMPROVEMENT 1211 if ( inputLambda < 0.01 || calLambda < 0.01 || picActualBpp < 0.0001 ) 1212 #else 900 1213 if ( inputLambda < 0.01 || calLambda < 0.01 || picActualBpp < 0.0001 || effectivePercentage < 0.05 ) 1214 #endif 901 1215 { 902 1216 alpha *= ( 1.0 - m_encRCSeq->getAlphaUpdate() / 2.0 ); 903 1217 beta *= ( 1.0 - m_encRCSeq->getBetaUpdate() / 2.0 ); 904 1218 1219 #if M0036_RC_IMPROVEMENT 1220 alpha = Clip3( g_RCAlphaMinValue, g_RCAlphaMaxValue, alpha ); 1221 beta = Clip3( g_RCBetaMinValue, g_RCBetaMaxValue, beta ); 1222 #else 905 1223 alpha = Clip3( 0.05, 20.0, alpha ); 906 1224 beta = Clip3( -3.0, -0.1, beta ); 1225 #endif 907 1226 TRCParameter rcPara; 908 1227 rcPara.m_alpha = alpha; … … 916 1235 alpha += m_encRCSeq->getAlphaUpdate() * ( log( inputLambda ) - log( calLambda ) ) * alpha; 917 1236 double lnbpp = log( picActualBpp ); 1237 #if M0036_RC_IMPROVEMENT 1238 lnbpp = Clip3( -5.0, -0.1, lnbpp ); 1239 #else 918 1240 lnbpp = Clip3( -5.0, 1.0, lnbpp ); 1241 #endif 919 1242 beta += m_encRCSeq->getBetaUpdate() * ( log( inputLambda ) - log( calLambda ) ) * lnbpp; 920 1243 1244 #if M0036_RC_IMPROVEMENT 1245 alpha = Clip3( g_RCAlphaMinValue, g_RCAlphaMaxValue, alpha ); 1246 beta = Clip3( g_RCBetaMinValue, g_RCBetaMaxValue, beta ); 1247 #else 921 1248 alpha = Clip3( 0.05, 20.0, alpha ); 922 1249 beta = Clip3( -3.0, -0.1, beta ); 1250 #endif 1251 #if RATE_CONTROL_INTRA 1252 } 1253 #endif 923 1254 924 1255 TRCParameter rcPara; … … 927 1258 928 1259 m_encRCSeq->setPicPara( m_frameLevel, rcPara ); 929 } 1260 1261 #if M0036_RC_IMPROVEMENT 1262 if ( m_frameLevel == 1 ) 1263 { 1264 Double currLambda = Clip3( 0.1, 10000.0, m_picLambda ); 1265 Double updateLastLambda = g_RCWeightHistoryLambda * m_encRCSeq->getLastLambda() + g_RCWeightCurrentLambda * currLambda; 1266 m_encRCSeq->setLastLambda( updateLastLambda ); 1267 } 1268 #endif 1269 } 1270 1271 #if RATE_CONTROL_INTRA 1272 Int TEncRCPic::getRefineBitsForIntra( Int orgBits ) 1273 { 1274 Double alpha=0.25, beta=0.5582; 1275 Int iIntraBits; 1276 1277 if (orgBits*40 < m_numberOfPixel) 1278 { 1279 alpha=0.25; 1280 } 1281 else 1282 { 1283 alpha=0.30; 1284 } 1285 1286 iIntraBits = (Int)(alpha* pow(m_totalCostIntra*4.0/(Double)orgBits, beta)*(Double)orgBits+0.5); 1287 1288 return iIntraBits; 1289 } 1290 1291 Double TEncRCPic::calculateLambdaIntra(double alpha, double beta, double MADPerPixel, double bitsPerPixel) 1292 { 1293 return ( (alpha/256.0) * pow( MADPerPixel/bitsPerPixel, beta ) ); 1294 } 1295 1296 Void TEncRCPic::updateAlphaBetaIntra(double *alpha, double *beta) 1297 { 1298 Double lnbpp = log(pow(m_totalCostIntra / (Double)m_numberOfPixel, BETA1)); 1299 Double diffLambda = (*beta)*(log((Double)m_picActualBits)-log((Double)m_targetBits)); 1300 1301 diffLambda = Clip3(-0.125, 0.125, 0.25*diffLambda); 1302 *alpha = (*alpha) * exp(diffLambda); 1303 *beta = (*beta) + diffLambda / lnbpp; 1304 } 1305 1306 1307 Void TEncRCPic::getLCUInitTargetBits() 1308 { 1309 Int iAvgBits = 0; 1310 1311 m_remainingCostIntra = m_totalCostIntra; 1312 for (Int i=m_numberOfLCU-1; i>=0; i--) 1313 { 1314 iAvgBits += Int(m_targetBits * getLCU(i).m_costIntra/m_totalCostIntra); 1315 getLCU(i).m_targetBitsLeft = iAvgBits; 1316 } 1317 } 1318 1319 1320 Double TEncRCPic::getLCUEstLambdaAndQP(Double bpp, Int clipPicQP, Int *estQP) 1321 { 1322 Int LCUIdx = getLCUCoded(); 1323 1324 Double alpha = m_encRCSeq->getPicPara( m_frameLevel ).m_alpha; 1325 Double beta = m_encRCSeq->getPicPara( m_frameLevel ).m_beta; 1326 1327 Double costPerPixel = getLCU(LCUIdx).m_costIntra/(Double)getLCU(LCUIdx).m_numberOfPixel; 1328 costPerPixel = pow(costPerPixel, BETA1); 1329 Double estLambda = calculateLambdaIntra(alpha, beta, costPerPixel, bpp); 1330 1331 Int clipNeighbourQP = g_RCInvalidQPValue; 1332 for (int i=LCUIdx-1; i>=0; i--) 1333 { 1334 if ((getLCU(i)).m_QP > g_RCInvalidQPValue) 1335 { 1336 clipNeighbourQP = getLCU(i).m_QP; 1337 break; 1338 } 1339 } 1340 1341 Int minQP = clipPicQP - 2; 1342 Int maxQP = clipPicQP + 2; 1343 1344 if ( clipNeighbourQP > g_RCInvalidQPValue ) 1345 { 1346 maxQP = min(clipNeighbourQP + 1, maxQP); 1347 minQP = max(clipNeighbourQP - 1, minQP); 1348 } 1349 1350 Double maxLambda=exp(((Double)(maxQP+0.49)-13.7122)/4.2005); 1351 Double minLambda=exp(((Double)(minQP-0.49)-13.7122)/4.2005); 1352 1353 estLambda = Clip3(minLambda, maxLambda, estLambda); 1354 1355 *estQP = Int( 4.2005 * log(estLambda) + 13.7122 + 0.5 ); 1356 *estQP = Clip3(minQP, maxQP, *estQP); 1357 1358 return estLambda; 1359 } 1360 #endif 930 1361 931 1362 TEncRateCtrl::TEncRateCtrl() … … 961 1392 } 962 1393 1394 #if M0036_RC_IMPROVEMENT 1395 Void TEncRateCtrl::init( Int totalFrames, Int targetBitrate, Int frameRate, Int GOPSize, Int picWidth, Int picHeight, Int LCUWidth, Int LCUHeight, Int keepHierBits, Bool useLCUSeparateModel, GOPEntry GOPList[MAX_GOP] ) 1396 #else 963 1397 Void TEncRateCtrl::init( Int totalFrames, Int targetBitrate, Int frameRate, Int GOPSize, Int picWidth, Int picHeight, Int LCUWidth, Int LCUHeight, Bool keepHierBits, Bool useLCUSeparateModel, GOPEntry GOPList[MAX_GOP] ) 1398 #endif 964 1399 { 965 1400 destroy(); … … 976 1411 977 1412 Int numberOfLevel = 1; 1413 #if M0036_RC_IMPROVEMENT 1414 Int adaptiveBit = 0; 1415 if ( keepHierBits > 0 ) 1416 #else 978 1417 if ( keepHierBits ) 1418 #endif 979 1419 { 980 1420 numberOfLevel = Int( log((Double)GOPSize)/log(2.0) + 0.5 ) + 1; … … 998 1438 } 999 1439 } 1440 1441 #if M0036_RC_IMPROVEMENT 1442 if ( keepHierBits > 0 ) 1443 #else 1000 1444 if ( keepHierBits ) 1445 #endif 1001 1446 { 1002 1447 Double bpp = (Double)( targetBitrate / (Double)( frameRate*picWidth*picHeight ) ); … … 1031 1476 bitsRatio[3] = 14; 1032 1477 } 1478 #if M0036_RC_IMPROVEMENT 1479 if ( keepHierBits == 2 ) 1480 { 1481 adaptiveBit = 1; 1482 } 1483 #endif 1033 1484 } 1034 1485 else if ( GOPSize == 8 && !isLowdelay ) … … 1078 1529 bitsRatio[7] = 1; 1079 1530 } 1531 #if M0036_RC_IMPROVEMENT 1532 if ( keepHierBits == 2 ) 1533 { 1534 adaptiveBit = 2; 1535 } 1536 #endif 1080 1537 } 1081 1538 else 1082 1539 { 1540 #if M0036_RC_IMPROVEMENT 1541 printf( "\n hierarchical bit allocation is not support for the specified coding structure currently.\n" ); 1542 #else 1083 1543 printf( "\n hierarchical bit allocation is not support for the specified coding structure currently." ); 1544 #endif 1084 1545 } 1085 1546 } … … 1094 1555 } 1095 1556 } 1557 #if M0036_RC_IMPROVEMENT 1558 if ( keepHierBits > 0 ) 1559 #else 1096 1560 if ( keepHierBits ) 1561 #endif 1097 1562 { 1098 1563 if ( GOPSize == 4 && isLowdelay ) … … 1129 1594 1130 1595 m_encRCSeq = new TEncRCSeq; 1596 #if M0036_RC_IMPROVEMENT 1597 m_encRCSeq->create( totalFrames, targetBitrate, frameRate, GOPSize, picWidth, picHeight, LCUWidth, LCUHeight, numberOfLevel, useLCUSeparateModel, adaptiveBit ); 1598 #else 1131 1599 m_encRCSeq->create( totalFrames, targetBitrate, frameRate, GOPSize, picWidth, picHeight, LCUWidth, LCUHeight, numberOfLevel, useLCUSeparateModel ); 1600 #endif 1132 1601 m_encRCSeq->initBitsRatio( bitsRatio ); 1133 1602 m_encRCSeq->initGOPID2Level( GOPID2Level ); -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncRateCtrl.h
r324 r537 65 65 const Double g_RCWeightPicTargetBitInGOP = 0.9; 66 66 const Double g_RCWeightPicRargetBitInBuffer = 1.0 - g_RCWeightPicTargetBitInGOP; 67 #if M0036_RC_IMPROVEMENT 68 const Int g_RCIterationNum = 20; 69 const Double g_RCWeightHistoryLambda = 0.5; 70 const Double g_RCWeightCurrentLambda = 1.0 - g_RCWeightHistoryLambda; 71 const Int g_RCLCUSmoothWindowSize = 4; 72 const Double g_RCAlphaMinValue = 0.05; 73 const Double g_RCAlphaMaxValue = 500.0; 74 const Double g_RCBetaMinValue = -3.0; 75 const Double g_RCBetaMaxValue = -0.1; 76 #endif 77 78 #if RATE_CONTROL_INTRA 79 #define ALPHA 6.7542; 80 #define BETA1 1.2517 81 #define BETA2 1.7860 82 #endif 67 83 68 84 struct TRCLCU … … 72 88 Int m_targetBits; 73 89 Double m_lambda; 90 #if M0036_RC_IMPROVEMENT 91 Double m_bitWeight; 92 #else 74 93 Double m_MAD; 94 #endif 75 95 Int m_numberOfPixel; 96 #if RATE_CONTROL_INTRA 97 Double m_costIntra; 98 Int m_targetBitsLeft; 99 #endif 76 100 }; 77 101 … … 89 113 90 114 public: 115 #if M0036_RC_IMPROVEMENT 116 Void create( Int totalFrames, Int targetBitrate, Int frameRate, Int GOPSize, Int picWidth, Int picHeight, Int LCUWidth, Int LCUHeight, Int numberOfLevel, Bool useLCUSeparateModel, Int adaptiveBit ); 117 #else 91 118 Void create( Int totalFrames, Int targetBitrate, Int frameRate, Int GOPSize, Int picWidth, Int picHeight, Int LCUWidth, Int LCUHeight, Int numberOfLevel, Bool useLCUSeparateModel ); 119 #endif 92 120 Void destroy(); 93 121 Void initBitsRatio( Int bitsRatio[] ); … … 96 124 Void initLCUPara( TRCParameter** LCUPara = NULL ); // NULL to initial with default value 97 125 Void updateAfterPic ( Int bits ); 126 #if !RATE_CONTROL_INTRA 98 127 Int getRefineBitsForIntra( Int orgBits ); 128 #endif 129 #if M0036_RC_IMPROVEMENT 130 Void setAllBitRatio( Double basicLambda, Double* equaCoeffA, Double* equaCoeffB ); 131 #endif 99 132 100 133 public: … … 134 167 Double getBetaUpdate() { return m_betaUpdate; } 135 168 169 #if M0036_RC_IMPROVEMENT 170 Int getAdaptiveBits() { return m_adaptiveBit; } 171 Double getLastLambda() { return m_lastLambda; } 172 Void setLastLambda( Double lamdba ) { m_lastLambda = lamdba; } 173 #endif 174 136 175 private: 137 176 Int m_totalFrames; … … 160 199 Double m_betaUpdate; 161 200 Bool m_useLCUSeparateModel; 201 202 #if M0036_RC_IMPROVEMENT 203 Int m_adaptiveBit; 204 Double m_lastLambda; 205 #endif 162 206 }; 163 207 … … 175 219 private: 176 220 Int xEstGOPTargetBits( TEncRCSeq* encRCSeq, Int GOPSize ); 221 #if M0036_RC_IMPROVEMENT 222 Void xCalEquaCoeff( TEncRCSeq* encRCSeq, Double* lambdaRatio, Double* equaCoeffA, Double* equaCoeffB, Int GOPSize ); 223 Double xSolveEqua( Double targetBpp, Double* equaCoeffA, Double* equaCoeffB, Int GOPSize ); 224 #endif 177 225 178 226 public: … … 203 251 Void destroy(); 204 252 253 #if !RATE_CONTROL_INTRA 205 254 Double estimatePicLambda( list<TEncRCPic*>& listPreviousPictures ); 255 #endif 206 256 Int estimatePicQP ( Double lambda, list<TEncRCPic*>& listPreviousPictures ); 257 #if RATE_CONTROL_INTRA 258 Int getRefineBitsForIntra(Int orgBits); 259 Double calculateLambdaIntra(double alpha, double beta, double MADPerPixel, double bitsPerPixel); 260 Double estimatePicLambda( list<TEncRCPic*>& listPreviousPictures, SliceType eSliceType); 261 262 Void updateAlphaBetaIntra(double *alpha, double *beta); 263 264 Double getLCUTargetBpp(SliceType eSliceType); 265 Double getLCUEstLambdaAndQP(Double bpp, Int clipPicQP, Int *estQP); 266 #else 207 267 Double getLCUTargetBpp(); 268 #endif 208 269 Double getLCUEstLambda( Double bpp ); 209 270 Int getLCUEstQP( Double lambda, Int clipPicQP ); 210 271 211 272 Void updateAfterLCU( Int LCUIdx, Int bits, Int QP, Double lambda, Bool updateLCUParameter = true ); 273 #if M0036_RC_IMPROVEMENT 274 #if RATE_CONTROL_INTRA 275 Void updateAfterPicture( Int actualHeaderBits, Int actualTotalBits, Double averageQP, Double averageLambda, SliceType eSliceType); 276 #else 277 Void updateAfterPicture( Int actualHeaderBits, Int actualTotalBits, Double averageQP, Double averageLambda ); 278 #endif 279 #else 212 280 Void updateAfterPicture( Int actualHeaderBits, Int actualTotalBits, Double averageQP, Double averageLambda, Double effectivePercentage ); 281 #endif 213 282 214 283 Void addToPictureLsit( list<TEncRCPic*>& listPreviousPictures ); 284 #if !M0036_RC_IMPROVEMENT 215 285 Double getEffectivePercentage(); 286 #endif 216 287 Double calAverageQP(); 217 288 Double calAverageLambda(); … … 229 300 Int getNumberOfLCU() { return m_numberOfLCU; } 230 301 Int getTargetBits() { return m_targetBits; } 302 #if !RATE_CONTROL_INTRA 231 303 Void setTargetBits( Int bits ) { m_targetBits = bits; } 304 #endif 232 305 Int getEstHeaderBits() { return m_estHeaderBits; } 233 306 Int getLCULeft() { return m_LCULeft; } … … 239 312 TRCLCU& getLCU( Int LCUIdx ) { return m_LCUs[LCUIdx]; } 240 313 Int getPicActualHeaderBits() { return m_picActualHeaderBits; } 314 #if !M0036_RC_IMPROVEMENT 241 315 Double getTotalMAD() { return m_totalMAD; } 242 316 Void setTotalMAD( Double MAD ) { m_totalMAD = MAD; } 317 #endif 318 #if RATE_CONTROL_INTRA 319 Void setTargetBits( Int bits ) { m_targetBits = bits; m_bitsLeft = bits;} 320 Void setTotalIntraCost(Double cost) { m_totalCostIntra = cost; } 321 Void getLCUInitTargetBits(); 322 #endif 323 243 324 Int getPicActualBits() { return m_picActualBits; } 244 325 Int getPicActualQP() { return m_picQP; } … … 267 348 TRCLCU* m_LCUs; 268 349 Int m_picActualHeaderBits; // only SH and potential APS 350 #if !M0036_RC_IMPROVEMENT 269 351 Double m_totalMAD; 352 #endif 353 #if RATE_CONTROL_INTRA 354 Double m_totalCostIntra; 355 Double m_remainingCostIntra; 356 #endif 270 357 Int m_picActualBits; // the whole picture, including header 271 358 Int m_picQP; // in integer form 272 359 Double m_picLambda; 360 #if !M0036_RC_IMPROVEMENT 273 361 TEncRCPic* m_lastPicture; 362 #endif 274 363 }; 275 364 … … 281 370 282 371 public: 372 #if M0036_RC_IMPROVEMENT 373 Void init( Int totalFrames, Int targetBitrate, Int frameRate, Int GOPSize, Int picWidth, Int picHeight, Int LCUWidth, Int LCUHeight, Int keepHierBits, Bool useLCUSeparateModel, GOPEntry GOPList[MAX_GOP] ); 374 #else 283 375 Void init( Int totalFrames, Int targetBitrate, Int frameRate, Int GOPSize, Int picWidth, Int picHeight, Int LCUWidth, Int LCUHeight, Bool keepHierBits, Bool useLCUSeparateModel, GOPEntry GOPList[MAX_GOP] ); 376 #endif 284 377 Void destroy(); 285 378 Void initRCPic( Int frameLevel ); -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp
r446 r537 299 299 m_iTypePartBest[iPartIdx] = -1; 300 300 if( m_bUseSBACRD ) 301 { 301 302 m_pcRDGoOnSbacCoder->store( m_pppcRDSbacCoder[pOnePart->PartLevel][CI_TEMP_BEST] ); 303 } 302 304 } 303 305 } -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSearch.cpp
r532 r537 1067 1067 } 1068 1068 #endif 1069 1070 1069 // save prediction 1071 1070 if(default0Save1Load2 == 1) … … 1427 1426 #if H_3D_DIM_ENC 1428 1427 , Bool zeroResi 1429 #endif 1430 1428 #endif 1429 ) 1431 1430 { 1432 1431 UInt uiFullDepth = pcCU->getDepth( 0 ) + uiTrDepth; … … 1436 1435 1437 1436 #if HHI_RQT_INTRA_SPEEDUP 1438 #if L0232_RD_PENALTY1439 1437 Int maxTuSize = pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize(); 1440 1438 Int isIntraSlice = (pcCU->getSlice()->getSliceType() == I_SLICE); … … 1453 1451 } 1454 1452 if( bCheckFirst && noSplitIntraMaxTuSize ) 1453 { 1454 bCheckSplit = false; 1455 } 1455 1456 #else 1456 if( bCheckFirst && bCheckFull )1457 #endif1458 {1459 bCheckSplit = false;1460 }1461 #else1462 #if L0232_RD_PENALTY1463 1457 Int maxTuSize = pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize(); 1464 1458 Int isIntraSlice = (pcCU->getSlice()->getSliceType() == I_SLICE); … … 1469 1463 } 1470 1464 #endif 1471 #endif1472 1465 #if H_3D_DIM 1473 1466 if( isDimMode( pcCU->getLumaIntraDir( uiAbsPartIdx ) ) ) … … 1476 1469 } 1477 1470 #endif 1478 1479 1471 Double dSingleCost = MAX_DOUBLE; 1480 1472 #if H_3D_VSO … … 1667 1659 //----- determine rate and r-d cost ----- 1668 1660 UInt uiSingleBits = xGetIntraBitsQT( pcCU, uiTrDepth, uiAbsPartIdx, true, !bLumaOnly, false ); 1669 #if L0232_RD_PENALTY1670 1661 if(m_pcEncCfg->getRDpenalty() && (uiLog2TrSize==5) && !isIntraSlice) 1671 1662 { 1672 1663 uiSingleBits=uiSingleBits*4; 1673 1664 } 1674 #endif1675 1665 #if H_3D_VSO // M40 1676 1666 if ( m_pcRdCost->getUseLambdaScaleVSO()) … … 1823 1813 } 1824 1814 } 1825 1826 1815 #if H_3D_VSO // M42 1827 1816 if ( m_pcRdCost->getUseRenModel() && bCheckFull ) … … 1836 1825 } 1837 1826 #endif 1838 1839 1827 ruiDistY += uiSingleDistY; 1840 1828 ruiDistC += uiSingleDistC; … … 2788 2776 2789 2777 UInt iModeBits = xModeBitsIntra( pcCU, uiMode, uiPU, uiPartOffset, uiDepth, uiInitTrDepth ); 2790 2791 2792 2778 #if H_3D_VSO // M35 2793 2779 #if H_3D_VSO_FIX // This fix should be enabled after verification … … 2924 2910 } 2925 2911 #endif 2926 2927 2912 //===== check modes (using r-d costs) ===== 2928 2913 #if HHI_RQT_INTRA_SPEEDUP_MOD … … 3112 3097 UInt uiPUDistC = 0; 3113 3098 Double dPUCost = 0.0; 3114 3115 3099 #if H_3D_VSO // M37 3116 3100 // reset Model … … 3164 3148 { 3165 3149 #endif 3166 3167 //--- update transform index and cbf --- 3150 //--- update transform index and cbf --- 3168 3151 UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> ( ( pcCU->getDepth(0) + uiInitTrDepth ) << 1 ); 3169 3152 ::memcpy( pcCU->getTransformIdx() + uiPartOffset, m_puhQTTempTrIdx, uiQPartNum * sizeof( UChar ) ); … … 3764 3747 UInt uiBitsTempL0[MAX_NUM_REF]; 3765 3748 3766 #if L0034_COMBINED_LIST_CLEANUP3767 3749 TComMv mvValidList1; 3768 3750 Int refIdxValidList1 = 0; 3769 3751 UInt bitsValidList1 = MAX_UINT; 3770 3752 UInt costValidList1 = MAX_UINT; 3771 #endif3772 3753 3773 3754 xGetBlkBits( ePartSize, pcCU->getSlice()->isInterP(), iPartIdx, uiLastMode, uiMbBits); … … 3821 3802 uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdx[iRefList][iRefIdxTemp]][AMVP_MAX_NUM_CANDS]; 3822 3803 #if ZERO_MVD_EST 3823 #if L0034_COMBINED_LIST_CLEANUP3824 3804 if ( iRefList == 0 || pcCU->getSlice()->getList1IdxToList0Idx( iRefIdxTemp ) < 0 ) 3825 #else3826 if ((iRefList != 1 || !pcCU->getSlice()->getNoBackPredFlag()) &&3827 (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) <= 0 || pcCU->getSlice()->getRefIdxOfLC(eRefPicList, iRefIdxTemp)>=0))3828 #endif3829 3805 { 3830 3806 uiZeroMvdBitsTemp = uiBitsTemp; … … 3846 3822 3847 3823 #if GPB_SIMPLE_UNI 3848 #if L0034_COMBINED_LIST_CLEANUP3849 3824 if ( iRefList == 1 ) // list 1 3850 3825 { … … 3871 3846 } 3872 3847 #else 3873 if ( pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0)3874 {3875 if ( iRefList && ( pcCU->getSlice()->getNoBackPredFlag() || (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && !pcCU->getSlice()->getNoBackPredFlag() && pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)>=0 ) ) )3876 {3877 if ( pcCU->getSlice()->getNoBackPredFlag() )3878 {3879 cMvTemp[1][iRefIdxTemp] = cMvTemp[0][iRefIdxTemp];3880 uiCostTemp = uiCostTempL0[iRefIdxTemp];3881 /*first subtract the bit-rate part of the cost of the other list*/3882 uiCostTemp -= m_pcRdCost->getCost( uiBitsTempL0[iRefIdxTemp] );3883 }3884 else3885 {3886 cMvTemp[1][iRefIdxTemp] = cMvTemp[0][pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)];3887 uiCostTemp = uiCostTempL0[pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)];3888 /*first subtract the bit-rate part of the cost of the other list*/3889 uiCostTemp -= m_pcRdCost->getCost( uiBitsTempL0[pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)] );3890 }3891 /*correct the bit-rate part of the current ref*/3892 m_pcRdCost->setPredictor ( cMvPred[iRefList][iRefIdxTemp] );3893 uiBitsTemp += m_pcRdCost->getBits( cMvTemp[1][iRefIdxTemp].getHor(), cMvTemp[1][iRefIdxTemp].getVer() );3894 /*calculate the correct cost*/3895 uiCostTemp += m_pcRdCost->getCost( uiBitsTemp );3896 }3897 else3898 {3899 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp );3900 }3901 }3902 else3903 {3904 if (iRefList && pcCU->getSlice()->getNoBackPredFlag())3905 {3906 uiCostTemp = MAX_UINT;3907 cMvTemp[1][iRefIdxTemp] = cMvTemp[0][iRefIdxTemp];3908 }3909 else3910 {3911 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp );3912 }3913 }3914 #endif3915 #else3916 3848 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp ); 3917 3849 #endif … … 3919 3851 xCheckBestMVP(pcCU, eRefPicList, cMvTemp[iRefList][iRefIdxTemp], cMvPred[iRefList][iRefIdxTemp], aaiMvpIdx[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp); 3920 3852 3921 #if L0034_COMBINED_LIST_CLEANUP3922 3853 if ( iRefList == 0 ) 3923 3854 { … … 3944 3875 refIdxValidList1 = iRefIdxTemp; 3945 3876 } 3946 #else3947 if(pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && !pcCU->getSlice()->getNoBackPredFlag())3948 {3949 if(iRefList==REF_PIC_LIST_0)3950 {3951 uiCostTempL0[iRefIdxTemp] = uiCostTemp;3952 uiBitsTempL0[iRefIdxTemp] = uiBitsTemp;3953 if(pcCU->getSlice()->getRefIdxOfLC(REF_PIC_LIST_0, iRefIdxTemp)<0)3954 {3955 uiCostTemp = MAX_UINT;3956 }3957 }3958 else3959 {3960 if(pcCU->getSlice()->getRefIdxOfLC(REF_PIC_LIST_1, iRefIdxTemp)<0)3961 {3962 uiCostTemp = MAX_UINT;3963 }3964 }3965 }3966 3967 if ( ( iRefList == 0 && uiCostTemp < uiCost[iRefList] ) ||3968 ( iRefList == 1 && pcCU->getSlice()->getNoBackPredFlag() && iRefIdxTemp == iRefIdx[0] ) ||3969 ( iRefList == 1 && (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0) && (iRefIdxTemp==0 || iRefIdxTemp == iRefIdx[0]) && !pcCU->getSlice()->getNoBackPredFlag() && (iRefIdxTemp == pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)) ) ||3970 ( iRefList == 1 && !pcCU->getSlice()->getNoBackPredFlag() && uiCostTemp < uiCost[iRefList] ) )3971 {3972 uiCost[iRefList] = uiCostTemp;3973 uiBits[iRefList] = uiBitsTemp; // storing for bi-prediction3974 3975 // set motion3976 cMv[iRefList] = cMvTemp[iRefList][iRefIdxTemp];3977 iRefIdx[iRefList] = iRefIdxTemp;3978 pcCU->getCUMvField(eRefPicList)->setAllMv( cMv[iRefList], ePartSize, uiPartAddr, 0, iPartIdx );3979 pcCU->getCUMvField(eRefPicList)->setAllRefIdx( iRefIdx[iRefList], ePartSize, uiPartAddr, 0, iPartIdx );3980 3981 if(!pcCU->getSlice()->getMvdL1ZeroFlag())3982 {3983 // storing list 1 prediction signal for iterative bi-directional prediction3984 if ( eRefPicList == REF_PIC_LIST_1 )3985 {3986 TComYuv* pcYuvPred = &m_acYuvPred[iRefList];3987 motionCompensation ( pcCU, pcYuvPred, eRefPicList, iPartIdx );3988 }3989 if ( (pcCU->getSlice()->getNoBackPredFlag() || (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(0)==0 )) && eRefPicList == REF_PIC_LIST_0 )3990 {3991 TComYuv* pcYuvPred = &m_acYuvPred[iRefList];3992 motionCompensation ( pcCU, pcYuvPred, eRefPicList, iPartIdx );3993 }3994 }3995 }3996 #endif3997 3877 } 3998 3878 } … … 4058 3938 4059 3939 Int iRefList = iIter % 2; 4060 #if L0034_COMBINED_LIST_CLEANUP4061 3940 if ( m_pcEncCfg->getUseFastEnc() ) 4062 3941 { … … 4081 3960 motionCompensation ( pcCU, pcYuvPred, RefPicList(1-iRefList), iPartIdx ); 4082 3961 } 4083 #else4084 if ( m_pcEncCfg->getUseFastEnc() && (pcCU->getSlice()->getNoBackPredFlag() || (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(0)==0 )) )4085 {4086 iRefList = 1;4087 }4088 #endif4089 3962 RefPicList eRefPicList = ( iRefList ? REF_PIC_LIST_1 : REF_PIC_LIST_0 ); 4090 3963 … … 4221 4094 UInt uiMEBits = 0; 4222 4095 // Set Motion Field_ 4223 #if L0034_COMBINED_LIST_CLEANUP4224 4096 cMv[1] = mvValidList1; 4225 4097 iRefIdx[1] = refIdxValidList1; 4226 4098 uiBits[1] = bitsValidList1; 4227 4099 uiCost[1] = costValidList1; 4228 #else4229 if ( pcCU->getSlice()->getNoBackPredFlag() || (pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(0)==0 ) )4230 {4231 uiCost[1] = MAX_UINT;4232 }4233 #endif4234 4100 #if AMP_MRG 4235 4101 if (bTestNormalMC) -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSlice.cpp
r521 r537 475 475 #endif 476 476 477 #if L0386_DB_METRIC478 477 if ( m_pcCfg->getDeblockingFilterMetric() ) 479 478 { … … 483 482 rpcSlice->setDeblockingFilterTcOffsetDiv2( 0 ); 484 483 } else 485 #endif486 484 if (rpcSlice->getPPS()->getDeblockingFilterControlPresentFlag()) 487 485 { … … 560 558 // store lambda 561 559 slice->setSliceQp( sliceQP ); 562 #if L0033_RC_BUGFIX563 560 slice->setSliceQpBase ( sliceQP ); 564 #endif565 561 m_pcRdCost ->setLambda( lambda ); 566 562 #if WEIGHTED_CHROMA_DISTORTION … … 876 872 /** \param rpcPic picture class 877 873 */ 874 #if RATE_CONTROL_INTRA 875 Void TEncSlice::calCostSliceI(TComPic*& rpcPic) 876 { 877 UInt uiCUAddr; 878 UInt uiStartCUAddr; 879 UInt uiBoundingCUAddr; 880 Int iSumHad, shift = g_bitDepthY-8, offset = (shift>0)?(1<<(shift-1)):0;; 881 Double iSumHadSlice = 0; 882 883 rpcPic->getSlice(getSliceIdx())->setSliceSegmentBits(0); 884 TComSlice* pcSlice = rpcPic->getSlice(getSliceIdx()); 885 xDetermineStartAndBoundingCUAddr ( uiStartCUAddr, uiBoundingCUAddr, rpcPic, false ); 886 887 UInt uiEncCUOrder; 888 uiCUAddr = rpcPic->getPicSym()->getCUOrderMap( uiStartCUAddr /rpcPic->getNumPartInCU()); 889 for( uiEncCUOrder = uiStartCUAddr/rpcPic->getNumPartInCU(); 890 uiEncCUOrder < (uiBoundingCUAddr+(rpcPic->getNumPartInCU()-1))/rpcPic->getNumPartInCU(); 891 uiCUAddr = rpcPic->getPicSym()->getCUOrderMap(++uiEncCUOrder) ) 892 { 893 // initialize CU encoder 894 TComDataCU*& pcCU = rpcPic->getCU( uiCUAddr ); 895 pcCU->initCU( rpcPic, uiCUAddr ); 896 897 Int height = min( pcSlice->getSPS()->getMaxCUHeight(),pcSlice->getSPS()->getPicHeightInLumaSamples() - uiCUAddr / rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUHeight() ); 898 Int width = min( pcSlice->getSPS()->getMaxCUWidth(),pcSlice->getSPS()->getPicWidthInLumaSamples() - uiCUAddr % rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUWidth() ); 899 900 iSumHad = m_pcCuEncoder->updateLCUDataISlice(pcCU, uiCUAddr, width, height); 901 902 (m_pcRateCtrl->getRCPic()->getLCU(uiCUAddr)).m_costIntra=(iSumHad+offset)>>shift; 903 iSumHadSlice += (m_pcRateCtrl->getRCPic()->getLCU(uiCUAddr)).m_costIntra; 904 905 } 906 m_pcRateCtrl->getRCPic()->setTotalIntraCost(iSumHadSlice); 907 } 908 #endif 909 878 910 Void TEncSlice::compressSlice( TComPic*& rpcPic ) 879 911 { … … 1161 1193 Double bpp = -1.0; 1162 1194 1195 #if M0036_RC_IMPROVEMENT 1196 if ( ( rpcPic->getSlice( 0 )->getSliceType() == I_SLICE && m_pcCfg->getForceIntraQP() ) || !m_pcCfg->getLCULevelRC() ) 1197 #else 1163 1198 if ( rpcPic->getSlice( 0 )->getSliceType() == I_SLICE || !m_pcCfg->getLCULevelRC() ) 1199 #endif 1164 1200 { 1165 1201 estQP = pcSlice->getSliceQp(); … … 1167 1203 else 1168 1204 { 1205 #if RATE_CONTROL_INTRA 1206 bpp = m_pcRateCtrl->getRCPic()->getLCUTargetBpp(pcSlice->getSliceType()); 1207 if ( rpcPic->getSlice( 0 )->getSliceType() == I_SLICE) 1208 { 1209 estLambda = m_pcRateCtrl->getRCPic()->getLCUEstLambdaAndQP(bpp, pcSlice->getSliceQp(), &estQP); 1210 } 1211 else 1212 { 1213 estLambda = m_pcRateCtrl->getRCPic()->getLCUEstLambda( bpp ); 1214 estQP = m_pcRateCtrl->getRCPic()->getLCUEstQP ( estLambda, pcSlice->getSliceQp() ); 1215 } 1216 #else 1169 1217 bpp = m_pcRateCtrl->getRCPic()->getLCUTargetBpp(); 1170 1218 estLambda = m_pcRateCtrl->getRCPic()->getLCUEstLambda( bpp ); 1171 1219 estQP = m_pcRateCtrl->getRCPic()->getLCUEstQP ( estLambda, pcSlice->getSliceQp() ); 1220 #endif 1221 1172 1222 estQP = Clip3( -pcSlice->getSPS()->getQpBDOffsetY(), MAX_QP, estQP ); 1173 1223 1174 1224 m_pcRdCost->setLambda(estLambda); 1225 #if M0036_RC_IMPROVEMENT 1226 #if RDOQ_CHROMA_LAMBDA 1227 // set lambda for RDOQ 1228 Double weight=m_pcRdCost->getChromaWeight(); 1229 m_pcTrQuant->setLambda( estLambda, estLambda / weight ); 1230 #else 1231 m_pcTrQuant->setLambda( estLambda ); 1232 #endif 1233 #endif 1175 1234 } 1176 1235 1177 1236 m_pcRateCtrl->setRCQP( estQP ); 1178 #if L0033_RC_BUGFIX1179 1237 pcCU->getSlice()->setSliceQpBase( estQP ); 1180 #endif1181 1238 } 1182 1239 #endif … … 1185 1242 m_pcCuEncoder->compressCU( pcCU ); 1186 1243 1244 #if !TICKET_1090_FIX 1187 1245 #if RATE_CONTROL_LAMBDA_DOMAIN 1188 1246 if ( m_pcCfg->getUseRateCtrl() ) 1189 1247 { 1248 #if !M0036_RC_IMPROVEMENT 1190 1249 UInt SAD = m_pcCuEncoder->getLCUPredictionSAD(); 1191 1250 Int height = min( pcSlice->getSPS()->getMaxCUHeight(),pcSlice->getSPS()->getPicHeightInLumaSamples() - uiCUAddr / rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUHeight() ); … … 1194 1253 MAD = MAD * MAD; 1195 1254 ( m_pcRateCtrl->getRCPic()->getLCU(uiCUAddr) ).m_MAD = MAD; 1255 #endif 1196 1256 1197 1257 Int actualQP = g_RCInvalidQPValue; … … 1217 1277 } 1218 1278 m_pcRdCost->setLambda(oldLambda); 1219 1279 #if RATE_CONTROL_INTRA 1280 m_pcRateCtrl->getRCPic()->updateAfterLCU( m_pcRateCtrl->getRCPic()->getLCUCoded(), actualBits, actualQP, actualLambda, 1281 pcCU->getSlice()->getSliceType() == I_SLICE ? 0 : m_pcCfg->getLCULevelRC() ); 1282 #else 1220 1283 m_pcRateCtrl->getRCPic()->updateAfterLCU( m_pcRateCtrl->getRCPic()->getLCUCoded(), actualBits, actualQP, actualLambda, m_pcCfg->getLCULevelRC() ); 1221 } 1284 #endif 1285 } 1286 #endif 1222 1287 #endif 1223 1288 … … 1253 1318 } 1254 1319 } 1320 1321 #if TICKET_1090_FIX 1322 #if RATE_CONTROL_LAMBDA_DOMAIN 1323 if ( m_pcCfg->getUseRateCtrl() ) 1324 { 1325 #if !M0036_RC_IMPROVEMENT 1326 UInt SAD = m_pcCuEncoder->getLCUPredictionSAD(); 1327 Int height = min( pcSlice->getSPS()->getMaxCUHeight(),pcSlice->getSPS()->getPicHeightInLumaSamples() - uiCUAddr / rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUHeight() ); 1328 Int width = min( pcSlice->getSPS()->getMaxCUWidth(),pcSlice->getSPS()->getPicWidthInLumaSamples() - uiCUAddr % rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUWidth() ); 1329 Double MAD = (Double)SAD / (Double)(height * width); 1330 MAD = MAD * MAD; 1331 ( m_pcRateCtrl->getRCPic()->getLCU(uiCUAddr) ).m_MAD = MAD; 1332 #endif 1333 1334 Int actualQP = g_RCInvalidQPValue; 1335 Double actualLambda = m_pcRdCost->getLambda(); 1336 Int actualBits = pcCU->getTotalBits(); 1337 Int numberOfEffectivePixels = 0; 1338 for ( Int idx = 0; idx < rpcPic->getNumPartInCU(); idx++ ) 1339 { 1340 if ( pcCU->getPredictionMode( idx ) != MODE_NONE && ( !pcCU->isSkipped( idx ) ) ) 1341 { 1342 numberOfEffectivePixels = numberOfEffectivePixels + 16; 1343 break; 1344 } 1345 } 1346 1347 if ( numberOfEffectivePixels == 0 ) 1348 { 1349 actualQP = g_RCInvalidQPValue; 1350 } 1351 else 1352 { 1353 actualQP = pcCU->getQP( 0 ); 1354 } 1355 m_pcRdCost->setLambda(oldLambda); 1356 1357 #if RATE_CONTROL_INTRA 1358 m_pcRateCtrl->getRCPic()->updateAfterLCU( m_pcRateCtrl->getRCPic()->getLCUCoded(), actualBits, actualQP, actualLambda, 1359 pcCU->getSlice()->getSliceType() == I_SLICE ? 0 : m_pcCfg->getLCULevelRC() ); 1360 #else 1361 m_pcRateCtrl->getRCPic()->updateAfterLCU( m_pcRateCtrl->getRCPic()->getLCUCoded(), actualBits, actualQP, actualLambda, m_pcCfg->getLCULevelRC() ); 1362 #endif 1363 } 1364 #endif 1365 #endif 1255 1366 } 1256 1367 // other case: encodeCU is not called -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSlice.h
r481 r537 131 131 Void precompressSlice ( TComPic*& rpcPic ); ///< precompress slice for multi-loop opt. 132 132 Void compressSlice ( TComPic*& rpcPic ); ///< analysis stage of slice 133 #if RATE_CONTROL_INTRA 134 Void calCostSliceI ( TComPic*& rpcPic ); 135 #endif 133 136 Void encodeSlice ( TComPic*& rpcPic, TComOutputBitstream* pcSubstreams ); 134 137 -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncTop.cpp
r534 r537 293 293 // This seems to be incorrect, but irrelevant for the MV-HEVC 294 294 *(m_cVPS->getPTL()) = *m_cSPS.getPTL(); 295 #if L0043_TIMING_INFO296 295 m_cVPS->getTimingInfo()->setTimingInfoPresentFlag ( false ); 297 #endif298 296 #else 299 297 *m_cVPS.getPTL() = *m_cSPS.getPTL(); 300 301 #if L0043_TIMING_INFO302 298 m_cVPS.getTimingInfo()->setTimingInfoPresentFlag ( false ); 303 #endif304 299 #endif 305 300 // initialize PPS … … 532 527 profileTierLevel.setProfileIdc(m_profile); 533 528 profileTierLevel.setProfileCompatibilityFlag(m_profile, 1); 534 #if L0046_CONSTRAINT_FLAGS535 529 profileTierLevel.setProgressiveSourceFlag(m_progressiveSourceFlag); 536 530 profileTierLevel.setInterlacedSourceFlag(m_interlacedSourceFlag); 537 531 profileTierLevel.setNonPackedConstraintFlag(m_nonPackedConstraintFlag); 538 532 profileTierLevel.setFrameOnlyConstraintFlag(m_frameOnlyConstraintFlag); 539 #endif540 533 541 534 if (m_profile == Profile::MAIN10 && g_bitDepthY == 8 && g_bitDepthC == 8) … … 584 577 585 578 m_cSPS.setMaxTrSize ( 1 << m_uiQuadtreeTULog2MaxSize ); 586 #if !L0034_COMBINED_LIST_CLEANUP587 m_cSPS.setUseLComb ( m_bUseLComb );588 #endif589 579 590 580 Int i; … … 651 641 pcVUI->setFieldSeqFlag(false); 652 642 pcVUI->setHrdParametersPresentFlag(false); 653 #if L0043_TIMING_INFO654 643 pcVUI->getTimingInfo()->setPocProportionalToTimingFlag(getPocProportionalToTimingFlag()); 655 644 pcVUI->getTimingInfo()->setNumTicksPocDiffOneMinus1 (getNumTicksPocDiffOneMinus1() ); 656 #else657 pcVUI->setPocProportionalToTimingFlag(getPocProportionalToTimingFlag());658 pcVUI->setNumTicksPocDiffOneMinus1 (getNumTicksPocDiffOneMinus1() );659 #endif660 645 pcVUI->setBitstreamRestrictionFlag(getBitstreamRestrictionFlag()); 661 646 pcVUI->setTilesFixedStructureFlag(getTilesFixedStructureFlag()); … … 790 775 } 791 776 } 792 #if L0323_LIMIT_DEFAULT_LIST_SIZE793 777 assert(bestPos <= 15); 794 #endif795 778 m_cPPS.setNumRefIdxL0DefaultActive(bestPos); 796 779 m_cPPS.setNumRefIdxL1DefaultActive(bestPos); … … 1047 1030 } 1048 1031 1049 #if L0208_SOP_DESCRIPTION_SEI1050 1032 Int TEncTop::getReferencePictureSetIdxForSOP(TComSlice* slice, Int POCCurr, Int GOPid ) 1051 1033 { … … 1077 1059 return rpsIdx; 1078 1060 } 1079 #endif1080 1061 1081 1062 Void TEncTop::xInitPPSforTiles() -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncTop.h
r479 r537 188 188 TComPPS* getPPS () { return &m_cPPS; } 189 189 Void selectReferencePictureSet(TComSlice* slice, Int POCCurr, Int GOPid ); 190 #if L0208_SOP_DESCRIPTION_SEI191 190 Int getReferencePictureSetIdxForSOP(TComSlice* slice, Int POCCurr, Int GOPid ); 192 #endif193 191 TComScalingList* getScalingList () { return &m_scalingList; } 194 192 #if H_MV
Note: See TracChangeset for help on using the changeset viewer.