Changeset 296 in 3DVCSoftware for trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
- Timestamp:
- 20 Feb 2013, 22:07:43 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
r210 r296 161 161 //DF flag 162 162 WRITE_FLAG(pcAPS->getLoopFilterOffsetInAPS()?1:0, "aps_deblocking_filter_flag"); 163 #if !SAO_UNIT_INTERLEAVING 164 //SAO flag 165 WRITE_FLAG( pcAPS->getSaoEnabled()?1:0, "aps_sample_adaptive_offset_flag"); 166 #endif 167 #if !LCU_SYNTAX_ALF 168 //ALF flag 169 WRITE_FLAG( pcAPS->getAlfEnabled()?1:0, "aps_adaptive_loop_filter_flag"); 170 #endif 171 } 172 #if LCU_SYNTAX_ALF 163 } 173 164 Void TEncCavlc::codeAPSAlflag(UInt uiCode) 174 165 { 175 166 WRITE_FLAG(uiCode, "aps_adaptive_loop_filter_flag"); 176 167 } 177 #endif178 168 179 169 Void TEncCavlc::codeDFFlag(UInt uiCode, const Char *pSymbolName) … … 186 176 } 187 177 188 #if RPS_IN_SPS189 178 Void TEncCavlc::codeShortTermRefPicSet( TComSPS* pcSPS, TComReferencePictureSet* rps ) 190 #else191 Void TEncCavlc::codeShortTermRefPicSet( TComPPS* pcPPS, TComReferencePictureSet* rps )192 #endif193 179 { 194 180 #if PRINT_RPS_INFO … … 245 231 xTracePPSHeader (pcPPS); 246 232 #endif 247 #if !RPS_IN_SPS248 TComRPSList* rpsList = pcPPS->getRPSList();249 #endif250 233 251 234 WRITE_UVLC( pcPPS->getPPSId(), "pic_parameter_set_id" ); 252 235 WRITE_UVLC( pcPPS->getSPSId(), "seq_parameter_set_id" ); 253 236 254 #if MULTIBITS_DATA_HIDING255 237 WRITE_FLAG( pcPPS->getSignHideFlag(), "sign_data_hiding_flag" ); 256 238 if( pcPPS->getSignHideFlag() ) … … 258 240 WRITE_CODE(pcPPS->getTSIG(), 4, "sign_hiding_threshold"); 259 241 } 260 #endif261 242 #if CABAC_INIT_FLAG 262 243 WRITE_FLAG( pcPPS->getCabacInitPresentFlag() ? 1 : 0, "cabac_init_present_flag" ); 263 #endif264 #if !RPS_IN_SPS265 // RPS is put before entropy_coding_mode_flag266 // since entropy_coding_mode_flag will probably be removed from the WD267 TComReferencePictureSet* rps;268 269 WRITE_UVLC(rpsList->getNumberOfReferencePictureSets(), "num_short_term_ref_pic_sets" );270 for(UInt i=0; i < rpsList->getNumberOfReferencePictureSets(); i++)271 {272 rps = rpsList->getReferencePictureSet(i);273 codeShortTermRefPicSet(pcPPS,rps);274 }275 WRITE_FLAG( pcPPS->getLongTermRefsPresent() ? 1 : 0, "long_term_ref_pics_present_flag" );276 244 #endif 277 245 // entropy_coding_mode_flag … … 280 248 if (pcPPS->getEntropyCodingMode()) 281 249 { 282 #if !WPP_SIMPLIFICATION 283 WRITE_UVLC( pcPPS->getEntropyCodingSynchro(), "entropy_coding_synchro" ); 284 WRITE_FLAG( pcPPS->getCabacIstateReset() ? 1 : 0, "cabac_istate_reset" ); 285 #endif 286 #if !TILES_OR_ENTROPY_SYNC_IDC 287 #if !WPP_SIMPLIFICATION 288 if ( pcPPS->getEntropyCodingSynchro() ) 289 #endif 290 { 291 WRITE_UVLC( pcPPS->getNumSubstreams()-1, "num_substreams_minus1" ); 292 } 293 #endif 294 } 295 #if !H0566_TLA 296 WRITE_UVLC( pcPPS->getNumTLayerSwitchingFlags(), "num_temporal_layer_switching_point_flags" ); 297 for( UInt i = 0; i < pcPPS->getNumTLayerSwitchingFlags(); i++ ) 298 { 299 WRITE_FLAG( pcPPS->getTLayerSwitchingFlag( i ) ? 1 : 0 , "temporal_layer_switching_point_flag" ); 300 } 301 #endif 250 } 302 251 // num_ref_idx_l0_default_active_minus1 303 252 // num_ref_idx_l1_default_active_minus1 … … 313 262 WRITE_FLAG( pcPPS->getUseWP() ? 1 : 0, "weighted_pred_flag" ); // Use of Weighting Prediction (P_SLICE) 314 263 WRITE_CODE( pcPPS->getWPBiPredIdc(), 2, "weighted_bipred_idc" ); // Use of Weighting Bi-Prediction (B_SLICE) 315 #if H0388316 264 WRITE_FLAG( pcPPS->getOutputFlagPresentFlag() ? 1 : 0, "output_flag_present_flag" ); 317 #endif318 #if TILES_OR_ENTROPY_SYNC_IDC319 265 if(pcPPS->getSPS()->getTilesOrEntropyCodingSyncIdc()==1) 320 266 { 321 #endif322 267 WRITE_FLAG( pcPPS->getColumnRowInfoPresent(), "tile_info_present_flag" ); 323 268 WRITE_FLAG( pcPPS->getTileBehaviorControlPresentFlag(), "tile_control_present_flag"); … … 347 292 if(iNumColTilesMinus1 !=0 || iNumRowTilesMinus1 !=0) 348 293 { 349 #if !REMOVE_TILE_DEPENDENCE350 WRITE_FLAG( pcPPS->getTileBoundaryIndependenceIdr(), "tile_boundary_independence_flag" );351 if(pcPPS->getTileBoundaryIndependenceIdr() == 1)352 {353 #endif354 294 WRITE_FLAG( pcPPS->getLFCrossTileBoundaryFlag()?1 : 0, "loop_filter_across_tile_flag"); 355 #if !REMOVE_TILE_DEPENDENCE 356 } 357 #endif 358 } 359 } 360 #if TILES_OR_ENTROPY_SYNC_IDC 295 } 296 } 361 297 } 362 298 else if(pcPPS->getSPS()->getTilesOrEntropyCodingSyncIdc()==2) … … 364 300 WRITE_UVLC( pcPPS->getNumSubstreams()-1, "num_substreams_minus1" ); 365 301 } 366 #endif 367 368 #if DBL_CONTROL 302 369 303 WRITE_FLAG( pcPPS->getDeblockingFilterControlPresent()?1 : 0, "deblocking_filter_control_present_flag"); 370 #endif371 #if PARALLEL_MERGE372 304 WRITE_UVLC( pcPPS->getLog2ParallelMergeLevelMinus2(), "log2_parallel_merge_level_minus2"); 373 #endif374 305 WRITE_FLAG( 0, "pps_extension_flag" ); 375 306 } … … 498 429 } 499 430 } 431 #if INTER_VIEW_VECTOR_SCALING_C0115 432 WRITE_FLAG( pcVPS->getIVScalingFlag(), "inter_view_vector_scaling_flag" ); 433 #endif 500 434 } 501 435 … … 508 442 #endif 509 443 #endif 510 #if HHI_MPI 444 #if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068 511 445 Void TEncCavlc::codeSPS( TComSPS* pcSPS, Bool bIsDepth ) 512 446 #else … … 528 462 WRITE_UVLC( pcSPS->getPicWidthInLumaSamples (), "pic_width_in_luma_samples" ); 529 463 WRITE_UVLC( pcSPS->getPicHeightInLumaSamples(), "pic_height_in_luma_samples" ); 530 #if PIC_CROPPING531 464 WRITE_FLAG( pcSPS->getPicCroppingFlag(), "pic_cropping_flag" ); 532 465 if (pcSPS->getPicCroppingFlag()) … … 537 470 WRITE_UVLC( pcSPS->getPicCropBottomOffset(), "pic_crop_bottom_offset" ); 538 471 } 539 #endif540 472 541 473 #if FULL_NBIT … … 563 495 564 496 WRITE_UVLC( pcSPS->getBitsForPOC()-4, "log2_max_pic_order_cnt_lsb_minus4" ); 565 #if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER566 497 for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++) 567 498 { … … 570 501 WRITE_UVLC( pcSPS->getMaxLatencyIncrease(i), "max_latency_increase[i]" ); 571 502 } 572 #else573 WRITE_UVLC( pcSPS->getMaxNumberOfReferencePictures(), "max_num_ref_pics" );574 WRITE_UVLC( pcSPS->getNumReorderFrames(), "num_reorder_frames" );575 WRITE_UVLC(pcSPS->getMaxDecFrameBuffering(), "max_dec_frame_buffering" );576 WRITE_UVLC(pcSPS->getMaxLatencyIncrease(), "max_latency_increase" );577 #endif578 503 assert( pcSPS->getMaxCUWidth() == pcSPS->getMaxCUHeight() ); 579 504 … … 586 511 } 587 512 588 #if H0412_REF_PIC_LIST_RESTRICTION589 513 WRITE_FLAG( pcSPS->getRestrictedRefPicListsFlag(), "restricted_ref_pic_lists_flag" ); 590 514 if( pcSPS->getRestrictedRefPicListsFlag() ) … … 592 516 WRITE_FLAG( pcSPS->getListsModificationPresentFlag(), "lists_modification_present_flag" ); 593 517 } 594 #endif595 518 WRITE_UVLC( log2MinCUSize - 3, "log2_min_coding_block_size_minus3" ); 596 519 WRITE_UVLC( pcSPS->getMaxCUDepth()-g_uiAddCUDepth, "log2_diff_max_min_coding_block_size" ); … … 618 541 WRITE_FLAG( pcSPS->getUseSAO() ? 1 : 0, "sample_adaptive_offset_enabled_flag"); 619 542 WRITE_FLAG( pcSPS->getUseALF () ? 1 : 0, "adaptive_loop_filter_enabled_flag"); 620 #if LCU_SYNTAX_ALF621 543 if(pcSPS->getUseALF()) 622 544 { 623 545 WRITE_FLAG( (pcSPS->getUseALFCoefInSlice()) ? 1 : 0, "alf_coef_in_slice_flag"); 624 546 } 625 #endif626 547 627 548 if( pcSPS->getUsePCM() ) … … 634 555 WRITE_FLAG( pcSPS->getTemporalIdNestingFlag() ? 1 : 0, "temporal_id_nesting_flag" ); 635 556 636 #if RPS_IN_SPS637 557 TComRPSList* rpsList = pcSPS->getRPSList(); 638 558 TComReferencePictureSet* rps; … … 645 565 } 646 566 WRITE_FLAG( pcSPS->getLongTermRefsPresent() ? 1 : 0, "long_term_ref_pics_present_flag" ); 647 #endif648 #if !PIC_CROPPING649 //!!!KS: Syntax not in WD !!!650 651 xWriteUvlc ( pcSPS->getPad (0) );652 xWriteUvlc ( pcSPS->getPad (1) );653 #endif654 567 // AMVP mode for each depth 655 568 for (Int i = 0; i < pcSPS->getMaxCUDepth(); i++) … … 658 571 } 659 572 660 #if TILES_WPP_ENTRY_POINT_SIGNALLING661 573 Int tilesOrEntropyCodingSyncIdc = 0; 662 574 if ( pcSPS->getNumColumnsMinus1() > 0 || pcSPS->getNumRowsMinus1() > 0) … … 670 582 pcSPS->setTilesOrEntropyCodingSyncIdc( tilesOrEntropyCodingSyncIdc ); 671 583 WRITE_CODE(tilesOrEntropyCodingSyncIdc, 2, "tiles_or_entropy_coding_sync_idc"); 672 #endif 673 674 #if TILES_OR_ENTROPY_SYNC_IDC 584 675 585 if(tilesOrEntropyCodingSyncIdc == 1) 676 586 { 677 #endif678 587 WRITE_UVLC( pcSPS->getNumColumnsMinus1(), "num_tile_columns_minus1" ); 679 588 WRITE_UVLC( pcSPS->getNumRowsMinus1(), "num_tile_rows_minus1" ); … … 694 603 if( pcSPS->getNumColumnsMinus1() !=0 || pcSPS->getNumRowsMinus1() != 0) 695 604 { 696 #if !REMOVE_TILE_DEPENDENCE697 WRITE_FLAG( pcSPS->getTileBoundaryIndependenceIdr(), "tile_boundary_independence_flag" );698 if(pcSPS->getTileBoundaryIndependenceIdr() == 1)699 {700 #endif701 605 WRITE_FLAG( pcSPS->getLFCrossTileBoundaryFlag()?1 : 0, "loop_filter_across_tile_flag"); 702 #if !REMOVE_TILE_DEPENDENCE 703 } 704 #endif 705 } 706 #if TILES_OR_ENTROPY_SYNC_IDC 707 } 708 #endif 606 } 607 } 709 608 WRITE_FLAG( 1, "sps_extension_flag" ); 710 609 #if !QC_MVHEVC_B0046 … … 792 691 WRITE_SVLC( pcSPS->getPdmOffset ()[ uiId ], "Pdm_offset" ); 793 692 } 794 #if H HI_INTER_VIEW_MOTION_PRED693 #if H3D_IVMP 795 694 WRITE_UVLC( pcSPS->getMultiviewMvPredMode(), "multi_view_mv_pred_mode" ); 796 695 #endif 797 #if H HI_INTER_VIEW_RESIDUAL_PRED696 #if H3D_IVRP 798 697 WRITE_FLAG ( pcSPS->getMultiviewResPredMode(), "multi_view_residual_pred_mode" ); 799 698 #endif … … 866 765 if (address==0) 867 766 { 868 if( pcSlice->getSPS()->getViewId() && !pcSlice->getIsDepth() ) 767 if( pcSlice->getSPS()->getViewId() 768 #if !LGE_ILLUCOMP_DEPTH_C0046 769 && !pcSlice->getIsDepth() 770 #endif 771 ) 869 772 { 870 773 WRITE_FLAG( pcSlice->getApplyIC() ? 1 : 0, "applying IC flag" ); … … 889 792 WRITE_UVLC( pcSlice->getPPS()->getPPSId(), "pic_parameter_set_id" ); 890 793 #endif 891 #if H0388892 794 if( pcSlice->getPPS()->getOutputFlagPresentFlag() ) 893 795 { 894 796 WRITE_FLAG( pcSlice->getPicOutputFlag() ? 1 : 0, "pic_output_flag" ); 895 797 } 896 #endif897 798 #if QC_REM_IDV_B0046 898 799 if(pcSlice->getNalUnitType()==NAL_UNIT_CODED_SLICE_IDR && pcSlice->getViewId() == 0) … … 917 818 { 918 819 WRITE_FLAG( 0, "short_term_ref_pic_set_sps_flag"); 919 #if RPS_IN_SPS920 820 codeShortTermRefPicSet(pcSlice->getSPS(), rps); 921 #else922 codeShortTermRefPicSet(pcSlice->getPPS(), rps);923 #endif924 821 } 925 822 else … … 928 825 WRITE_UVLC( pcSlice->getRPSidx(), "short_term_ref_pic_set_idx" ); 929 826 } 930 #if RPS_IN_SPS931 827 if(pcSlice->getSPS()->getLongTermRefsPresent()) 932 #else933 if(pcSlice->getPPS()->getLongTermRefsPresent())934 #endif935 828 { 936 829 WRITE_UVLC( rps->getNumberOfLongtermPictures(), "num_long_term_pics"); 937 830 Int maxPocLsb = 1<<pcSlice->getSPS()->getBitsForPOC(); 938 831 Int prev = 0; 939 #if LTRP_MULT940 832 Int prevDeltaPocLt=0; 941 833 Int currDeltaPocLt=0; 942 #endif943 834 for(Int i=rps->getNumberOfPictures()-1 ; i > rps->getNumberOfPictures()-rps->getNumberOfLongtermPictures()-1; i--) 944 835 { 945 836 WRITE_UVLC((maxPocLsb-rps->getDeltaPOC(i)+prev)%maxPocLsb, "delta_poc_lsb_lt"); 946 837 947 #if LTRP_MULT948 838 currDeltaPocLt=((maxPocLsb-rps->getDeltaPOC(i)+prev)%maxPocLsb)+prevDeltaPocLt; 949 839 … … 976 866 } 977 867 prevDeltaPocLt=currDeltaPocLt; 978 #endif979 868 prev = rps->getDeltaPOC(i); 980 869 WRITE_FLAG( rps->getUsed(i), "used_by_curr_pic_lt_flag"); … … 988 877 { 989 878 WRITE_FLAG( 0, "short_term_ref_pic_set_sps_flag"); 990 #if RPS_IN_SPS991 879 codeShortTermRefPicSet(pcSlice->getSPS(), rps); 992 #else993 codeShortTermRefPicSet(pcSlice->getPPS(), rps);994 #endif995 880 } 996 881 else … … 999 884 WRITE_UVLC( pcSlice->getRPSidx(), "short_term_ref_pic_set_idx" ); 1000 885 } 1001 #if RPS_IN_SPS1002 886 if(pcSlice->getSPS()->getLongTermRefsPresent()) 1003 #else1004 if(pcSlice->getPPS()->getLongTermRefsPresent())1005 #endif1006 887 { 1007 888 WRITE_UVLC( rps->getNumberOfLongtermPictures(), "num_long_term_pics"); 1008 889 Int maxPocLsb = 1<<pcSlice->getSPS()->getBitsForPOC(); 1009 890 Int prev = 0; 1010 #if LTRP_MULT1011 891 Int prevDeltaPocLt=0; 1012 892 Int currDeltaPocLt=0; 1013 #endif1014 893 for(Int i=rps->getNumberOfPictures()-1 ; i > rps->getNumberOfPictures()-rps->getNumberOfLongtermPictures()-1; i--) 1015 894 { 1016 895 WRITE_UVLC((maxPocLsb-rps->getDeltaPOC(i)+prev)%maxPocLsb, "delta_poc_lsb_lt"); 1017 896 1018 #if LTRP_MULT1019 897 currDeltaPocLt=((maxPocLsb-rps->getDeltaPOC(i)+prev)%maxPocLsb)+prevDeltaPocLt; 1020 898 … … 1047 925 } 1048 926 prevDeltaPocLt=currDeltaPocLt; 1049 #endif1050 927 prev = rps->getDeltaPOC(i); 1051 928 WRITE_FLAG( rps->getUsed(i), "used_by_curr_pic_lt_flag"); … … 1059 936 if (pcSlice->getSPS()->getUseALF()) 1060 937 { 1061 #if !LCU_SYNTAX_ALF1062 if (pcSlice->getAlfEnabledFlag())1063 {1064 assert (pcSlice->getAPS()->getAlfEnabled());1065 }1066 #endif1067 938 WRITE_FLAG( pcSlice->getAlfEnabledFlag(), "ALF on/off flag in slice header" ); 1068 939 } 1069 940 if (pcSlice->getSPS()->getUseSAO()) 1070 941 { 1071 #if SAO_UNIT_INTERLEAVING1072 942 WRITE_FLAG( pcSlice->getSaoInterleavingFlag(), "SAO interleaving flag" ); 1073 #endif1074 943 assert (pcSlice->getSaoEnabledFlag() == pcSlice->getAPS()->getSaoEnabled()); 1075 944 WRITE_FLAG( pcSlice->getSaoEnabledFlag(), "SAO on/off flag in slice header" ); 1076 #if SAO_UNIT_INTERLEAVING1077 945 if (pcSlice->getSaoInterleavingFlag()&&pcSlice->getSaoEnabledFlag() ) 1078 946 { … … 1080 948 WRITE_FLAG( pcSlice->getAPS()->getSaoParam()->bSaoFlag[2], "SAO on/off flag for Cr in slice header" ); 1081 949 } 1082 #endif1083 950 } 1084 951 WRITE_UVLC( pcSlice->getAPS()->getAPSID(), "aps_id"); … … 1103 970 pcSlice->setNumRefIdx(REF_PIC_LIST_1, 0); 1104 971 } 1105 #if H0412_REF_PIC_LIST_RESTRICTION1106 972 if( pcSlice->getSPS()->getListsModificationPresentFlag() ) 1107 973 { 1108 #endif1109 974 TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification(); 1110 #if H0137_0138_LIST_MODIFICATION1111 975 if( !pcSlice->isIntra() ) 1112 976 { … … 1151 1015 } 1152 1016 } 1153 #else 1154 if(!pcSlice->isIntra()) 1155 { 1156 WRITE_FLAG(pcSlice->getRefPicListModification()->getRefPicListModificationFlagL0() ? 1 : 0, "ref_pic_list_modification_flag" ); 1157 for(Int i = 0; i < refPicListModification->getNumberOfRefPicListModificationsL0(); i++) 1158 { 1159 WRITE_UVLC( refPicListModification->getListIdcL0(i), "ref_pic_list_modification_idc"); 1160 WRITE_UVLC( refPicListModification->getRefPicSetIdxL0(i), "ref_pic_set_idx"); 1161 } 1162 if(pcSlice->getRefPicListModification()->getRefPicListModificationFlagL0()) 1163 WRITE_UVLC( 3, "ref_pic_list_modification_idc"); 1164 } 1165 if(pcSlice->isInterB()) 1166 { 1167 WRITE_FLAG(pcSlice->getRefPicListModification()->getRefPicListModificationFlagL1() ? 1 : 0, "ref_pic_list_modification_flag" ); 1168 for(Int i = 0; i < refPicListModification->getNumberOfRefPicListModificationsL1(); i++) 1169 { 1170 WRITE_UVLC( refPicListModification->getListIdcL1(i), "ref_pic_list_modification_idc"); 1171 WRITE_UVLC( refPicListModification->getRefPicSetIdxL1(i), "ref_pic_set_idx"); 1172 } 1173 if(pcSlice->getRefPicListModification()->getRefPicListModificationFlagL1()) 1174 WRITE_UVLC( 3, "ref_pic_list_modification_idc"); 1175 } 1176 #endif 1177 } 1178 #if H0412_REF_PIC_LIST_RESTRICTION 1179 } 1180 #endif 1017 } 1018 } 1181 1019 // ref_pic_list_combination( ) 1182 1020 // maybe move to own function? … … 1188 1026 WRITE_UVLC( pcSlice->getNumRefIdx(REF_PIC_LIST_C) - 1, "num_ref_idx lc_active_minus1"); 1189 1027 1190 #if H0412_REF_PIC_LIST_RESTRICTION1191 1028 if( pcSlice->getSPS()->getListsModificationPresentFlag() ) 1192 1029 { 1193 #endif1194 1030 WRITE_FLAG( pcSlice->getRefPicListModificationFlagLC() ? 1 : 0, "ref_pic_list_modification_flag_lc" ); 1195 1031 if(pcSlice->getRefPicListModificationFlagLC()) … … 1198 1034 { 1199 1035 WRITE_FLAG( pcSlice->getListIdFromIdxOfLC(i), "pic_from_list_0_flag" ); 1200 #if H0137_0138_LIST_MODIFICATION1201 1036 if (((pcSlice->getListIdFromIdxOfLC(i)==REF_PIC_LIST_0) && pcSlice->getNumRefIdx( REF_PIC_LIST_0 )>1 ) || ((pcSlice->getListIdFromIdxOfLC(i)==REF_PIC_LIST_1) && pcSlice->getNumRefIdx( REF_PIC_LIST_1 )>1 ) ) 1202 1037 { 1203 1038 WRITE_UVLC( pcSlice->getRefIdxFromIdxOfLC(i), "ref_idx_list_curr" ); 1204 1039 } 1205 #else1206 WRITE_UVLC( pcSlice->getRefIdxFromIdxOfLC(i), "ref_idx_list_curr" );1207 #endif1208 1040 } 1209 1041 } 1210 #if H0412_REF_PIC_LIST_RESTRICTION 1211 } 1212 #endif 1042 } 1213 1043 } 1214 1044 } 1215 1045 1216 #if H0111_MVD_L1_ZERO1217 1046 if (pcSlice->isInterB()) 1218 1047 { 1219 1048 WRITE_FLAG( pcSlice->getMvdL1ZeroFlag() ? 1 : 0, "mvd_l1_zero_flag"); 1220 1049 } 1221 #endif1222 1050 1223 1051 if(pcSlice->getPPS()->getEntropyCodingMode() && !pcSlice->isIntra()) … … 1242 1070 Int iCode = pcSlice->getSliceQp() - ( pcSlice->getPPS()->getPicInitQPMinus26() + 26 ); 1243 1071 WRITE_SVLC( iCode, "slice_qp_delta" ); 1244 #if DBL_CONTROL1245 1072 if (pcSlice->getPPS()->getDeblockingFilterControlPresent()) 1246 1073 { … … 1249 1076 WRITE_FLAG(pcSlice->getInheritDblParamFromAPS(), "inherit_dbl_param_from_APS_flag"); 1250 1077 } 1251 #else1252 WRITE_FLAG(pcSlice->getInheritDblParamFromAPS(), "inherit_dbl_param_from_APS_flag");1253 #endif1254 1078 if (!pcSlice->getInheritDblParamFromAPS()) 1255 1079 { … … 1261 1085 } 1262 1086 } 1263 #if DBL_CONTROL 1264 } 1265 #endif 1087 } 1266 1088 if ( pcSlice->getSliceType() == B_SLICE ) 1267 1089 { … … 1299 1121 } 1300 1122 1301 #if ( HHI_MPI || H HI_INTER_VIEW_MOTION_PRED)1302 #if ( HHI_MPI && H HI_INTER_VIEW_MOTION_PRED)1123 #if ( HHI_MPI || H3D_IVMP ) 1124 #if ( HHI_MPI && H3D_IVMP ) 1303 1125 const int iExtraMergeCandidates = ( pcSlice->getSPS()->getUseMVI() || pcSlice->getSPS()->getMultiviewMvPredMode() ) ? 1 : 0; 1304 1126 #elif HHI_MPI 1305 1127 const int iExtraMergeCandidates = pcSlice->getSPS()->getUseMVI() ? 1 : 0; 1128 #elif MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137 1129 const int iExtraMergeCandidates = ( pcSlice->getIsDepth() || pcSlice->getSPS()->getMultiviewMvPredMode() ) ? 1 : 0; 1306 1130 #else 1307 1131 const int iExtraMergeCandidates = pcSlice->getSPS()->getMultiviewMvPredMode() ? 1 : 0; … … 1332 1156 \param pcSlice Where we find the substream size information. 1333 1157 */ 1334 #if TILES_WPP_ENTRY_POINT_SIGNALLING1335 1158 Void TEncCavlc::codeTilesWPPEntryPoint( TComSlice* pSlice ) 1336 1159 { … … 1432 1255 delete [] entryPointOffset; 1433 1256 } 1434 #else1435 Void TEncCavlc::codeSliceHeaderSubstreamTable( TComSlice* pcSlice )1436 {1437 UInt uiNumSubstreams = pcSlice->getPPS()->getNumSubstreams();1438 UInt*puiSubstreamSizes = pcSlice->getSubstreamSizes();1439 1440 // Write header information for all substreams except the last.1441 for (UInt ui = 0; ui+1 < uiNumSubstreams; ui++)1442 {1443 UInt uiNumbits = puiSubstreamSizes[ui];1444 1445 //the 2 first bits are used to give the size of the header1446 if ( uiNumbits < (1<<8) )1447 {1448 xWriteCode(0, 2 );1449 xWriteCode(uiNumbits, 8 );1450 }1451 else if ( uiNumbits < (1<<16) )1452 {1453 xWriteCode(1, 2 );1454 xWriteCode(uiNumbits, 16 );1455 }1456 else if ( uiNumbits < (1<<24) )1457 {1458 xWriteCode(2, 2 );1459 xWriteCode(uiNumbits, 24 );1460 }1461 else if ( uiNumbits < (1<<31) )1462 {1463 xWriteCode(3, 2 );1464 xWriteCode(uiNumbits, 32 );1465 }1466 else1467 {1468 printf("Error in codeSliceHeaderTable\n");1469 exit(-1);1470 }1471 }1472 }1473 #endif1474 1257 1475 1258 Void TEncCavlc::codeTerminatingBit ( UInt uilsLast ) … … 1481 1264 } 1482 1265 1483 #if H HI_INTER_VIEW_MOTION_PRED1266 #if H3D_IVMP 1484 1267 Void TEncCavlc::codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList, Int iNum ) 1485 1268 #else … … 1510 1293 } 1511 1294 1512 #if H HI_INTER_VIEW_RESIDUAL_PRED1295 #if H3D_IVRP 1513 1296 Void 1514 1297 TEncCavlc::codeResPredFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) … … 1590 1373 } 1591 1374 1592 #if BURST_IPCM1593 1375 /** Code I_PCM information. 1594 1376 * \param pcCU pointer to CU … … 1602 1384 assert(0); 1603 1385 } 1604 #else1605 /** Code I_PCM information.1606 * \param pcCU pointer to CU1607 * \param uiAbsPartIdx CU index1608 * \returns Void1609 *1610 * If I_PCM flag indicates that the CU is I_PCM, code its PCM alignment bits and codes.1611 */1612 Void TEncCavlc::codeIPCMInfo( TComDataCU* pcCU, UInt uiAbsPartIdx)1613 {1614 UInt uiIPCM = (pcCU->getIPCMFlag(uiAbsPartIdx) == true)? 1 : 0;1615 1616 xWriteFlag(uiIPCM);1617 1618 if (uiIPCM)1619 {1620 xWritePCMAlignZero();1621 1622 UInt uiMinCoeffSize = pcCU->getPic()->getMinCUWidth()*pcCU->getPic()->getMinCUHeight();1623 UInt uiLumaOffset = uiMinCoeffSize*uiAbsPartIdx;1624 UInt uiChromaOffset = uiLumaOffset>>2;1625 1626 Pel* piPCMSample;1627 UInt uiWidth;1628 UInt uiHeight;1629 UInt uiSampleBits;1630 UInt uiX, uiY;1631 1632 piPCMSample = pcCU->getPCMSampleY() + uiLumaOffset;1633 uiWidth = pcCU->getWidth(uiAbsPartIdx);1634 uiHeight = pcCU->getHeight(uiAbsPartIdx);1635 uiSampleBits = pcCU->getSlice()->getSPS()->getPCMBitDepthLuma();1636 1637 for(uiY = 0; uiY < uiHeight; uiY++)1638 {1639 for(uiX = 0; uiX < uiWidth; uiX++)1640 {1641 UInt uiSample = piPCMSample[uiX];1642 1643 xWriteCode(uiSample, uiSampleBits);1644 }1645 piPCMSample += uiWidth;1646 }1647 1648 piPCMSample = pcCU->getPCMSampleCb() + uiChromaOffset;1649 uiWidth = pcCU->getWidth(uiAbsPartIdx)/2;1650 uiHeight = pcCU->getHeight(uiAbsPartIdx)/2;1651 uiSampleBits = pcCU->getSlice()->getSPS()->getPCMBitDepthChroma();1652 1653 for(uiY = 0; uiY < uiHeight; uiY++)1654 {1655 for(uiX = 0; uiX < uiWidth; uiX++)1656 {1657 UInt uiSample = piPCMSample[uiX];1658 1659 xWriteCode(uiSample, uiSampleBits);1660 }1661 piPCMSample += uiWidth;1662 }1663 1664 piPCMSample = pcCU->getPCMSampleCr() + uiChromaOffset;1665 uiWidth = pcCU->getWidth(uiAbsPartIdx)/2;1666 uiHeight = pcCU->getHeight(uiAbsPartIdx)/2;1667 uiSampleBits = pcCU->getSlice()->getSPS()->getPCMBitDepthChroma();1668 1669 for(uiY = 0; uiY < uiHeight; uiY++)1670 {1671 for(uiX = 0; uiX < uiWidth; uiX++)1672 {1673 UInt uiSample = piPCMSample[uiX];1674 1675 xWriteCode(uiSample, uiSampleBits);1676 }1677 piPCMSample += uiWidth;1678 }1679 }1680 }1681 #endif1682 1386 1683 1387 Void TEncCavlc::codeIntraDirLumaAng( TComDataCU* pcCU, UInt uiAbsPartIdx ) … … 1710 1414 Int iDQp = pcCU->getQP( uiAbsPartIdx ) - pcCU->getRefQP( uiAbsPartIdx ); 1711 1415 1712 #if H0736_AVC_STYLE_QP_RANGE1713 1416 Int qpBdOffsetY = pcCU->getSlice()->getSPS()->getQpBDOffsetY(); 1714 1417 iDQp = (iDQp + 78 + qpBdOffsetY + (qpBdOffsetY/2)) % (52 + qpBdOffsetY) - 26 - (qpBdOffsetY/2); 1715 #endif1716 1418 1717 1419 xWriteSvlc( iDQp ); … … 1744 1446 xWriteSvlc( iCode ); 1745 1447 } 1746 #if LCU_SYNTAX_ALF1747 1448 /** Code the fixed length code (smaller than one max value) in OSALF 1748 1449 * \param idx: coded value … … 1769 1470 } 1770 1471 } 1771 #endif1772 1472 1773 1473 Void TEncCavlc::codeSaoFlag( UInt uiCode ) … … 1785 1485 xWriteSvlc( iCode ); 1786 1486 } 1787 #if SAO_UNIT_INTERLEAVING1788 1487 /** Code SAO run. 1789 1488 * \param uiCode … … 1809 1508 WRITE_CODE( uiCode, uiLength, "sao_run_diff"); 1810 1509 } 1811 #endif1812 1510 1813 1511 Void TEncCavlc::estBit( estBitsSbacStruct* pcEstBitsCabac, Int width, Int height, TextType eTType ) … … 2114 1812 Void TEncCavlc::xCodeScalingList(TComScalingList* scalingList, UInt sizeId, UInt listId) 2115 1813 { 2116 #if SCALING_LIST2117 1814 Int coefNum = min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId]); 2118 1815 UInt* scan = g_auiFrameScanXY [ (sizeId == 0)? 1 : 2]; 2119 #else2120 Int coefNum = (Int)g_scalingListSize[sizeId];2121 UInt* scan = g_auiFrameScanXY [ sizeId + 1];2122 #endif2123 1816 Int nextCoef = SCALING_LIST_START_VALUE; 2124 1817 Int data; 2125 1818 Int *src = scalingList->getScalingListAddress(sizeId, listId); 2126 #if SCALING_LIST2127 1819 if(sizeId > SCALING_LIST_8x8 && scalingList->getUseDefaultScalingMatrixFlag(sizeId,listId)) 2128 1820 { … … 2155 1847 } 2156 1848 } 2157 #else2158 for(Int i=0;i<coefNum;i++)2159 {2160 data = src[scan[i]] - nextCoef;2161 nextCoef = src[scan[i]];2162 if(data > 127)2163 {2164 data = data - 256;2165 }2166 if(data < -128)2167 {2168 data = data + 256;2169 }2170 2171 WRITE_SVLC( data, "delta_coef");2172 }2173 #endif2174 1849 } 2175 1850 Bool TComScalingList::checkPredMode(UInt sizeId, UInt listId) … … 2177 1852 for(Int predListIdx = (Int)listId -1 ; predListIdx >= 0; predListIdx--) 2178 1853 { 2179 #if SCALING_LIST2180 1854 if( !memcmp(getScalingListAddress(sizeId,listId),getScalingListAddress(sizeId, predListIdx),sizeof(Int)*min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId])) // check value of matrix 2181 1855 && ((sizeId < SCALING_LIST_16x16) || (getScalingListDC(sizeId,listId) == getScalingListDC(sizeId,predListIdx)))) // check DC value 2182 #else2183 if( !memcmp(getScalingListAddress(sizeId,listId),getScalingListAddress(sizeId, predListIdx),sizeof(Int)*(Int)g_scalingListSize[sizeId])) // check value of matrix2184 #endif2185 1856 { 2186 1857 setRefMatrixId(sizeId, listId, predListIdx);
Note: See TracChangeset for help on using the changeset viewer.