Changeset 537 in 3DVCSoftware for branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCavlc.cpp
- Timestamp:
- 13 Jul 2013, 15:51:26 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset for help on using the changeset viewer.