Changeset 77 in 3DVCSoftware for trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
- Timestamp:
- 14 Jun 2012, 16:38:29 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
r56 r77 375 375 } 376 376 377 #if VIDYO_VPS_INTEGRATION 378 Void TEncCavlc::codeVPS( TComVPS* pcVPS ) 379 { 380 WRITE_CODE( pcVPS->getMaxTLayers() - 1, 3, "max_temporal_layers_minus1" ); 381 WRITE_CODE( pcVPS->getMaxLayers() - 1, 5, "max_layers_minus1" ); 382 WRITE_FLAG( pcVPS->getTemporalNestingFlag() - 1, "temporal_id_nesting_flag" ); 383 WRITE_UVLC( pcVPS->getVPSId(), "video_parameter_set_id" ); 384 for(UInt i=0; i <= pcVPS->getMaxTLayers()-1; i++) 385 { 386 WRITE_UVLC( pcVPS->getMaxDecPicBuffering(i), "max_dec_pic_buffering[i]" ); 387 WRITE_UVLC( pcVPS->getNumReorderPics(i), "num_reorder_pics[i]" ); 388 WRITE_UVLC( pcVPS->getMaxLatencyIncrease(i), "max_latency_increase[i]" ); 389 } 390 391 WRITE_CODE( 1, 1, "bit_equal_to_one" ); 392 393 if( pcVPS->getMaxLayers() - 1 > 0 ) 394 { 395 WRITE_UVLC( pcVPS->getExtensionType(), "extension_type" ); 396 397 for(UInt i=1; i <= pcVPS->getMaxLayers()-1; i++) 398 { 399 WRITE_FLAG( pcVPS->getDependentFlag(i), "dependent_flag[i]" ); 400 if( pcVPS->getDependentFlag(i) ) 401 { 402 WRITE_UVLC( i - pcVPS->getDependentLayer(i) - 1, "delta_reference_layer_id_minus1[i]" ); 403 if( pcVPS->getExtensionType() == VPS_EXTENSION_TYPE_MULTI_VIEW ) 404 { 405 WRITE_UVLC( pcVPS->getViewId(i), "view_id[i]" ); 406 WRITE_FLAG( pcVPS->getDepthFlag(i), "depth_flag[i]" ); 407 WRITE_SVLC( pcVPS->getViewOrderIdx(i), "view_order_idx[i]" ); 408 } 409 410 } 411 } 412 } 413 414 WRITE_FLAG( 0, "vps_extension_flag" ); 415 416 //future extensions here.. 417 418 return; 419 } 420 #endif 421 377 422 #if HHI_MPI 378 423 Void TEncCavlc::codeSPS( TComSPS* pcSPS, Bool bIsDepth ) … … 388 433 WRITE_CODE( pcSPS->getLevelIdc (), 8, "level_idc" ); 389 434 WRITE_UVLC( pcSPS->getSPSId (), "seq_parameter_set_id" ); 435 #if VIDYO_VPS_INTEGRATION 436 WRITE_UVLC( pcSPS->getVPSId (), "video_parameter_set_id" ); 437 #endif 390 438 WRITE_UVLC( pcSPS->getChromaFormatIdc (), "chroma_format_idc" ); 391 439 WRITE_CODE( pcSPS->getMaxTLayers() - 1, 3, "max_temporal_layers_minus1" ); … … 727 775 { 728 776 WRITE_CODE( (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC()))%(1<<pcSlice->getSPS()->getBitsForPOC()), pcSlice->getSPS()->getBitsForPOC(), "pic_order_cnt_lsb"); 729 730 if( pcSlice->get NalUnitType() != NAL_UNIT_CODED_SLICE_IDV )777 #if HHI_FIX 778 if( pcSlice->getPOC() == 0 && pcSlice->getNalUnitType() != NAL_UNIT_CODED_SLICE_IDV ) 731 779 { 732 780 TComReferencePictureSet* rps = pcSlice->getRPS(); … … 799 847 } 800 848 } 849 if( pcSlice->getPOC() != 0 ) 850 #else 851 if( pcSlice->getNalUnitType() != NAL_UNIT_CODED_SLICE_IDV ) 852 #endif 853 { 854 TComReferencePictureSet* rps = pcSlice->getRPS(); 855 if(pcSlice->getRPSidx() < 0) 856 { 857 WRITE_FLAG( 0, "short_term_ref_pic_set_sps_flag"); 858 #if RPS_IN_SPS 859 codeShortTermRefPicSet(pcSlice->getSPS(), rps); 860 #else 861 codeShortTermRefPicSet(pcSlice->getPPS(), rps); 862 #endif 863 } 864 else 865 { 866 WRITE_FLAG( 1, "short_term_ref_pic_set_sps_flag"); 867 WRITE_UVLC( pcSlice->getRPSidx(), "short_term_ref_pic_set_idx" ); 868 } 869 #if RPS_IN_SPS 870 if(pcSlice->getSPS()->getLongTermRefsPresent()) 871 #else 872 if(pcSlice->getPPS()->getLongTermRefsPresent()) 873 #endif 874 { 875 WRITE_UVLC( rps->getNumberOfLongtermPictures(), "num_long_term_pics"); 876 Int maxPocLsb = 1<<pcSlice->getSPS()->getBitsForPOC(); 877 Int prev = 0; 878 #if LTRP_MULT 879 Int prevDeltaPocLt=0; 880 Int currDeltaPocLt=0; 881 #endif 882 for(Int i=rps->getNumberOfPictures()-1 ; i > rps->getNumberOfPictures()-rps->getNumberOfLongtermPictures()-1; i--) 883 { 884 WRITE_UVLC((maxPocLsb-rps->getDeltaPOC(i)+prev)%maxPocLsb, "delta_poc_lsb_lt"); 885 886 #if LTRP_MULT 887 currDeltaPocLt=((maxPocLsb-rps->getDeltaPOC(i)+prev)%maxPocLsb)+prevDeltaPocLt; 888 889 Int deltaMsbCycle=0; 890 if( (i==(rps->getNumberOfPictures()-1)) ) 891 { 892 deltaMsbCycle=((-rps->getDeltaPOC(i))/maxPocLsb)-1; 893 } 894 else if( prevDeltaPocLt!=currDeltaPocLt ) 895 { 896 deltaMsbCycle=((-rps->getDeltaPOC(i))/maxPocLsb)-1; 897 if( ((prevDeltaPocLt==maxPocLsb-1) && (currDeltaPocLt==maxPocLsb+1)) || ((prevDeltaPocLt==maxPocLsb-2) && (currDeltaPocLt==maxPocLsb))) 898 { 899 deltaMsbCycle=deltaMsbCycle-1; 900 } 901 } 902 else 903 { 904 deltaMsbCycle=((rps->getDeltaPOC(i+1)-rps->getDeltaPOC(i))/maxPocLsb)-1; 905 } 906 907 if(deltaMsbCycle>=0) 908 { 909 WRITE_FLAG( 1, "delta_poc_msb_present_flag"); 910 WRITE_UVLC(deltaMsbCycle, "delta_poc_msb_cycle_lt_minus1"); 911 } 912 else 913 { 914 WRITE_FLAG( 0, "delta_poc_msb_present_flag"); 915 } 916 prevDeltaPocLt=currDeltaPocLt; 917 #endif 918 prev = rps->getDeltaPOC(i); 919 WRITE_FLAG( rps->getUsed(i), "used_by_curr_pic_lt_flag"); 920 } 921 } 922 } 801 923 } 802 924
Note: See TracChangeset for help on using the changeset viewer.